lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAD=FV=Xk6hYmJGLhW2ruvWwOETfmCAQX000WX4LrC3CPCZJMJQ@mail.gmail.com>
Date: Mon, 17 Mar 2025 09:26:54 -0700
From: Doug Anderson <dianders@...omium.org>
To: Tejas Vipin <tejasvipin76@...il.com>
Cc: neil.armstrong@...aro.org, maarten.lankhorst@...ux.intel.com, 
	mripard@...nel.org, tzimmermann@...e.de, airlied@...il.com, simona@...ll.ch, 
	aweber.kernel@...il.com, quic_jesszhan@...cinc.com, 
	dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org, 
	asrivats@...hat.com
Subject: Re: [PATCH] drm/panel: samsung-s6d7aa0: transition to mipi_dsi
 wrapped functions

Hi,

On Sat, Mar 15, 2025 at 9:50 PM Tejas Vipin <tejasvipin76@...il.com> wrote:
>
> @@ -62,93 +62,66 @@ static void s6d7aa0_reset(struct s6d7aa0 *ctx)
>         msleep(50);
>  }
>
> -static int s6d7aa0_lock(struct s6d7aa0 *ctx, bool lock)
> +static void s6d7aa0_lock(struct s6d7aa0 *ctx, struct mipi_dsi_multi_context *dsi_ctx, bool lock)
>  {
> -       struct mipi_dsi_device *dsi = ctx->dsi;
> +       if (dsi_ctx->accum_err)
> +               return;

nit: I don't think you need this extra check, do you? The entire
function is "multi" calls so just let them be no-ops. It may seem like
an optimization to have the extra check at the start of the function,
but it's better to optimize for the "no error" case and let the
"error" case be a little slower.


>  static int s6d7aa0_on(struct s6d7aa0 *ctx)
>  {
>         struct mipi_dsi_device *dsi = ctx->dsi;
> -       struct device *dev = &dsi->dev;
> -       int ret;
> +       struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
>
> -       ret = ctx->desc->init_func(ctx);
> -       if (ret < 0) {
> -               dev_err(dev, "Failed to initialize panel: %d\n", ret);
> +       ctx->desc->init_func(ctx, &dsi_ctx);
> +       if (dsi_ctx.accum_err < 0)
>                 gpiod_set_value_cansleep(ctx->reset_gpio, 1);
> -               return ret;
> -       }
>
> -       ret = mipi_dsi_dcs_set_display_on(dsi);
> -       if (ret < 0) {
> -               dev_err(dev, "Failed to set display on: %d\n", ret);
> -               return ret;
> -       }
> +       mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
>
> -       return 0;
> +       return dsi_ctx.accum_err;

Not something new to your patch, I wonder if the setting of the reset
GPIO should actually be _below_ the call to turn the display on. Seems
like if that fails you should also be setting the reset GPIO. That
would be a change in behavior but seems more correct?

Given that it's a change in behavior, I'd be OK w/ leaving it as-is or
changing it (and mentioning it in the commit message). I'd be curious
if anyone else has opinions here.

...oh, actually, you should just delete the reset GPIO stuff from this
function. The one caller of this function is already setting the reset
GPIO, right?


Everything else looks good to me.

-DOug

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ