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] [thread-next>] [day] [month] [year] [list]
Message-ID: <877cdakdq9.fsf@intel.com>
Date: Wed, 24 Jul 2024 18:32:14 +0300
From: Jani Nikula <jani.nikula@...ux.intel.com>
To: Tejas Vipin <tejasvipin76@...il.com>, maarten.lankhorst@...ux.intel.com,
 mripard@...nel.org, tzimmermann@...e.de
Cc: dianders@...omium.org, airlied@...il.com, daniel@...ll.ch,
 dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org, Tejas Vipin
 <tejasvipin76@...il.com>
Subject: Re: [PATCH 2/2] drm/mipi-dsi: Change multi functions to use quiet
 member of mipi_dsi_multi_context

On Wed, 24 Jul 2024, Tejas Vipin <tejasvipin76@...il.com> wrote:
> Changes all the multi functions to check if the current context requires
> errors to be printed or not using the quiet member.
>
> Signed-off-by: Tejas Vipin <tejasvipin76@...il.com>
> ---
>  drivers/gpu/drm/drm_mipi_dsi.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c
> index a471c46f5ca6..cbb77342d201 100644
> --- a/drivers/gpu/drm/drm_mipi_dsi.c
> +++ b/drivers/gpu/drm/drm_mipi_dsi.c
> @@ -814,6 +814,8 @@ void mipi_dsi_generic_write_multi(struct mipi_dsi_multi_context *ctx,
>  	ret = mipi_dsi_generic_write(dsi, payload, size);
>  	if (ret < 0) {
>  		ctx->accum_err = ret;
> +		if (ctx->quiet)
> +			return;
>  		dev_err(dev, "sending generic data %*ph failed: %d\n",
>  			(int)size, payload, ctx->accum_err);

A maintainability nitpick. Imagine someone wishing to add some more
error handling here. Or something else after the block.

IMO the dev_err() should be wrapped in if (!ctx->quiet) instead of
adding an early return.

Ditto everywhere.

BR,
Jani.


>  	}
> @@ -958,6 +960,8 @@ void mipi_dsi_dcs_write_buffer_multi(struct mipi_dsi_multi_context *ctx,
>  	ret = mipi_dsi_dcs_write_buffer(dsi, data, len);
>  	if (ret < 0) {
>  		ctx->accum_err = ret;
> +		if (ctx->quiet)
> +			return;
>  		dev_err(dev, "sending dcs data %*ph failed: %d\n",
>  			(int)len, data, ctx->accum_err);
>  	}
> @@ -1450,6 +1454,8 @@ void mipi_dsi_picture_parameter_set_multi(struct mipi_dsi_multi_context *ctx,
>  	ret = mipi_dsi_picture_parameter_set(dsi, pps);
>  	if (ret < 0) {
>  		ctx->accum_err = ret;
> +		if (ctx->quiet)
> +			return;
>  		dev_err(dev, "sending PPS failed: %d\n",
>  			ctx->accum_err);
>  	}
> @@ -1481,6 +1487,8 @@ void mipi_dsi_compression_mode_ext_multi(struct mipi_dsi_multi_context *ctx,
>  	ret = mipi_dsi_compression_mode_ext(dsi, enable, algo, pps_selector);
>  	if (ret < 0) {
>  		ctx->accum_err = ret;
> +		if (ctx->quiet)
> +			return;
>  		dev_err(dev, "sending COMPRESSION_MODE failed: %d\n",
>  			ctx->accum_err);
>  	}
> @@ -1506,6 +1514,8 @@ void mipi_dsi_dcs_nop_multi(struct mipi_dsi_multi_context *ctx)
>  	ret = mipi_dsi_dcs_nop(dsi);
>  	if (ret < 0) {
>  		ctx->accum_err = ret;
> +		if (ctx->quiet)
> +			return;
>  		dev_err(dev, "sending DCS NOP failed: %d\n",
>  			ctx->accum_err);
>  	}
> @@ -1531,6 +1541,8 @@ void mipi_dsi_dcs_enter_sleep_mode_multi(struct mipi_dsi_multi_context *ctx)
>  	ret = mipi_dsi_dcs_enter_sleep_mode(dsi);
>  	if (ret < 0) {
>  		ctx->accum_err = ret;
> +		if (ctx->quiet)
> +			return;
>  		dev_err(dev, "sending DCS ENTER_SLEEP_MODE failed: %d\n",
>  			ctx->accum_err);
>  	}
> @@ -1556,6 +1568,8 @@ void mipi_dsi_dcs_exit_sleep_mode_multi(struct mipi_dsi_multi_context *ctx)
>  	ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
>  	if (ret < 0) {
>  		ctx->accum_err = ret;
> +		if (ctx->quiet)
> +			return;
>  		dev_err(dev, "sending DCS EXIT_SLEEP_MODE failed: %d\n",
>  			ctx->accum_err);
>  	}
> @@ -1581,6 +1595,8 @@ void mipi_dsi_dcs_set_display_off_multi(struct mipi_dsi_multi_context *ctx)
>  	ret = mipi_dsi_dcs_set_display_off(dsi);
>  	if (ret < 0) {
>  		ctx->accum_err = ret;
> +		if (ctx->quiet)
> +			return;
>  		dev_err(dev, "sending DCS SET_DISPLAY_OFF failed: %d\n",
>  			ctx->accum_err);
>  	}
> @@ -1606,6 +1622,8 @@ void mipi_dsi_dcs_set_display_on_multi(struct mipi_dsi_multi_context *ctx)
>  	ret = mipi_dsi_dcs_set_display_on(dsi);
>  	if (ret < 0) {
>  		ctx->accum_err = ret;
> +		if (ctx->quiet)
> +			return;
>  		dev_err(dev, "sending DCS SET_DISPLAY_ON failed: %d\n",
>  			ctx->accum_err);
>  	}
> @@ -1633,6 +1651,8 @@ void mipi_dsi_dcs_set_tear_on_multi(struct mipi_dsi_multi_context *ctx,
>  	ret = mipi_dsi_dcs_set_tear_on(dsi, mode);
>  	if (ret < 0) {
>  		ctx->accum_err = ret;
> +		if (ctx->quiet)
> +			return;
>  		dev_err(dev, "sending DCS SET_TEAR_ON failed: %d\n",
>  			ctx->accum_err);
>  	}

-- 
Jani Nikula, Intel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ