Skip to content

Commit 7de13cc

Browse files
committed
drm/i915/dmc: handle request_firmware() errors separately
Clarify request_firmware() error handling. Don't proceed to trying to parse non-existent firmware or check for payload when request_firmware() failed to begin with. There's no reason to release_firmware() either when request_firmware() failed. Also move the message about DMC firmware homepage here, as in other cases the user probably has some firmware, although its parsing fails for some reason. Reviewed-by: Gustavo Sousa <[email protected]> Acked-by: Lucas De Marchi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/0654bb3480f8d2103225d26f665badead5495532.1713519628.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <[email protected]>
1 parent d08184a commit 7de13cc

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

drivers/gpu/drm/i915/display/intel_dmc.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,15 @@ static void dmc_load_work_fn(struct work_struct *work)
942942
}
943943
}
944944

945+
if (err) {
946+
drm_notice(&i915->drm,
947+
"Failed to load DMC firmware %s (%pe). Disabling runtime power management.\n",
948+
dmc->fw_path, ERR_PTR(err));
949+
drm_notice(&i915->drm, "DMC firmware homepage: %s",
950+
INTEL_DMC_FIRMWARE_URL);
951+
return;
952+
}
953+
945954
parse_dmc_fw(dmc, fw);
946955

947956
if (intel_dmc_has_payload(i915)) {
@@ -956,8 +965,6 @@ static void dmc_load_work_fn(struct work_struct *work)
956965
"Failed to load DMC firmware %s."
957966
" Disabling runtime power management.\n",
958967
dmc->fw_path);
959-
drm_notice(&i915->drm, "DMC firmware homepage: %s",
960-
INTEL_DMC_FIRMWARE_URL);
961968
}
962969

963970
release_firmware(fw);

0 commit comments

Comments
 (0)