* [PATCH kernel] powerpc/powernv/ioda2: Add devices only from buses which belong to PE
@ 2015-06-12 6:19 Alexey Kardashevskiy
2015-06-12 6:47 ` Gavin Shan
2015-06-15 6:49 ` [kernel] " Michael Ellerman
0 siblings, 2 replies; 6+ messages in thread
From: Alexey Kardashevskiy @ 2015-06-12 6:19 UTC (permalink / raw)
To: linuxppc-dev
Cc: Alexey Kardashevskiy, Benjamin Herrenschmidt, David Gibson,
Gavin Shan, Michael Ellerman, Paul Mackerras, linux-kernel
The existing code puts all devices from a root PE to the same IOMMU group.
However it is a possible situation when subordinate buses belong to
separate PEs, in this case devices from these subordinate buses
should be added to lower level PE rather to the root PE.
This limits pnv_ioda_setup_bus_dma() invocation to only PEs which own
all subordinate buses.
Suggested-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
This would be nice to have together with the DDW patchset.
This does not fix anything DDW patchset did, it fixes IOMMU
groups management which is essential for the whole feature to work.
---
arch/powerpc/platforms/powernv/pci-ioda.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index a0b00c1..3b1dc79 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -1702,7 +1702,7 @@ static void pnv_ioda_setup_bus_dma(struct pnv_ioda_pe *pe,
set_iommu_table_base(&dev->dev, pe->table_group.tables[0]);
iommu_add_device(&dev->dev);
- if (dev->subordinate)
+ if ((pe->flags & PNV_IODA_PE_BUS_ALL) && dev->subordinate)
pnv_ioda_setup_bus_dma(pe, dev->subordinate);
}
}
--
2.4.0.rc3.8.gfb3e7d5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH kernel] powerpc/powernv/ioda2: Add devices only from buses which belong to PE
2015-06-12 6:19 [PATCH kernel] powerpc/powernv/ioda2: Add devices only from buses which belong to PE Alexey Kardashevskiy
@ 2015-06-12 6:47 ` Gavin Shan
2015-06-12 15:06 ` Nishanth Aravamudan
2015-06-15 6:49 ` [kernel] " Michael Ellerman
1 sibling, 1 reply; 6+ messages in thread
From: Gavin Shan @ 2015-06-12 6:47 UTC (permalink / raw)
To: Alexey Kardashevskiy
Cc: linuxppc-dev, Benjamin Herrenschmidt, David Gibson, Gavin Shan,
Michael Ellerman, Paul Mackerras, linux-kernel
On Fri, Jun 12, 2015 at 04:19:17PM +1000, Alexey Kardashevskiy wrote:
>The existing code puts all devices from a root PE to the same IOMMU group.
>However it is a possible situation when subordinate buses belong to
>separate PEs, in this case devices from these subordinate buses
>should be added to lower level PE rather to the root PE.
>
>This limits pnv_ioda_setup_bus_dma() invocation to only PEs which own
>all subordinate buses.
>
>Suggested-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
>Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Alexey, I think it's good candidate for stable.
Thanks,
Gavin
>---
>
>This would be nice to have together with the DDW patchset.
>This does not fix anything DDW patchset did, it fixes IOMMU
>groups management which is essential for the whole feature to work.
>
>---
> arch/powerpc/platforms/powernv/pci-ioda.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
>index a0b00c1..3b1dc79 100644
>--- a/arch/powerpc/platforms/powernv/pci-ioda.c
>+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
>@@ -1702,7 +1702,7 @@ static void pnv_ioda_setup_bus_dma(struct pnv_ioda_pe *pe,
> set_iommu_table_base(&dev->dev, pe->table_group.tables[0]);
> iommu_add_device(&dev->dev);
>
>- if (dev->subordinate)
>+ if ((pe->flags & PNV_IODA_PE_BUS_ALL) && dev->subordinate)
> pnv_ioda_setup_bus_dma(pe, dev->subordinate);
> }
> }
>--
>2.4.0.rc3.8.gfb3e7d5
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH kernel] powerpc/powernv/ioda2: Add devices only from buses which belong to PE
2015-06-12 6:47 ` Gavin Shan
@ 2015-06-12 15:06 ` Nishanth Aravamudan
2015-06-12 16:47 ` Alexey Kardashevskiy
2015-06-15 0:11 ` Gavin Shan
0 siblings, 2 replies; 6+ messages in thread
From: Nishanth Aravamudan @ 2015-06-12 15:06 UTC (permalink / raw)
To: Gavin Shan
Cc: Alexey Kardashevskiy, linux-kernel, Paul Mackerras, linuxppc-dev,
David Gibson
On 12.06.2015 [16:47:03 +1000], Gavin Shan wrote:
> On Fri, Jun 12, 2015 at 04:19:17PM +1000, Alexey Kardashevskiy wrote:
> >The existing code puts all devices from a root PE to the same IOMMU group.
> >However it is a possible situation when subordinate buses belong to
> >separate PEs, in this case devices from these subordinate buses
> >should be added to lower level PE rather to the root PE.
> >
> >This limits pnv_ioda_setup_bus_dma() invocation to only PEs which own
> >all subordinate buses.
> >
> >Suggested-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
> >Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>
> Alexey, I think it's good candidate for stable.
Why? This commit message doesn't imply there is a serious bug just a
"possible" (does that mean theoretical?) situtation and the following:
> >This would be nice to have together with the DDW patchset.
> >This does not fix anything DDW patchset did, it fixes IOMMU
> >groups management which is essential for the whole feature to work.
implies it is both related and independent of DDW?
-Nish
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH kernel] powerpc/powernv/ioda2: Add devices only from buses which belong to PE
2015-06-12 15:06 ` Nishanth Aravamudan
@ 2015-06-12 16:47 ` Alexey Kardashevskiy
2015-06-15 0:11 ` Gavin Shan
1 sibling, 0 replies; 6+ messages in thread
From: Alexey Kardashevskiy @ 2015-06-12 16:47 UTC (permalink / raw)
To: Nishanth Aravamudan, Gavin Shan
Cc: linux-kernel, Paul Mackerras, linuxppc-dev, David Gibson
On 06/13/2015 01:06 AM, Nishanth Aravamudan wrote:
> On 12.06.2015 [16:47:03 +1000], Gavin Shan wrote:
>> On Fri, Jun 12, 2015 at 04:19:17PM +1000, Alexey Kardashevskiy wrote:
>>> The existing code puts all devices from a root PE to the same IOMMU group.
>>> However it is a possible situation when subordinate buses belong to
>>> separate PEs, in this case devices from these subordinate buses
>>> should be added to lower level PE rather to the root PE.
>>>
>>> This limits pnv_ioda_setup_bus_dma() invocation to only PEs which own
>>> all subordinate buses.
>>>
>>> Suggested-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>
>> Alexey, I think it's good candidate for stable.
>
> Why? This commit message doesn't imply there is a serious bug just a
> "possible" (does that mean theoretical?) situtation and the following:
>
>>> This would be nice to have together with the DDW patchset.
>>> This does not fix anything DDW patchset did, it fixes IOMMU
>>> groups management which is essential for the whole feature to work.
>
> implies it is both related and independent of DDW?
DDW is for fast devices and I just got my hands on a "firestone" machine
(p8 + nvidia tesla = very fast machine) where this bug appeared first time.
--
Alexey
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH kernel] powerpc/powernv/ioda2: Add devices only from buses which belong to PE
2015-06-12 15:06 ` Nishanth Aravamudan
2015-06-12 16:47 ` Alexey Kardashevskiy
@ 2015-06-15 0:11 ` Gavin Shan
1 sibling, 0 replies; 6+ messages in thread
From: Gavin Shan @ 2015-06-15 0:11 UTC (permalink / raw)
To: Nishanth Aravamudan
Cc: Gavin Shan, Alexey Kardashevskiy, linux-kernel, Paul Mackerras,
linuxppc-dev, David Gibson
On Fri, Jun 12, 2015 at 08:06:43AM -0700, Nishanth Aravamudan wrote:
>On 12.06.2015 [16:47:03 +1000], Gavin Shan wrote:
>> On Fri, Jun 12, 2015 at 04:19:17PM +1000, Alexey Kardashevskiy wrote:
>> >The existing code puts all devices from a root PE to the same IOMMU group.
>> >However it is a possible situation when subordinate buses belong to
>> >separate PEs, in this case devices from these subordinate buses
>> >should be added to lower level PE rather to the root PE.
>> >
>> >This limits pnv_ioda_setup_bus_dma() invocation to only PEs which own
>> >all subordinate buses.
>> >
>> >Suggested-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
>> >Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>
>> Alexey, I think it's good candidate for stable.
>
>Why? This commit message doesn't imply there is a serious bug just a
>"possible" (does that mean theoretical?) situtation and the following:
>
The problem depends on the PCI topology. Below topology, existing on
firestone machine, is one of the cases that wrong IOMMU group is used
for devices behind the upstream port of the PCIe switch: The PE for
Bus#2 has same IOMMU group as that one of the PE for "Root Bus" wrongly
here.
|
+---------------+ (Root Bus)
| |
[ Root Port ] [ System Peripheral ]
+
| (Bus#1)
+
[ Up Port ]
+
|
+------------+-----------+ (Bus#2)
| |
[ Dn port] [ Dn Port]
>> >This would be nice to have together with the DDW patchset.
>> >This does not fix anything DDW patchset did, it fixes IOMMU
>> >groups management which is essential for the whole feature to work.
>
>implies it is both related and independent of DDW?
>
The problem is independent of DDW.
Thanks,
Gavin
>-Nish
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [kernel] powerpc/powernv/ioda2: Add devices only from buses which belong to PE
2015-06-12 6:19 [PATCH kernel] powerpc/powernv/ioda2: Add devices only from buses which belong to PE Alexey Kardashevskiy
2015-06-12 6:47 ` Gavin Shan
@ 2015-06-15 6:49 ` Michael Ellerman
1 sibling, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2015-06-15 6:49 UTC (permalink / raw)
To: Alexey Kardashevskiy, linuxppc-dev
Cc: Alexey Kardashevskiy, Gavin Shan, linux-kernel, Paul Mackerras,
David Gibson
On Fri, 2015-12-06 at 06:19:17 UTC, Alexey Kardashevskiy wrote:
> The existing code puts all devices from a root PE to the same IOMMU group.
> However it is a possible situation when subordinate buses belong to
> separate PEs, in this case devices from these subordinate buses
> should be added to lower level PE rather to the root PE.
>
> This limits pnv_ioda_setup_bus_dma() invocation to only PEs which own
> all subordinate buses.
>
> Suggested-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Alexey/Gavin, can one of you write a better changelog for this. Explaining
what exactly is broken without it, how it fixes the problem, and why that is
the right fix.
cheers
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-06-15 6:49 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-12 6:19 [PATCH kernel] powerpc/powernv/ioda2: Add devices only from buses which belong to PE Alexey Kardashevskiy
2015-06-12 6:47 ` Gavin Shan
2015-06-12 15:06 ` Nishanth Aravamudan
2015-06-12 16:47 ` Alexey Kardashevskiy
2015-06-15 0:11 ` Gavin Shan
2015-06-15 6:49 ` [kernel] " 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).