All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/panel: novatek-nt35950: Only unregister DSI1 if it exists
@ 2023-04-17 15:41 ` Konrad Dybcio
  0 siblings, 0 replies; 6+ messages in thread
From: Konrad Dybcio @ 2023-04-17 15:41 UTC (permalink / raw)
  To: Neil Armstrong, Sam Ravnborg, David Airlie, Daniel Vetter
  Cc: Marijn Suijten, dri-devel, linux-kernel,
	AngeloGioacchino Del Regno, Konrad Dybcio

Commit 5dd45b66742a ("drm/panel: novatek-nt35950: Improve error handling")
introduced logic to unregister DSI1 on any sort of probe failure, as
that's not done automatically by kernel APIs.

It did not however account for cases where only one DSI host is used.
Fix that.

Fixes: 5dd45b66742a ("drm/panel: novatek-nt35950: Improve error handling")
Reported-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/gpu/drm/panel/panel-novatek-nt35950.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35950.c b/drivers/gpu/drm/panel/panel-novatek-nt35950.c
index 7498fc6258bb..8b108ac80b55 100644
--- a/drivers/gpu/drm/panel/panel-novatek-nt35950.c
+++ b/drivers/gpu/drm/panel/panel-novatek-nt35950.c
@@ -586,7 +586,8 @@ static int nt35950_probe(struct mipi_dsi_device *dsi)
 
 	ret = drm_panel_of_backlight(&nt->panel);
 	if (ret) {
-		mipi_dsi_device_unregister(nt->dsi[1]);
+		if (num_dsis == 2)
+			mipi_dsi_device_unregister(nt->dsi[1]);
 
 		return dev_err_probe(dev, ret, "Failed to get backlight\n");
 	}
@@ -606,7 +607,8 @@ static int nt35950_probe(struct mipi_dsi_device *dsi)
 		ret = mipi_dsi_attach(nt->dsi[i]);
 		if (ret < 0) {
 			/* If we fail to attach to either host, we're done */
-			mipi_dsi_device_unregister(nt->dsi[1]);
+			if (num_dsis == 2)
+				mipi_dsi_device_unregister(nt->dsi[1]);
 
 			return dev_err_probe(dev, ret,
 					     "Cannot attach to DSI%d host.\n", i);

---
base-commit: ab4f869fba6119997f7630d600049762a2b014fa
change-id: 20230417-topic-maple_panel_fixup-170b6d3a8c9b

Best regards,
-- 
Konrad Dybcio <konrad.dybcio@linaro.org>


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] drm/panel: novatek-nt35950: Only unregister DSI1 if it exists
@ 2023-04-17 15:41 ` Konrad Dybcio
  0 siblings, 0 replies; 6+ messages in thread
From: Konrad Dybcio @ 2023-04-17 15:41 UTC (permalink / raw)
  To: Neil Armstrong, Sam Ravnborg, David Airlie, Daniel Vetter
  Cc: Konrad Dybcio, Marijn Suijten, linux-kernel, dri-devel,
	AngeloGioacchino Del Regno

Commit 5dd45b66742a ("drm/panel: novatek-nt35950: Improve error handling")
introduced logic to unregister DSI1 on any sort of probe failure, as
that's not done automatically by kernel APIs.

It did not however account for cases where only one DSI host is used.
Fix that.

Fixes: 5dd45b66742a ("drm/panel: novatek-nt35950: Improve error handling")
Reported-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/gpu/drm/panel/panel-novatek-nt35950.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35950.c b/drivers/gpu/drm/panel/panel-novatek-nt35950.c
index 7498fc6258bb..8b108ac80b55 100644
--- a/drivers/gpu/drm/panel/panel-novatek-nt35950.c
+++ b/drivers/gpu/drm/panel/panel-novatek-nt35950.c
@@ -586,7 +586,8 @@ static int nt35950_probe(struct mipi_dsi_device *dsi)
 
 	ret = drm_panel_of_backlight(&nt->panel);
 	if (ret) {
-		mipi_dsi_device_unregister(nt->dsi[1]);
+		if (num_dsis == 2)
+			mipi_dsi_device_unregister(nt->dsi[1]);
 
 		return dev_err_probe(dev, ret, "Failed to get backlight\n");
 	}
@@ -606,7 +607,8 @@ static int nt35950_probe(struct mipi_dsi_device *dsi)
 		ret = mipi_dsi_attach(nt->dsi[i]);
 		if (ret < 0) {
 			/* If we fail to attach to either host, we're done */
-			mipi_dsi_device_unregister(nt->dsi[1]);
+			if (num_dsis == 2)
+				mipi_dsi_device_unregister(nt->dsi[1]);
 
 			return dev_err_probe(dev, ret,
 					     "Cannot attach to DSI%d host.\n", i);

---
base-commit: ab4f869fba6119997f7630d600049762a2b014fa
change-id: 20230417-topic-maple_panel_fixup-170b6d3a8c9b

Best regards,
-- 
Konrad Dybcio <konrad.dybcio@linaro.org>


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/panel: novatek-nt35950: Only unregister DSI1 if it exists
  2023-04-17 15:41 ` Konrad Dybcio
@ 2023-04-18  8:04   ` AngeloGioacchino Del Regno
  -1 siblings, 0 replies; 6+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-04-18  8:04 UTC (permalink / raw)
  To: Konrad Dybcio, Neil Armstrong, Sam Ravnborg, David Airlie, Daniel Vetter
  Cc: Marijn Suijten, dri-devel, linux-kernel

Il 17/04/23 17:41, Konrad Dybcio ha scritto:
> Commit 5dd45b66742a ("drm/panel: novatek-nt35950: Improve error handling")
> introduced logic to unregister DSI1 on any sort of probe failure, as
> that's not done automatically by kernel APIs.
> 
> It did not however account for cases where only one DSI host is used.
> Fix that.
> 
> Fixes: 5dd45b66742a ("drm/panel: novatek-nt35950: Improve error handling")
> Reported-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/panel: novatek-nt35950: Only unregister DSI1 if it exists
@ 2023-04-18  8:04   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 6+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-04-18  8:04 UTC (permalink / raw)
  To: Konrad Dybcio, Neil Armstrong, Sam Ravnborg, David Airlie, Daniel Vetter
  Cc: Marijn Suijten, linux-kernel, dri-devel

Il 17/04/23 17:41, Konrad Dybcio ha scritto:
> Commit 5dd45b66742a ("drm/panel: novatek-nt35950: Improve error handling")
> introduced logic to unregister DSI1 on any sort of probe failure, as
> that's not done automatically by kernel APIs.
> 
> It did not however account for cases where only one DSI host is used.
> Fix that.
> 
> Fixes: 5dd45b66742a ("drm/panel: novatek-nt35950: Improve error handling")
> Reported-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/panel: novatek-nt35950: Only unregister DSI1 if it exists
  2023-04-17 15:41 ` Konrad Dybcio
@ 2023-04-18  8:22   ` Neil Armstrong
  -1 siblings, 0 replies; 6+ messages in thread
From: Neil Armstrong @ 2023-04-18  8:22 UTC (permalink / raw)
  To: Sam Ravnborg, David Airlie, Daniel Vetter, Konrad Dybcio
  Cc: Marijn Suijten, dri-devel, linux-kernel, AngeloGioacchino Del Regno

Hi,

On Mon, 17 Apr 2023 17:41:08 +0200, Konrad Dybcio wrote:
> Commit 5dd45b66742a ("drm/panel: novatek-nt35950: Improve error handling")
> introduced logic to unregister DSI1 on any sort of probe failure, as
> that's not done automatically by kernel APIs.
> 
> It did not however account for cases where only one DSI host is used.
> Fix that.
> 
> [...]

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

[1/1] drm/panel: novatek-nt35950: Only unregister DSI1 if it exists
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=a50be876f4fe2349dc8b056a49d87f69c944570f

-- 
Neil


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/panel: novatek-nt35950: Only unregister DSI1 if it exists
@ 2023-04-18  8:22   ` Neil Armstrong
  0 siblings, 0 replies; 6+ messages in thread
From: Neil Armstrong @ 2023-04-18  8:22 UTC (permalink / raw)
  To: Sam Ravnborg, David Airlie, Daniel Vetter, Konrad Dybcio
  Cc: Marijn Suijten, linux-kernel, dri-devel, AngeloGioacchino Del Regno

Hi,

On Mon, 17 Apr 2023 17:41:08 +0200, Konrad Dybcio wrote:
> Commit 5dd45b66742a ("drm/panel: novatek-nt35950: Improve error handling")
> introduced logic to unregister DSI1 on any sort of probe failure, as
> that's not done automatically by kernel APIs.
> 
> It did not however account for cases where only one DSI host is used.
> Fix that.
> 
> [...]

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

[1/1] drm/panel: novatek-nt35950: Only unregister DSI1 if it exists
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=a50be876f4fe2349dc8b056a49d87f69c944570f

-- 
Neil


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-04-18  8:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-17 15:41 [PATCH] drm/panel: novatek-nt35950: Only unregister DSI1 if it exists Konrad Dybcio
2023-04-17 15:41 ` Konrad Dybcio
2023-04-18  8:04 ` AngeloGioacchino Del Regno
2023-04-18  8:04   ` AngeloGioacchino Del Regno
2023-04-18  8:22 ` Neil Armstrong
2023-04-18  8:22   ` Neil Armstrong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.