Commit 1fd99fe
committed
NVIDIA: VR: SAUCE: cxl/region: Avoid attach action self-deadlock
devm_add_action_or_reset() synchronously invokes
endpoint_unregister_region() on allocation failure while
cxl_memdev_attach_region() still holds cxl_rwsem.region for read. Region
teardown then tries to acquire that lock for write and self-deadlocks.
Use devm_add_action() and, on failure, leave the region and DPA read-lock
scope before invoking endpoint_unregister_region() directly. Keep the
endpoint device locked so the topology remains stable while the failed
action registration is unwound.
Fixes: a2305bb ("NVIDIA: VR: SAUCE: cxl: Backport the mainline Type-2 memdev lifetime model")
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>1 parent a2305bb commit 1fd99fe
1 file changed
Lines changed: 45 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4322 | 4322 | | |
4323 | 4323 | | |
4324 | 4324 | | |
| 4325 | + | |
4325 | 4326 | | |
4326 | 4327 | | |
4327 | 4328 | | |
4328 | 4329 | | |
4329 | | - | |
4330 | | - | |
4331 | 4330 | | |
4332 | | - | |
4333 | | - | |
4334 | | - | |
4335 | | - | |
4336 | | - | |
4337 | | - | |
| 4331 | + | |
| 4332 | + | |
| 4333 | + | |
4338 | 4334 | | |
4339 | | - | |
4340 | | - | |
4341 | | - | |
4342 | | - | |
4343 | | - | |
| 4335 | + | |
| 4336 | + | |
| 4337 | + | |
| 4338 | + | |
| 4339 | + | |
| 4340 | + | |
| 4341 | + | |
| 4342 | + | |
| 4343 | + | |
| 4344 | + | |
| 4345 | + | |
| 4346 | + | |
| 4347 | + | |
| 4348 | + | |
4344 | 4349 | | |
4345 | | - | |
4346 | | - | |
| 4350 | + | |
| 4351 | + | |
4347 | 4352 | | |
4348 | | - | |
4349 | | - | |
4350 | | - | |
4351 | | - | |
4352 | | - | |
4353 | | - | |
| 4353 | + | |
| 4354 | + | |
| 4355 | + | |
| 4356 | + | |
| 4357 | + | |
| 4358 | + | |
4354 | 4359 | | |
4355 | | - | |
4356 | | - | |
4357 | | - | |
4358 | | - | |
4359 | | - | |
| 4360 | + | |
| 4361 | + | |
| 4362 | + | |
| 4363 | + | |
| 4364 | + | |
4360 | 4365 | | |
4361 | | - | |
4362 | | - | |
4363 | | - | |
4364 | | - | |
4365 | | - | |
4366 | | - | |
| 4366 | + | |
| 4367 | + | |
| 4368 | + | |
| 4369 | + | |
| 4370 | + | |
| 4371 | + | |
| 4372 | + | |
| 4373 | + | |
| 4374 | + | |
| 4375 | + | |
| 4376 | + | |
| 4377 | + | |
4367 | 4378 | | |
4368 | | - | |
4369 | | - | |
4370 | | - | |
4371 | | - | |
4372 | | - | |
| 4379 | + | |
| 4380 | + | |
4373 | 4381 | | |
4374 | 4382 | | |
4375 | 4383 | | |
| |||
0 commit comments