Commit cac0757
committed
drm/panthor: Fix race when converting group handle to group object
XArray provides it's own internal lock which protects the internal array
when entries are being simultaneously added and removed. However there
is still a race between retrieving the pointer from the XArray and
incrementing the reference count.
To avoid this race simply hold the internal XArray lock when
incrementing the reference count, this ensures there cannot be a racing
call to xa_erase().
Fixes: de85488 ("drm/panthor: Add the scheduler logical block")
Signed-off-by: Steven Price <steven.price@arm.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240923103406.2509906-1-steven.price@arm.com1 parent d92b90f commit cac0757
1 file changed
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3242 | 3242 | | |
3243 | 3243 | | |
3244 | 3244 | | |
| 3245 | + | |
| 3246 | + | |
| 3247 | + | |
| 3248 | + | |
| 3249 | + | |
| 3250 | + | |
| 3251 | + | |
| 3252 | + | |
| 3253 | + | |
| 3254 | + | |
| 3255 | + | |
| 3256 | + | |
3245 | 3257 | | |
3246 | 3258 | | |
3247 | 3259 | | |
| |||
3253 | 3265 | | |
3254 | 3266 | | |
3255 | 3267 | | |
3256 | | - | |
| 3268 | + | |
3257 | 3269 | | |
3258 | 3270 | | |
3259 | 3271 | | |
| |||
3384 | 3396 | | |
3385 | 3397 | | |
3386 | 3398 | | |
3387 | | - | |
| 3399 | + | |
3388 | 3400 | | |
3389 | 3401 | | |
3390 | 3402 | | |
| |||
0 commit comments