Skip to contentSkip to conversation

drm/tilcdc: Fix the driver data used in suspend and resume

PATCH In review Màxim Pedraza Padilla 2 participants 3 messages Dec 1

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/tilcdc: Fix the driver data used in suspend and resume

The probe stores the driver private structure as driver data, but the suspend and resume callbacks read it back as a struct drm_device. Since the DRM device is embedded in the private structure, but not at its start, they pass a wrong pointer to drm_mode_config_helper_suspend() and drm_mode_config_helper_resume(), and suspend oopses:

  Unable to handle kernel paging request at virtual address 3bd8be0c

Get the private structure and use the DRM device embedded in it.

Fixes 3301302060da ("drm/tilcdc: Modernize driver initialization and cleanup paths")
Assisted-by Claude:claude-opus-5-5
---
 drivers/gpu/drm/tilcdc/tilcdc_drv.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/tilcdc/tilcdc_drv.c +4 -2
index 1d6c9a423a41..e82cb2686c5f 100644
@@ -235,7 +235,8 @@ static const struct drm_driver tilcdc_driver = {
 
 static int tilcdc_pm_suspend(struct device *dev)
 {
-	struct drm_device *ddev = dev_get_drvdata(dev);
+	struct tilcdc_drm_private *priv = dev_get_drvdata(dev);
+	struct drm_device *ddev = &priv->ddev;
 	int ret = 0;
 
 	ret = drm_mode_config_helper_suspend(ddev);
@@ -248,7 +249,8 @@ static int tilcdc_pm_suspend(struct device *dev)
 
 static int tilcdc_pm_resume(struct device *dev)
 {
-	struct drm_device *ddev = dev_get_drvdata(dev);
+	struct tilcdc_drm_private *priv = dev_get_drvdata(dev);
+	struct drm_device *ddev = &priv->ddev;
 
 	/* Select default pin state */
 	pinctrl_pm_select_default_state(dev);

base-commit: 5ce32a0c94a827ff44ee60898c28060714dcff75

Signature · 1 line
2.39.5
#1 lore raw
Quoted 9 lines · Màxim Pedraza Padilla

The probe stores the driver private structure as driver data, but the suspend and resume callbacks read it back as a struct drm_device. Since the DRM device is embedded in the private structure, but not at its start, they pass a wrong pointer to drm_mode_config_helper_suspend() and drm_mode_config_helper_resume(), and suspend oopses:

   Unable to handle kernel paging request at virtual address 3bd8be0c

Get the private structure and use the DRM device embedded in it.

This has already been fixed.
https://lore.kernel.org/lkml/20261103-v7-4-topic-am335lpm-tilcdc-v1-1-b7f91f9c9a05@baylibre.com/

Signature · 3 lines
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com