Skip to contentSkip to conversation

drm/amdgpu: remove duplicate evict_vram in suspend path

PATCH NAK Alex Deucher 5 participants 8 messages Oct 5, 2016 – Oct 10, 2016 6 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: remove duplicate evict_vram in suspend path

Looks like fallout from a rebase or merge.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -3
index 45259b5..c2f70be 100644
@@ -1956,9 +1956,6 @@ int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon)
 
 	r = amdgpu_suspend(adev);
 
-	/* evict remaining vram memory */
-	amdgpu_bo_evict_vram(adev);
-
 	pci_save_state(dev->pdev);
 	if (suspend) {
 		/* Shut down the device */
Signature · 6 lines
2.5.5

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1475696538-24754-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org

#2 lore raw
Quoted 1 line · Alex Deucher

Looks like fallout from a rebase or merge.

Nearly sure we do it twice on purpose, at least radeon does it as well.

so NAK without a better explaination.

Dave.

Quoted 23 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -4
index 45259b5..c2f70be 100644
@@ -1956,9 +1956,6 @@ int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon)
 
        r = amdgpu_suspend(adev);
 
-       /* evict remaining vram memory */
-       amdgpu_bo_evict_vram(adev);
-
        pci_save_state(dev->pdev);
        if (suspend) {
                /* Shut down the device */
--

2.5.5

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): CAPM=9txmXEg-i7=gPs+6pQebxJ7nRkFDAtv32uvyiG+Cb6Wo4A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#4 lore raw

I proposed to remove that when running into SDMA job out-of-order issues and Christian K very strongly NAK'ed that (a couple of times).

So I suspect he'll do it again.

Tom

Quoted 34 lines · Dave Airlie
Quoted 1 line · Alex Deucher

Looks like fallout from a rebase or merge.

Nearly sure we do it twice on purpose, at least radeon does it as well.

so NAK without a better explaination.

Dave.

Review

Quoted 7 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ---
 1 file changed, 3 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_device_suspend(struct drm_device *dev,

Quoted 4 lines

index 45259b5..c2f70be 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
@@ -1956,9 +1956,6 @@ int amdgpu_device_suspend(struct drm_device *dev,

bool suspend, bool fbcon)

Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -4
        r = amdgpu_suspend(adev);
 
-       /* evict remaining vram memory */
-       amdgpu_bo_evict_vram(adev);
-
        pci_save_state(dev->pdev);
        if (suspend) {
                /* Shut down the device */
--

2.5.5

Quoted 9 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#5 lore raw
In reply to a message not in the archive

Am 05.10.2016 um 21:42 schrieb Alex Deucher:

Quoted 3 lines

Looks like fallout from a rebase or merge.

NAK, this is done on purpose and is for evicting the GART table using memcpy.

Tom wanted to remove that as well and it makes resume then fail horrible on dGPUs.

We should probably add a comment why this is necessary.

Christian.

Quoted 9 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ---
  1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index 45259b5..c2f70be 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon) · line 1961

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -3
@@ -1956,9 +1956,6 @@ int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon)
 
  	r = amdgpu_suspend(adev);
 
-	/* evict remaining vram memory */
-	amdgpu_bo_evict_vram(adev);
-
  	pci_save_state(dev->pdev);
  	if (suspend) {
  		/* Shut down the device */

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 5f17b1d4-b088-4ed7-06b7-86b4c85bd4f0-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org

#7 lore raw

Yup that's what I said in another part of the thread :-)

i'm a trailblazer of bad ideas at times :-) hehehehe

Tom

Quoted 37 lines · Christian König

Am 05.10.2016 um 21:42 schrieb Alex Deucher:

Quoted 3 lines

Looks like fallout from a rebase or merge.

NAK, this is done on purpose and is for evicting the GART table using memcpy.

Tom wanted to remove that as well and it makes resume then fail horrible on dGPUs.

We should probably add a comment why this is necessary.

Christian.

Review

Quoted 5 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ---
  1 file changed, 3 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_device_suspend(struct drm_device *dev,

Quoted 4 lines

index 45259b5..c2f70be 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
@@ -1956,9 +1956,6 @@ int amdgpu_device_suspend(struct drm_device *dev,

bool suspend, bool fbcon)

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon) · line 1961

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -3
      r = amdgpu_suspend(adev);
 
-     /* evict remaining vram memory */
-     amdgpu_bo_evict_vram(adev);
-
      pci_save_state(dev->pdev);
      if (suspend) {
              /* Shut down the device */
Quoted 5 lines

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): CAAzXoRKnei7U3hvUCosvpOB8z9kM6CL1Lg5GduyzfUpW9ZrxKQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#9 lore raw
Quoted 1 line

i'm a trailblazer of bad ideas at times :-) hehehehe

Well, I know this because I had the same bad idea earlier and spend a lot of time bisecting why it broke :)

Christian.

Am 09.10.2016 um 19:54 schrieb Tom St Denis:

Quoted 43 lines

Yup that's what I said in another part of the thread :-)

i'm a trailblazer of bad ideas at times :-) hehehehe

Tom

On Sun, Oct 9, 2016 at 11:13 AM Christian König <[email protected] <mailto:[email protected]>> wrote:

    Am 05.10.2016 um 21:42 schrieb Alex Deucher:
    > Looks like fallout from a rebase or merge.
    >
    > Signed-off-by: Alex Deucher <[email protected]
    <mailto:[email protected]>>

    NAK, this is done on purpose and is for evicting the GART table using
    memcpy.

    Tom wanted to remove that as well and it makes resume then fail
    horrible
    on dGPUs.

    We should probably add a comment why this is necessary.

    Christian.

    > ---
    >   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ---
    >   1 file changed, 3 deletions(-)
    >
    > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
    b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
    > index 45259b5..c2f70be 100644
    > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
    > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
    > @@ -1956,9 +1956,6 @@ int amdgpu_device_suspend(struct
    drm_device *dev, bool suspend, bool fbcon)
    >
    >       r = amdgpu_suspend(adev);
    >
    > -     /* evict remaining vram memory */
    > -     amdgpu_bo_evict_vram(adev);
    > -
    >       pci_save_state(dev->pdev);
Quoted 9 lines
    >       if (suspend) {
    >               /* Shut down the device */


    _______________________________________________
    amd-gfx mailing list
    [email protected] <mailto:[email protected]>
    https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 9a09b439-600b-ed25-4d1c-3ee12848a6d8-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org

#11 lore raw

We can make it dGpu specific if APU has no problem.

Regards,
David Zhou

Quoted 61 lines · Christian König
Quoted 1 line

i'm a trailblazer of bad ideas at times :-) hehehehe

Well, I know this because I had the same bad idea earlier and spend a lot of time bisecting why it broke :)

Christian.

Am 09.10.2016 um 19:54 schrieb Tom St Denis:

Quoted 43 lines

Yup that's what I said in another part of the thread :-)

i'm a trailblazer of bad ideas at times :-) hehehehe

Tom

On Sun, Oct 9, 2016 at 11:13 AM Christian König <[email protected] <mailto:[email protected]>> wrote:

    Am 05.10.2016 um 21:42 schrieb Alex Deucher:
    > Looks like fallout from a rebase or merge.
    >
    > Signed-off-by: Alex Deucher <[email protected]
    <mailto:[email protected]>>

    NAK, this is done on purpose and is for evicting the GART table using
    memcpy.

    Tom wanted to remove that as well and it makes resume then fail
    horrible
    on dGPUs.

    We should probably add a comment why this is necessary.

    Christian.

    > ---
    >   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ---
    >   1 file changed, 3 deletions(-)
    >
    > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
    b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
    > index 45259b5..c2f70be 100644
    > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
    > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
    > @@ -1956,9 +1956,6 @@ int amdgpu_device_suspend(struct
    drm_device *dev, bool suspend, bool fbcon)
    >
    >       r = amdgpu_suspend(adev);
    >
    > -     /* evict remaining vram memory */
    > -     amdgpu_bo_evict_vram(adev);
    > -
    >       pci_save_state(dev->pdev);
Quoted 9 lines
    >       if (suspend) {
    >               /* Shut down the device */


    _______________________________________________
    amd-gfx mailing list
    [email protected] <mailto:[email protected]>
    https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 4 lines

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): [email protected]

#13 lore raw

APUs have a problem with that as well when we try to suspend to disk because the kernel has no idea that he needs to backup the stolen VRAM as well.

I discussed that with Alex internally as well and our conclusion is that we could work on this, but it's probably not worth it and potentially causes more trouble than it fixes.

It's probably a better idea to give the suspend/resume and eviction code some more testing and hardening and add comments here and there why we do things like we do them.

Regards,
Christian.

Am 10.10.2016 um 09:11 schrieb zhoucm1:

Quoted 73 lines

We can make it dGpu specific if APU has no problem.

Regards,
David Zhou

Quoted 66 lines · Christian König
Quoted 1 line

i'm a trailblazer of bad ideas at times :-) hehehehe

Well, I know this because I had the same bad idea earlier and spend a lot of time bisecting why it broke :)

Christian.

Am 09.10.2016 um 19:54 schrieb Tom St Denis:

Quoted 44 lines

Yup that's what I said in another part of the thread :-)

i'm a trailblazer of bad ideas at times :-) hehehehe

Tom

On Sun, Oct 9, 2016 at 11:13 AM Christian König <[email protected] <mailto:[email protected]>> wrote:

    Am 05.10.2016 um 21:42 schrieb Alex Deucher:
    > Looks like fallout from a rebase or merge.
    >
    > Signed-off-by: Alex Deucher <[email protected]
    <mailto:[email protected]>>

    NAK, this is done on purpose and is for evicting the GART table
    using
    memcpy.

    Tom wanted to remove that as well and it makes resume then fail
    horrible
    on dGPUs.

    We should probably add a comment why this is necessary.

    Christian.

    > ---
    >   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ---
    >   1 file changed, 3 deletions(-)
    >
    > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
    b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
    > index 45259b5..c2f70be 100644
    > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
    > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
    > @@ -1956,9 +1956,6 @@ int amdgpu_device_suspend(struct
    drm_device *dev, bool suspend, bool fbcon)
    >
    >       r = amdgpu_suspend(adev);
    >
    > -     /* evict remaining vram memory */
    > -     amdgpu_bo_evict_vram(adev);
    > -
    >       pci_save_state(dev->pdev);
Quoted 9 lines
    >       if (suspend) {
    >               /* Shut down the device */


    _______________________________________________
    amd-gfx mailing list
    [email protected] <mailto:[email protected]>
    https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx