[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2718437.9Mp67QZiUf@diego>
Date: Wed, 07 Jan 2026 13:18:00 +0100
From: Heiko StĂĽbner <heiko@...ech.de>
To: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Sandy Huang <hjc@...k-chips.com>, Andy Yan <andy.yan@...k-chips.com>,
Chaoyi Chen <kernel@...kyi.com>
Cc: dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
linux-rockchip@...ts.infradead.org, Chaoyi Chen <chaoyi.chen@...k-chips.com>
Subject:
Re: [PATCH] drm/mipi-dsi: Only remove child devices that match the dsi device
type
Am Mittwoch, 3. Dezember 2025, 12:50:28 Mitteleuropäische Normalzeit schrieb Chaoyi Chen:
> From: Chaoyi Chen <chaoyi.chen@...k-chips.com>
>
> This patch checks whether the device is a valid mipi_dsi_device before
> accessing it in mipi_dsi_remove_device_fn().
>
> The mipi_dsi_host_unregister() assumes that all child devices of the
> host device are mipi_dsi_devices and uses mipi_dsi_remove_device_fn()
> to perform subsequent operations specific to mipi_dsi_device.
>
> In rockchip platform, for dw-mipi-dsi-rockchip.c, it creates a dphy
> device, and it use the dsi host device as its parent device.
>
> And when we call dw_mipi_dsi_remove() in
> dw_mipi_dsi_rockchip_remove(), mipi_dsi_host_unregister() will get
> such a dphy child device and treat it as an mipi_dsi_device, which
> will lead to a further panic.
>
> Signed-off-by: Chaoyi Chen <chaoyi.chen@...k-chips.com>
> ---
> drivers/gpu/drm/drm_mipi_dsi.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c
> index a712e177b350..5b9cc799eb87 100644
> --- a/drivers/gpu/drm/drm_mipi_dsi.c
> +++ b/drivers/gpu/drm/drm_mipi_dsi.c
> @@ -349,7 +349,12 @@ EXPORT_SYMBOL(mipi_dsi_host_register);
>
> static int mipi_dsi_remove_device_fn(struct device *dev, void *priv)
> {
> - struct mipi_dsi_device *dsi = to_mipi_dsi_device(dev);
> + struct mipi_dsi_device *dsi;
> +
> + if (!dev_is_mipi_dsi(dev))
> + return 0;
> +
> + dsi = to_mipi_dsi_device(dev);
>
> if (dsi->attached)
> mipi_dsi_detach(dsi);
>
This makes a lot of sense.
Reviewed-by: Heiko Stuebner <heiko@...ech.de>
For people reading along:
The DSI controllers on the RK3399 uses a phy that is _inside_ the
DW-DSI controller, instead of a separate IP block.
But this internal PHY can also work as a receiver for camera data
for the ISP block in the RK3399.
Heiko
Powered by blists - more mailing lists