Skip to content

Commit 866bd5e

Browse files
committed
Merge tag 'amd-drm-fixes-5.5-2020-01-01' of git://people.freedesktop.org/~agd5f/linux into drm-fixes
amd-drm-fixes-5.5-2020-01-01: amdgpu: - ATPX regression fix - SMU metrics table locking fixes - gfxoff fix for raven - RLC firmware loading stability fix Signed-off-by: Dave Airlie <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents e7cbcb1 + 969e115 commit 866bd5e

File tree

9 files changed

+28
-14
lines changed

9 files changed

+28
-14
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,17 @@ static bool amdgpu_atpx_detect(void)
613613
bool d3_supported = false;
614614
struct pci_dev *parent_pdev;
615615

616-
while ((pdev = pci_get_class(PCI_BASE_CLASS_DISPLAY << 16, pdev)) != NULL) {
616+
while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) {
617+
vga_count++;
618+
619+
has_atpx |= (amdgpu_atpx_pci_probe_handle(pdev) == true);
620+
621+
parent_pdev = pci_upstream_bridge(pdev);
622+
d3_supported |= parent_pdev && parent_pdev->bridge_d3;
623+
amdgpu_atpx_get_quirks(pdev);
624+
}
625+
626+
while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_OTHER << 8, pdev)) != NULL) {
617627
vga_count++;
618628

619629
has_atpx |= (amdgpu_atpx_pci_probe_handle(pdev) == true);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1488,7 +1488,7 @@ static int psp_np_fw_load(struct psp_context *psp)
14881488

14891489
/* Start rlc autoload after psp recieved all the gfx firmware */
14901490
if (psp->autoload_supported && ucode->ucode_id == (amdgpu_sriov_vf(adev) ?
1491-
AMDGPU_UCODE_ID_CP_MEC2 : AMDGPU_UCODE_ID_RLC_RESTORE_LIST_SRM_MEM)) {
1491+
AMDGPU_UCODE_ID_CP_MEC2 : AMDGPU_UCODE_ID_RLC_G)) {
14921492
ret = psp_rlc_autoload(psp);
14931493
if (ret) {
14941494
DRM_ERROR("Failed to start rlc autoload\n");

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,10 @@ enum AMDGPU_UCODE_ID {
292292
AMDGPU_UCODE_ID_CP_MEC2_JT,
293293
AMDGPU_UCODE_ID_CP_MES,
294294
AMDGPU_UCODE_ID_CP_MES_DATA,
295-
AMDGPU_UCODE_ID_RLC_G,
296295
AMDGPU_UCODE_ID_RLC_RESTORE_LIST_CNTL,
297296
AMDGPU_UCODE_ID_RLC_RESTORE_LIST_GPM_MEM,
298297
AMDGPU_UCODE_ID_RLC_RESTORE_LIST_SRM_MEM,
298+
AMDGPU_UCODE_ID_RLC_G,
299299
AMDGPU_UCODE_ID_STORAGE,
300300
AMDGPU_UCODE_ID_SMC,
301301
AMDGPU_UCODE_ID_UVD,

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

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,17 +1052,10 @@ static void gfx_v9_0_check_if_need_gfxoff(struct amdgpu_device *adev)
10521052
case CHIP_VEGA20:
10531053
break;
10541054
case CHIP_RAVEN:
1055-
/* Disable GFXOFF on original raven. There are combinations
1056-
* of sbios and platforms that are not stable.
1057-
*/
1058-
if (!(adev->rev_id >= 0x8 || adev->pdev->device == 0x15d8))
1059-
adev->pm.pp_feature &= ~PP_GFXOFF_MASK;
1060-
else if (!(adev->rev_id >= 0x8 || adev->pdev->device == 0x15d8)
1061-
&&((adev->gfx.rlc_fw_version != 106 &&
1062-
adev->gfx.rlc_fw_version < 531) ||
1063-
(adev->gfx.rlc_fw_version == 53815) ||
1064-
(adev->gfx.rlc_feature_version < 1) ||
1065-
!adev->gfx.rlc.is_rlc_v2_1))
1055+
if (!(adev->rev_id >= 0x8 ||
1056+
adev->pdev->device == 0x15d8) &&
1057+
(adev->pm.fw_version < 0x41e2b || /* not raven1 fresh */
1058+
!adev->gfx.rlc.is_rlc_v2_1)) /* without rlc save restore ucodes */
10661059
adev->pm.pp_feature &= ~PP_GFXOFF_MASK;
10671060

10681061
if (adev->pm.pp_feature & PP_GFXOFF_MASK)

drivers/gpu/drm/amd/powerplay/amdgpu_smu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,7 @@ static int smu_sw_init(void *handle)
866866
smu->smu_baco.platform_support = false;
867867

868868
mutex_init(&smu->sensor_lock);
869+
mutex_init(&smu->metrics_lock);
869870

870871
smu->watermarks_bitmap = 0;
871872
smu->power_profile_mode = PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT;

drivers/gpu/drm/amd/powerplay/arcturus_ppt.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,18 +862,21 @@ static int arcturus_get_metrics_table(struct smu_context *smu,
862862
struct smu_table_context *smu_table= &smu->smu_table;
863863
int ret = 0;
864864

865+
mutex_lock(&smu->metrics_lock);
865866
if (!smu_table->metrics_time ||
866867
time_after(jiffies, smu_table->metrics_time + HZ / 1000)) {
867868
ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS, 0,
868869
(void *)smu_table->metrics_table, false);
869870
if (ret) {
870871
pr_info("Failed to export SMU metrics table!\n");
872+
mutex_unlock(&smu->metrics_lock);
871873
return ret;
872874
}
873875
smu_table->metrics_time = jiffies;
874876
}
875877

876878
memcpy(metrics_table, smu_table->metrics_table, sizeof(SmuMetrics_t));
879+
mutex_unlock(&smu->metrics_lock);
877880

878881
return ret;
879882
}

drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ struct smu_context
349349
const struct pptable_funcs *ppt_funcs;
350350
struct mutex mutex;
351351
struct mutex sensor_lock;
352+
struct mutex metrics_lock;
352353
uint64_t pool_size;
353354

354355
struct smu_table_context smu_table;

drivers/gpu/drm/amd/powerplay/navi10_ppt.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,17 +562,20 @@ static int navi10_get_metrics_table(struct smu_context *smu,
562562
struct smu_table_context *smu_table= &smu->smu_table;
563563
int ret = 0;
564564

565+
mutex_lock(&smu->metrics_lock);
565566
if (!smu_table->metrics_time || time_after(jiffies, smu_table->metrics_time + msecs_to_jiffies(100))) {
566567
ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS, 0,
567568
(void *)smu_table->metrics_table, false);
568569
if (ret) {
569570
pr_info("Failed to export SMU metrics table!\n");
571+
mutex_unlock(&smu->metrics_lock);
570572
return ret;
571573
}
572574
smu_table->metrics_time = jiffies;
573575
}
574576

575577
memcpy(metrics_table, smu_table->metrics_table, sizeof(SmuMetrics_t));
578+
mutex_unlock(&smu->metrics_lock);
576579

577580
return ret;
578581
}

drivers/gpu/drm/amd/powerplay/vega20_ppt.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,17 +1678,20 @@ static int vega20_get_metrics_table(struct smu_context *smu,
16781678
struct smu_table_context *smu_table= &smu->smu_table;
16791679
int ret = 0;
16801680

1681+
mutex_lock(&smu->metrics_lock);
16811682
if (!smu_table->metrics_time || time_after(jiffies, smu_table->metrics_time + HZ / 1000)) {
16821683
ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS, 0,
16831684
(void *)smu_table->metrics_table, false);
16841685
if (ret) {
16851686
pr_info("Failed to export SMU metrics table!\n");
1687+
mutex_unlock(&smu->metrics_lock);
16861688
return ret;
16871689
}
16881690
smu_table->metrics_time = jiffies;
16891691
}
16901692

16911693
memcpy(metrics_table, smu_table->metrics_table, sizeof(SmuMetrics_t));
1694+
mutex_unlock(&smu->metrics_lock);
16921695

16931696
return ret;
16941697
}

0 commit comments

Comments
 (0)