Commit 3393778d authored by Gavin Shan's avatar Gavin Shan Committed by Ben Hutchings

powerpc/pseries: Fix PCI config address for DDW

commit 8a934efe upstream.

In commit 8445a87f "powerpc/iommu: Remove the dependency on EEH
struct in DDW mechanism", the PE address was replaced with the PCI
config address in order to remove dependency on EEH. According to PAPR
spec, firmware (pHyp or QEMU) should accept "xxBBSSxx" format PCI config
address, not "xxxxBBSS" provided by the patch. Note that "BB" is PCI bus
number and "SS" is the combination of slot and function number.

This fixes the PCI address passed to DDW RTAS calls.

Fixes: 8445a87f ("powerpc/iommu: Remove the dependency on EEH struct in DDW mechanism")
Reported-by: default avatarGuilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Signed-off-by: default avatarGavin Shan <gwshan@linux.vnet.ibm.com>
Tested-by: default avatarGuilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent e3d00f24
...@@ -841,7 +841,7 @@ static int query_ddw(struct pci_dev *dev, const u32 *ddw_avail, ...@@ -841,7 +841,7 @@ static int query_ddw(struct pci_dev *dev, const u32 *ddw_avail,
dn = pci_device_to_OF_node(dev); dn = pci_device_to_OF_node(dev);
pdn = PCI_DN(dn); pdn = PCI_DN(dn);
buid = pdn->phb->buid; buid = pdn->phb->buid;
cfg_addr = (pdn->busno << 8) | pdn->devfn; cfg_addr = ((pdn->busno << 16) | (pdn->devfn << 8));
ret = rtas_call(ddw_avail[0], 3, 5, (u32 *)query, ret = rtas_call(ddw_avail[0], 3, 5, (u32 *)query,
cfg_addr, BUID_HI(buid), BUID_LO(buid)); cfg_addr, BUID_HI(buid), BUID_LO(buid));
...@@ -870,7 +870,7 @@ static int create_ddw(struct pci_dev *dev, const u32 *ddw_avail, ...@@ -870,7 +870,7 @@ static int create_ddw(struct pci_dev *dev, const u32 *ddw_avail,
dn = pci_device_to_OF_node(dev); dn = pci_device_to_OF_node(dev);
pdn = PCI_DN(dn); pdn = PCI_DN(dn);
buid = pdn->phb->buid; buid = pdn->phb->buid;
cfg_addr = (pdn->busno << 8) | pdn->devfn; cfg_addr = ((pdn->busno << 16) | (pdn->devfn << 8));
do { do {
/* extra outputs are LIOBN and dma-addr (hi, lo) */ /* extra outputs are LIOBN and dma-addr (hi, lo) */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment