drm/tilcdc: Fix the driver data used in suspend and resume
Subsystems (4)
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.
--- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/tilcdc/tilcdc_drv.c +4 -2
@@ -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
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 todrm_mode_config_helper_suspend()anddrm_mode_config_helper_resume(), and suspend oopses:Unable to handle kernel paging request at virtual address 3bd8be0cGet 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
Hi Kory,
Quoted 2 lines · Kory Maincent
This has already been fixed.
https://lore.kernel.org/lkml/20261103-v7-4-topic-am335lpm-tilcdc-v1-1-b7f91f9c9a05@baylibre.com/
Thanks, I missed it as I only checked drm-misc-next. Please disregard mine.
Màxim