lkml.org 
[lkml]   [2019]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] drm/panel: samsung: s6e8aa0: Add backlight control support
Date
Hi,

thanks a lot for the review, Andrzej!

Andrzej Hajda:
>> +static const struct backlight_ops s6e8aa0_backlight_ops = {
>> + .update_status = s6e8aa0_set_brightness,
>
>
> This is racy, update_status can be called in any time between probe and
> remove, particularly:
>
> a) before panel enable,
>
> b) during panel enable,
>
> c) when panel is enabled,
>
> d) during panel disable,
>
> e) after panel disable,
>
>
> b and d are racy for sure - backlight and drm callbacks are async.
>
> IMO the best solution would be to register backlight after attaching
> panel to drm, but for this drm_panel_funcs should have attach/detach
> callbacks (like drm_bridge_funcs),
>
> then update_status callback should take some drm_connector lock to
> synchronize with drm, and write to hw only when pipe is enabled.

I will start reading the kernel DRM KMS documentation in order to learn
how the attach callback would fit in the picture and do what you suggest
but it might take a few weeks or months.

Also, as a lot of this code was mimicked from
drivers/gpu/drm/panel/panel-samsung-s6e63m0.c it looks like that is also
having this race condition. Unfortunately, I don't think I have the
s6e63m0 panel so for that I probably cannot fix this issue.

Joonas

\
 
 \ /
  Last update: 2019-09-23 19:57    [W:0.072 / U:0.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site