[PATCH kernel v11 02/10] powerpc/powernv/iommu: Add real mode version of iommu_table_ops::exchange()

Michael Ellerman mpe at ellerman.id.au
Mon Mar 27 19:47:08 AEDT 2017


Alexey Kardashevskiy <aik at ozlabs.ru> writes:

> diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
> index 5f202a566ec5..9bace5df05d5 100644
> --- a/arch/powerpc/kernel/iommu.c
> +++ b/arch/powerpc/kernel/iommu.c
> @@ -1004,6 +1004,29 @@ long iommu_tce_xchg(struct iommu_table *tbl, unsigned long entry,
>  }
>  EXPORT_SYMBOL_GPL(iommu_tce_xchg);
>  
> +long iommu_tce_xchg_rm(struct iommu_table *tbl, unsigned long entry,
> +		unsigned long *hpa, enum dma_data_direction *direction)
> +{
> +	long ret;
> +
> +	ret = tbl->it_ops->exchange_rm(tbl, entry, hpa, direction);
> +
> +	if (!ret && ((*direction == DMA_FROM_DEVICE) ||
> +			(*direction == DMA_BIDIRECTIONAL))) {
> +		struct page *pg = realmode_pfn_to_page(*hpa >> PAGE_SHIFT);

This breaks the corenet64_smp_defconfig build:

arch/powerpc/kernel/iommu.c:1037:21: error: implicit declaration of function 'realmode_pfn_to_page' [-Werror=implicit-function-declaration]


I think you can probably just put it inside #ifdef CONFIG_PPC_BOOK3S_64.

cheers


More information about the Linuxppc-dev mailing list