iMX8MM and panel driver Himax8279D: imx_sec_dsim_drv: wait pkthdr tx done time out

Hi @Mowlwurf

If I remember correctly when investigating another MIPI-DSI driver issue this is because of the wait_complete in the prepare function. It seems that the NXP driver somehow has interrupts disabled there. So one way of fixing this is to move everything to the enable function.

Here is a quick example. I didn’t test it and it is dirty but it would be interesting to see if it fixes the issue you see:

diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
index 42854bd37fd5..5401cd5f6cd1 100644
--- a/drivers/gpu/drm/panel/panel-boe-himax8279d.c
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -135,6 +135,20 @@ static int boe_panel_prepare(struct drm_panel *panel)
 	if (pinfo->prepared)
 		return 0;
 
+
+	pinfo->prepared = true;
+
+	return 0;
+}
+
+static int boe_panel_enable(struct drm_panel *panel)
+{
+	struct panel_info *pinfo = to_panel_info(panel);
+	int ret;
+
+	if (pinfo->enabled)
+		return 0;
+
 	gpiod_set_value(pinfo->pp18_gpio, 1);
 	/* T1: 5ms - 6ms */
 	usleep_range(5000, 6000);
@@ -160,44 +174,15 @@ static int boe_panel_prepare(struct drm_panel *panel)
 	err = send_mipi_cmds(panel, pinfo->desc->on_cmds);
 	if (err < 0) {
 		dev_err(panel->dev, "failed to send DCS Init Code: %d\n", err);
-		goto poweroff;
+		return err;
 	}
 
 	err = mipi_dsi_dcs_exit_sleep_mode(pinfo->link);
 	if (err < 0) {
 		dev_err(panel->dev, "failed to exit sleep mode: %d\n", err);
-		goto poweroff;
-	}
-
-	/* T6: 120ms - 121ms */
-	usleep_range(120000, 121000);
-
-	err = mipi_dsi_dcs_set_display_on(pinfo->link);
-	if (err < 0) {
-		dev_err(panel->dev, "failed to set display on: %d\n", err);
-		goto poweroff;
+		return err;
 	}
 
-	/* T7: 20ms - 21ms */
-	usleep_range(20000, 21000);
-
-	pinfo->prepared = true;
-
-	return 0;
-
-poweroff:
-	disable_gpios(pinfo);
-	return err;
-}
-
-static int boe_panel_enable(struct drm_panel *panel)
-{
-	struct panel_info *pinfo = to_panel_info(panel);
-	int ret;
-
-	if (pinfo->enabled)
-		return 0;
-
 	usleep_range(120000, 121000);
 
 	ret = mipi_dsi_dcs_set_display_on(pinfo->link);

I just moved everything that is part of the prepare function to the enable function. I also moved the other parts because there is a sleep in there and if interrupts are disabled it might happen that the system slows down during boot. However, that wouldn’t be necessary.

I hope this changes something.

Regards,
Stefan