[Very RFC 32/46] powernv/pci: Remove open-coded PE lookup in iommu_bypass_supported()

Alexey Kardashevskiy aik at ozlabs.ru
Wed Nov 27 16:09:38 AEDT 2019



On 20/11/2019 12:28, Oliver O'Halloran wrote:
> Signed-off-by: Oliver O'Halloran <oohall at gmail.com>



Reviewed-by: Alexey Kardashevskiy <aik at ozlabs.ru>

but honestly can be squashed into 31/46 or/and 33/46 or other similar
patches.

> ---
>  arch/powerpc/platforms/powernv/pci-ioda.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
> index 98d858999a2d..7e88de18ead6 100644
> --- a/arch/powerpc/platforms/powernv/pci-ioda.c
> +++ b/arch/powerpc/platforms/powernv/pci-ioda.c
> @@ -1801,13 +1801,11 @@ static bool pnv_pci_ioda_iommu_bypass_supported(struct pci_dev *pdev,
>  		u64 dma_mask)
>  {
>  	struct pnv_phb *phb = pci_bus_to_pnvhb(pdev->bus);
> -	struct pci_dn *pdn = pci_get_pdn(pdev);
> -	struct pnv_ioda_pe *pe;
> +	struct pnv_ioda_pe *pe = pnv_ioda_get_pe(pdev);
>  
> -	if (WARN_ON(!pdn || pdn->pe_number == IODA_INVALID_PE))
> +	if (WARN_ON(!pe))
>  		return false;
>  
> -	pe = &phb->ioda.pe_array[pdn->pe_number];
>  	if (pe->tce_bypass_enabled) {
>  		u64 top = pe->tce_bypass_base + memblock_end_of_DRAM() - 1;
>  		if (dma_mask >= top)
> 

-- 
Alexey


More information about the Linuxppc-dev mailing list