Re: [PATCH v2 6/8] drm/amdgpu: Unmap entire device address space on device remove.

2020-06-23 Thread Andrey Grodzovsky


On 6/23/20 9:16 AM, Christian König wrote:

Am 23.06.20 um 12:22 schrieb Daniel Vetter:

On Mon, Jun 22, 2020 at 03:48:29PM -0400, Alex Deucher wrote:

On Mon, Jun 22, 2020 at 3:38 PM Christian König
 wrote:

Am 21.06.20 um 08:03 schrieb Andrey Grodzovsky:

Use the new TTM interface to invalidate all exsisting BO CPU mappings
form all user proccesses.

Signed-off-by: Andrey Grodzovsky 

Reviewed-by: Christian König 

I think those two patches could already land in amd-staging-drm-next
since they are a good idea independent of how else we fix the other issues.

Please make sure they land in drm-misc as well.

Not sure that's much use, since without any of the fault side changes you
just blow up on the first refault. Seems somewhat silly to charge ahead on
this with the other bits still very much under discussion.


Well what I wanted to say is that we don't need to send out those simple 
patches once more.



Plus I suggested a possible bikeshed here :-)


No bikeshed, but indeed a rather good idea to not make this a TTM function.

Christian.



So i will incorporate the changes suggested to turn the TTM part into generic 
DRM helper and will resend both patches as part of V3 (which might take a while 
now due to a context switch I am doing for another task).


Andrey





-Daniel


Alex


---
   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 +
   1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

index 43592dc..6932d75 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -1135,6 +1135,7 @@ amdgpu_pci_remove(struct pci_dev *pdev)
   struct drm_device *dev = pci_get_drvdata(pdev);

   drm_dev_unplug(dev);
+ ttm_bo_unmap_virtual_address_space(>mman.bdev);
   amdgpu_driver_unload_kms(dev);

   pci_disable_device(pdev);



___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH v2 6/8] drm/amdgpu: Unmap entire device address space on device remove.

2020-06-23 Thread Christian König

Am 23.06.20 um 12:22 schrieb Daniel Vetter:

On Mon, Jun 22, 2020 at 03:48:29PM -0400, Alex Deucher wrote:

On Mon, Jun 22, 2020 at 3:38 PM Christian König
 wrote:

Am 21.06.20 um 08:03 schrieb Andrey Grodzovsky:

Use the new TTM interface to invalidate all exsisting BO CPU mappings
form all user proccesses.

Signed-off-by: Andrey Grodzovsky 

Reviewed-by: Christian König 

I think those two patches could already land in amd-staging-drm-next
since they are a good idea independent of how else we fix the other issues.

Please make sure they land in drm-misc as well.

Not sure that's much use, since without any of the fault side changes you
just blow up on the first refault. Seems somewhat silly to charge ahead on
this with the other bits still very much under discussion.


Well what I wanted to say is that we don't need to send out those simple 
patches once more.



Plus I suggested a possible bikeshed here :-)


No bikeshed, but indeed a rather good idea to not make this a TTM function.

Christian.


-Daniel


Alex


---
   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 +
   1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 43592dc..6932d75 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -1135,6 +1135,7 @@ amdgpu_pci_remove(struct pci_dev *pdev)
   struct drm_device *dev = pci_get_drvdata(pdev);

   drm_dev_unplug(dev);
+ ttm_bo_unmap_virtual_address_space(>mman.bdev);
   amdgpu_driver_unload_kms(dev);

   pci_disable_device(pdev);


___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH v2 6/8] drm/amdgpu: Unmap entire device address space on device remove.

2020-06-23 Thread Daniel Vetter
On Mon, Jun 22, 2020 at 03:48:29PM -0400, Alex Deucher wrote:
> On Mon, Jun 22, 2020 at 3:38 PM Christian König
>  wrote:
> >
> > Am 21.06.20 um 08:03 schrieb Andrey Grodzovsky:
> > > Use the new TTM interface to invalidate all exsisting BO CPU mappings
> > > form all user proccesses.
> > >
> > > Signed-off-by: Andrey Grodzovsky 
> >
> > Reviewed-by: Christian König 
> >
> > I think those two patches could already land in amd-staging-drm-next
> > since they are a good idea independent of how else we fix the other issues.
> 
> Please make sure they land in drm-misc as well.

Not sure that's much use, since without any of the fault side changes you
just blow up on the first refault. Seems somewhat silly to charge ahead on
this with the other bits still very much under discussion.

Plus I suggested a possible bikeshed here :-)
-Daniel

> 
> Alex
> 
> >
> > > ---
> > >   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 +
> > >   1 file changed, 1 insertion(+)
> > >
> > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c 
> > > b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > > index 43592dc..6932d75 100644
> > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > > @@ -1135,6 +1135,7 @@ amdgpu_pci_remove(struct pci_dev *pdev)
> > >   struct drm_device *dev = pci_get_drvdata(pdev);
> > >
> > >   drm_dev_unplug(dev);
> > > + ttm_bo_unmap_virtual_address_space(>mman.bdev);
> > >   amdgpu_driver_unload_kms(dev);
> > >
> > >   pci_disable_device(pdev);
> >

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


Re: [PATCH v2 6/8] drm/amdgpu: Unmap entire device address space on device remove.

2020-06-22 Thread Alex Deucher
On Mon, Jun 22, 2020 at 3:38 PM Christian König
 wrote:
>
> Am 21.06.20 um 08:03 schrieb Andrey Grodzovsky:
> > Use the new TTM interface to invalidate all exsisting BO CPU mappings
> > form all user proccesses.
> >
> > Signed-off-by: Andrey Grodzovsky 
>
> Reviewed-by: Christian König 
>
> I think those two patches could already land in amd-staging-drm-next
> since they are a good idea independent of how else we fix the other issues.

Please make sure they land in drm-misc as well.

Alex

>
> > ---
> >   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 +
> >   1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c 
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > index 43592dc..6932d75 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > @@ -1135,6 +1135,7 @@ amdgpu_pci_remove(struct pci_dev *pdev)
> >   struct drm_device *dev = pci_get_drvdata(pdev);
> >
> >   drm_dev_unplug(dev);
> > + ttm_bo_unmap_virtual_address_space(>mman.bdev);
> >   amdgpu_driver_unload_kms(dev);
> >
> >   pci_disable_device(pdev);
>
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH v2 6/8] drm/amdgpu: Unmap entire device address space on device remove.

2020-06-22 Thread Christian König

Am 21.06.20 um 08:03 schrieb Andrey Grodzovsky:

Use the new TTM interface to invalidate all exsisting BO CPU mappings
form all user proccesses.

Signed-off-by: Andrey Grodzovsky 


Reviewed-by: Christian König 

I think those two patches could already land in amd-staging-drm-next 
since they are a good idea independent of how else we fix the other issues.



---
  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 43592dc..6932d75 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -1135,6 +1135,7 @@ amdgpu_pci_remove(struct pci_dev *pdev)
struct drm_device *dev = pci_get_drvdata(pdev);
  
  	drm_dev_unplug(dev);

+   ttm_bo_unmap_virtual_address_space(>mman.bdev);
amdgpu_driver_unload_kms(dev);
  
  	pci_disable_device(pdev);


___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH v2 6/8] drm/amdgpu: Unmap entire device address space on device remove.

2020-06-22 Thread Daniel Vetter
On Sun, Jun 21, 2020 at 02:03:06AM -0400, Andrey Grodzovsky wrote:
> Use the new TTM interface to invalidate all exsisting BO CPU mappings
> form all user proccesses.
> 
> Signed-off-by: Andrey Grodzovsky 
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index 43592dc..6932d75 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -1135,6 +1135,7 @@ amdgpu_pci_remove(struct pci_dev *pdev)
>   struct drm_device *dev = pci_get_drvdata(pdev);
>  
>   drm_dev_unplug(dev);
> + ttm_bo_unmap_virtual_address_space(>mman.bdev);
>   amdgpu_driver_unload_kms(dev);

Hm a ttm, or maybe even vram helper function which wraps drm_dev_unplug +
ttm unmapping into one would be nice I think? I suspect there's going to
be more in the future here.
-Daniel

>  
>   pci_disable_device(pdev);
> -- 
> 2.7.4
> 

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


[PATCH v2 6/8] drm/amdgpu: Unmap entire device address space on device remove.

2020-06-21 Thread Andrey Grodzovsky
Use the new TTM interface to invalidate all exsisting BO CPU mappings
form all user proccesses.

Signed-off-by: Andrey Grodzovsky 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 43592dc..6932d75 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -1135,6 +1135,7 @@ amdgpu_pci_remove(struct pci_dev *pdev)
struct drm_device *dev = pci_get_drvdata(pdev);
 
drm_dev_unplug(dev);
+   ttm_bo_unmap_virtual_address_space(>mman.bdev);
amdgpu_driver_unload_kms(dev);
 
pci_disable_device(pdev);
-- 
2.7.4

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx