[PATCH 05/32] drm/mipi-dsi: log DSI device attach and detach
Luca Ceresoli
luca.ceresoli at bootlin.com
Wed Jun 25 16:45:09 UTC 2025
Some MIPI DSI host drivers log a line on attach success, failure, or
attempt. These log lines are inconsistent and sparse across
drivers. Moreover most of them use the "info" logging level, but drivers
should be mostly or totally silent when successful.
Add logging in the DSI core, so that it is consistent across drivers and
not redundant. Log for both attach success and failure, and while there
also log on detach. Print the main format parameters on each line (lanes,
bpp and mode flags). Finally, use "debug" logging level (except for the
"error" logging level in case of failure).
Later commits will remove the now-redundant logging in individual drivers.
Signed-off-by: Luca Ceresoli <luca.ceresoli at bootlin.com>
---
drivers/gpu/drm/drm_mipi_dsi.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c
index 82d4f9c1de5fbc60f32d0b0baf41e1bd2991ebe4..f16f70c70c87988a95f959d0b8b18a6941dd2808 100644
--- a/drivers/gpu/drm/drm_mipi_dsi.c
+++ b/drivers/gpu/drm/drm_mipi_dsi.c
@@ -383,11 +383,19 @@ int mipi_dsi_attach(struct mipi_dsi_device *dsi)
return dev_err_probe(&dsi->dev, -EINVAL, "Incorrect lanes number\n");
ret = ops->attach(dsi->host, dsi);
- if (ret)
+ if (ret) {
+ dev_err(dsi->host->dev,
+ "Failed to attach %s device (lanes:%d bpp:%d mode-flags:0x%lx) (%d)\n",
+ dsi->name, dsi->lanes, mipi_dsi_pixel_format_to_bpp(dsi->format),
+ dsi->mode_flags, ret);
return ret;
+ }
dsi->attached = true;
+ dev_dbg(dsi->host->dev, "Attached %s device (lanes:%d bpp:%d mode-flags:0x%lx)\n",
+ dsi->name, dsi->lanes, mipi_dsi_pixel_format_to_bpp(dsi->format), dsi->mode_flags);
+
return 0;
}
EXPORT_SYMBOL(mipi_dsi_attach);
@@ -406,6 +414,10 @@ int mipi_dsi_detach(struct mipi_dsi_device *dsi)
if (!ops || !ops->detach)
return -ENOSYS;
+ dev_dbg(dsi->host->dev, "Detaching %s device (lanes:%d bpp:%d mode-flags:0x%lx)\n",
+ dsi->name, dsi->lanes, mipi_dsi_pixel_format_to_bpp(dsi->format),
+ dsi->mode_flags);
+
dsi->attached = false;
return ops->detach(dsi->host, dsi);
--
2.49.0
More information about the dri-devel
mailing list