From dcd33b23c9f322274efb94d6e86370bac2b3c68f Mon Sep 17 00:00:00 2001 From: Sebastian Ott Date: Thu, 16 May 2019 14:19:51 +0200 Subject: [PATCH] s390/pci: fix assignment of bus resources Adjust bus resources depending on the usage of MIO instructions. Fixes: 71ba41c9b1d9 ("s390/pci: provide support for MIO instructions") Signed-off-by: Sebastian Ott Signed-off-by: Heiko Carstens --- arch/s390/pci/pci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c index 0ebb7c40..86ca7f8 100644 --- a/arch/s390/pci/pci.c +++ b/arch/s390/pci/pci.c @@ -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); -- 2.7.4