Commit 7d83513
iommu/arm-smmu: Make instance lookup robust
Relying on the driver list was a cute idea for minimising the scope of
our SMMU device lookups, however it turns out to have a subtle flaw. The
SMMU device only gets added to that list after arm_smmu_device_probe()
returns success, so there's actually no way the iommu_device_register()
call from there could ever work as intended, even if it wasn't already
hampered by the fwspec setup not happening early enough.
Switch both arm_smmu_get_by_fwnode() implementations to use a platform
bus lookup instead, which *will* reliably work. Also make sure that we
don't register SMMUv2 instances until we've fully initialised them, to
avoid similar consequences of the lookup now finding a device with no
drvdata. Moving the error returns is also a perfect excuse to streamline
them with dev_err_probe() in the process.
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/6d7ce1dc31873abdb75c895fb8bd2097cce098b4.1733406914.git.robin.murphy@arm.com
Signed-off-by: Will Deacon <will@kernel.org>1 parent 9b640ae commit 7d83513
File tree
2 files changed
+15
-18
lines changed- drivers/iommu/arm
- arm-smmu-v3
- arm-smmu
2 files changed
+15
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3351 | 3351 | | |
3352 | 3352 | | |
3353 | 3353 | | |
3354 | | - | |
3355 | | - | |
| 3354 | + | |
| 3355 | + | |
3356 | 3356 | | |
3357 | 3357 | | |
3358 | 3358 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1411 | 1411 | | |
1412 | 1412 | | |
1413 | 1413 | | |
1414 | | - | |
1415 | | - | |
| 1414 | + | |
| 1415 | + | |
1416 | 1416 | | |
1417 | 1417 | | |
1418 | 1418 | | |
| |||
2227 | 2227 | | |
2228 | 2228 | | |
2229 | 2229 | | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
2230 | 2238 | | |
2231 | 2239 | | |
2232 | | - | |
2233 | | - | |
2234 | | - | |
2235 | | - | |
| 2240 | + | |
| 2241 | + | |
2236 | 2242 | | |
2237 | 2243 | | |
2238 | 2244 | | |
2239 | 2245 | | |
2240 | | - | |
2241 | 2246 | | |
2242 | | - | |
| 2247 | + | |
2243 | 2248 | | |
2244 | 2249 | | |
2245 | | - | |
2246 | | - | |
2247 | | - | |
2248 | | - | |
2249 | | - | |
2250 | | - | |
2251 | | - | |
2252 | | - | |
2253 | 2250 | | |
2254 | 2251 | | |
2255 | 2252 | | |
| |||
0 commit comments