lkml.org 
[lkml]   [2022]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v4 02/16] iommu/amd: Handle race between registration and device probe
    Date
    As for the Intel driver, make sure the AMD driver can cope with seeing
    .probe_device calls without having to wait for all known instances to
    register first.

    Signed-off-by: Robin Murphy <robin.murphy@arm.com>
    ---

    v4: No change

    drivers/iommu/amd/iommu.c | 4 ++++
    1 file changed, 4 insertions(+)

    diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
    index 65b8e4fd8217..5ed9fd40d2a7 100644
    --- a/drivers/iommu/amd/iommu.c
    +++ b/drivers/iommu/amd/iommu.c
    @@ -1851,6 +1851,10 @@ static struct iommu_device *amd_iommu_probe_device(struct device *dev)
    if (!iommu)
    return ERR_PTR(-ENODEV);

    + /* Not registered yet? */
    + if (!iommu->iommu.ops)
    + return ERR_PTR(-ENODEV);
    +
    if (dev_iommu_priv_get(dev))
    return &iommu->iommu;

    --
    2.36.1.dirty
    \
     
     \ /
      Last update: 2022-08-15 18:21    [W:2.816 / U:0.212 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site