Question: multiple SMMUv3 devices probe

richard clark richard.xnu.clark at gmail.com
Wed Apr 14 04:17:31 BST 2021


Zenghui Yu <yuzenghui at huawei.com> 于2021年4月14日周三 上午10:40写道:
>
> On 2021/4/14 9:45, richard clark wrote:
> > Jean-Philippe Brucker <jean-philippe at linaro.org> 于2021年4月13日周二 下午8:58写道:
> >>
> >> On Tue, Apr 13, 2021 at 08:40:47PM +0800, richard clark wrote:
>
> [...]
>
> >>> Actually, my question is a if pci device driver probes its device
> >>> before the SMMUv3 driver probing,
> >>> how does that pci device using the DMA with SMMU translation?
> >>
> >> It doesn't - by looking at the dependencies described in device-tree
> > (forget to reply all, so add the CC'ing...)
> > I understand 'it doesn't' here means the pci driver will not probe its
> > device before SMMU driver is on
> >> (iommu-map property) or in ACPI IORT, we defer probe of the PCI device
> >> until the SMMU is operational.
> >>
> > If that is correct, Jean, would you point me to the code snippet that
> > a pci driver will defer
> > its probe until the SMMU is functional? Some key points are enough...
>
> I think it's correct. Take ACPI-based system as an example, we setup PCI
> device's DMA configuration by pci_dma_configure()/acpi_dma_configure().
> If as you said, the PCI device is probed before the SMMUv3 probing, we
> will get *-EPROBE_DEFER* during the DMA configuration. Please have a
> look at iort_pci_iommu_init()/iort_iommu_xlate(), which should have
> provided the whole details for us.
>
> The device we *are* probing is then put onto the "deferred list" (grep
> it in the driver core code) and will be retried from the list by
> deferred_probe_work.
>
> Hope it helps.
>
Ah, very clear workflow to clarify my confusion. It really does help,
thanks guy, good luck!
>
> Zenghui



More information about the linux-arm-kernel mailing list