Skip to content

Commit 1d37040

Browse files
alexdeuchergregkh
authored andcommitted
drm/amdgpu/discovery: fix fw based ip discovery
commit 514678d upstream. We only need the fw based discovery table for sysfs. No need to parse it. Additionally parsing some of the board specific tables may result in incorrect data on some boards. just load the binary and don't parse it on those boards. Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4441 Fixes: 80a0e82 ("drm/amdgpu/discovery: optionally use fw based ip discovery") Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 62eedd1) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 56b9557 commit 1d37040

File tree

2 files changed

+41
-36
lines changed

2 files changed

+41
-36
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2561,9 +2561,6 @@ static int amdgpu_device_parse_gpu_info_fw(struct amdgpu_device *adev)
25612561

25622562
adev->firmware.gpu_info_fw = NULL;
25632563

2564-
if (adev->mman.discovery_bin)
2565-
return 0;
2566-
25672564
switch (adev->asic_type) {
25682565
default:
25692566
return 0;
@@ -2585,6 +2582,8 @@ static int amdgpu_device_parse_gpu_info_fw(struct amdgpu_device *adev)
25852582
chip_name = "arcturus";
25862583
break;
25872584
case CHIP_NAVI12:
2585+
if (adev->mman.discovery_bin)
2586+
return 0;
25882587
chip_name = "navi12";
25892588
break;
25902589
}

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

Lines changed: 39 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2555,40 +2555,11 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
25552555

25562556
switch (adev->asic_type) {
25572557
case CHIP_VEGA10:
2558-
case CHIP_VEGA12:
2559-
case CHIP_RAVEN:
2560-
case CHIP_VEGA20:
2561-
case CHIP_ARCTURUS:
2562-
case CHIP_ALDEBARAN:
2563-
/* this is not fatal. We have a fallback below
2564-
* if the new firmwares are not present. some of
2565-
* this will be overridden below to keep things
2566-
* consistent with the current behavior.
2558+
/* This is not fatal. We only need the discovery
2559+
* binary for sysfs. We don't need it for a
2560+
* functional system.
25672561
*/
2568-
r = amdgpu_discovery_reg_base_init(adev);
2569-
if (!r) {
2570-
amdgpu_discovery_harvest_ip(adev);
2571-
amdgpu_discovery_get_gfx_info(adev);
2572-
amdgpu_discovery_get_mall_info(adev);
2573-
amdgpu_discovery_get_vcn_info(adev);
2574-
}
2575-
break;
2576-
default:
2577-
r = amdgpu_discovery_reg_base_init(adev);
2578-
if (r) {
2579-
drm_err(&adev->ddev, "discovery failed: %d\n", r);
2580-
return r;
2581-
}
2582-
2583-
amdgpu_discovery_harvest_ip(adev);
2584-
amdgpu_discovery_get_gfx_info(adev);
2585-
amdgpu_discovery_get_mall_info(adev);
2586-
amdgpu_discovery_get_vcn_info(adev);
2587-
break;
2588-
}
2589-
2590-
switch (adev->asic_type) {
2591-
case CHIP_VEGA10:
2562+
amdgpu_discovery_init(adev);
25922563
vega10_reg_base_init(adev);
25932564
adev->sdma.num_instances = 2;
25942565
adev->gmc.num_umc = 4;
@@ -2611,6 +2582,11 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
26112582
adev->ip_versions[DCI_HWIP][0] = IP_VERSION(12, 0, 0);
26122583
break;
26132584
case CHIP_VEGA12:
2585+
/* This is not fatal. We only need the discovery
2586+
* binary for sysfs. We don't need it for a
2587+
* functional system.
2588+
*/
2589+
amdgpu_discovery_init(adev);
26142590
vega10_reg_base_init(adev);
26152591
adev->sdma.num_instances = 2;
26162592
adev->gmc.num_umc = 4;
@@ -2633,6 +2609,11 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
26332609
adev->ip_versions[DCI_HWIP][0] = IP_VERSION(12, 0, 1);
26342610
break;
26352611
case CHIP_RAVEN:
2612+
/* This is not fatal. We only need the discovery
2613+
* binary for sysfs. We don't need it for a
2614+
* functional system.
2615+
*/
2616+
amdgpu_discovery_init(adev);
26362617
vega10_reg_base_init(adev);
26372618
adev->sdma.num_instances = 1;
26382619
adev->vcn.num_vcn_inst = 1;
@@ -2674,6 +2655,11 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
26742655
}
26752656
break;
26762657
case CHIP_VEGA20:
2658+
/* This is not fatal. We only need the discovery
2659+
* binary for sysfs. We don't need it for a
2660+
* functional system.
2661+
*/
2662+
amdgpu_discovery_init(adev);
26772663
vega20_reg_base_init(adev);
26782664
adev->sdma.num_instances = 2;
26792665
adev->gmc.num_umc = 8;
@@ -2697,6 +2683,11 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
26972683
adev->ip_versions[DCI_HWIP][0] = IP_VERSION(12, 1, 0);
26982684
break;
26992685
case CHIP_ARCTURUS:
2686+
/* This is not fatal. We only need the discovery
2687+
* binary for sysfs. We don't need it for a
2688+
* functional system.
2689+
*/
2690+
amdgpu_discovery_init(adev);
27002691
arct_reg_base_init(adev);
27012692
adev->sdma.num_instances = 8;
27022693
adev->vcn.num_vcn_inst = 2;
@@ -2725,6 +2716,11 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
27252716
adev->ip_versions[UVD_HWIP][1] = IP_VERSION(2, 5, 0);
27262717
break;
27272718
case CHIP_ALDEBARAN:
2719+
/* This is not fatal. We only need the discovery
2720+
* binary for sysfs. We don't need it for a
2721+
* functional system.
2722+
*/
2723+
amdgpu_discovery_init(adev);
27282724
aldebaran_reg_base_init(adev);
27292725
adev->sdma.num_instances = 5;
27302726
adev->vcn.num_vcn_inst = 2;
@@ -2751,6 +2747,16 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
27512747
adev->ip_versions[XGMI_HWIP][0] = IP_VERSION(6, 1, 0);
27522748
break;
27532749
default:
2750+
r = amdgpu_discovery_reg_base_init(adev);
2751+
if (r) {
2752+
drm_err(&adev->ddev, "discovery failed: %d\n", r);
2753+
return r;
2754+
}
2755+
2756+
amdgpu_discovery_harvest_ip(adev);
2757+
amdgpu_discovery_get_gfx_info(adev);
2758+
amdgpu_discovery_get_mall_info(adev);
2759+
amdgpu_discovery_get_vcn_info(adev);
27542760
break;
27552761
}
27562762

0 commit comments

Comments
 (0)