Missing Error-Handling in DSI Driver on i.MX 8M Mini

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Missing Error-Handling in DSI Driver on i.MX 8M Mini

608 Views
philippe_schenk
Contributor IV

We are currently integrating NXPs new BSP Linux 5.15.32_2.0.0​. There we found a difficulty that prevented MIPI DSI to work on our module using an i.MX 8M Mini SoC. A probe defer that only happened on our hardware and the subsequent missing cleanup prevented it from working.

We had to adjust the driver drivers/gpu/drm/imx/sec_mipi_dsim-imx.c the following way:

diff --git a/drivers/gpu/drm/imx/sec_mipi_dsim-imx.c b/drivers/gpu/drm/imx/sec_mipi_dsim-imx.c
index cd80096477b0..048a2c700b5e 100644
--- a/drivers/gpu/drm/imx/sec_mipi_dsim-imx.c
+++ b/drivers/gpu/drm/imx/sec_mipi_dsim-imx.c
@@ -456,7 +456,14 @@ static int imx_sec_dsim_probe(struct platform_device *pdev)
 
 	pm_runtime_enable(dev);
 
-	return component_add(dev, &imx_sec_dsim_ops);
+	ret = component_add(dev, &imx_sec_dsim_ops);
+	if (ret) {
+		pm_runtime_disable(&pdev->dev);
+		sec_dsim_of_put_resets(dsim_dev);
+		return ret;
+	}
+
+	return 0;
 }
 
 static int imx_sec_dsim_remove(struct platform_device *pdev)

 

the function component_add() can return -EPROBE_DEFER. In such a case the resets need to be cleaned up so they can be loaded again in the next try. That is what this patch does.

You can also find the patch in our repo: https://git.toradex.com/cgit/linux-toradex.git/commit/?h=toradex_5.15-2.0.x-imx&id=67f5de2563fe696d5...

I sincerely ask you to integrate this fix into the next BSP release so we and others can profit from it.

Thank you very much in advance.
Philippe

0 Kudos
Reply
1 Reply

555 Views
fd
Contributor II

Hello,

This request did not receive any comment in months. Now the same exact patch was now applied, with a different copyright/author to your kernel.

https://github.com/nxp-imx/linux-imx/commit/e98c3502bd334b79e88cac2b2747117ffe600d48

 

Can you please help clarify the process here?

0 Kudos
Reply