Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [High] Incorrect and non-atomic modification of `dsi->mode_flags` permanently enables Low Power Mode and introduces a data race. - [High] Backlight `update_status` sends DSI commands without verifying that the panel is powered on, risking DSI host timeouts. --
commit 2f966f15c21adb82ce5699cdffad22cac6628b98 Author: Arpit Saini <[email protected]> drm/panel: add Ilitek ILI7807S panel driver Add a DRM panel driver for the DLC DLC0697 1080x1920@60Hz MIPI DSI panel based on the Ilitek ILI7807S display controller. > diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili7807s.c > b/drivers/gpu/drm/panel/panel-ilitek-ili7807s.c > new file mode 100644 > index 0000000000000..8ddfab2693ec8 > --- /dev/null > +++ b/drivers/gpu/drm/panel/panel-ilitek-ili7807s.c [ ... ] > +static int ili7807s_bl_update_status(struct backlight_device *bl) > +{ > + struct mipi_dsi_device *dsi = bl_get_data(bl); > + u16 brightness = backlight_get_brightness(bl); > + int ret; > + [Severity: High] Does this code send DSI commands without verifying if the panel is powered on? If the panel regulators are disabled and reset is asserted via ili7807s_unprepare(), attempting to communicate with it here during a sysfs backlight update could result in DSI host bus timeouts or hardware lockups. Should there be a check against a power state tracking flag before sending the DCS command? > + dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; > + > + ret = mipi_dsi_dcs_set_display_brightness_large(dsi, brightness); > + > + dsi->mode_flags |= MIPI_DSI_MODE_LPM; [Severity: High] Does unconditionally setting MIPI_DSI_MODE_LPM here permanently alter the panel's base operating state? Since the mode_flags are modified without synchronization with DRM modeset paths (like ili7807s_on() and ili7807s_off()), could this create a data race? Also, the logic clears the flag before the transaction and unconditionally sets it afterwards, leaving Low Power Mode permanently enabled for subsequent DSI transmissions. > + > + return ret; > +} -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=2
