Skip to content

Commit 80afdfa

Browse files
committed
drm/edid/firmware: stop using a throwaway platform device
We've used a temporary platform device for firmware EDID loading since it was introduced in commit da0df92 ("drm: allow loading an EDID as firmware to override broken monitor"), but there's no explanation why. Using a temporary device does not play well with CONFIG_FW_CACHE=y, which caches firmware images (e.g. on suspend) so that drivers can request firmware when the system is not ready for it, and return the images from the cache (e.g. during resume). This works automatically for regular devices, but obviously not for a temporarily created device. Stop using the throwaway platform device, and use the drm device instead. Note that this may still be problematic for cases where the display was plugged in during suspend, and the firmware wasn't loaded and therefore not cached before suspend. References: https://lore.kernel.org/r/[email protected] Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/2061 Reported-by: Matthieu CHARETTE <[email protected]> Tested-by: Matthieu CHARETTE <[email protected]> Cc: Ville Syrjälä <[email protected]> Signed-off-by: Jani Nikula <[email protected]> Acked-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 0ba2fa8 commit 80afdfa

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

drivers/gpu/drm/drm_edid_load.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -172,20 +172,9 @@ static const struct drm_edid *edid_load(struct drm_connector *connector, const c
172172
fwdata = generic_edid[builtin];
173173
fwsize = sizeof(generic_edid[builtin]);
174174
} else {
175-
struct platform_device *pdev;
176175
int err;
177176

178-
pdev = platform_device_register_simple(connector->name, -1, NULL, 0);
179-
if (IS_ERR(pdev)) {
180-
drm_err(connector->dev,
181-
"[CONNECTOR:%d:%s] Failed to register EDID firmware platform device for connector \"%s\"\n",
182-
connector->base.id, connector->name,
183-
connector->name);
184-
return ERR_CAST(pdev);
185-
}
186-
187-
err = request_firmware(&fw, name, &pdev->dev);
188-
platform_device_unregister(pdev);
177+
err = request_firmware(&fw, name, connector->dev->dev);
189178
if (err) {
190179
drm_err(connector->dev,
191180
"[CONNECTOR:%d:%s] Requesting EDID firmware \"%s\" failed (err=%d)\n",

0 commit comments

Comments
 (0)