Skip to content

Commit 9225818

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 daaea17 commit 9225818

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
@@ -2387,9 +2387,6 @@ static int amdgpu_device_parse_gpu_info_fw(struct amdgpu_device *adev)
23872387

23882388
adev->firmware.gpu_info_fw = NULL;
23892389

2390-
if (adev->mman.discovery_bin)
2391-
return 0;
2392-
23932390
switch (adev->asic_type) {
23942391
default:
23952392
return 0;
@@ -2411,6 +2408,8 @@ static int amdgpu_device_parse_gpu_info_fw(struct amdgpu_device *adev)
24112408
chip_name = "arcturus";
24122409
break;
24132410
case CHIP_NAVI12:
2411+
if (adev->mman.discovery_bin)
2412+
return 0;
24142413
chip_name = "navi12";
24152414
break;
24162415
}

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

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

24562456
switch (adev->asic_type) {
24572457
case CHIP_VEGA10:
2458-
case CHIP_VEGA12:
2459-
case CHIP_RAVEN:
2460-
case CHIP_VEGA20:
2461-
case CHIP_ARCTURUS:
2462-
case CHIP_ALDEBARAN:
2463-
/* this is not fatal. We have a fallback below
2464-
* if the new firmwares are not present. some of
2465-
* this will be overridden below to keep things
2466-
* consistent with the current behavior.
2458+
/* This is not fatal. We only need the discovery
2459+
* binary for sysfs. We don't need it for a
2460+
* functional system.
24672461
*/
2468-
r = amdgpu_discovery_reg_base_init(adev);
2469-
if (!r) {
2470-
amdgpu_discovery_harvest_ip(adev);
2471-
amdgpu_discovery_get_gfx_info(adev);
2472-
amdgpu_discovery_get_mall_info(adev);
2473-
amdgpu_discovery_get_vcn_info(adev);
2474-
}
2475-
break;
2476-
default:
2477-
r = amdgpu_discovery_reg_base_init(adev);
2478-
if (r) {
2479-
drm_err(&adev->ddev, "discovery failed: %d\n", r);
2480-
return r;
2481-
}
2482-
2483-
amdgpu_discovery_harvest_ip(adev);
2484-
amdgpu_discovery_get_gfx_info(adev);
2485-
amdgpu_discovery_get_mall_info(adev);
2486-
amdgpu_discovery_get_vcn_info(adev);
2487-
break;
2488-
}
2489-
2490-
switch (adev->asic_type) {
2491-
case CHIP_VEGA10:
2462+
amdgpu_discovery_init(adev);
24922463
vega10_reg_base_init(adev);
24932464
adev->sdma.num_instances = 2;
24942465
adev->gmc.num_umc = 4;
@@ -2511,6 +2482,11 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
25112482
adev->ip_versions[DCI_HWIP][0] = IP_VERSION(12, 0, 0);
25122483
break;
25132484
case CHIP_VEGA12:
2485+
/* This is not fatal. We only need the discovery
2486+
* binary for sysfs. We don't need it for a
2487+
* functional system.
2488+
*/
2489+
amdgpu_discovery_init(adev);
25142490
vega10_reg_base_init(adev);
25152491
adev->sdma.num_instances = 2;
25162492
adev->gmc.num_umc = 4;
@@ -2533,6 +2509,11 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
25332509
adev->ip_versions[DCI_HWIP][0] = IP_VERSION(12, 0, 1);
25342510
break;
25352511
case CHIP_RAVEN:
2512+
/* This is not fatal. We only need the discovery
2513+
* binary for sysfs. We don't need it for a
2514+
* functional system.
2515+
*/
2516+
amdgpu_discovery_init(adev);
25362517
vega10_reg_base_init(adev);
25372518
adev->sdma.num_instances = 1;
25382519
adev->vcn.num_vcn_inst = 1;
@@ -2572,6 +2553,11 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
25722553
}
25732554
break;
25742555
case CHIP_VEGA20:
2556+
/* This is not fatal. We only need the discovery
2557+
* binary for sysfs. We don't need it for a
2558+
* functional system.
2559+
*/
2560+
amdgpu_discovery_init(adev);
25752561
vega20_reg_base_init(adev);
25762562
adev->sdma.num_instances = 2;
25772563
adev->gmc.num_umc = 8;
@@ -2595,6 +2581,11 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
25952581
adev->ip_versions[DCI_HWIP][0] = IP_VERSION(12, 1, 0);
25962582
break;
25972583
case CHIP_ARCTURUS:
2584+
/* This is not fatal. We only need the discovery
2585+
* binary for sysfs. We don't need it for a
2586+
* functional system.
2587+
*/
2588+
amdgpu_discovery_init(adev);
25982589
arct_reg_base_init(adev);
25992590
adev->sdma.num_instances = 8;
26002591
adev->vcn.num_vcn_inst = 2;
@@ -2623,6 +2614,11 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
26232614
adev->ip_versions[UVD_HWIP][1] = IP_VERSION(2, 5, 0);
26242615
break;
26252616
case CHIP_ALDEBARAN:
2617+
/* This is not fatal. We only need the discovery
2618+
* binary for sysfs. We don't need it for a
2619+
* functional system.
2620+
*/
2621+
amdgpu_discovery_init(adev);
26262622
aldebaran_reg_base_init(adev);
26272623
adev->sdma.num_instances = 5;
26282624
adev->vcn.num_vcn_inst = 2;
@@ -2649,6 +2645,16 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
26492645
adev->ip_versions[XGMI_HWIP][0] = IP_VERSION(6, 1, 0);
26502646
break;
26512647
default:
2648+
r = amdgpu_discovery_reg_base_init(adev);
2649+
if (r) {
2650+
drm_err(&adev->ddev, "discovery failed: %d\n", r);
2651+
return r;
2652+
}
2653+
2654+
amdgpu_discovery_harvest_ip(adev);
2655+
amdgpu_discovery_get_gfx_info(adev);
2656+
amdgpu_discovery_get_mall_info(adev);
2657+
amdgpu_discovery_get_vcn_info(adev);
26522658
break;
26532659
}
26542660

0 commit comments

Comments
 (0)