From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: neil.armstrong@linaro.org,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Sam Ravnborg <sam@ravnborg.org>, David Airlie <airlied@gmail.com>,
Daniel Vetter <daniel@ffwll.ch>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@somainline.org>
Cc: Marijn Suijten <marijn.suijten@somainline.org>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/panel: novatek-nt35950: Improve error handling
Date: Mon, 17 Apr 2023 11:44:00 +0200 [thread overview]
Message-ID: <e9c2e179-eacc-151e-123b-a4e425e76333@collabora.com> (raw)
In-Reply-To: <ea9f27a2-ce75-01a9-3758-0fe0bfcd1e5e@linaro.org>
Il 17/04/23 09:25, Neil Armstrong ha scritto:
> On 15/04/2023 13:00, Konrad Dybcio wrote:
>> In a very peculiar case when probing and registering with the secondary
>> DSI host succeeds, but the OF backlight or DSI attachment fails, the
>> primary DSI device is automatically cleaned up, but the secondary one
>> is not, leading to -EEXIST when the driver core tries to handle
>> -EPROBE_DEFER.
>>
>> Unregister the DSI1 device manually on failure to prevent that.
>>
>> Fixes: 623a3531e9cf ("drm/panel: Add driver for Novatek NT35950 DSI DriverIC
>> panels")
>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>> ---
>> drivers/gpu/drm/panel/panel-novatek-nt35950.c | 8 +++++++-
>> 1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35950.c
>> b/drivers/gpu/drm/panel/panel-novatek-nt35950.c
>> index abf752b36a52..7498fc6258bb 100644
>> --- a/drivers/gpu/drm/panel/panel-novatek-nt35950.c
>> +++ b/drivers/gpu/drm/panel/panel-novatek-nt35950.c
>> @@ -585,8 +585,11 @@ static int nt35950_probe(struct mipi_dsi_device *dsi)
>> DRM_MODE_CONNECTOR_DSI);
>> ret = drm_panel_of_backlight(&nt->panel);
>> - if (ret)
>> + if (ret) {
If this is not a dual-DSI case, nt->dsi[1] will be NULL: I agree it's still
fine as in the kernel won't crash in that case, but for logical correctness
I would still account for that:
if (num_dsis == 2)
mipi_dsi_device_unregister(nt->dsi[1]);
>> + mipi_dsi_device_unregister(nt->dsi[1]);
>> +
>> return dev_err_probe(dev, ret, "Failed to get backlight\n");
>> + }
>> drm_panel_add(&nt->panel);
>> @@ -602,6 +605,9 @@ static int nt35950_probe(struct mipi_dsi_device *dsi)
>> ret = mipi_dsi_attach(nt->dsi[i]);
>> if (ret < 0) {
Same here, please add a check for num_dsis.
Regards,
Angelo
next prev parent reply other threads:[~2023-04-17 9:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-15 11:00 Konrad Dybcio
2023-04-17 7:25 ` Neil Armstrong
2023-04-17 9:44 ` AngeloGioacchino Del Regno [this message]
2023-04-17 9:44 ` AngeloGioacchino Del Regno
2023-04-17 13:38 ` Konrad Dybcio
2023-04-17 14:16 ` AngeloGioacchino Del Regno
2023-04-17 7:28 ` Neil Armstrong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e9c2e179-eacc-151e-123b-a4e425e76333@collabora.com \
--to=angelogioacchino.delregno@collabora.com \
--cc=airlied@gmail.com \
--cc=angelogioacchino.delregno@somainline.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=konrad.dybcio@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marijn.suijten@somainline.org \
--cc=neil.armstrong@linaro.org \
--cc=sam@ravnborg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®