s390/pci: fix assignment of bus resources
authorSebastian Ott <sebott@linux.ibm.com>
Thu, 16 May 2019 12:19:51 +0000 (14:19 +0200)
committerHeiko Carstens <heiko.carstens@de.ibm.com>
Tue, 28 May 2019 12:49:32 +0000 (14:49 +0200)
Adjust bus resources depending on the usage of MIO instructions.

Fixes: 71ba41c9b1d9 ("s390/pci: provide support for MIO instructions")
Signed-off-by: Sebastian Ott <sebott@linux.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
arch/s390/pci/pci.c

index 0ebb7c405a2508d28c66530eaf1b39b4598635b5..86ca7f88fb22f9f5a9995362f243a3d446fefb9e 100644 (file)
@@ -528,7 +528,10 @@ static int zpci_setup_bus_resources(struct zpci_dev *zdev,
                if (zdev->bars[i].val & 4)
                        flags |= IORESOURCE_MEM_64;
 
-               addr = ZPCI_ADDR(entry);
+               if (static_branch_likely(&have_mio))
+                       addr = (unsigned long) zdev->bars[i].mio_wb;
+               else
+                       addr = ZPCI_ADDR(entry);
                size = 1UL << zdev->bars[i].size;
 
                res = __alloc_res(zdev, addr, size, flags);