lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <MN0PR12MB6101AC459C9DBBCC4837B7B3E2809@MN0PR12MB6101.namprd12.prod.outlook.com>
Date:   Mon, 20 Mar 2023 21:42:36 +0000
From:   "Limonciello, Mario" <Mario.Limonciello@....com>
To:     Kai-Heng Feng <kai.heng.feng@...onical.com>,
        "Deucher, Alexander" <Alexander.Deucher@....com>,
        "Koenig, Christian" <Christian.Koenig@....com>,
        "Pan, Xinhui" <Xinhui.Pan@....com>
CC:     David Airlie <airlied@...il.com>, Daniel Vetter <daniel@...ll.ch>,
        "Zhang, Hawking" <Hawking.Zhang@....com>,
        "Gao, Likun" <Likun.Gao@....com>,
        "Kuehling, Felix" <Felix.Kuehling@....com>,
        "Zhao, Victor" <Victor.Zhao@....com>,
        "Xiao, Jack" <Jack.Xiao@....com>, "Quan, Evan" <Evan.Quan@....com>,
        "Lazar, Lijo" <Lijo.Lazar@....com>,
        "Chai, Thomas" <YiPeng.Chai@....com>,
        Andrey Grodzovsky <andrey.grodzovsky@....com>,
        "Somalapuram, Amaranath" <Amaranath.Somalapuram@....com>,
        "Zhang, Bokun" <Bokun.Zhang@....com>, "Liu, Leo" <Leo.Liu@....com>,
        "Gopalakrishnan, Veerabadhran (Veera)" 
        <Veerabadhran.Gopalakrishnan@....com>,
        "Gong, Richard" <Richard.Gong@....com>,
        "Feng, Kenneth" <Kenneth.Feng@....com>,
        Jiansong Chen <Jiansong.Chen@....com>,
        "amd-gfx@...ts.freedesktop.org" <amd-gfx@...ts.freedesktop.org>,
        "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v2] drm/amdgpu/nv: Apply ASPM quirk on Intel ADL + AMD
 Navi

[Public]



> -----Original Message-----
> From: Kai-Heng Feng <kai.heng.feng@...onical.com>
> Sent: Wednesday, March 15, 2023 07:07
> To: Deucher, Alexander <Alexander.Deucher@....com>; Koenig, Christian
> <Christian.Koenig@....com>; Pan, Xinhui <Xinhui.Pan@....com>
> Cc: Kai-Heng Feng <kai.heng.feng@...onical.com>; David Airlie
> <airlied@...il.com>; Daniel Vetter <daniel@...ll.ch>; Zhang, Hawking
> <Hawking.Zhang@....com>; Gao, Likun <Likun.Gao@....com>; Kuehling,
> Felix <Felix.Kuehling@....com>; Zhao, Victor <Victor.Zhao@....com>;
> Xiao, Jack <Jack.Xiao@....com>; Quan, Evan <Evan.Quan@....com>;
> Limonciello, Mario <Mario.Limonciello@....com>; Lazar, Lijo
> <Lijo.Lazar@....com>; Chai, Thomas <YiPeng.Chai@....com>; Andrey
> Grodzovsky <andrey.grodzovsky@....com>; Somalapuram, Amaranath
> <Amaranath.Somalapuram@....com>; Zhang, Bokun
> <Bokun.Zhang@....com>; Liu, Leo <Leo.Liu@....com>; Gopalakrishnan,
> Veerabadhran (Veera) <Veerabadhran.Gopalakrishnan@....com>; Gong,
> Richard <Richard.Gong@....com>; Feng, Kenneth
> <Kenneth.Feng@....com>; Jiansong Chen <Jiansong.Chen@....com>;
> amd-gfx@...ts.freedesktop.org; dri-devel@...ts.freedesktop.org; linux-
> kernel@...r.kernel.org
> Subject: [PATCH v2] drm/amdgpu/nv: Apply ASPM quirk on Intel ADL + AMD
> Navi
> 
> S2idle resume freeze can be observed on Intel ADL + AMD WX5500. This is
> caused by commit 0064b0ce85bb ("drm/amd/pm: enable ASPM by default").
> 
> The root cause is still not clear for now.
> 
> So extend and apply the ASPM quirk from commit e02fe3bc7aba
> ("drm/amdgpu: vi: disable ASPM on Intel Alder Lake based systems"), to
> workaround the issue on Navi cards too.
> 
> Fixes: 0064b0ce85bb ("drm/amd/pm: enable ASPM by default")
> Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2458
> Reviewed-by: Alex Deucher <alexander.deucher@....com>
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@...onical.com>

Reviewed-by: Mario Limonciello <mario.limonciello@....com>

I've applied to this to amd-staging-drm-next, thanks!

> ---
> v2:
>  - Rename the quirk function.
> 
>  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            | 17 +----------------
>  4 files changed, 18 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index 164141bc8b4a..5f3b139c1f99 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -1272,6 +1272,7 @@ 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 c4a4e2fe6681..05a34ff79e78 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -80,6 +80,10 @@
> 
>  #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");
> @@ -1356,6 +1360,17 @@ 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 855d390c41de..26733263913e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/nv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/nv.c
> @@ -578,7 +578,7 @@ static void nv_pcie_gen3_enable(struct
> amdgpu_device *adev)
> 
>  static void nv_program_aspm(struct amdgpu_device *adev)
>  {
> -	if (!amdgpu_device_should_use_aspm(adev))
> +	if (!amdgpu_device_should_use_aspm(adev) ||
> !amdgpu_device_aspm_support_quirk())
>  		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 12ef782eb478..ceab8783575c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vi.c
> @@ -81,10 +81,6 @@
>  #include "mxgpu_vi.h"
>  #include "amdgpu_dm.h"
> 
> -#if IS_ENABLED(CONFIG_X86)
> -#include <asm/intel-family.h>
> -#endif
> -
>  #define ixPCIE_LC_L1_PM_SUBSTATE	0x100100C6
>  #define
> PCIE_LC_L1_PM_SUBSTATE__LC_L1_SUBSTATES_OVERRIDE_EN_MASK
> 	0x00000001L
>  #define PCIE_LC_L1_PM_SUBSTATE__LC_PCI_PM_L1_2_OVERRIDE_MASK
> 	0x00000002L
> @@ -1138,24 +1134,13 @@ static void vi_enable_aspm(struct
> amdgpu_device *adev)
>  		WREG32_PCIE(ixPCIE_LC_CNTL, data);
>  }
> 
> -static bool aspm_support_quirk_check(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
> -}
> -
>  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) ||
> !aspm_support_quirk_check())
> +	if (!amdgpu_device_should_use_aspm(adev) ||
> !amdgpu_device_aspm_support_quirk())
>  		return;
> 
>  	if (adev->flags & AMD_IS_APU ||
> --
> 2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ