2023-04-12 18:31:46

by James Cowgill

[permalink] [raw]
Subject: [RESEND PATCH] drm/panel: otm8009a: Set backlight parent to panel device

This is the logical place to put the backlight device, and it also
fixes a kernel crash if the MIPI host is removed. Previously the
backlight device would be unregistered twice when this happened - once
as a child of the MIPI host through `mipi_dsi_host_unregister`, and
once when the panel device is destroyed.

Fixes: 12a6cbd4f3f1 ("drm/panel: otm8009a: Use new backlight API")
Signed-off-by: James Cowgill <[email protected]>
Cc: [email protected]
---
drivers/gpu/drm/panel/panel-orisetech-otm8009a.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c b/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c
index b4729a94c34a8..898b892f11439 100644
--- a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c
+++ b/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c
@@ -471,7 +471,7 @@ static int otm8009a_probe(struct mipi_dsi_device *dsi)
DRM_MODE_CONNECTOR_DSI);

ctx->bl_dev = devm_backlight_device_register(dev, dev_name(dev),
- dsi->host->dev, ctx,
+ dev, ctx,
&otm8009a_backlight_ops,
NULL);
if (IS_ERR(ctx->bl_dev)) {
--
2.39.1


2023-04-17 07:56:23

by Neil Armstrong

[permalink] [raw]
Subject: Re: [RESEND PATCH] drm/panel: otm8009a: Set backlight parent to panel device

Hi,

On Wed, 12 Apr 2023 17:35:07 +0000, James Cowgill wrote:
> This is the logical place to put the backlight device, and it also
> fixes a kernel crash if the MIPI host is removed. Previously the
> backlight device would be unregistered twice when this happened - once
> as a child of the MIPI host through `mipi_dsi_host_unregister`, and
> once when the panel device is destroyed.
>
>
> [...]

Thanks, Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-next-fixes)

[1/1] drm/panel: otm8009a: Set backlight parent to panel device
https://cgit.freedesktop.org/drm/drm-misc/commit/?id=ab4f869fba6119997f7630d600049762a2b014fa

--
Neil

2023-04-17 07:56:30

by Neil Armstrong

[permalink] [raw]
Subject: Re: [RESEND PATCH] drm/panel: otm8009a: Set backlight parent to panel device

On 12/04/2023 19:35, James Cowgill wrote:
> This is the logical place to put the backlight device, and it also
> fixes a kernel crash if the MIPI host is removed. Previously the
> backlight device would be unregistered twice when this happened - once
> as a child of the MIPI host through `mipi_dsi_host_unregister`, and
> once when the panel device is destroyed.
>
> Fixes: 12a6cbd4f3f1 ("drm/panel: otm8009a: Use new backlight API")
> Signed-off-by: James Cowgill <[email protected]>
> Cc: [email protected]
> ---
> drivers/gpu/drm/panel/panel-orisetech-otm8009a.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c b/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c
> index b4729a94c34a8..898b892f11439 100644
> --- a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c
> +++ b/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c
> @@ -471,7 +471,7 @@ static int otm8009a_probe(struct mipi_dsi_device *dsi)
> DRM_MODE_CONNECTOR_DSI);
>
> ctx->bl_dev = devm_backlight_device_register(dev, dev_name(dev),
> - dsi->host->dev, ctx,
> + dev, ctx,
> &otm8009a_backlight_ops,
> NULL);
> if (IS_ERR(ctx->bl_dev)) {

Reviewed-by: Neil Armstrong <[email protected]>