[PATCH v12 14/21] powerpc/powernv: Allocate struct pnv_ioda_pe iommu_table dynamically

Wei Yang weiyang at linux.vnet.ibm.com
Wed Mar 11 17:13:51 AEDT 2015


On Tue, Mar 10, 2015 at 09:47:37PM -0500, Bjorn Helgaas wrote:
>On Mon, Mar 02, 2015 at 03:50:37PM +0800, Wei Yang wrote:
>> On Tue, Feb 24, 2015 at 02:46:53AM -0600, Bjorn Helgaas wrote:
>> >On Tue, Feb 24, 2015 at 02:34:35AM -0600, Bjorn Helgaas wrote:
>> >> From: Wei Yang <weiyang at linux.vnet.ibm.com>
>> >> 
>> >> Current iommu_table of a PE is a static field.  This will have a problem
>> >> when iommu_free_table() is called.
>> >> 
>> >> Allocate iommu_table dynamically.
>> >
>> >I'd like a little more explanation about why we're calling
>> >iommu_free_table() now when we didn't call it before.  Maybe this happens
>> >when we disable SR-IOV and the VFs go away?
>> 
>> Yes, it is called in disable path.
>> 
>> pcibios_sriov_disable
>>     pnv_pci_sriov_disable
>>         pnv_ioda_release_vf_PE
>> 	    pnv_pci_ioda2_release_dma_pe
>> 	        iommu_free_table            <--- here it is invoked
>> 
>> 
>> >
>> >Is there a hotplug remove path where we should also be calling
>> >iommu_free_table()?
>> 
>> When VF is not introduced, no one calls this on powernv platform.
>> 
>> Each PCI bus is a PE and it has its own iommu table, even a device is
>> hotpluged, the iommu table will not be released.
>
>None of this explanation made it into the v13 patch.  And I don't quite
>understand it anyway.
>
>Something like "Previously the iommu_table had the same lifetime as a
>struct pnv_ioda_pe and was embedded in it.  The pnv_ioda_pe was allocated
>when XXX and freed when YYY.  This no longer works: we can't allocate the
>iommu_table at the same time as the pnv_ioda_pe because XXX, so we allocate
>it when XXX and free it when YYY."

Got it, I have put the explanation in change log in next version.

>
>Bjorn
>_______________________________________________
>Linuxppc-dev mailing list
>Linuxppc-dev at lists.ozlabs.org
>https://lists.ozlabs.org/listinfo/linuxppc-dev

-- 
Richard Yang
Help you, Help me



More information about the Linuxppc-dev mailing list