From: Tejas Vipin <tejasvipin76@gmail.com>
To: Doug Anderson <dianders@chromium.org>
Cc: neil.armstrong@linaro.org, quic_jesszhan@quicinc.com,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/panel: raydium-rm692e5: transition to mipi_dsi wrapped functions
Date: Tue, 18 Jun 2024 19:28:58 +0530 [thread overview]
Message-ID: <55d951fc-d5c4-4bd1-9629-352d1e7489f4@gmail.com> (raw)
In-Reply-To: <CAD=FV=XX-_YA6ZjiwfqttL5y4i+QRLJn=BQUM2ugSa8HNkEUtg@mail.gmail.com>
On 6/18/24 7:06 PM, Doug Anderson wrote:
> Hi,
>
> On Tue, Jun 18, 2024 at 5:25 AM Tejas Vipin <tejasvipin76@gmail.com> wrote:
>>
>>>> rm692e5_reset(ctx);
>>>>
>>>> - ret = rm692e5_on(ctx);
>>>> - if (ret < 0) {
>>>> - dev_err(dev, "Failed to initialize panel: %d\n", ret);
>>>> + dsi_ctx.accum_err = rm692e5_on(ctx);
>>>> + if (dsi_ctx.accum_err) {
>>>> + dev_err(dev, "Failed to initialize panel: %d\n", dsi_ctx.accum_err);
>>>
>>> I'd probably change rm692e5_on() to take the "dsi_ctx" as a parameter
>>> and then you don't need to declare a new one there.
>>>
>>> ...also, you don't need to add an error message since rm692e5_on()
>>> will have already printed one (since the "multi" style functions
>>> always print error messages for you).
>>
>> I'm guessing that the change about regulator_bulk_enable and
>> rm692e5 should also be applied to all the other panels where
>> similar behavior occurs?
>
> Yeah, I'd say so.
>
>
>>>> gpiod_set_value_cansleep(ctx->reset_gpio, 1);
>>>> regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
>>>> - return ret;
>>>> + return dsi_ctx.accum_err;
>>>
>>> Not new for your patch, but it seems odd that we don't do this error
>>> handling (re-assert reset and disable the regulator) for errors later
>>> in the function. Shouldn't it do that? It feels like the error
>>> handling should be in an "err" label and we should end up doing that
>>> any time we return an error code... What do you think?
>>
>> Personally I don't think this is necessary because imo labels
>> only get useful when there's a couple of them and/or they're
>> jumped to multiple times. I don't think either would happen in
>> this particular function. But I guess if you have some convention
>> in mind, then it could be done?
>
> I think mostly my suggestion was just that we should also do the
> gpiod_set_value_cansleep() and regulator_bulk_disable() at the end of
> rm692e5_prepare() if `dsi_ctx.accum_err` is non-zero. Then you've got
> two places doing the same thing: here and at the end of the function.
>
> ...oh, but everything below here is already a no-op if the error is
> set. ...so I guess looking at it closer, my suggestion wouldn't be a
> "goto" but would instead be to just move the gpio/regulator call to
> the end. What do you think?
Yeah, sounds good. I'll be doing that.
>
> -Doug
prev parent reply other threads:[~2024-06-18 13:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-15 9:37 [PATCH] drm/panel: raydium-rm692e5: transition to mipi_dsi wrapped functions Tejas Vipin
2024-06-17 20:06 ` Doug Anderson
2024-06-18 12:25 ` Tejas Vipin
2024-06-18 13:36 ` Doug Anderson
2024-06-18 13:58 ` Tejas Vipin [this message]
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=55d951fc-d5c4-4bd1-9629-352d1e7489f4@gmail.com \
--to=tejasvipin76@gmail.com \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dianders@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=quic_jesszhan@quicinc.com \
--cc=tzimmermann@suse.de \
/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