diff options
author | xinhui pan <xinhui.pan@amd.com> | 2021-09-07 12:08:32 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-09-26 14:10:20 +0200 |
commit | f7525b4c5d402a6be0cb5e62956ca71607e77260 (patch) | |
tree | 8e9b467bb98385a364322924bc9ff8b1aacccc05 /drivers/of | |
parent | 3a4a126d3515188aa25362007b7d7501bb1b5625 (diff) |
drm/ttm: Fix a deadlock if the target BO is not idle during swap
[ Upstream commit 70982eef4d7eebb47a3b1ef25ec1bc742f3a21cf ]
The ret value might be -EBUSY, caller will think lru lock is still
locked but actually NOT. So return -ENOSPC instead. Otherwise we hit
list corruption.
ttm_bo_cleanup_refs might fail too if BO is not idle. If we return 0,
caller(ttm_tt_populate -> ttm_global_swapout ->ttm_device_swapout) will
be stuck as we actually did not free any BO memory. This usually happens
when the fence is not signaled for a long time.
Signed-off-by: xinhui pan <xinhui.pan@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Fixes: ebd59851c796 ("drm/ttm: move swapout logic around v3")
Link: https://patchwork.freedesktop.org/patch/msgid/20210907040832.1107747-1-xinhui.pan@amd.com
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/of')
0 files changed, 0 insertions, 0 deletions