Skip to content

Commit 1886230

Browse files
superm1alexdeucher
authored andcommitted
drm/amd: Move helper for dynamic speed switch check out of smu13
This helper is used for checking if the connected host supports the feature, it can be moved into generic code to be used by other smu implementations as well. Signed-off-by: Mario Limonciello <[email protected]> Reviewed-by: Evan Quan <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected] # 6.1.x
1 parent 31c7a3b commit 1886230

File tree

3 files changed

+21
-20
lines changed

3 files changed

+21
-20
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,6 +1296,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
12961296
void amdgpu_device_pci_config_reset(struct amdgpu_device *adev);
12971297
int amdgpu_device_pci_reset(struct amdgpu_device *adev);
12981298
bool amdgpu_device_need_post(struct amdgpu_device *adev);
1299+
bool amdgpu_device_pcie_dynamic_switching_supported(void);
12991300
bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev);
13001301
bool amdgpu_device_aspm_support_quirk(void);
13011302

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,6 +1458,25 @@ bool amdgpu_device_need_post(struct amdgpu_device *adev)
14581458
return true;
14591459
}
14601460

1461+
/*
1462+
* Intel hosts such as Raptor Lake and Sapphire Rapids don't support dynamic
1463+
* speed switching. Until we have confirmation from Intel that a specific host
1464+
* supports it, it's safer that we keep it disabled for all.
1465+
*
1466+
* https://edc.intel.com/content/www/us/en/design/products/platforms/details/raptor-lake-s/13th-generation-core-processors-datasheet-volume-1-of-2/005/pci-express-support/
1467+
* https://gitlab.freedesktop.org/drm/amd/-/issues/2663
1468+
*/
1469+
bool amdgpu_device_pcie_dynamic_switching_supported(void)
1470+
{
1471+
#if IS_ENABLED(CONFIG_X86)
1472+
struct cpuinfo_x86 *c = &cpu_data(0);
1473+
1474+
if (c->x86_vendor == X86_VENDOR_INTEL)
1475+
return false;
1476+
#endif
1477+
return true;
1478+
}
1479+
14611480
/**
14621481
* amdgpu_device_should_use_aspm - check if the device should program ASPM
14631482
*

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2425,25 +2425,6 @@ int smu_v13_0_mode1_reset(struct smu_context *smu)
24252425
return ret;
24262426
}
24272427

2428-
/*
2429-
* Intel hosts such as Raptor Lake and Sapphire Rapids don't support dynamic
2430-
* speed switching. Until we have confirmation from Intel that a specific host
2431-
* supports it, it's safer that we keep it disabled for all.
2432-
*
2433-
* https://edc.intel.com/content/www/us/en/design/products/platforms/details/raptor-lake-s/13th-generation-core-processors-datasheet-volume-1-of-2/005/pci-express-support/
2434-
* https://gitlab.freedesktop.org/drm/amd/-/issues/2663
2435-
*/
2436-
static bool smu_v13_0_is_pcie_dynamic_switching_supported(void)
2437-
{
2438-
#if IS_ENABLED(CONFIG_X86)
2439-
struct cpuinfo_x86 *c = &cpu_data(0);
2440-
2441-
if (c->x86_vendor == X86_VENDOR_INTEL)
2442-
return false;
2443-
#endif
2444-
return true;
2445-
}
2446-
24472428
int smu_v13_0_update_pcie_parameters(struct smu_context *smu,
24482429
uint32_t pcie_gen_cap,
24492430
uint32_t pcie_width_cap)
@@ -2455,7 +2436,7 @@ int smu_v13_0_update_pcie_parameters(struct smu_context *smu,
24552436
uint32_t smu_pcie_arg;
24562437
int ret, i;
24572438

2458-
if (!smu_v13_0_is_pcie_dynamic_switching_supported()) {
2439+
if (!amdgpu_device_pcie_dynamic_switching_supported()) {
24592440
if (pcie_table->pcie_gen[num_of_levels - 1] < pcie_gen_cap)
24602441
pcie_gen_cap = pcie_table->pcie_gen[num_of_levels - 1];
24612442

0 commit comments

Comments
 (0)