diff options
author | Andrey Grodzovsky <andrey.grodzovsky@amd.com> | 2021-01-18 16:01:11 -0500 |
---|---|---|
committer | Christian König <christian.koenig@amd.com> | 2021-01-19 10:22:14 +0100 |
commit | b9d4efa8f9a26428d8d9bace9ce0f988ab28431b (patch) | |
tree | 3e8e5c5aea8ff87a418f8bbd999f5cf4e22b3500 | |
parent | 36b73b051c41c1c1a4fd543faed1ceeca1c2bce3 (diff) | |
download | linux-stable-b9d4efa8f9a26428d8d9bace9ce0f988ab28431b.tar.gz linux-stable-b9d4efa8f9a26428d8d9bace9ce0f988ab28431b.tar.bz2 linux-stable-b9d4efa8f9a26428d8d9bace9ce0f988ab28431b.zip |
drm: Unamp the entire device address space on device unplug
Invalidate all BOs CPU mappings once device is removed.
v3: Move the code from TTM into drm_dev_unplug
Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/414809/
Signed-off-by: Christian König <christian.koenig@amd.com>
-rw-r--r-- | drivers/gpu/drm/drm_drv.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index d384a5b8119f..20d22e41d7ce 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -469,6 +469,9 @@ void drm_dev_unplug(struct drm_device *dev) synchronize_srcu(&drm_unplug_srcu); drm_dev_unregister(dev); + + /* Clear all CPU mappings pointing to this device */ + unmap_mapping_range(dev->anon_inode->i_mapping, 0, 0, 1); } EXPORT_SYMBOL(drm_dev_unplug); |