linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH kernel] powerpc/powernv/npu: Remove dead iommu code
@ 2017-02-21  2:40 Alexey Kardashevskiy
  2017-02-21 22:33 ` Gavin Shan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alexey Kardashevskiy @ 2017-02-21  2:40 UTC (permalink / raw)
  To: linuxppc-dev
  Cc: Alexey Kardashevskiy, David Gibson, Gavin Shan, Russell Currey

PNV_IODA_PE_DEV is only used for NPU devices (emulated PCI bridges
representing NVLink). These are added to IOMMU groups with corresponding
NVIDIA devices after all non-NPU PEs are setup; a special helper -
pnv_pci_ioda_setup_iommu_api() - handles this in pnv_pci_ioda_fixup().

The pnv_pci_ioda2_setup_dma_pe() helper sets up DMA for a PE. It is called
for VFs (so it does not handle NPU case) and PCI bridges but only
IODA1 and IODA2 types. An NPU bridge has its own type id (PNV_PHB_NPU)
so pnv_pci_ioda2_setup_dma_pe() cannot be called on NPU and therefore
(pe->flags & PNV_IODA_PE_DEV) is always "false".

This removes not used iommu_add_device(). This should not cause any
behavioral change.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
 arch/powerpc/platforms/powernv/pci-ioda.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 5fcae29107e1..51ec0dc1dfde 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -2724,9 +2724,7 @@ static void pnv_pci_ioda2_setup_dma_pe(struct pnv_phb *phb,
 	if (rc)
 		return;
 
-	if (pe->flags & PNV_IODA_PE_DEV)
-		iommu_add_device(&pe->pdev->dev);
-	else if (pe->flags & (PNV_IODA_PE_BUS | PNV_IODA_PE_BUS_ALL))
+	if (pe->flags & (PNV_IODA_PE_BUS | PNV_IODA_PE_BUS_ALL))
 		pnv_ioda_setup_bus_dma(pe, pe->pbus);
 }
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH kernel] powerpc/powernv/npu: Remove dead iommu code
  2017-02-21  2:40 [PATCH kernel] powerpc/powernv/npu: Remove dead iommu code Alexey Kardashevskiy
@ 2017-02-21 22:33 ` Gavin Shan
  2017-02-22  0:36 ` David Gibson
  2017-03-21 11:36 ` [kernel] " Michael Ellerman
  2 siblings, 0 replies; 4+ messages in thread
From: Gavin Shan @ 2017-02-21 22:33 UTC (permalink / raw)
  To: Alexey Kardashevskiy; +Cc: linuxppc-dev, Gavin Shan, David Gibson

On Tue, Feb 21, 2017 at 01:40:20PM +1100, Alexey Kardashevskiy wrote:
>PNV_IODA_PE_DEV is only used for NPU devices (emulated PCI bridges
>representing NVLink). These are added to IOMMU groups with corresponding
>NVIDIA devices after all non-NPU PEs are setup; a special helper -
>pnv_pci_ioda_setup_iommu_api() - handles this in pnv_pci_ioda_fixup().
>
>The pnv_pci_ioda2_setup_dma_pe() helper sets up DMA for a PE. It is called
>for VFs (so it does not handle NPU case) and PCI bridges but only
>IODA1 and IODA2 types. An NPU bridge has its own type id (PNV_PHB_NPU)
>so pnv_pci_ioda2_setup_dma_pe() cannot be called on NPU and therefore
>(pe->flags & PNV_IODA_PE_DEV) is always "false".
>
>This removes not used iommu_add_device(). This should not cause any
>behavioral change.
>
>Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>

Acked-by: Gavin Shan <gwshan@linux.vnet.ibm.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH kernel] powerpc/powernv/npu: Remove dead iommu code
  2017-02-21  2:40 [PATCH kernel] powerpc/powernv/npu: Remove dead iommu code Alexey Kardashevskiy
  2017-02-21 22:33 ` Gavin Shan
@ 2017-02-22  0:36 ` David Gibson
  2017-03-21 11:36 ` [kernel] " Michael Ellerman
  2 siblings, 0 replies; 4+ messages in thread
From: David Gibson @ 2017-02-22  0:36 UTC (permalink / raw)
  To: Alexey Kardashevskiy; +Cc: linuxppc-dev, Gavin Shan, Russell Currey

[-- Attachment #1: Type: text/plain, Size: 1867 bytes --]

On Tue, Feb 21, 2017 at 01:40:20PM +1100, Alexey Kardashevskiy wrote:
> PNV_IODA_PE_DEV is only used for NPU devices (emulated PCI bridges
> representing NVLink). These are added to IOMMU groups with corresponding
> NVIDIA devices after all non-NPU PEs are setup; a special helper -
> pnv_pci_ioda_setup_iommu_api() - handles this in pnv_pci_ioda_fixup().
> 
> The pnv_pci_ioda2_setup_dma_pe() helper sets up DMA for a PE. It is called
> for VFs (so it does not handle NPU case) and PCI bridges but only
> IODA1 and IODA2 types. An NPU bridge has its own type id (PNV_PHB_NPU)
> so pnv_pci_ioda2_setup_dma_pe() cannot be called on NPU and therefore
> (pe->flags & PNV_IODA_PE_DEV) is always "false".
> 
> This removes not used iommu_add_device(). This should not cause any
> behavioral change.
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  arch/powerpc/platforms/powernv/pci-ioda.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
> index 5fcae29107e1..51ec0dc1dfde 100644
> --- a/arch/powerpc/platforms/powernv/pci-ioda.c
> +++ b/arch/powerpc/platforms/powernv/pci-ioda.c
> @@ -2724,9 +2724,7 @@ static void pnv_pci_ioda2_setup_dma_pe(struct pnv_phb *phb,
>  	if (rc)
>  		return;
>  
> -	if (pe->flags & PNV_IODA_PE_DEV)
> -		iommu_add_device(&pe->pdev->dev);
> -	else if (pe->flags & (PNV_IODA_PE_BUS | PNV_IODA_PE_BUS_ALL))
> +	if (pe->flags & (PNV_IODA_PE_BUS | PNV_IODA_PE_BUS_ALL))
>  		pnv_ioda_setup_bus_dma(pe, pe->pbus);
>  }
>  

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [kernel] powerpc/powernv/npu: Remove dead iommu code
  2017-02-21  2:40 [PATCH kernel] powerpc/powernv/npu: Remove dead iommu code Alexey Kardashevskiy
  2017-02-21 22:33 ` Gavin Shan
  2017-02-22  0:36 ` David Gibson
@ 2017-03-21 11:36 ` Michael Ellerman
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2017-03-21 11:36 UTC (permalink / raw)
  To: Alexey Kardashevskiy, linuxppc-dev
  Cc: Alexey Kardashevskiy, Gavin Shan, David Gibson

On Tue, 2017-02-21 at 02:40:20 UTC, Alexey Kardashevskiy wrote:
> PNV_IODA_PE_DEV is only used for NPU devices (emulated PCI bridges
> representing NVLink). These are added to IOMMU groups with corresponding
> NVIDIA devices after all non-NPU PEs are setup; a special helper -
> pnv_pci_ioda_setup_iommu_api() - handles this in pnv_pci_ioda_fixup().
> 
> The pnv_pci_ioda2_setup_dma_pe() helper sets up DMA for a PE. It is called
> for VFs (so it does not handle NPU case) and PCI bridges but only
> IODA1 and IODA2 types. An NPU bridge has its own type id (PNV_PHB_NPU)
> so pnv_pci_ioda2_setup_dma_pe() cannot be called on NPU and therefore
> (pe->flags & PNV_IODA_PE_DEV) is always "false".
> 
> This removes not used iommu_add_device(). This should not cause any
> behavioral change.
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> Acked-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/20f13b95eef1b3ca75535e313357b0

cheers

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-21 11:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-21  2:40 [PATCH kernel] powerpc/powernv/npu: Remove dead iommu code Alexey Kardashevskiy
2017-02-21 22:33 ` Gavin Shan
2017-02-22  0:36 ` David Gibson
2017-03-21 11:36 ` [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).