All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Amit Barzilai" <amit.barzilai22@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/ssd130x: Add per-family update backlight logic
Date: Wed, 29 Jul 2026 05:40:23 +0000	[thread overview]
Message-ID: <20260729054024.5DC711F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260729053054.29374-3-amit.barzilai22@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Multi-byte hardware command sequences can interleave during concurrent display and backlight updates, corrupting the panel state.
--

--- Patch [2]: [PATCH 2/2] drm/ssd130x: Add per-family update backlight logic ---
commit 3c6fc209e783670f32fed55dedcfe0a2a66ad662
Author: Amit Barzilai <amit.barzilai22@gmail.com>

drm/ssd130x: Add per-family update backlight logic
    
This commit adds per-family backlight update logic to support SSD133x panels,
which require a three-channel contrast update sequence instead of a single
global contrast command.

> diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c
> index f49e5245b2160..0b0fc6fe3df23 100644
> --- a/drivers/gpu/drm/solomon/ssd130x.c
> +++ b/drivers/gpu/drm/solomon/ssd130x.c
> @@ -1711,8 +1711,25 @@ static int ssd130x_update_bl(struct backlight_device *bdev)
>  	return 0;
>  }
>  
> -static const struct backlight_ops ssd130xfb_bl_ops = {
> -	.update_status	= ssd130x_update_bl,
> +static int ssd133x_update_bl(struct backlight_device *bdev)
> +{
> +	struct ssd130x_device *ssd130x = bl_get_data(bdev);
> +
> +	ssd130x->contrast = backlight_get_brightness(bdev);
> +
> +	return ssd133x_set_contrast(ssd130x, ssd130x->contrast);
> +}

[Severity: High]
This is a pre-existing issue, but does this newly added function exacerbate a
race condition with concurrent DRM atomic plane updates?

When a backlight sysfs brightness update runs concurrently with a DRM atomic
plane update, both paths invoke regmap_write() repeatedly to send multi-byte
sequences. Since regmap_write() only locks internally for a single byte, there
appears to be no driver-level mutex to serialize the entire command sequence.

The newly added ssd133x_update_bl() sends a 7-command multi-byte sequence via
ssd133x_set_contrast() and ssd130x_run_cmd_seq() without driver-level locks.
Similarly, the existing ssd130x_update_bl() function splits a 2-byte command
across two separate ssd130x_write_cmd() calls.

Could these multi-byte hardware command sequences interleave during concurrent
display and backlight updates, and potentially corrupt the panel's hardware
state machine?

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260729053054.29374-1-amit.barzilai22@gmail.com?part=2

      reply	other threads:[~2026-07-29  5:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-29  5:30 [PATCH 0/2] drm/ssd130x: Wire up ssd133x backlight/dimming Amit Barzilai
2026-07-29  5:30 ` [PATCH 1/2] drm/ssd130x: Scale ssd133x per-channel contrast by brightness on init Amit Barzilai
2026-07-29  5:41   ` sashiko-bot
2026-07-29  5:30 ` [PATCH 2/2] drm/ssd130x: Add per-family update backlight logic Amit Barzilai
2026-07-29  5:40   ` sashiko-bot [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=20260729054024.5DC711F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=amit.barzilai22@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 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.