projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c919739
)
iommu/amd: Handle race between registration and device probe
author
Robin Murphy
<robin.murphy@arm.com>
Mon, 15 Aug 2022 16:20:03 +0000
(17:20 +0100)
committer
Joerg Roedel
<jroedel@suse.de>
Wed, 7 Sep 2022 12:25:01 +0000
(14:25 +0200)
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>
Link:
https://lore.kernel.org/r/a8d8ebe12b411d28972f1ab928c6db92e8913cf5.1660572783.git.robin.murphy@arm.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd/iommu.c
patch
|
blob
|
history
diff --git
a/drivers/iommu/amd/iommu.c
b/drivers/iommu/amd/iommu.c
index 94220eb5bff3f103ade5e0a0917e30a06bf9b478..85c4122b5d61dadc58d9ab59d5b77ff4c4159e7e 100644
(file)
--- 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;