Re: [PATCHv2] drm/amdgpu: disable ASPM on Intel AlderLake based systems

2022-04-11 Thread kernel test robot
Hi Richard,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on drm/drm-next]
[also build test ERROR on v5.18-rc2 next-20220411]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:
https://github.com/intel-lab-lkp/linux/commits/Richard-Gong/drm-amdgpu-disable-ASPM-on-Intel-AlderLake-based-systems/20220409-030656
base:   git://anongit.freedesktop.org/drm/drm drm-next
config: um-allmodconfig 
(https://download.01.org/0day-ci/archive/20220412/202204120618.4i6douw9-...@intel.com/config)
compiler: gcc-11 (Debian 11.2.0-19) 11.2.0
reproduce (this is a W=1 build):
# 
https://github.com/intel-lab-lkp/linux/commit/bb9a037cafa91918c2ece823591d1d04b812ae17
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review 
Richard-Gong/drm-amdgpu-disable-ASPM-on-Intel-AlderLake-based-systems/20220409-030656
git checkout bb9a037cafa91918c2ece823591d1d04b812ae17
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=um SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot 

All errors (new ones prefixed by >>):

   In file included from arch/x86/um/asm/processor.h:41,
from include/linux/mutex.h:19,
from include/linux/kernfs.h:11,
from include/linux/sysfs.h:16,
from include/linux/kobject.h:20,
from include/linux/pci.h:35,
from drivers/gpu/drm/amd/amdgpu/vi.c:24:
   drivers/gpu/drm/amd/amdgpu/vi.c: In function 'intel_core_apsm_chk':
   arch/um/include/asm/processor-generic.h:103:19: error: called object is not 
a function or function pointer
 103 | #define cpu_data (_cpu_data)
 |  ~^~~
   drivers/gpu/drm/amd/amdgpu/vi.c:1144:34: note: in expansion of macro 
'cpu_data'
1144 | struct cpuinfo_x86 *c = _data(0);
 |  ^~~~
>> drivers/gpu/drm/amd/amdgpu/vi.c:1146:18: error: invalid use of undefined 
>> type 'struct cpuinfo_x86'
1146 | return (c->x86 == 6 && c->x86_model == INTEL_FAM6_ALDERLAKE);
 |  ^~
   drivers/gpu/drm/amd/amdgpu/vi.c:1146:33: error: invalid use of undefined 
type 'struct cpuinfo_x86'
1146 | return (c->x86 == 6 && c->x86_model == INTEL_FAM6_ALDERLAKE);
 | ^~
   drivers/gpu/drm/amd/amdgpu/vi.c:1150:1: error: control reaches end of 
non-void function [-Werror=return-type]
1150 | }
 | ^
   cc1: some warnings being treated as errors


vim +1146 drivers/gpu/drm/amd/amdgpu/vi.c

  1140  
  1141  static bool intel_core_apsm_chk(void)
  1142  {
  1143  #if IS_ENABLED(CONFIG_X86_64)
  1144  struct cpuinfo_x86 *c = _data(0);
  1145  
> 1146  return (c->x86 == 6 && c->x86_model == INTEL_FAM6_ALDERLAKE);
  1147  #else
  1148  return false;
  1149  #endif
  1150  }
  1151  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp


Re: [PATCHv2] drm/amdgpu: disable ASPM on Intel AlderLake based systems

2022-04-11 Thread Paul Menzel

Dear Richard,


Am 11.04.22 um 13:38 schrieb Gong, Richard:


On 4/11/2022 2:41 AM, Paul Menzel wrote:

[Cc: +]



Am 11.04.22 um 02:27 schrieb Gong, Richard:


On 4/8/2022 7:19 PM, Paul Menzel wrote:



Am 08.04.22 um 21:05 schrieb Richard Gong:
Active State Power Management (ASPM) feature is enabled since 
kernel 5.14.

There are some AMD GFX cards (such as WX3200 and RX640) that cannot be
used with Intel AlderLake based systems to enable ASPM. Using these 
GFX


Alder Lake

will correct in the next version.



cards as video/display output, Intel Alder Lake based systems will hang
during suspend/resume.


Please reflow for 75 characters per line.

Also please mention the exact system you had problems with (also 
firmware versions).




Add extra check to disable ASPM on Intel AlderLake based systems.


Is that a problem with Intel Alder Lake or the Dell system? 
Shouldn’t ASPM just be disabled for the problematic cards for the 
Dell system. You write newer cards worked fine.


There is a problem with Dell system (Dell Precision DT workstation), 
which is based on Intel Alder Lake.


ASPM works just fine on these GPU's. It's more of an issue with 
whether the underlying platform supports ASPM or not.


At least you didn’t document what the real issue is,


You can refer to bug tag from the comment messages.

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1885


No, the commit message should be self-contained, and reviewers and 
readers of the commit message not required to read comments of bug 
reports. Please add the necessary information to the commit message.



Kind regards,

Paul


that ASPM does not work. With current information (some GPU graphics 
card with the the Dell system and others don’t), it could be the GPU, 
the Dell system (firmware, …), a problem with Alder Lake SOC, or 
another bug. I hope you are in contact with Dell to analyze it, so 
ASPM can be enabled again.


[…]


Kind regards,

Paul


Re: [PATCHv2] drm/amdgpu: disable ASPM on Intel AlderLake based systems

2022-04-11 Thread Gong, Richard

Hi Paul,

On 4/11/2022 2:41 AM, Paul Menzel wrote:

[Cc: +]

Dear Richard,


Am 11.04.22 um 02:27 schrieb Gong, Richard:


On 4/8/2022 7:19 PM, Paul Menzel wrote:



Am 08.04.22 um 21:05 schrieb Richard Gong:
Active State Power Management (ASPM) feature is enabled since 
kernel 5.14.

There are some AMD GFX cards (such as WX3200 and RX640) that cannot be
used with Intel AlderLake based systems to enable ASPM. Using these 
GFX


Alder Lake

will correct in the next version.


cards as video/display output, Intel Alder Lake based systems will 
hang

during suspend/resume.


Please reflow for 75 characters per line.

Also please mention the exact system you had problems with (also 
firmware versions).




Add extra check to disable ASPM on Intel AlderLake based systems.


Is that a problem with Intel Alder Lake or the Dell system? 
Shouldn’t ASPM just be disabled for the problematic cards for the 
Dell system. You write newer cards worked fine.


There is a problem with Dell system (Dell Precision DT workstation), 
which is based on Intel Alder Lake.


ASPM works just fine on these GPU's. It's more of an issue with 
whether the underlying platform supports ASPM or not.


At least you didn’t document what the real issue is,


You can refer to bug tag from the comment messages.

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1885

Regards,

Richard

that ASPM does not work. With current information (some GPU graphics 
card with the the Dell system and others don’t), it could be the GPU, 
the Dell system (firmware, …), a problem with Alder Lake SOC, or 
another bug. I hope you are in contact with Dell to analyze it, so 
ASPM can be enabled again.


[…]


Kind regards,

Paul


Re: [PATCHv2] drm/amdgpu: disable ASPM on Intel AlderLake based systems

2022-04-11 Thread Gong, Richard

Hi Lijo,

On 4/10/2022 11:15 PM, Lazar, Lijo wrote:



On 4/9/2022 12:35 AM, Richard Gong wrote:
Active State Power Management (ASPM) feature is enabled since kernel 
5.14.

There are some AMD GFX cards (such as WX3200 and RX640) that cannot be
used with Intel AlderLake based systems to enable ASPM. Using these GFX
cards as video/display output, Intel Alder Lake based systems will hang
during suspend/resume.

Add extra check to disable ASPM on Intel AlderLake based systems.

Fixes: 0064b0ce85bb ("drm/amd/pm: enable ASPM by default")
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1885
Signed-off-by: Richard Gong 
---
v2: correct commit description
 move the check from chip family to problematic platform
---
  drivers/gpu/drm/amd/amdgpu/vi.c | 17 -
  1 file changed, 16 insertions(+), 1 deletion(-)

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

index 039b90cdc3bc..8b4eaf54b23e 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -81,6 +81,10 @@
  #include "mxgpu_vi.h"
  #include "amdgpu_dm.h"
  +#if IS_ENABLED(CONFIG_X86_64)
+#include 
+#endif
+
  #define ixPCIE_LC_L1_PM_SUBSTATE    0x100100C6
  #define PCIE_LC_L1_PM_SUBSTATE__LC_L1_SUBSTATES_OVERRIDE_EN_MASK 
0x0001L
  #define PCIE_LC_L1_PM_SUBSTATE__LC_PCI_PM_L1_2_OVERRIDE_MASK 
0x0002L
@@ -1134,13 +1138,24 @@ static void vi_enable_aspm(struct 
amdgpu_device *adev)

  WREG32_PCIE(ixPCIE_LC_CNTL, data);
  }
  +static bool intel_core_apsm_chk(void)


If this is only for Dell systems, use DMI_SYS_VENDOR/DMI_PRODUCT_NAME 
to identify the platform information from SMBIOS.
Not sure, the report issue was originally for Dell system but may occur 
with others. This is why I just check CPU info.


Better to rename to aspm_support_quirk_check() or similar, and return 
false on is_alderlake() or is_dell_xyz();



Ok, will rename to aspm_support_quick_check in the next versin.


Thanks,
Lijo


+{
+#if IS_ENABLED(CONFIG_X86_64)
+    struct cpuinfo_x86 *c = _data(0);
+
+    return (c->x86 == 6 && c->x86_model == INTEL_FAM6_ALDERLAKE);
+#else
+    return false;
+#endif
+}
+
  static void vi_program_aspm(struct amdgpu_device *adev)
  {
  u32 data, data1, orig;
  bool bL1SS = false;
  bool bClkReqSupport = true;
  -    if (!amdgpu_device_should_use_aspm(adev))
+    if (!amdgpu_device_should_use_aspm(adev) || intel_core_apsm_chk())
  return;
    if (adev->flags & AMD_IS_APU ||



Re: [PATCHv2] drm/amdgpu: disable ASPM on Intel AlderLake based systems

2022-04-11 Thread Paul Menzel

[Cc: +]

Dear Richard,


Am 11.04.22 um 02:27 schrieb Gong, Richard:


On 4/8/2022 7:19 PM, Paul Menzel wrote:



Am 08.04.22 um 21:05 schrieb Richard Gong:

Active State Power Management (ASPM) feature is enabled since kernel 5.14.
There are some AMD GFX cards (such as WX3200 and RX640) that cannot be
used with Intel AlderLake based systems to enable ASPM. Using these GFX


Alder Lake

will correct in the next version.



cards as video/display output, Intel Alder Lake based systems will hang
during suspend/resume.


Please reflow for 75 characters per line.

Also please mention the exact system you had problems with (also 
firmware versions).




Add extra check to disable ASPM on Intel AlderLake based systems.


Is that a problem with Intel Alder Lake or the Dell system? Shouldn’t 
ASPM just be disabled for the problematic cards for the Dell system. 
You write newer cards worked fine.


There is a problem with Dell system (Dell Precision DT workstation), 
which is based on Intel Alder Lake.


ASPM works just fine on these GPU's. It's more of an issue with whether 
the underlying platform supports ASPM or not.


At least you didn’t document what the real issue is, that ASPM does not 
work. With current information (some GPU graphics card with the the Dell 
system and others don’t), it could be the GPU, the Dell system 
(firmware, …), a problem with Alder Lake SOC, or another bug. I hope you 
are in contact with Dell to analyze it, so ASPM can be enabled again.


[…]


Kind regards,

Paul


Re: [PATCHv2] drm/amdgpu: disable ASPM on Intel AlderLake based systems

2022-04-11 Thread Paul Menzel

Dear Richard,


Thank you for your response, but please reply to your own reply next time.

Am 11.04.22 um 02:37 schrieb Gong, Richard:


On 4/8/2022 7:19 PM, Paul Menzel wrote:



Thank you for your patch.

Am 08.04.22 um 21:05 schrieb Richard Gong:
Active State Power Management (ASPM) feature is enabled since kernel 
5.14.

There are some AMD GFX cards (such as WX3200 and RX640) that cannot be
used with Intel AlderLake based systems to enable ASPM. Using these GFX


Alder Lake
Actually there are 2 formats (one with space, another is w/o space) in 
the upstream sources, so I will keep that unchanged and use the format 
w/o space.


Do you mean the Linux kernel sources? Anyway, please use the correct 
spelling [1].



Kind regards,

Paul


[1]: 
https://ark.intel.com/content/www/us/en/ark/products/codename/147470/products-formerly-alder-lake.html

[2]: https://en.wikipedia.org/wiki/Alder_Lake


Re: [PATCHv2] drm/amdgpu: disable ASPM on Intel AlderLake based systems

2022-04-10 Thread Lazar, Lijo




On 4/9/2022 12:35 AM, Richard Gong wrote:

Active State Power Management (ASPM) feature is enabled since kernel 5.14.
There are some AMD GFX cards (such as WX3200 and RX640) that cannot be
used with Intel AlderLake based systems to enable ASPM. Using these GFX
cards as video/display output, Intel Alder Lake based systems will hang
during suspend/resume.

Add extra check to disable ASPM on Intel AlderLake based systems.

Fixes: 0064b0ce85bb ("drm/amd/pm: enable ASPM by default")
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1885
Signed-off-by: Richard Gong 
---
v2: correct commit description
 move the check from chip family to problematic platform
---
  drivers/gpu/drm/amd/amdgpu/vi.c | 17 -
  1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
index 039b90cdc3bc..8b4eaf54b23e 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -81,6 +81,10 @@
  #include "mxgpu_vi.h"
  #include "amdgpu_dm.h"
  
+#if IS_ENABLED(CONFIG_X86_64)

+#include 
+#endif
+
  #define ixPCIE_LC_L1_PM_SUBSTATE  0x100100C6
  #define PCIE_LC_L1_PM_SUBSTATE__LC_L1_SUBSTATES_OVERRIDE_EN_MASK  
0x0001L
  #define PCIE_LC_L1_PM_SUBSTATE__LC_PCI_PM_L1_2_OVERRIDE_MASK  0x0002L
@@ -1134,13 +1138,24 @@ static void vi_enable_aspm(struct amdgpu_device *adev)
WREG32_PCIE(ixPCIE_LC_CNTL, data);
  }
  
+static bool intel_core_apsm_chk(void)


If this is only for Dell systems, use DMI_SYS_VENDOR/DMI_PRODUCT_NAME to 
identify the platform information from SMBIOS.


Better to rename to aspm_support_quirk_check() or similar, and return 
false on is_alderlake() or is_dell_xyz();


Thanks,
Lijo


+{
+#if IS_ENABLED(CONFIG_X86_64)
+   struct cpuinfo_x86 *c = _data(0);
+
+   return (c->x86 == 6 && c->x86_model == INTEL_FAM6_ALDERLAKE);
+#else
+   return false;
+#endif
+}
+
  static void vi_program_aspm(struct amdgpu_device *adev)
  {
u32 data, data1, orig;
bool bL1SS = false;
bool bClkReqSupport = true;
  
-	if (!amdgpu_device_should_use_aspm(adev))

+   if (!amdgpu_device_should_use_aspm(adev) || intel_core_apsm_chk())
return;
  
  	if (adev->flags & AMD_IS_APU ||




Re: [PATCHv2] drm/amdgpu: disable ASPM on Intel AlderLake based systems

2022-04-10 Thread Gong, Richard



On 4/8/2022 7:19 PM, Paul Menzel wrote:

Dear Richard,


Thank you for your patch.

Am 08.04.22 um 21:05 schrieb Richard Gong:
Active State Power Management (ASPM) feature is enabled since kernel 
5.14.

There are some AMD GFX cards (such as WX3200 and RX640) that cannot be
used with Intel AlderLake based systems to enable ASPM. Using these GFX


Alder Lake
Actually there are 2 formats (one with space, another is w/o space) in 
the upstream sources, so I will keep that unchanged and use the format 
w/o space.



cards as video/display output, Intel Alder Lake based systems will hang
during suspend/resume.


Please reflow for 75 characters per line.

Also please mention the exact system you had problems with (also 
firmware versions).




Add extra check to disable ASPM on Intel AlderLake based systems.


Is that a problem with Intel Alder Lake or the Dell system? Shouldn’t 
ASPM just be disabled for the problematic cards for the Dell system. 
You write newer cards worked fine.



Fixes: 0064b0ce85bb ("drm/amd/pm: enable ASPM by default")
Link: 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fdrm%2Famd%2F-%2Fissues%2F1885data=04%7C01%7Crichard.gong%40amd.com%7C6b94ff2249244c04974e08da19bea71b%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637850604066094079%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000sdata=%2FiF%2Bnwzm5RlClT%2Fv%2B0RJvmVwsc%2FiwV3jCiFq7PB84wM%3Dreserved=0

Signed-off-by: Richard Gong 
---
v2: correct commit description
 move the check from chip family to problematic platform
---
  drivers/gpu/drm/amd/amdgpu/vi.c | 17 -
  1 file changed, 16 insertions(+), 1 deletion(-)

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

index 039b90cdc3bc..8b4eaf54b23e 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -81,6 +81,10 @@
  #include "mxgpu_vi.h"
  #include "amdgpu_dm.h"
  +#if IS_ENABLED(CONFIG_X86_64)
+#include 
+#endif
+
  #define ixPCIE_LC_L1_PM_SUBSTATE    0x100100C6
  #define PCIE_LC_L1_PM_SUBSTATE__LC_L1_SUBSTATES_OVERRIDE_EN_MASK 
0x0001L
  #define PCIE_LC_L1_PM_SUBSTATE__LC_PCI_PM_L1_2_OVERRIDE_MASK 
0x0002L
@@ -1134,13 +1138,24 @@ static void vi_enable_aspm(struct 
amdgpu_device *adev)

  WREG32_PCIE(ixPCIE_LC_CNTL, data);
  }
  +static bool intel_core_apsm_chk(void)


aspm


+{
+#if IS_ENABLED(CONFIG_X86_64)
+    struct cpuinfo_x86 *c = _data(0);
+
+    return (c->x86 == 6 && c->x86_model == INTEL_FAM6_ALDERLAKE);
+#else
+    return false;
+#endif


Please do the check in C code and not the preprocessor.


+}
+
  static void vi_program_aspm(struct amdgpu_device *adev)
  {
  u32 data, data1, orig;
  bool bL1SS = false;
  bool bClkReqSupport = true;
  -    if (!amdgpu_device_should_use_aspm(adev))
+    if (!amdgpu_device_should_use_aspm(adev) || intel_core_apsm_chk())
  return;
    if (adev->flags & AMD_IS_APU ||



Kind regards,

Paul


Re: [PATCHv2] drm/amdgpu: disable ASPM on Intel AlderLake based systems

2022-04-10 Thread Gong, Richard

Hi Nils,

On 4/10/2022 8:54 AM, Nils Wallménius wrote:

Hi Richard, see inline comment.

Den fre 8 apr. 2022 21:05Richard Gong  skrev:

Active State Power Management (ASPM) feature is enabled since
kernel 5.14.
There are some AMD GFX cards (such as WX3200 and RX640) that cannot be
used with Intel AlderLake based systems to enable ASPM. Using
these GFX
cards as video/display output, Intel Alder Lake based systems will
hang
during suspend/resume.

Add extra check to disable ASPM on Intel AlderLake based systems.

Fixes: 0064b0ce85bb ("drm/amd/pm: enable ASPM by default")
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1885


Signed-off-by: Richard Gong 
---
v2: correct commit description
    move the check from chip family to problematic platform
---
 drivers/gpu/drm/amd/amdgpu/vi.c | 17 -
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c
b/drivers/gpu/drm/amd/amdgpu/vi.c
index 039b90cdc3bc..8b4eaf54b23e 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -81,6 +81,10 @@
 #include "mxgpu_vi.h"
 #include "amdgpu_dm.h"

+#if IS_ENABLED(CONFIG_X86_64)
+#include 
+#endif
+
 #define ixPCIE_LC_L1_PM_SUBSTATE       0x100100C6
 #define PCIE_LC_L1_PM_SUBSTATE__LC_L1_SUBSTATES_OVERRIDE_EN_MASK
     0x0001L
 #define PCIE_LC_L1_PM_SUBSTATE__LC_PCI_PM_L1_2_OVERRIDE_MASK
 0x0002L
@@ -1134,13 +1138,24 @@ static void vi_enable_aspm(struct
amdgpu_device *adev)
                WREG32_PCIE(ixPCIE_LC_CNTL, data);
 }


There's a typo in the new function name apsm/aspm. Btw might be worth 
a comment why this check is done?



Thanks for review,

s/intel_core_apsm_chk/intel_core_aspm_chk in the next view.

Regards,

Richard


Regards
Nils


+static bool intel_core_apsm_chk(void)
+{
+#if IS_ENABLED(CONFIG_X86_64)
+       struct cpuinfo_x86 *c = _data(0);
+
+       return (c->x86 == 6 && c->x86_model == INTEL_FAM6_ALDERLAKE);
+#else
+       return false;
+#endif
+}
+
 static void vi_program_aspm(struct amdgpu_device *adev)
 {
        u32 data, data1, orig;
        bool bL1SS = false;
        bool bClkReqSupport = true;

-       if (!amdgpu_device_should_use_aspm(adev))
+       if (!amdgpu_device_should_use_aspm(adev) ||
intel_core_apsm_chk())
                return;

        if (adev->flags & AMD_IS_APU ||
-- 
2.25.1


Re: [PATCHv2] drm/amdgpu: disable ASPM on Intel AlderLake based systems

2022-04-10 Thread Gong, Richard

Hi Pail.

On 4/8/2022 7:19 PM, Paul Menzel wrote:

Dear Richard,


Thank you for your patch.

Am 08.04.22 um 21:05 schrieb Richard Gong:
Active State Power Management (ASPM) feature is enabled since kernel 
5.14.

There are some AMD GFX cards (such as WX3200 and RX640) that cannot be
used with Intel AlderLake based systems to enable ASPM. Using these GFX


Alder Lake

will correct in the next version.



cards as video/display output, Intel Alder Lake based systems will hang
during suspend/resume.


Please reflow for 75 characters per line.

Also please mention the exact system you had problems with (also 
firmware versions).




Add extra check to disable ASPM on Intel AlderLake based systems.


Is that a problem with Intel Alder Lake or the Dell system? Shouldn’t 
ASPM just be disabled for the problematic cards for the Dell system. 
You write newer cards worked fine.


There is a problem with Dell system (Dell Precision DT workstation), 
which is based on Intel Alder Lake.


ASPM works just fine on these GPU's. It's more of an issue with whether 
the underlying platform supports ASPM or not.





Fixes: 0064b0ce85bb ("drm/amd/pm: enable ASPM by default")
Link: 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fdrm%2Famd%2F-%2Fissues%2F1885data=04%7C01%7Crichard.gong%40amd.com%7C6b94ff2249244c04974e08da19bea71b%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637850604066094079%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000sdata=%2FiF%2Bnwzm5RlClT%2Fv%2B0RJvmVwsc%2FiwV3jCiFq7PB84wM%3Dreserved=0

Signed-off-by: Richard Gong 
---
v2: correct commit description
 move the check from chip family to problematic platform
---
  drivers/gpu/drm/amd/amdgpu/vi.c | 17 -
  1 file changed, 16 insertions(+), 1 deletion(-)

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

index 039b90cdc3bc..8b4eaf54b23e 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -81,6 +81,10 @@
  #include "mxgpu_vi.h"
  #include "amdgpu_dm.h"
  +#if IS_ENABLED(CONFIG_X86_64)
+#include 
+#endif
+
  #define ixPCIE_LC_L1_PM_SUBSTATE    0x100100C6
  #define PCIE_LC_L1_PM_SUBSTATE__LC_L1_SUBSTATES_OVERRIDE_EN_MASK 
0x0001L
  #define PCIE_LC_L1_PM_SUBSTATE__LC_PCI_PM_L1_2_OVERRIDE_MASK 
0x0002L
@@ -1134,13 +1138,24 @@ static void vi_enable_aspm(struct 
amdgpu_device *adev)

  WREG32_PCIE(ixPCIE_LC_CNTL, data);
  }
  +static bool intel_core_apsm_chk(void)


aspm

s/apsm/aspm in the next version



+{
+#if IS_ENABLED(CONFIG_X86_64)
+    struct cpuinfo_x86 *c = _data(0);
+
+    return (c->x86 == 6 && c->x86_model == INTEL_FAM6_ALDERLAKE);
+#else
+    return false;
+#endif


Please do the check in C code and not the preprocessor.

followed the pattern with other upsteram drivers.



+}
+
  static void vi_program_aspm(struct amdgpu_device *adev)
  {
  u32 data, data1, orig;
  bool bL1SS = false;
  bool bClkReqSupport = true;
  -    if (!amdgpu_device_should_use_aspm(adev))
+    if (!amdgpu_device_should_use_aspm(adev) || intel_core_apsm_chk())
  return;
    if (adev->flags & AMD_IS_APU ||



Kind regards,

Paul


Regards,

Richard



Re: [PATCHv2] drm/amdgpu: disable ASPM on Intel AlderLake based systems

2022-04-10 Thread Nils Wallménius
Hi Richard, see inline comment.

Den fre 8 apr. 2022 21:05Richard Gong  skrev:

> Active State Power Management (ASPM) feature is enabled since kernel 5.14.
> There are some AMD GFX cards (such as WX3200 and RX640) that cannot be
> used with Intel AlderLake based systems to enable ASPM. Using these GFX
> cards as video/display output, Intel Alder Lake based systems will hang
> during suspend/resume.
>
> Add extra check to disable ASPM on Intel AlderLake based systems.
>
> Fixes: 0064b0ce85bb ("drm/amd/pm: enable ASPM by default")
> Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1885
> Signed-off-by: Richard Gong 
> ---
> v2: correct commit description
> move the check from chip family to problematic platform
> ---
>  drivers/gpu/drm/amd/amdgpu/vi.c | 17 -
>  1 file changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c
> b/drivers/gpu/drm/amd/amdgpu/vi.c
> index 039b90cdc3bc..8b4eaf54b23e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vi.c
> @@ -81,6 +81,10 @@
>  #include "mxgpu_vi.h"
>  #include "amdgpu_dm.h"
>
> +#if IS_ENABLED(CONFIG_X86_64)
> +#include 
> +#endif
> +
>  #define ixPCIE_LC_L1_PM_SUBSTATE   0x100100C6
>  #define PCIE_LC_L1_PM_SUBSTATE__LC_L1_SUBSTATES_OVERRIDE_EN_MASK
>  0x0001L
>  #define PCIE_LC_L1_PM_SUBSTATE__LC_PCI_PM_L1_2_OVERRIDE_MASK   0x0002L
> @@ -1134,13 +1138,24 @@ static void vi_enable_aspm(struct amdgpu_device
> *adev)
> WREG32_PCIE(ixPCIE_LC_CNTL, data);
>  }
>

There's a typo in the new function name apsm/aspm. Btw might be worth a
comment why this check is done?

Regards
Nils


> +static bool intel_core_apsm_chk(void)
> +{
> +#if IS_ENABLED(CONFIG_X86_64)
> +   struct cpuinfo_x86 *c = _data(0);
> +
> +   return (c->x86 == 6 && c->x86_model == INTEL_FAM6_ALDERLAKE);
> +#else
> +   return false;
> +#endif
> +}
> +
>  static void vi_program_aspm(struct amdgpu_device *adev)
>  {
> u32 data, data1, orig;
> bool bL1SS = false;
> bool bClkReqSupport = true;
>
> -   if (!amdgpu_device_should_use_aspm(adev))
> +   if (!amdgpu_device_should_use_aspm(adev) || intel_core_apsm_chk())
> return;
>
> if (adev->flags & AMD_IS_APU ||
> --
> 2.25.1
>
>


Re: [PATCHv2] drm/amdgpu: disable ASPM on Intel AlderLake based systems

2022-04-08 Thread Paul Menzel

Dear Richard,


Thank you for your patch.

Am 08.04.22 um 21:05 schrieb Richard Gong:

Active State Power Management (ASPM) feature is enabled since kernel 5.14.
There are some AMD GFX cards (such as WX3200 and RX640) that cannot be
used with Intel AlderLake based systems to enable ASPM. Using these GFX


Alder Lake


cards as video/display output, Intel Alder Lake based systems will hang
during suspend/resume.


Please reflow for 75 characters per line.

Also please mention the exact system you had problems with (also 
firmware versions).




Add extra check to disable ASPM on Intel AlderLake based systems.


Is that a problem with Intel Alder Lake or the Dell system? Shouldn’t 
ASPM just be disabled for the problematic cards for the Dell system. You 
write newer cards worked fine.



Fixes: 0064b0ce85bb ("drm/amd/pm: enable ASPM by default")
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1885
Signed-off-by: Richard Gong 
---
v2: correct commit description
 move the check from chip family to problematic platform
---
  drivers/gpu/drm/amd/amdgpu/vi.c | 17 -
  1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
index 039b90cdc3bc..8b4eaf54b23e 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -81,6 +81,10 @@
  #include "mxgpu_vi.h"
  #include "amdgpu_dm.h"
  
+#if IS_ENABLED(CONFIG_X86_64)

+#include 
+#endif
+
  #define ixPCIE_LC_L1_PM_SUBSTATE  0x100100C6
  #define PCIE_LC_L1_PM_SUBSTATE__LC_L1_SUBSTATES_OVERRIDE_EN_MASK  
0x0001L
  #define PCIE_LC_L1_PM_SUBSTATE__LC_PCI_PM_L1_2_OVERRIDE_MASK  0x0002L
@@ -1134,13 +1138,24 @@ static void vi_enable_aspm(struct amdgpu_device *adev)
WREG32_PCIE(ixPCIE_LC_CNTL, data);
  }
  
+static bool intel_core_apsm_chk(void)


aspm


+{
+#if IS_ENABLED(CONFIG_X86_64)
+   struct cpuinfo_x86 *c = _data(0);
+
+   return (c->x86 == 6 && c->x86_model == INTEL_FAM6_ALDERLAKE);
+#else
+   return false;
+#endif


Please do the check in C code and not the preprocessor.


+}
+
  static void vi_program_aspm(struct amdgpu_device *adev)
  {
u32 data, data1, orig;
bool bL1SS = false;
bool bClkReqSupport = true;
  
-	if (!amdgpu_device_should_use_aspm(adev))

+   if (!amdgpu_device_should_use_aspm(adev) || intel_core_apsm_chk())
return;
  
  	if (adev->flags & AMD_IS_APU ||



Kind regards,

Paul


RE: [PATCHv2] drm/amdgpu: disable ASPM on Intel AlderLake based systems

2022-04-08 Thread Limonciello, Mario
[Public]



> -Original Message-
> From: Alex Deucher 
> Sent: Friday, April 8, 2022 14:09
> To: Gong, Richard 
> Cc: Deucher, Alexander ; Koenig, Christian
> ; Pan, Xinhui ; Dave Airlie
> ; Daniel Vetter ; Limonciello, Mario
> ; Maling list - DRI developers  de...@lists.freedesktop.org>; amd-gfx list ;
> LKML 
> Subject: Re: [PATCHv2] drm/amdgpu: disable ASPM on Intel AlderLake based
> systems
> 
> On Fri, Apr 8, 2022 at 3:05 PM Richard Gong  wrote:
> >
> > Active State Power Management (ASPM) feature is enabled since kernel 5.14.
> > There are some AMD GFX cards (such as WX3200 and RX640) that cannot be
> > used with Intel AlderLake based systems to enable ASPM. Using these GFX
> > cards as video/display output, Intel Alder Lake based systems will hang
> > during suspend/resume.
> >
> > Add extra check to disable ASPM on Intel AlderLake based systems.
> >
> > Fixes: 0064b0ce85bb ("drm/amd/pm: enable ASPM by default")
> > Link:
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.fr
> eedesktop.org%2Fdrm%2Famd%2F-
> %2Fissues%2F1885data=04%7C01%7Cmario.limonciello%40amd.com%7
> C440357cd10e74d8c4e1d08da1993344b%7C3dd8961fe4884e608e11a82d994e1
> 83d%7C0%7C0%7C637850417310167943%7CUnknown%7CTWFpbGZsb3d8eyJ
> WIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C
> 3000sdata=WXyESh1FGlxgFLH14P7pYJu3tsyp53uKpUP9NyDV5yE%3D
> p;reserved=0
> > Signed-off-by: Richard Gong 
> 
> Reviewed-by: Alex Deucher 

Reviewed-by: Mario Limonciello 

> 
> > ---
> > v2: correct commit description
> > move the check from chip family to problematic platform
> > ---
> >  drivers/gpu/drm/amd/amdgpu/vi.c | 17 -
> >  1 file changed, 16 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c
> b/drivers/gpu/drm/amd/amdgpu/vi.c
> > index 039b90cdc3bc..8b4eaf54b23e 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/vi.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/vi.c
> > @@ -81,6 +81,10 @@
> >  #include "mxgpu_vi.h"
> >  #include "amdgpu_dm.h"
> >
> > +#if IS_ENABLED(CONFIG_X86_64)
> > +#include 
> > +#endif
> > +
> >  #define ixPCIE_LC_L1_PM_SUBSTATE   0x100100C6
> >  #define
> PCIE_LC_L1_PM_SUBSTATE__LC_L1_SUBSTATES_OVERRIDE_EN_MASK
> 0x0001L
> >  #define PCIE_LC_L1_PM_SUBSTATE__LC_PCI_PM_L1_2_OVERRIDE_MASK
> 0x0002L
> > @@ -1134,13 +1138,24 @@ static void vi_enable_aspm(struct
> amdgpu_device *adev)
> > WREG32_PCIE(ixPCIE_LC_CNTL, data);
> >  }
> >
> > +static bool intel_core_apsm_chk(void)
> > +{
> > +#if IS_ENABLED(CONFIG_X86_64)
> > +   struct cpuinfo_x86 *c = _data(0);
> > +
> > +   return (c->x86 == 6 && c->x86_model == INTEL_FAM6_ALDERLAKE);
> > +#else
> > +   return false;
> > +#endif
> > +}
> > +
> >  static void vi_program_aspm(struct amdgpu_device *adev)
> >  {
> > u32 data, data1, orig;
> > bool bL1SS = false;
> > bool bClkReqSupport = true;
> >
> > -   if (!amdgpu_device_should_use_aspm(adev))
> > +   if (!amdgpu_device_should_use_aspm(adev) || intel_core_apsm_chk())
> > return;
> >
> > if (adev->flags & AMD_IS_APU ||
> > --
> > 2.25.1
> >


Re: [PATCHv2] drm/amdgpu: disable ASPM on Intel AlderLake based systems

2022-04-08 Thread Alex Deucher
On Fri, Apr 8, 2022 at 3:05 PM Richard Gong  wrote:
>
> Active State Power Management (ASPM) feature is enabled since kernel 5.14.
> There are some AMD GFX cards (such as WX3200 and RX640) that cannot be
> used with Intel AlderLake based systems to enable ASPM. Using these GFX
> cards as video/display output, Intel Alder Lake based systems will hang
> during suspend/resume.
>
> Add extra check to disable ASPM on Intel AlderLake based systems.
>
> Fixes: 0064b0ce85bb ("drm/amd/pm: enable ASPM by default")
> Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1885
> Signed-off-by: Richard Gong 

Reviewed-by: Alex Deucher 

> ---
> v2: correct commit description
> move the check from chip family to problematic platform
> ---
>  drivers/gpu/drm/amd/amdgpu/vi.c | 17 -
>  1 file changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
> index 039b90cdc3bc..8b4eaf54b23e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vi.c
> @@ -81,6 +81,10 @@
>  #include "mxgpu_vi.h"
>  #include "amdgpu_dm.h"
>
> +#if IS_ENABLED(CONFIG_X86_64)
> +#include 
> +#endif
> +
>  #define ixPCIE_LC_L1_PM_SUBSTATE   0x100100C6
>  #define PCIE_LC_L1_PM_SUBSTATE__LC_L1_SUBSTATES_OVERRIDE_EN_MASK   
> 0x0001L
>  #define PCIE_LC_L1_PM_SUBSTATE__LC_PCI_PM_L1_2_OVERRIDE_MASK   0x0002L
> @@ -1134,13 +1138,24 @@ static void vi_enable_aspm(struct amdgpu_device *adev)
> WREG32_PCIE(ixPCIE_LC_CNTL, data);
>  }
>
> +static bool intel_core_apsm_chk(void)
> +{
> +#if IS_ENABLED(CONFIG_X86_64)
> +   struct cpuinfo_x86 *c = _data(0);
> +
> +   return (c->x86 == 6 && c->x86_model == INTEL_FAM6_ALDERLAKE);
> +#else
> +   return false;
> +#endif
> +}
> +
>  static void vi_program_aspm(struct amdgpu_device *adev)
>  {
> u32 data, data1, orig;
> bool bL1SS = false;
> bool bClkReqSupport = true;
>
> -   if (!amdgpu_device_should_use_aspm(adev))
> +   if (!amdgpu_device_should_use_aspm(adev) || intel_core_apsm_chk())
> return;
>
> if (adev->flags & AMD_IS_APU ||
> --
> 2.25.1
>