[PATCH kernel v11 02/34] powerpc/iommu/powernv: Get rid of set_iommu_table_base_and_group

David Gibson david at gibson.dropbear.id.au
Mon Jun 1 13:47:34 AEST 2015


On Fri, May 29, 2015 at 06:44:26PM +1000, Alexey Kardashevskiy wrote:
> The set_iommu_table_base_and_group() name suggests that the function
> sets table base and add a device to an IOMMU group.
> 
> The actual purpose for table base setting is to put some reference
> into a device so later iommu_add_device() can get the IOMMU group
> reference and the device to the group.
> 
> At the moment a group cannot be explicitly passed to iommu_add_device()
> as we want it to work from the bus notifier, we can fix it later and
> remove confusing calls of set_iommu_table_base().
> 
> This replaces set_iommu_table_base_and_group() with a couple of
> set_iommu_table_base() + iommu_add_device() which makes reading the code
> easier.
> 
> This adds few comments why set_iommu_table_base() and iommu_add_device()
> are called where they are called.
> 
> For IODA1/2, this essentially removes iommu_add_device() call from
> the pnv_pci_ioda_dma_dev_setup() as it will always fail at this particular
> place:
> - for physical PE, the device is already attached by iommu_add_device()
> in pnv_pci_ioda_setup_dma_pe();
> - for virtual PE, the sysfs entries are not ready to create all symlinks
> so actual adding is happening in tce_iommu_bus_notifier.
> 
> Signed-off-by: Alexey Kardashevskiy <aik at ozlabs.ru>
> Reviewed-by: Gavin Shan <gwshan at linux.vnet.ibm.com>

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

-- 
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20150601/9ffda85f/attachment-0001.sig>


More information about the Linuxppc-dev mailing list