linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: disable ASPM for legacy products that don't support ASPM
@ 2022-04-08 15:44 Richard Gong
  2022-04-08 15:47 ` Limonciello, Mario
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Gong @ 2022-04-08 15:44 UTC (permalink / raw)
  To: alexander.deucher, christian.koenig, Xinhui.Pan, airlied, daniel
  Cc: amd-gfx, dri-devel, linux-kernel, mario.limonciello, richard.gong

Active State Power Management (ASPM) feature is enabled since kernel 5.14.
However there are some legacy products (WX3200 and RX640 are examples) that
do not support ASPM. Use them as video/display output and system would hang
during suspend/resume.

Add extra check to disable ASPM for old products that don't have
ASPM support.

Signed-off-by: Richard Gong <richard.gong@amd.com>
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1885
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index bb1c025d9001..8987107f41ee 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -2012,6 +2012,10 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
 	if (amdgpu_aspm == -1 && !pcie_aspm_enabled(pdev))
 		amdgpu_aspm = 0;
 
+	/* disable ASPM for the legacy products that don't support ASPM */
+	if ((flags & AMD_ASIC_MASK) == CHIP_POLARIS12)
+		amdgpu_aspm = 0;
+
 	if (amdgpu_virtual_display ||
 	    amdgpu_device_asic_has_dc_support(flags & AMD_ASIC_MASK))
 		supports_atomic = true;
-- 
2.25.1


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

* RE: [PATCH] drm/amdgpu: disable ASPM for legacy products that don't support ASPM
  2022-04-08 15:44 [PATCH] drm/amdgpu: disable ASPM for legacy products that don't support ASPM Richard Gong
@ 2022-04-08 15:47 ` Limonciello, Mario
  2022-04-08 15:54   ` Alex Deucher
  2022-04-08 16:19   ` Gong, Richard
  0 siblings, 2 replies; 8+ messages in thread
From: Limonciello, Mario @ 2022-04-08 15:47 UTC (permalink / raw)
  To: Gong, Richard, Deucher, Alexander, Koenig, Christian, Pan,
	Xinhui, airlied, daniel
  Cc: amd-gfx, dri-devel, linux-kernel

[Public]



> -----Original Message-----
> From: Gong, Richard <Richard.Gong@amd.com>
> Sent: Friday, April 8, 2022 10:45
> To: Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian
> <Christian.Koenig@amd.com>; Pan, Xinhui <Xinhui.Pan@amd.com>;
> airlied@linux.ie; daniel@ffwll.ch
> Cc: amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux-
> kernel@vger.kernel.org; Limonciello, Mario <Mario.Limonciello@amd.com>;
> Gong, Richard <Richard.Gong@amd.com>
> Subject: [PATCH] drm/amdgpu: disable ASPM for legacy products that don't
> support ASPM
> 
> Active State Power Management (ASPM) feature is enabled since kernel
> 5.14.
> However there are some legacy products (WX3200 and RX640 are examples)
> that
> do not support ASPM. Use them as video/display output and system would
> hang
> during suspend/resume.
> 
> Add extra check to disable ASPM for old products that don't have
> ASPM support.
> 
> Signed-off-by: Richard Gong <richard.gong@amd.com>
> Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1885
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index bb1c025d9001..8987107f41ee 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -2012,6 +2012,10 @@ static int amdgpu_pci_probe(struct pci_dev
> *pdev,
>  	if (amdgpu_aspm == -1 && !pcie_aspm_enabled(pdev))
>  		amdgpu_aspm = 0;
> 
> +	/* disable ASPM for the legacy products that don't support ASPM */
> +	if ((flags & AMD_ASIC_MASK) == CHIP_POLARIS12)
> +		amdgpu_aspm = 0;
> +

I think it's problematic to disable it for the entire driver.  There might be multiple
AMDGPUs in the system, and others may support ASPM.

Can it be done just as part of probe for Polaris?

>  	if (amdgpu_virtual_display ||
>  	    amdgpu_device_asic_has_dc_support(flags & AMD_ASIC_MASK))
>  		supports_atomic = true;
> --
> 2.25.1

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

* Re: [PATCH] drm/amdgpu: disable ASPM for legacy products that don't support ASPM
  2022-04-08 15:47 ` Limonciello, Mario
@ 2022-04-08 15:54   ` Alex Deucher
  2022-04-08 15:56     ` Alex Deucher
  2022-04-08 16:15     ` Gong, Richard
  2022-04-08 16:19   ` Gong, Richard
  1 sibling, 2 replies; 8+ messages in thread
From: Alex Deucher @ 2022-04-08 15:54 UTC (permalink / raw)
  To: Limonciello, Mario
  Cc: Gong, Richard, Deucher, Alexander, Koenig, Christian, Pan,
	Xinhui, airlied, daniel, dri-devel, amd-gfx, linux-kernel

On Fri, Apr 8, 2022 at 11:47 AM Limonciello, Mario
<Mario.Limonciello@amd.com> wrote:
>
> [Public]
>
>
>
> > -----Original Message-----
> > From: Gong, Richard <Richard.Gong@amd.com>
> > Sent: Friday, April 8, 2022 10:45
> > To: Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian
> > <Christian.Koenig@amd.com>; Pan, Xinhui <Xinhui.Pan@amd.com>;
> > airlied@linux.ie; daniel@ffwll.ch
> > Cc: amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux-
> > kernel@vger.kernel.org; Limonciello, Mario <Mario.Limonciello@amd.com>;
> > Gong, Richard <Richard.Gong@amd.com>
> > Subject: [PATCH] drm/amdgpu: disable ASPM for legacy products that don't
> > support ASPM
> >
> > Active State Power Management (ASPM) feature is enabled since kernel
> > 5.14.
> > However there are some legacy products (WX3200 and RX640 are examples)
> > that
> > do not support ASPM. Use them as video/display output and system would
> > hang
> > during suspend/resume.
> >
> > Add extra check to disable ASPM for old products that don't have
> > ASPM support.

The patch description is incorrect.  ASPM works just fine on these
GPUs.  It's more of an issue with whether the underlying platform
supports ASPM or not.  Rather than disabling a chip family, I would
prefer to add a check for problematic platforms and disable ASPM on
those platforms.

Alex

> >
> > Signed-off-by: Richard Gong <richard.gong@amd.com>
> > Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1885
> > ---
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > index bb1c025d9001..8987107f41ee 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > @@ -2012,6 +2012,10 @@ static int amdgpu_pci_probe(struct pci_dev
> > *pdev,
> >       if (amdgpu_aspm == -1 && !pcie_aspm_enabled(pdev))
> >               amdgpu_aspm = 0;
> >
> > +     /* disable ASPM for the legacy products that don't support ASPM */
> > +     if ((flags & AMD_ASIC_MASK) == CHIP_POLARIS12)
> > +             amdgpu_aspm = 0;
> > +
>
> I think it's problematic to disable it for the entire driver.  There might be multiple
> AMDGPUs in the system, and others may support ASPM.
>
> Can it be done just as part of probe for Polaris?
>
> >       if (amdgpu_virtual_display ||
> >           amdgpu_device_asic_has_dc_support(flags & AMD_ASIC_MASK))
> >               supports_atomic = true;
> > --
> > 2.25.1

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

* Re: [PATCH] drm/amdgpu: disable ASPM for legacy products that don't support ASPM
  2022-04-08 15:54   ` Alex Deucher
@ 2022-04-08 15:56     ` Alex Deucher
  2022-04-08 16:15     ` Gong, Richard
  1 sibling, 0 replies; 8+ messages in thread
From: Alex Deucher @ 2022-04-08 15:56 UTC (permalink / raw)
  To: Limonciello, Mario
  Cc: Gong, Richard, Deucher, Alexander, Koenig, Christian, Pan,
	Xinhui, airlied, daniel, dri-devel, amd-gfx, linux-kernel

On Fri, Apr 8, 2022 at 11:54 AM Alex Deucher <alexdeucher@gmail.com> wrote:
>
> On Fri, Apr 8, 2022 at 11:47 AM Limonciello, Mario
> <Mario.Limonciello@amd.com> wrote:
> >
> > [Public]
> >
> >
> >
> > > -----Original Message-----
> > > From: Gong, Richard <Richard.Gong@amd.com>
> > > Sent: Friday, April 8, 2022 10:45
> > > To: Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian
> > > <Christian.Koenig@amd.com>; Pan, Xinhui <Xinhui.Pan@amd.com>;
> > > airlied@linux.ie; daniel@ffwll.ch
> > > Cc: amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux-
> > > kernel@vger.kernel.org; Limonciello, Mario <Mario.Limonciello@amd.com>;
> > > Gong, Richard <Richard.Gong@amd.com>
> > > Subject: [PATCH] drm/amdgpu: disable ASPM for legacy products that don't
> > > support ASPM
> > >
> > > Active State Power Management (ASPM) feature is enabled since kernel
> > > 5.14.
> > > However there are some legacy products (WX3200 and RX640 are examples)
> > > that
> > > do not support ASPM. Use them as video/display output and system would
> > > hang
> > > during suspend/resume.
> > >
> > > Add extra check to disable ASPM for old products that don't have
> > > ASPM support.
>
> The patch description is incorrect.  ASPM works just fine on these
> GPUs.  It's more of an issue with whether the underlying platform
> supports ASPM or not.  Rather than disabling a chip family, I would
> prefer to add a check for problematic platforms and disable ASPM on
> those platforms.

For example, see intel_core_rkl_chk() in smu7_hwmgr.c.  We disable
PCIe DPM on RKL platforms due to compatibility issues with that
particular platform.

Alex

>
> Alex
>
> > >
> > > Signed-off-by: Richard Gong <richard.gong@amd.com>
> > > Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1885
> > > ---
> > >  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++++
> > >  1 file changed, 4 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > > b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > > index bb1c025d9001..8987107f41ee 100644
> > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > > @@ -2012,6 +2012,10 @@ static int amdgpu_pci_probe(struct pci_dev
> > > *pdev,
> > >       if (amdgpu_aspm == -1 && !pcie_aspm_enabled(pdev))
> > >               amdgpu_aspm = 0;
> > >
> > > +     /* disable ASPM for the legacy products that don't support ASPM */
> > > +     if ((flags & AMD_ASIC_MASK) == CHIP_POLARIS12)
> > > +             amdgpu_aspm = 0;
> > > +
> >
> > I think it's problematic to disable it for the entire driver.  There might be multiple
> > AMDGPUs in the system, and others may support ASPM.
> >
> > Can it be done just as part of probe for Polaris?
> >
> > >       if (amdgpu_virtual_display ||
> > >           amdgpu_device_asic_has_dc_support(flags & AMD_ASIC_MASK))
> > >               supports_atomic = true;
> > > --
> > > 2.25.1

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

* Re: [PATCH] drm/amdgpu: disable ASPM for legacy products that don't support ASPM
  2022-04-08 15:54   ` Alex Deucher
  2022-04-08 15:56     ` Alex Deucher
@ 2022-04-08 16:15     ` Gong, Richard
  2022-04-08 18:13       ` Alex Deucher
  1 sibling, 1 reply; 8+ messages in thread
From: Gong, Richard @ 2022-04-08 16:15 UTC (permalink / raw)
  To: Alex Deucher, Limonciello, Mario
  Cc: Deucher, Alexander, Koenig, Christian, Pan, Xinhui, airlied,
	daniel, dri-devel, amd-gfx, linux-kernel

Hi Alex,

On 4/8/2022 10:54 AM, Alex Deucher wrote:
> On Fri, Apr 8, 2022 at 11:47 AM Limonciello, Mario
> <Mario.Limonciello@amd.com> wrote:
>> [Public]
>>
>>
>>
>>> -----Original Message-----
>>> From: Gong, Richard <Richard.Gong@amd.com>
>>> Sent: Friday, April 8, 2022 10:45
>>> To: Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian
>>> <Christian.Koenig@amd.com>; Pan, Xinhui <Xinhui.Pan@amd.com>;
>>> airlied@linux.ie; daniel@ffwll.ch
>>> Cc: amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux-
>>> kernel@vger.kernel.org; Limonciello, Mario <Mario.Limonciello@amd.com>;
>>> Gong, Richard <Richard.Gong@amd.com>
>>> Subject: [PATCH] drm/amdgpu: disable ASPM for legacy products that don't
>>> support ASPM
>>>
>>> Active State Power Management (ASPM) feature is enabled since kernel
>>> 5.14.
>>> However there are some legacy products (WX3200 and RX640 are examples)
>>> that
>>> do not support ASPM. Use them as video/display output and system would
>>> hang
>>> during suspend/resume.
>>>
>>> Add extra check to disable ASPM for old products that don't have
>>> ASPM support.
> The patch description is incorrect.  ASPM works just fine on these
> GPUs.  It's more of an issue with whether the underlying platform
> supports ASPM or not.  Rather than disabling a chip family, I would
> prefer to add a check for problematic platforms and disable ASPM on
> those platforms.

I thought that initially.

But I found out that suspend/resume works just fine on the "problematic" 
platform (Dell Precision 3660, Intel ADL based) + AMD W6400 GFX card. 
With WX3200 or RX640, suspend/resume works only when ASPM was disabled. 
Both WX3200 and RX640 are from CHIP_POLARIS12 family.

This is why I take chip family approach.

Regards,

Richard

> Alex
>
>>> Signed-off-by: Richard Gong <richard.gong@amd.com>
>>> Link: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fdrm%2Famd%2F-%2Fissues%2F1885&amp;data=04%7C01%7CRichard.Gong%40amd.com%7C96f8f686f75f43abb5ed08da19780fab%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637850300760921285%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=xVKC0Q16ho5Y2GDuN%2Fnx68wm6NzOIyR5xJbiXPgqPpQ%3D&amp;reserved=0
>>> ---
>>>   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++++
>>>   1 file changed, 4 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>>> index bb1c025d9001..8987107f41ee 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>>> @@ -2012,6 +2012,10 @@ static int amdgpu_pci_probe(struct pci_dev
>>> *pdev,
>>>        if (amdgpu_aspm == -1 && !pcie_aspm_enabled(pdev))
>>>                amdgpu_aspm = 0;
>>>
>>> +     /* disable ASPM for the legacy products that don't support ASPM */
>>> +     if ((flags & AMD_ASIC_MASK) == CHIP_POLARIS12)
>>> +             amdgpu_aspm = 0;
>>> +
>> I think it's problematic to disable it for the entire driver.  There might be multiple
>> AMDGPUs in the system, and others may support ASPM.
>>
>> Can it be done just as part of probe for Polaris?
>>
>>>        if (amdgpu_virtual_display ||
>>>            amdgpu_device_asic_has_dc_support(flags & AMD_ASIC_MASK))
>>>                supports_atomic = true;
>>> --
>>> 2.25.1

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

* Re: [PATCH] drm/amdgpu: disable ASPM for legacy products that don't support ASPM
  2022-04-08 15:47 ` Limonciello, Mario
  2022-04-08 15:54   ` Alex Deucher
@ 2022-04-08 16:19   ` Gong, Richard
  2022-04-08 16:23     ` Limonciello, Mario
  1 sibling, 1 reply; 8+ messages in thread
From: Gong, Richard @ 2022-04-08 16:19 UTC (permalink / raw)
  To: Limonciello, Mario, Deucher, Alexander, Koenig, Christian, Pan,
	Xinhui, airlied, daniel
  Cc: amd-gfx, dri-devel, linux-kernel


On 4/8/2022 10:47 AM, Limonciello, Mario wrote:
> [Public]
>
>
>
>> -----Original Message-----
>> From: Gong, Richard <Richard.Gong@amd.com>
>> Sent: Friday, April 8, 2022 10:45
>> To: Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian
>> <Christian.Koenig@amd.com>; Pan, Xinhui <Xinhui.Pan@amd.com>;
>> airlied@linux.ie; daniel@ffwll.ch
>> Cc: amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux-
>> kernel@vger.kernel.org; Limonciello, Mario <Mario.Limonciello@amd.com>;
>> Gong, Richard <Richard.Gong@amd.com>
>> Subject: [PATCH] drm/amdgpu: disable ASPM for legacy products that don't
>> support ASPM
>>
>> Active State Power Management (ASPM) feature is enabled since kernel
>> 5.14.
>> However there are some legacy products (WX3200 and RX640 are examples)
>> that
>> do not support ASPM. Use them as video/display output and system would
>> hang
>> during suspend/resume.
>>
>> Add extra check to disable ASPM for old products that don't have
>> ASPM support.
>>
>> Signed-off-by: Richard Gong <richard.gong@amd.com>
>> Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1885
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>> index bb1c025d9001..8987107f41ee 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>> @@ -2012,6 +2012,10 @@ static int amdgpu_pci_probe(struct pci_dev
>> *pdev,
>>   	if (amdgpu_aspm == -1 && !pcie_aspm_enabled(pdev))
>>   		amdgpu_aspm = 0;
>>
>> +	/* disable ASPM for the legacy products that don't support ASPM */
>> +	if ((flags & AMD_ASIC_MASK) == CHIP_POLARIS12)
>> +		amdgpu_aspm = 0;
>> +
> I think it's problematic to disable it for the entire driver.  There might be multiple
> AMDGPUs in the system, and others may support ASPM.

The "problem" are WX3200 and RX640, both are from the same POLARIS12 family.

> Can it be done just as part of probe for Polaris?
>
>>   	if (amdgpu_virtual_display ||
>>   	    amdgpu_device_asic_has_dc_support(flags & AMD_ASIC_MASK))
>>   		supports_atomic = true;
>> --
>> 2.25.1

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

* RE: [PATCH] drm/amdgpu: disable ASPM for legacy products that don't support ASPM
  2022-04-08 16:19   ` Gong, Richard
@ 2022-04-08 16:23     ` Limonciello, Mario
  0 siblings, 0 replies; 8+ messages in thread
From: Limonciello, Mario @ 2022-04-08 16:23 UTC (permalink / raw)
  To: Gong, Richard, Deucher, Alexander, Koenig, Christian, Pan,
	Xinhui, airlied, daniel
  Cc: amd-gfx, dri-devel, linux-kernel

[Public]



> -----Original Message-----
> From: Gong, Richard <Richard.Gong@amd.com>
> Sent: Friday, April 8, 2022 11:20
> To: Limonciello, Mario <Mario.Limonciello@amd.com>; Deucher, Alexander
> <Alexander.Deucher@amd.com>; Koenig, Christian
> <Christian.Koenig@amd.com>; Pan, Xinhui <Xinhui.Pan@amd.com>;
> airlied@linux.ie; daniel@ffwll.ch
> Cc: amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux-
> kernel@vger.kernel.org
> Subject: Re: [PATCH] drm/amdgpu: disable ASPM for legacy products that
> don't support ASPM
> 
> 
> On 4/8/2022 10:47 AM, Limonciello, Mario wrote:
> > [Public]
> >
> >
> >
> >> -----Original Message-----
> >> From: Gong, Richard <Richard.Gong@amd.com>
> >> Sent: Friday, April 8, 2022 10:45
> >> To: Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig,
> Christian
> >> <Christian.Koenig@amd.com>; Pan, Xinhui <Xinhui.Pan@amd.com>;
> >> airlied@linux.ie; daniel@ffwll.ch
> >> Cc: amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org;
> linux-
> >> kernel@vger.kernel.org; Limonciello, Mario
> <Mario.Limonciello@amd.com>;
> >> Gong, Richard <Richard.Gong@amd.com>
> >> Subject: [PATCH] drm/amdgpu: disable ASPM for legacy products that
> don't
> >> support ASPM
> >>
> >> Active State Power Management (ASPM) feature is enabled since kernel
> >> 5.14.
> >> However there are some legacy products (WX3200 and RX640 are
> examples)
> >> that
> >> do not support ASPM. Use them as video/display output and system
> would
> >> hang
> >> during suspend/resume.
> >>
> >> Add extra check to disable ASPM for old products that don't have
> >> ASPM support.
> >>
> >> Signed-off-by: Richard Gong <richard.gong@amd.com>
> >> Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1885
> >> ---
> >>   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++++
> >>   1 file changed, 4 insertions(+)
> >>
> >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> >> b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> >> index bb1c025d9001..8987107f41ee 100644
> >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> >> @@ -2012,6 +2012,10 @@ static int amdgpu_pci_probe(struct pci_dev
> >> *pdev,
> >>   	if (amdgpu_aspm == -1 && !pcie_aspm_enabled(pdev))
> >>   		amdgpu_aspm = 0;
> >>
> >> +	/* disable ASPM for the legacy products that don't support ASPM */
> >> +	if ((flags & AMD_ASIC_MASK) == CHIP_POLARIS12)
> >> +		amdgpu_aspm = 0;
> >> +
> > I think it's problematic to disable it for the entire driver.  There might be
> multiple
> > AMDGPUs in the system, and others may support ASPM.
> 
> The "problem" are WX3200 and RX640, both are from the same POLARIS12
> family.
> 

Right but what if some other "working" cards are included in the system too?
Then ASPM gets disabled for them too.  It should only be disabled for the pci_dev
corresponding to problematic GPUs in problematic situations.

> > Can it be done just as part of probe for Polaris?
> >
> >>   	if (amdgpu_virtual_display ||
> >>   	    amdgpu_device_asic_has_dc_support(flags & AMD_ASIC_MASK))
> >>   		supports_atomic = true;
> >> --
> >> 2.25.1

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

* Re: [PATCH] drm/amdgpu: disable ASPM for legacy products that don't support ASPM
  2022-04-08 16:15     ` Gong, Richard
@ 2022-04-08 18:13       ` Alex Deucher
  0 siblings, 0 replies; 8+ messages in thread
From: Alex Deucher @ 2022-04-08 18:13 UTC (permalink / raw)
  To: Gong, Richard
  Cc: Limonciello, Mario, Deucher, Alexander, Koenig, Christian, Pan,
	Xinhui, airlied, daniel, dri-devel, amd-gfx, linux-kernel

On Fri, Apr 8, 2022 at 12:15 PM Gong, Richard <richard.gong@amd.com> wrote:
>
> Hi Alex,
>
> On 4/8/2022 10:54 AM, Alex Deucher wrote:
> > On Fri, Apr 8, 2022 at 11:47 AM Limonciello, Mario
> > <Mario.Limonciello@amd.com> wrote:
> >> [Public]
> >>
> >>
> >>
> >>> -----Original Message-----
> >>> From: Gong, Richard <Richard.Gong@amd.com>
> >>> Sent: Friday, April 8, 2022 10:45
> >>> To: Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian
> >>> <Christian.Koenig@amd.com>; Pan, Xinhui <Xinhui.Pan@amd.com>;
> >>> airlied@linux.ie; daniel@ffwll.ch
> >>> Cc: amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux-
> >>> kernel@vger.kernel.org; Limonciello, Mario <Mario.Limonciello@amd.com>;
> >>> Gong, Richard <Richard.Gong@amd.com>
> >>> Subject: [PATCH] drm/amdgpu: disable ASPM for legacy products that don't
> >>> support ASPM
> >>>
> >>> Active State Power Management (ASPM) feature is enabled since kernel
> >>> 5.14.
> >>> However there are some legacy products (WX3200 and RX640 are examples)
> >>> that
> >>> do not support ASPM. Use them as video/display output and system would
> >>> hang
> >>> during suspend/resume.
> >>>
> >>> Add extra check to disable ASPM for old products that don't have
> >>> ASPM support.
> > The patch description is incorrect.  ASPM works just fine on these
> > GPUs.  It's more of an issue with whether the underlying platform
> > supports ASPM or not.  Rather than disabling a chip family, I would
> > prefer to add a check for problematic platforms and disable ASPM on
> > those platforms.
>
> I thought that initially.
>
> But I found out that suspend/resume works just fine on the "problematic"
> platform (Dell Precision 3660, Intel ADL based) + AMD W6400 GFX card.
> With WX3200 or RX640, suspend/resume works only when ASPM was disabled.
> Both WX3200 and RX640 are from CHIP_POLARIS12 family.
>
> This is why I take chip family approach.

Sure, but you could put those polaris12 boards into a different system
and they work just fine with ASPM enabled.

Alex

>
> Regards,
>
> Richard
>
> > Alex
> >
> >>> Signed-off-by: Richard Gong <richard.gong@amd.com>
> >>> Link: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fdrm%2Famd%2F-%2Fissues%2F1885&amp;data=04%7C01%7CRichard.Gong%40amd.com%7C96f8f686f75f43abb5ed08da19780fab%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637850300760921285%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=xVKC0Q16ho5Y2GDuN%2Fnx68wm6NzOIyR5xJbiXPgqPpQ%3D&amp;reserved=0
> >>> ---
> >>>   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++++
> >>>   1 file changed, 4 insertions(+)
> >>>
> >>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> >>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> >>> index bb1c025d9001..8987107f41ee 100644
> >>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> >>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> >>> @@ -2012,6 +2012,10 @@ static int amdgpu_pci_probe(struct pci_dev
> >>> *pdev,
> >>>        if (amdgpu_aspm == -1 && !pcie_aspm_enabled(pdev))
> >>>                amdgpu_aspm = 0;
> >>>
> >>> +     /* disable ASPM for the legacy products that don't support ASPM */
> >>> +     if ((flags & AMD_ASIC_MASK) == CHIP_POLARIS12)
> >>> +             amdgpu_aspm = 0;
> >>> +
> >> I think it's problematic to disable it for the entire driver.  There might be multiple
> >> AMDGPUs in the system, and others may support ASPM.
> >>
> >> Can it be done just as part of probe for Polaris?
> >>
> >>>        if (amdgpu_virtual_display ||
> >>>            amdgpu_device_asic_has_dc_support(flags & AMD_ASIC_MASK))
> >>>                supports_atomic = true;
> >>> --
> >>> 2.25.1

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

end of thread, other threads:[~2022-04-08 18:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-08 15:44 [PATCH] drm/amdgpu: disable ASPM for legacy products that don't support ASPM Richard Gong
2022-04-08 15:47 ` Limonciello, Mario
2022-04-08 15:54   ` Alex Deucher
2022-04-08 15:56     ` Alex Deucher
2022-04-08 16:15     ` Gong, Richard
2022-04-08 18:13       ` Alex Deucher
2022-04-08 16:19   ` Gong, Richard
2022-04-08 16:23     ` Limonciello, Mario

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).