From: "Joonas Kylmälä" <joonas.kylmala@iki.fi>
To: Andrzej Hajda <a.hajda@samsung.com>,
Thierry Reding <thierry.reding@gmail.com>,
Sam Ravnborg <sam@ravnborg.org>, David Airlie <airlied@linux.ie>,
Daniel Vetter <daniel@ffwll.ch>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Cc: paul.kocialkowski@bootlin.com, GNUtoo@cyberdimension.org
Subject: Re: [PATCH] drm/panel: samsung: s6e8aa0: Add backlight control support
Date: Mon, 23 Sep 2019 20:57:17 +0300 [thread overview]
Message-ID: <08a83744-ed02-d641-e2a4-db2247ae53de@iki.fi> (raw)
In-Reply-To: <d8a8bf25-0c5e-8d94-9406-b1f74e3edfac@samsung.com>
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
next prev parent reply other threads:[~2019-09-23 17:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20190921125017epcas3p2f5661cca04f0959f9707f6111102435d@epcas3p2.samsung.com>
2019-09-21 12:48 ` Joonas Kylmälä
2019-09-23 8:16 ` Andrzej Hajda
2019-09-23 17:57 ` Joonas Kylmälä [this message]
2020-04-04 13:27 ` Joonas Kylmälä
2020-04-05 13:57 ` Daniel Vetter
2020-04-05 14:27 ` Sam Ravnborg
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=08a83744-ed02-d641-e2a4-db2247ae53de@iki.fi \
--to=joonas.kylmala@iki.fi \
--cc=GNUtoo@cyberdimension.org \
--cc=a.hajda@samsung.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paul.kocialkowski@bootlin.com \
--cc=sam@ravnborg.org \
--cc=thierry.reding@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome