* [PATCH] powerpc/pseries: Fix PCI config address for DDW
@ 2016-05-25 23:56 Gavin Shan
2016-05-26 0:46 ` Gavin Shan
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Gavin Shan @ 2016-05-25 23:56 UTC (permalink / raw)
To: linuxppc-dev; +Cc: mpe, gpiccoli, Gavin Shan
In commit <8445a87f7092> ("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: 8445a87f7092 ("powerpc/iommu: Remove the dependency on EEH struct in DDW mechanism")
Reported-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Tested-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
---
arch/powerpc/platforms/pseries/iommu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index b7dfc13..3e8865b 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -927,7 +927,7 @@ static int query_ddw(struct pci_dev *dev, const u32 *ddw_avail,
dn = pci_device_to_OF_node(dev);
pdn = PCI_DN(dn);
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,
cfg_addr, BUID_HI(buid), BUID_LO(buid));
@@ -956,7 +956,7 @@ static int create_ddw(struct pci_dev *dev, const u32 *ddw_avail,
dn = pci_device_to_OF_node(dev);
pdn = PCI_DN(dn);
buid = pdn->phb->buid;
- cfg_addr = (pdn->busno << 8) | pdn->devfn;
+ cfg_addr = ((pdn->busno << 16) | (pdn->devfn << 8));
do {
/* extra outputs are LIOBN and dma-addr (hi, lo) */
--
2.1.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/pseries: Fix PCI config address for DDW
2016-05-25 23:56 [PATCH] powerpc/pseries: Fix PCI config address for DDW Gavin Shan
@ 2016-05-26 0:46 ` Gavin Shan
2016-06-06 1:53 ` Michael Ellerman
2016-06-07 3:35 ` Michael Ellerman
2 siblings, 0 replies; 4+ messages in thread
From: Gavin Shan @ 2016-05-26 0:46 UTC (permalink / raw)
To: Gavin Shan; +Cc: linuxppc-dev, gpiccoli
On Thu, May 26, 2016 at 09:56:07AM +1000, Gavin Shan wrote:
>In commit <8445a87f7092> ("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: 8445a87f7092 ("powerpc/iommu: Remove the dependency on EEH struct in DDW mechanism")
>Reported-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
>Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
>Tested-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
>---
> arch/powerpc/platforms/pseries/iommu.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
There are two mails sent for same patch. I don't know how is
happening. Maybe there is something wrong in my mailbox scripts.
Please ignore this one and sorry for the noise.
Thanks,
Gavin
>diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
>index b7dfc13..3e8865b 100644
>--- a/arch/powerpc/platforms/pseries/iommu.c
>+++ b/arch/powerpc/platforms/pseries/iommu.c
>@@ -927,7 +927,7 @@ static int query_ddw(struct pci_dev *dev, const u32 *ddw_avail,
> dn = pci_device_to_OF_node(dev);
> pdn = PCI_DN(dn);
> 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,
> cfg_addr, BUID_HI(buid), BUID_LO(buid));
>@@ -956,7 +956,7 @@ static int create_ddw(struct pci_dev *dev, const u32 *ddw_avail,
> dn = pci_device_to_OF_node(dev);
> pdn = PCI_DN(dn);
> buid = pdn->phb->buid;
>- cfg_addr = (pdn->busno << 8) | pdn->devfn;
>+ cfg_addr = ((pdn->busno << 16) | (pdn->devfn << 8));
>
> do {
> /* extra outputs are LIOBN and dma-addr (hi, lo) */
>--
>2.1.0
>
>_______________________________________________
>Linuxppc-dev mailing list
>Linuxppc-dev@lists.ozlabs.org
>https://lists.ozlabs.org/listinfo/linuxppc-dev
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: powerpc/pseries: Fix PCI config address for DDW
2016-05-25 23:56 [PATCH] powerpc/pseries: Fix PCI config address for DDW Gavin Shan
2016-05-26 0:46 ` Gavin Shan
@ 2016-06-06 1:53 ` Michael Ellerman
2016-06-07 3:35 ` Michael Ellerman
2 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2016-06-06 1:53 UTC (permalink / raw)
To: Gavin Shan, linuxppc-dev; +Cc: Gavin Shan, gpiccoli
On Wed, 2016-25-05 at 23:56:07 UTC, Gavin Shan wrote:
> In commit <8445a87f7092> ("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: 8445a87f7092 ("powerpc/iommu: Remove the dependency on EEH struct in DDW mechanism")
That commit was Cc'ed to stable, so this needs to be also.
I've added it here.
cheers
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: powerpc/pseries: Fix PCI config address for DDW
2016-05-25 23:56 [PATCH] powerpc/pseries: Fix PCI config address for DDW Gavin Shan
2016-05-26 0:46 ` Gavin Shan
2016-06-06 1:53 ` Michael Ellerman
@ 2016-06-07 3:35 ` Michael Ellerman
2 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2016-06-07 3:35 UTC (permalink / raw)
To: Gavin Shan, linuxppc-dev; +Cc: Gavin Shan, gpiccoli
On Wed, 2016-25-05 at 23:56:07 UTC, Gavin Shan wrote:
> In commit <8445a87f7092> ("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: 8445a87f7092 ("powerpc/iommu: Remove the dependency on EEH struct in DDW mechanism")
> Reported-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
> Tested-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Applied to powerpc fixes, thanks.
https://git.kernel.org/powerpc/c/8a934efe94347eee843aeea65b
cheers
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-06-07 3:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-25 23:56 [PATCH] powerpc/pseries: Fix PCI config address for DDW Gavin Shan
2016-05-26 0:46 ` Gavin Shan
2016-06-06 1:53 ` Michael Ellerman
2016-06-07 3:35 ` Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).