aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hovold <johan+linaro@kernel.org>2022-10-25 10:35:49 +0200
committerManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>2023-03-13 16:03:03 +0530
commitb58ec1257ed2bf2e596bed83eb2002ea83697ccd (patch)
treef35f855cf81849cae3b6836117d86e672a2ff1dc
parent5681ba11481877f74e57b7536776b6500952855b (diff)
hack: drm/probe-helper: fix crash on early hotplug event
The PMIC GLINK altmode driver is broken and can forward notifications before the DRM driver is ready to receive them. To make things worse, the DRM subsystem also enables forwarding of these notifications before things have been fully initialised (this bit appears to have been fixed in 6.3). Taken together and depending on timing, this can lead to dropped hotplug notifications or a NULL-pointer dereference during boot. Work around the immediate issue and trigger a WARN() until this has been fixed properly. Link: https://lore.kernel.org/lkml/Y1efJh11B5UQZ0Tz@hovoldconsulting.com/ Link: https://lore.kernel.org/lkml/Y86vaTQR7INWezyj@hovoldconsulting.com/ Not-signed-off-by: Johan Hovold <johan+linaro@kernel.org>
-rw-r--r--drivers/gpu/drm/drm_probe_helper.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index bcd9611dabfd..6a20def83d5a 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -660,7 +660,9 @@ void drm_kms_helper_hotplug_event(struct drm_device *dev)
{
/* send a uevent + call fbdev */
drm_sysfs_hotplug_event(dev);
- if (dev->mode_config.funcs->output_poll_changed)
+
+ WARN_ON(!dev->mode_config.funcs);
+ if (dev->mode_config.funcs && dev->mode_config.funcs->output_poll_changed)
dev->mode_config.funcs->output_poll_changed(dev);
drm_client_dev_hotplug(dev);