Skip to content

Commit 73eab78

Browse files
superm1alexdeucher
authored andcommitted
drm/amd: Adjust output for discovery error handling
commit 017fbb6 ("drm/amdgpu/discovery: check ip_discovery fw file available") added support for reading an amdgpu IP discovery bin file for some specific products. If it's not found then it will fallback to hardcoded values. However if it's not found there is also a lot of noise about missing files and errors. Adjust the error handling to decrease most messages to DEBUG and to show users less about missing files. Reviewed-by: Lijo Lazar <[email protected]> Reported-by: Marcus Seyfarth <[email protected]> Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4312 Tested-by: Marcus Seyfarth <[email protected]> Fixes: 017fbb6 ("drm/amdgpu/discovery: check ip_discovery fw file available") Acked-by: Alex Deucher <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mario Limonciello <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit 49f1f9f)
1 parent 99579c5 commit 73eab78

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

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

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,12 @@ static int amdgpu_discovery_read_binary_from_file(struct amdgpu_device *adev,
321321
const struct firmware *fw;
322322
int r;
323323

324-
r = request_firmware(&fw, fw_name, adev->dev);
324+
r = firmware_request_nowarn(&fw, fw_name, adev->dev);
325325
if (r) {
326-
dev_err(adev->dev, "can't load firmware \"%s\"\n",
327-
fw_name);
326+
if (amdgpu_discovery == 2)
327+
dev_err(adev->dev, "can't load firmware \"%s\"\n", fw_name);
328+
else
329+
drm_info(&adev->ddev, "Optional firmware \"%s\" was not found\n", fw_name);
328330
return r;
329331
}
330332

@@ -459,16 +461,12 @@ static int amdgpu_discovery_init(struct amdgpu_device *adev)
459461
/* Read from file if it is the preferred option */
460462
fw_name = amdgpu_discovery_get_fw_name(adev);
461463
if (fw_name != NULL) {
462-
dev_info(adev->dev, "use ip discovery information from file");
464+
drm_dbg(&adev->ddev, "use ip discovery information from file");
463465
r = amdgpu_discovery_read_binary_from_file(adev, adev->mman.discovery_bin, fw_name);
464-
465-
if (r) {
466-
dev_err(adev->dev, "failed to read ip discovery binary from file\n");
467-
r = -EINVAL;
466+
if (r)
468467
goto out;
469-
}
470-
471468
} else {
469+
drm_dbg(&adev->ddev, "use ip discovery information from memory");
472470
r = amdgpu_discovery_read_binary_from_mem(
473471
adev, adev->mman.discovery_bin);
474472
if (r)
@@ -1338,10 +1336,8 @@ static int amdgpu_discovery_reg_base_init(struct amdgpu_device *adev)
13381336
int r;
13391337

13401338
r = amdgpu_discovery_init(adev);
1341-
if (r) {
1342-
DRM_ERROR("amdgpu_discovery_init failed\n");
1339+
if (r)
13431340
return r;
1344-
}
13451341

13461342
wafl_ver = 0;
13471343
adev->gfx.xcc_mask = 0;
@@ -2579,8 +2575,10 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
25792575
break;
25802576
default:
25812577
r = amdgpu_discovery_reg_base_init(adev);
2582-
if (r)
2583-
return -EINVAL;
2578+
if (r) {
2579+
drm_err(&adev->ddev, "discovery failed: %d\n", r);
2580+
return r;
2581+
}
25842582

25852583
amdgpu_discovery_harvest_ip(adev);
25862584
amdgpu_discovery_get_gfx_info(adev);

0 commit comments

Comments
 (0)