All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: don't do resets on APUs which don't support it
@ 2022-01-13  4:01 ` Alex Deucher
  0 siblings, 0 replies; 8+ messages in thread
From: Alex Deucher @ 2022-01-13  4:01 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, stable

It can cause a hang.  This is normally not enabled for GPU
hangs on these asics, but was recently enabled for handling
aborted suspends.  This causes hangs on some platforms
on suspend.

Fixes: daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)")
Cc: stable@vger.kernel.org
Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1858
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/cik.c | 4 ++++
 drivers/gpu/drm/amd/amdgpu/vi.c  | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c
index 54f28c075f21..f10ce740a29c 100644
--- a/drivers/gpu/drm/amd/amdgpu/cik.c
+++ b/drivers/gpu/drm/amd/amdgpu/cik.c
@@ -1428,6 +1428,10 @@ static int cik_asic_reset(struct amdgpu_device *adev)
 {
 	int r;
 
+	/* APUs don't have full asic reset */
+	if (adev->flags & AMD_IS_APU)
+		return 0;
+
 	if (cik_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) {
 		dev_info(adev->dev, "BACO reset\n");
 		r = amdgpu_dpm_baco_reset(adev);
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
index fe9a7cc8d9eb..6645ebbd2696 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -956,6 +956,10 @@ static int vi_asic_reset(struct amdgpu_device *adev)
 {
 	int r;
 
+	/* APUs don't have full asic reset */
+	if (adev->flags & AMD_IS_APU)
+		return 0;
+
 	if (vi_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) {
 		dev_info(adev->dev, "BACO reset\n");
 		r = amdgpu_dpm_baco_reset(adev);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] drm/amdgpu: don't do resets on APUs which don't support it
@ 2022-01-13  4:01 ` Alex Deucher
  0 siblings, 0 replies; 8+ messages in thread
From: Alex Deucher @ 2022-01-13  4:01 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, stable

It can cause a hang.  This is normally not enabled for GPU
hangs on these asics, but was recently enabled for handling
aborted suspends.  This causes hangs on some platforms
on suspend.

Fixes: daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)")
Cc: stable@vger.kernel.org
Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1858
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/cik.c | 4 ++++
 drivers/gpu/drm/amd/amdgpu/vi.c  | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c
index 54f28c075f21..f10ce740a29c 100644
--- a/drivers/gpu/drm/amd/amdgpu/cik.c
+++ b/drivers/gpu/drm/amd/amdgpu/cik.c
@@ -1428,6 +1428,10 @@ static int cik_asic_reset(struct amdgpu_device *adev)
 {
 	int r;
 
+	/* APUs don't have full asic reset */
+	if (adev->flags & AMD_IS_APU)
+		return 0;
+
 	if (cik_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) {
 		dev_info(adev->dev, "BACO reset\n");
 		r = amdgpu_dpm_baco_reset(adev);
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
index fe9a7cc8d9eb..6645ebbd2696 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -956,6 +956,10 @@ static int vi_asic_reset(struct amdgpu_device *adev)
 {
 	int r;
 
+	/* APUs don't have full asic reset */
+	if (adev->flags & AMD_IS_APU)
+		return 0;
+
 	if (vi_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) {
 		dev_info(adev->dev, "BACO reset\n");
 		r = amdgpu_dpm_baco_reset(adev);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* RE: [PATCH] drm/amdgpu: don't do resets on APUs which don't support it
  2022-01-13  4:01 ` Alex Deucher
@ 2022-01-13  6:12   ` Chen, Guchun
  -1 siblings, 0 replies; 8+ messages in thread
From: Chen, Guchun @ 2022-01-13  6:12 UTC (permalink / raw)
  To: Deucher, Alexander, amd-gfx; +Cc: Deucher, Alexander, stable

[-- Attachment #1: Type: text/plain, Size: 2393 bytes --]

Acked-by: Guchun Chen <guchun.chen@amd.com>

Regards,
Guchun

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Alex Deucher
Sent: Thursday, January 13, 2022 12:01 PM
To: amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; stable@vger.kernel.org
Subject: [PATCH] drm/amdgpu: don't do resets on APUs which don't support it

It can cause a hang.  This is normally not enabled for GPU hangs on these asics, but was recently enabled for handling aborted suspends.  This causes hangs on some platforms on suspend.

Fixes: daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)")
Cc: stable@vger.kernel.org
Bug: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fdrm%2Famd%2F-%2Fissues%2F1858&amp;data=04%7C01%7Cguchun.chen%40amd.com%7C2462de07d629440dbe5d08d9d6495d8a%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637776432879987023%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=WrqnZKTZCDx729gO5TXEr6IOhBFa%2FkGqMa5VDjbSx%2Bk%3D&amp;reserved=0
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/cik.c | 4 ++++  drivers/gpu/drm/amd/amdgpu/vi.c  | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c
index 54f28c075f21..f10ce740a29c 100644
--- a/drivers/gpu/drm/amd/amdgpu/cik.c
+++ b/drivers/gpu/drm/amd/amdgpu/cik.c
@@ -1428,6 +1428,10 @@ static int cik_asic_reset(struct amdgpu_device *adev)  {
 	int r;
 
+	/* APUs don't have full asic reset */
+	if (adev->flags & AMD_IS_APU)
+		return 0;
+
 	if (cik_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) {
 		dev_info(adev->dev, "BACO reset\n");
 		r = amdgpu_dpm_baco_reset(adev);
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c index fe9a7cc8d9eb..6645ebbd2696 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -956,6 +956,10 @@ static int vi_asic_reset(struct amdgpu_device *adev)  {
 	int r;
 
+	/* APUs don't have full asic reset */
+	if (adev->flags & AMD_IS_APU)
+		return 0;
+
 	if (vi_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) {
 		dev_info(adev->dev, "BACO reset\n");
 		r = amdgpu_dpm_baco_reset(adev);
--
2.34.1


[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 15335 bytes --]

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* RE: [PATCH] drm/amdgpu: don't do resets on APUs which don't support it
@ 2022-01-13  6:12   ` Chen, Guchun
  0 siblings, 0 replies; 8+ messages in thread
From: Chen, Guchun @ 2022-01-13  6:12 UTC (permalink / raw)
  To: Deucher, Alexander, amd-gfx; +Cc: Deucher, Alexander, stable

Acked-by: Guchun Chen <guchun.chen@amd.com>

Regards,
Guchun

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Alex Deucher
Sent: Thursday, January 13, 2022 12:01 PM
To: amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; stable@vger.kernel.org
Subject: [PATCH] drm/amdgpu: don't do resets on APUs which don't support it

It can cause a hang.  This is normally not enabled for GPU hangs on these asics, but was recently enabled for handling aborted suspends.  This causes hangs on some platforms on suspend.

Fixes: daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)")
Cc: stable@vger.kernel.org
Bug: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fdrm%2Famd%2F-%2Fissues%2F1858&amp;data=04%7C01%7Cguchun.chen%40amd.com%7C2462de07d629440dbe5d08d9d6495d8a%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637776432879987023%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=WrqnZKTZCDx729gO5TXEr6IOhBFa%2FkGqMa5VDjbSx%2Bk%3D&amp;reserved=0
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/cik.c | 4 ++++  drivers/gpu/drm/amd/amdgpu/vi.c  | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c
index 54f28c075f21..f10ce740a29c 100644
--- a/drivers/gpu/drm/amd/amdgpu/cik.c
+++ b/drivers/gpu/drm/amd/amdgpu/cik.c
@@ -1428,6 +1428,10 @@ static int cik_asic_reset(struct amdgpu_device *adev)  {
 	int r;
 
+	/* APUs don't have full asic reset */
+	if (adev->flags & AMD_IS_APU)
+		return 0;
+
 	if (cik_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) {
 		dev_info(adev->dev, "BACO reset\n");
 		r = amdgpu_dpm_baco_reset(adev);
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c index fe9a7cc8d9eb..6645ebbd2696 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -956,6 +956,10 @@ static int vi_asic_reset(struct amdgpu_device *adev)  {
 	int r;
 
+	/* APUs don't have full asic reset */
+	if (adev->flags & AMD_IS_APU)
+		return 0;
+
 	if (vi_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) {
 		dev_info(adev->dev, "BACO reset\n");
 		r = amdgpu_dpm_baco_reset(adev);
--
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/amdgpu: don't do resets on APUs which don't support it
  2022-01-13  4:01 ` Alex Deucher
  (?)
  (?)
@ 2022-01-13  6:56 ` Lazar, Lijo
  2022-01-13 14:39   ` Limonciello, Mario
  2022-01-13 15:00     ` Alex Deucher
  -1 siblings, 2 replies; 8+ messages in thread
From: Lazar, Lijo @ 2022-01-13  6:56 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx; +Cc: stable

Hi Alex,

What about something like this?

bool amdgpu_device_reset_on_suspend(struct amdgpu_device *adev)
{
         if (adev->in_s0ix || adev->gmc.xgmi.num_physical_nodes > 1)
                 return false;

         switch (amdgpu_asic_reset_method(adev)) {
         case AMD_RESET_METHOD_BACO:
         case AMD_RESET_METHOD_MODE1:
         case AMD_RESET_METHOD_MODE2:
                 return true;
         }

         return false;
}

Thanks,
Lijo

On 1/13/2022 9:31 AM, Alex Deucher wrote:
> It can cause a hang.  This is normally not enabled for GPU
> hangs on these asics, but was recently enabled for handling
> aborted suspends.  This causes hangs on some platforms
> on suspend.
> 
> Fixes: daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)")
> Cc: stable@vger.kernel.org
> Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1858
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/cik.c | 4 ++++
>   drivers/gpu/drm/amd/amdgpu/vi.c  | 4 ++++
>   2 files changed, 8 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c
> index 54f28c075f21..f10ce740a29c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/cik.c
> +++ b/drivers/gpu/drm/amd/amdgpu/cik.c
> @@ -1428,6 +1428,10 @@ static int cik_asic_reset(struct amdgpu_device *adev)
>   {
>   	int r;
>   
> +	/* APUs don't have full asic reset */
> +	if (adev->flags & AMD_IS_APU)
> +		return 0;
> +
>   	if (cik_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) {
>   		dev_info(adev->dev, "BACO reset\n");
>   		r = amdgpu_dpm_baco_reset(adev);
> diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
> index fe9a7cc8d9eb..6645ebbd2696 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vi.c
> @@ -956,6 +956,10 @@ static int vi_asic_reset(struct amdgpu_device *adev)
>   {
>   	int r;
>   
> +	/* APUs don't have full asic reset */
> +	if (adev->flags & AMD_IS_APU)
> +		return 0;
> +
>   	if (vi_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) {
>   		dev_info(adev->dev, "BACO reset\n");
>   		r = amdgpu_dpm_baco_reset(adev);
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/amdgpu: don't do resets on APUs which don't support it
  2022-01-13  6:56 ` Lazar, Lijo
@ 2022-01-13 14:39   ` Limonciello, Mario
  2022-01-13 15:00     ` Alex Deucher
  1 sibling, 0 replies; 8+ messages in thread
From: Limonciello, Mario @ 2022-01-13 14:39 UTC (permalink / raw)
  To: Lazar, Lijo, Alex Deucher, amd-gfx

On 1/13/2022 00:56, Lazar, Lijo wrote:
> Hi Alex,
> 
> What about something like this?
> 
> bool amdgpu_device_reset_on_suspend(struct amdgpu_device *adev)
> {
>          if (adev->in_s0ix || adev->gmc.xgmi.num_physical_nodes > 1)
>                  return false;
> 
>          switch (amdgpu_asic_reset_method(adev)) {
>          case AMD_RESET_METHOD_BACO:
>          case AMD_RESET_METHOD_MODE1:
>          case AMD_RESET_METHOD_MODE2:
>                  return true;
>          }
> 
>          return false;
> }
> 

I think the approach that Alex shared *might* be more flexible to also 
be used in the aborted suspend case too on s0ix.  There is some 
discussions going on for that right now.

> Thanks,
> Lijo
> 
> On 1/13/2022 9:31 AM, Alex Deucher wrote:
>> It can cause a hang.  This is normally not enabled for GPU
>> hangs on these asics, but was recently enabled for handling
>> aborted suspends.  This causes hangs on some platforms
>> on suspend.
>>
>> Fixes: daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend 
>> (v2)")
>> Cc: stable@vger.kernel.org
>> Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1858
>> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/cik.c | 4 ++++
>>   drivers/gpu/drm/amd/amdgpu/vi.c  | 4 ++++
>>   2 files changed, 8 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c 
>> b/drivers/gpu/drm/amd/amdgpu/cik.c
>> index 54f28c075f21..f10ce740a29c 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/cik.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/cik.c
>> @@ -1428,6 +1428,10 @@ static int cik_asic_reset(struct amdgpu_device 
>> *adev)
>>   {
>>       int r;
>> +    /* APUs don't have full asic reset */
>> +    if (adev->flags & AMD_IS_APU)
>> +        return 0;
>> +
>>       if (cik_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) {
>>           dev_info(adev->dev, "BACO reset\n");
>>           r = amdgpu_dpm_baco_reset(adev);
>> diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c 
>> b/drivers/gpu/drm/amd/amdgpu/vi.c
>> index fe9a7cc8d9eb..6645ebbd2696 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/vi.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/vi.c
>> @@ -956,6 +956,10 @@ static int vi_asic_reset(struct amdgpu_device *adev)
>>   {
>>       int r;
>> +    /* APUs don't have full asic reset */
>> +    if (adev->flags & AMD_IS_APU)
>> +        return 0;
>> +
>>       if (vi_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) {
>>           dev_info(adev->dev, "BACO reset\n");
>>           r = amdgpu_dpm_baco_reset(adev);
>>
> 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/amdgpu: don't do resets on APUs which don't support it
  2022-01-13  6:56 ` Lazar, Lijo
@ 2022-01-13 15:00     ` Alex Deucher
  2022-01-13 15:00     ` Alex Deucher
  1 sibling, 0 replies; 8+ messages in thread
From: Alex Deucher @ 2022-01-13 15:00 UTC (permalink / raw)
  To: Lazar, Lijo; +Cc: Alex Deucher, amd-gfx list, for 3.8

On Thu, Jan 13, 2022 at 1:56 AM Lazar, Lijo <lijo.lazar@amd.com> wrote:
>
> Hi Alex,
>
> What about something like this?
>
> bool amdgpu_device_reset_on_suspend(struct amdgpu_device *adev)
> {
>          if (adev->in_s0ix || adev->gmc.xgmi.num_physical_nodes > 1)
>                  return false;
>
>          switch (amdgpu_asic_reset_method(adev)) {
>          case AMD_RESET_METHOD_BACO:
>          case AMD_RESET_METHOD_MODE1:
>          case AMD_RESET_METHOD_MODE2:

This should also work on AMD_RESET_METHOD_LEGACY, at least for dGPUs.
I think the current approach is probably better since I don't think
GPU resets work reliably on these chips anyway (it's not enabled by
default on them gor hangs), so better to just not do it as it may make
the problem worse.

Alex


>                  return true;
>          }
>
>          return false;
> }
>
> Thanks,
> Lijo
>
> On 1/13/2022 9:31 AM, Alex Deucher wrote:
> > It can cause a hang.  This is normally not enabled for GPU
> > hangs on these asics, but was recently enabled for handling
> > aborted suspends.  This causes hangs on some platforms
> > on suspend.
> >
> > Fixes: daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)")
> > Cc: stable@vger.kernel.org
> > Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1858
> > Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> > ---
> >   drivers/gpu/drm/amd/amdgpu/cik.c | 4 ++++
> >   drivers/gpu/drm/amd/amdgpu/vi.c  | 4 ++++
> >   2 files changed, 8 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c
> > index 54f28c075f21..f10ce740a29c 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/cik.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/cik.c
> > @@ -1428,6 +1428,10 @@ static int cik_asic_reset(struct amdgpu_device *adev)
> >   {
> >       int r;
> >
> > +     /* APUs don't have full asic reset */
> > +     if (adev->flags & AMD_IS_APU)
> > +             return 0;
> > +
> >       if (cik_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) {
> >               dev_info(adev->dev, "BACO reset\n");
> >               r = amdgpu_dpm_baco_reset(adev);
> > diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
> > index fe9a7cc8d9eb..6645ebbd2696 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/vi.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/vi.c
> > @@ -956,6 +956,10 @@ static int vi_asic_reset(struct amdgpu_device *adev)
> >   {
> >       int r;
> >
> > +     /* APUs don't have full asic reset */
> > +     if (adev->flags & AMD_IS_APU)
> > +             return 0;
> > +
> >       if (vi_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) {
> >               dev_info(adev->dev, "BACO reset\n");
> >               r = amdgpu_dpm_baco_reset(adev);
> >

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/amdgpu: don't do resets on APUs which don't support it
@ 2022-01-13 15:00     ` Alex Deucher
  0 siblings, 0 replies; 8+ messages in thread
From: Alex Deucher @ 2022-01-13 15:00 UTC (permalink / raw)
  To: Lazar, Lijo; +Cc: Alex Deucher, for 3.8, amd-gfx list

On Thu, Jan 13, 2022 at 1:56 AM Lazar, Lijo <lijo.lazar@amd.com> wrote:
>
> Hi Alex,
>
> What about something like this?
>
> bool amdgpu_device_reset_on_suspend(struct amdgpu_device *adev)
> {
>          if (adev->in_s0ix || adev->gmc.xgmi.num_physical_nodes > 1)
>                  return false;
>
>          switch (amdgpu_asic_reset_method(adev)) {
>          case AMD_RESET_METHOD_BACO:
>          case AMD_RESET_METHOD_MODE1:
>          case AMD_RESET_METHOD_MODE2:

This should also work on AMD_RESET_METHOD_LEGACY, at least for dGPUs.
I think the current approach is probably better since I don't think
GPU resets work reliably on these chips anyway (it's not enabled by
default on them gor hangs), so better to just not do it as it may make
the problem worse.

Alex


>                  return true;
>          }
>
>          return false;
> }
>
> Thanks,
> Lijo
>
> On 1/13/2022 9:31 AM, Alex Deucher wrote:
> > It can cause a hang.  This is normally not enabled for GPU
> > hangs on these asics, but was recently enabled for handling
> > aborted suspends.  This causes hangs on some platforms
> > on suspend.
> >
> > Fixes: daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)")
> > Cc: stable@vger.kernel.org
> > Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1858
> > Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> > ---
> >   drivers/gpu/drm/amd/amdgpu/cik.c | 4 ++++
> >   drivers/gpu/drm/amd/amdgpu/vi.c  | 4 ++++
> >   2 files changed, 8 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c
> > index 54f28c075f21..f10ce740a29c 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/cik.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/cik.c
> > @@ -1428,6 +1428,10 @@ static int cik_asic_reset(struct amdgpu_device *adev)
> >   {
> >       int r;
> >
> > +     /* APUs don't have full asic reset */
> > +     if (adev->flags & AMD_IS_APU)
> > +             return 0;
> > +
> >       if (cik_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) {
> >               dev_info(adev->dev, "BACO reset\n");
> >               r = amdgpu_dpm_baco_reset(adev);
> > diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
> > index fe9a7cc8d9eb..6645ebbd2696 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/vi.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/vi.c
> > @@ -956,6 +956,10 @@ static int vi_asic_reset(struct amdgpu_device *adev)
> >   {
> >       int r;
> >
> > +     /* APUs don't have full asic reset */
> > +     if (adev->flags & AMD_IS_APU)
> > +             return 0;
> > +
> >       if (vi_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) {
> >               dev_info(adev->dev, "BACO reset\n");
> >               r = amdgpu_dpm_baco_reset(adev);
> >

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-01-13 15:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-13  4:01 [PATCH] drm/amdgpu: don't do resets on APUs which don't support it Alex Deucher
2022-01-13  4:01 ` Alex Deucher
2022-01-13  6:12 ` Chen, Guchun
2022-01-13  6:12   ` Chen, Guchun
2022-01-13  6:56 ` Lazar, Lijo
2022-01-13 14:39   ` Limonciello, Mario
2022-01-13 15:00   ` Alex Deucher
2022-01-13 15:00     ` Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.