diff mbox series

[2/2] drm/amdgpu: Remove ASPM workaround on VI and NV

Message ID 20230329095933.1203559-2-kai.heng.feng@canonical.com (mailing list archive)
State New, archived
Headers show
Series [1/2] drm/amdgpu: Reset GPU on S0ix when device supports BOCO | expand

Commit Message

Kai-Heng Feng March 29, 2023, 9:59 a.m. UTC
Since the original issue is resolved by a new fix, the ASPM workaround
can be dropped.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h        |  1 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 15 ---------------
 drivers/gpu/drm/amd/amdgpu/nv.c            |  2 +-
 drivers/gpu/drm/amd/amdgpu/vi.c            |  2 +-
 4 files changed, 2 insertions(+), 18 deletions(-)

Comments

Gong, Richard March 29, 2023, 1:08 p.m. UTC | #1
On 3/29/2023 4:59 AM, Kai-Heng Feng wrote:
> Since the original issue is resolved by a new fix, the ASPM workaround
> can be dropped.
What is the new fix? Can you elaborate more or add the new fix commit here?
>
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu.h        |  1 -
>   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 15 ---------------
>   drivers/gpu/drm/amd/amdgpu/nv.c            |  2 +-
>   drivers/gpu/drm/amd/amdgpu/vi.c            |  2 +-
>   4 files changed, 2 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index 8cf2cc50b3de..a19a6489b117 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -1248,7 +1248,6 @@ void amdgpu_device_pci_config_reset(struct amdgpu_device *adev);
>   int amdgpu_device_pci_reset(struct amdgpu_device *adev);
>   bool amdgpu_device_need_post(struct amdgpu_device *adev);
>   bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev);
> -bool amdgpu_device_aspm_support_quirk(void);
>   
>   void amdgpu_cs_report_moved_bytes(struct amdgpu_device *adev, u64 num_bytes,
>   				  u64 num_vis_bytes);
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index d56b7a2bafa6..0cacace2d6c2 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -81,10 +81,6 @@
>   
>   #include <drm/drm_drv.h>
>   
> -#if IS_ENABLED(CONFIG_X86)
> -#include <asm/intel-family.h>
> -#endif
> -
>   MODULE_FIRMWARE("amdgpu/vega10_gpu_info.bin");
>   MODULE_FIRMWARE("amdgpu/vega12_gpu_info.bin");
>   MODULE_FIRMWARE("amdgpu/raven_gpu_info.bin");
> @@ -1377,17 +1373,6 @@ bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev)
>   	return pcie_aspm_enabled(adev->pdev);
>   }
>   
> -bool amdgpu_device_aspm_support_quirk(void)
> -{
> -#if IS_ENABLED(CONFIG_X86)
> -	struct cpuinfo_x86 *c = &cpu_data(0);
> -
> -	return !(c->x86 == 6 && c->x86_model == INTEL_FAM6_ALDERLAKE);
> -#else
> -	return true;
> -#endif
> -}
> -
>   /* if we get transitioned to only one device, take VGA back */
>   /**
>    * amdgpu_device_vga_set_decode - enable/disable vga decode
> diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
> index 47420b403871..15f3c6745ea9 100644
> --- a/drivers/gpu/drm/amd/amdgpu/nv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/nv.c
> @@ -522,7 +522,7 @@ static int nv_set_vce_clocks(struct amdgpu_device *adev, u32 evclk, u32 ecclk)
>   
>   static void nv_program_aspm(struct amdgpu_device *adev)
>   {
> -	if (!amdgpu_device_should_use_aspm(adev) || !amdgpu_device_aspm_support_quirk())
> +	if (!amdgpu_device_should_use_aspm(adev))
>   		return;
>   
>   	if (!(adev->flags & AMD_IS_APU) &&
> diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
> index 531f173ade2d..81dcb1148a60 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vi.c
> @@ -1122,7 +1122,7 @@ static void vi_program_aspm(struct amdgpu_device *adev)
>   	bool bL1SS = false;
>   	bool bClkReqSupport = true;
>   
> -	if (!amdgpu_device_should_use_aspm(adev) || !amdgpu_device_aspm_support_quirk())
> +	if (!amdgpu_device_should_use_aspm(adev))
>   		return;
>   
>   	if (adev->flags & AMD_IS_APU ||
Mario Limonciello March 29, 2023, 1:18 p.m. UTC | #2
On 3/29/23 08:08, Gong, Richard wrote:
>
> On 3/29/2023 4:59 AM, Kai-Heng Feng wrote:
>> Since the original issue is resolved by a new fix, the ASPM workaround
>> can be dropped.
> What is the new fix? Can you elaborate more or add the new fix commit 
> here?

It's his first patch in the series, but yes I agree it should be 
mentioned in this

message explicitly what about that means this can be dropped.

>>
>> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu.h        |  1 -
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 15 ---------------
>>   drivers/gpu/drm/amd/amdgpu/nv.c            |  2 +-
>>   drivers/gpu/drm/amd/amdgpu/vi.c            |  2 +-
>>   4 files changed, 2 insertions(+), 18 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h 
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> index 8cf2cc50b3de..a19a6489b117 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> @@ -1248,7 +1248,6 @@ void amdgpu_device_pci_config_reset(struct 
>> amdgpu_device *adev);
>>   int amdgpu_device_pci_reset(struct amdgpu_device *adev);
>>   bool amdgpu_device_need_post(struct amdgpu_device *adev);
>>   bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev);
>> -bool amdgpu_device_aspm_support_quirk(void);
>>     void amdgpu_cs_report_moved_bytes(struct amdgpu_device *adev, u64 
>> num_bytes,
>>                     u64 num_vis_bytes);
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> index d56b7a2bafa6..0cacace2d6c2 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> @@ -81,10 +81,6 @@
>>     #include <drm/drm_drv.h>
>>   -#if IS_ENABLED(CONFIG_X86)
>> -#include <asm/intel-family.h>
>> -#endif
>> -
>>   MODULE_FIRMWARE("amdgpu/vega10_gpu_info.bin");
>>   MODULE_FIRMWARE("amdgpu/vega12_gpu_info.bin");
>>   MODULE_FIRMWARE("amdgpu/raven_gpu_info.bin");
>> @@ -1377,17 +1373,6 @@ bool amdgpu_device_should_use_aspm(struct 
>> amdgpu_device *adev)
>>       return pcie_aspm_enabled(adev->pdev);
>>   }
>>   -bool amdgpu_device_aspm_support_quirk(void)
>> -{
>> -#if IS_ENABLED(CONFIG_X86)
>> -    struct cpuinfo_x86 *c = &cpu_data(0);
>> -
>> -    return !(c->x86 == 6 && c->x86_model == INTEL_FAM6_ALDERLAKE);
>> -#else
>> -    return true;
>> -#endif
>> -}
>> -
>>   /* if we get transitioned to only one device, take VGA back */
>>   /**
>>    * amdgpu_device_vga_set_decode - enable/disable vga decode
>> diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c 
>> b/drivers/gpu/drm/amd/amdgpu/nv.c
>> index 47420b403871..15f3c6745ea9 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/nv.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/nv.c
>> @@ -522,7 +522,7 @@ static int nv_set_vce_clocks(struct amdgpu_device 
>> *adev, u32 evclk, u32 ecclk)
>>     static void nv_program_aspm(struct amdgpu_device *adev)
>>   {
>> -    if (!amdgpu_device_should_use_aspm(adev) || 
>> !amdgpu_device_aspm_support_quirk())
>> +    if (!amdgpu_device_should_use_aspm(adev))
>>           return;
>>         if (!(adev->flags & AMD_IS_APU) &&
>> diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c 
>> b/drivers/gpu/drm/amd/amdgpu/vi.c
>> index 531f173ade2d..81dcb1148a60 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/vi.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/vi.c
>> @@ -1122,7 +1122,7 @@ static void vi_program_aspm(struct 
>> amdgpu_device *adev)
>>       bool bL1SS = false;
>>       bool bClkReqSupport = true;
>>   -    if (!amdgpu_device_should_use_aspm(adev) || 
>> !amdgpu_device_aspm_support_quirk())
>> +    if (!amdgpu_device_should_use_aspm(adev))
>>           return;
>>         if (adev->flags & AMD_IS_APU ||
diff mbox series

Patch

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 8cf2cc50b3de..a19a6489b117 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1248,7 +1248,6 @@  void amdgpu_device_pci_config_reset(struct amdgpu_device *adev);
 int amdgpu_device_pci_reset(struct amdgpu_device *adev);
 bool amdgpu_device_need_post(struct amdgpu_device *adev);
 bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev);
-bool amdgpu_device_aspm_support_quirk(void);
 
 void amdgpu_cs_report_moved_bytes(struct amdgpu_device *adev, u64 num_bytes,
 				  u64 num_vis_bytes);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index d56b7a2bafa6..0cacace2d6c2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -81,10 +81,6 @@ 
 
 #include <drm/drm_drv.h>
 
-#if IS_ENABLED(CONFIG_X86)
-#include <asm/intel-family.h>
-#endif
-
 MODULE_FIRMWARE("amdgpu/vega10_gpu_info.bin");
 MODULE_FIRMWARE("amdgpu/vega12_gpu_info.bin");
 MODULE_FIRMWARE("amdgpu/raven_gpu_info.bin");
@@ -1377,17 +1373,6 @@  bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev)
 	return pcie_aspm_enabled(adev->pdev);
 }
 
-bool amdgpu_device_aspm_support_quirk(void)
-{
-#if IS_ENABLED(CONFIG_X86)
-	struct cpuinfo_x86 *c = &cpu_data(0);
-
-	return !(c->x86 == 6 && c->x86_model == INTEL_FAM6_ALDERLAKE);
-#else
-	return true;
-#endif
-}
-
 /* if we get transitioned to only one device, take VGA back */
 /**
  * amdgpu_device_vga_set_decode - enable/disable vga decode
diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 47420b403871..15f3c6745ea9 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -522,7 +522,7 @@  static int nv_set_vce_clocks(struct amdgpu_device *adev, u32 evclk, u32 ecclk)
 
 static void nv_program_aspm(struct amdgpu_device *adev)
 {
-	if (!amdgpu_device_should_use_aspm(adev) || !amdgpu_device_aspm_support_quirk())
+	if (!amdgpu_device_should_use_aspm(adev))
 		return;
 
 	if (!(adev->flags & AMD_IS_APU) &&
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
index 531f173ade2d..81dcb1148a60 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -1122,7 +1122,7 @@  static void vi_program_aspm(struct amdgpu_device *adev)
 	bool bL1SS = false;
 	bool bClkReqSupport = true;
 
-	if (!amdgpu_device_should_use_aspm(adev) || !amdgpu_device_aspm_support_quirk())
+	if (!amdgpu_device_should_use_aspm(adev))
 		return;
 
 	if (adev->flags & AMD_IS_APU ||