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 <[email protected]>

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/[email protected]?part=2

Reply via email to