Re: [PATCH v3 02/12] drm: Unamp the entire device address space on device unplug

2020-11-24 Thread Daniel Vetter
On Sat, Nov 21, 2020 at 03:16:15PM +0100, Christian König wrote:
> Am 21.11.20 um 06:21 schrieb Andrey Grodzovsky:
> > Invalidate all BOs CPU mappings once device is removed.
> > 
> > v3: Move the code from TTM into drm_dev_unplug
> > 
> > Signed-off-by: Andrey Grodzovsky 
> 
> Reviewed-by: Christian König 

Was wondering for a moment whether this should be in drm_dev_unregister
instead, but then it's only one part of the coin really. So

Reviewed-by: Daniel Vetter 

> 
> > ---
> >   drivers/gpu/drm/drm_drv.c | 3 +++
> >   1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
> > index 13068fd..d550fd5 100644
> > --- a/drivers/gpu/drm/drm_drv.c
> > +++ b/drivers/gpu/drm/drm_drv.c
> > @@ -479,6 +479,9 @@ void drm_dev_unplug(struct drm_device *dev)
> > synchronize_srcu(_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);
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v3 02/12] drm: Unamp the entire device address space on device unplug

2020-11-21 Thread Christian König

Am 21.11.20 um 06:21 schrieb Andrey Grodzovsky:

Invalidate all BOs CPU mappings once device is removed.

v3: Move the code from TTM into drm_dev_unplug

Signed-off-by: Andrey Grodzovsky 


Reviewed-by: Christian König 


---
  drivers/gpu/drm/drm_drv.c | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 13068fd..d550fd5 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -479,6 +479,9 @@ void drm_dev_unplug(struct drm_device *dev)
synchronize_srcu(_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);
  


___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v3 02/12] drm: Unamp the entire device address space on device unplug

2020-11-20 Thread Andrey Grodzovsky
Invalidate all BOs CPU mappings once device is removed.

v3: Move the code from TTM into drm_dev_unplug

Signed-off-by: Andrey Grodzovsky 
---
 drivers/gpu/drm/drm_drv.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 13068fd..d550fd5 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -479,6 +479,9 @@ void drm_dev_unplug(struct drm_device *dev)
synchronize_srcu(_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);
 
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel