From: Paul Kocialkowski <contact@paulk.fr>
To: linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Thierry Reding <thierry.reding@gmail.com>,
Lee Jones <lee.jones@linaro.org>,
Daniel Thompson <daniel.thompson@linaro.org>,
Jingoo Han <jingoohan1@gmail.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: PWM backlight initial state assumptions, or how pwm_bl killed my (nyan) cat^W backlight support
Date: Tue, 04 Jul 2017 23:13:34 +0300 [thread overview]
Message-ID: <1499199214.1347.8.camel@paulk.fr> (raw)
[-- Attachment #1: Type: text/plain, Size: 2444 bytes --]
As I try to maintain support for ARM CrOS (read, ChromeOS/ChromiumOS) devices in
upstream Linux on my spare time, I try to test out rc and stable versions as
often as time allows. I have been rolling out 4.12 since Monday and noticed that
the backlight on my tegra124 nyan big stayed dark for this release.
Not very cool, although I'm not blaming anyone else than myself on this,
I should have just tested it and brought the issue up during the rc cycle.
Still, let's try to move forward.
After investigating, it appears that the pwm_bl driver is enforcing a policy on
heavily relying on the backlight initial state
(pwm_backlight_initial_power_state). To make it short, if backlight wasn't
detected as already enabled by the bootloader, it's going to refuse to enable it
during the whole lifetime of the driver.
This policy isn't exactly new (so I do realize that I'm a bit late to the
party), but it went one step further this cycle by adding a check on the PWM
state. This broke support for my nyan big, as the pwm driver does not check for
the previous state at probe time and reports it as disabled initially.
One could say that the driver has to be fixed to report that state (and I agree
it is a desirable thing to do), but I think it is a symptom of a broader issue.
Basically, do we really want pwm_bl to behave this way? What is the rationale
behind this decision, other than "because we can"? A strong argument against it
is that not all bootloaders have support for turning the backlight on (that is
definitely not the case on the omap3 sniper and omap4 kc1 boards with upstream
U-Boot, that I introduced to mainline Linux).
Also, we can still expect the gpio/regulator/pwm drivers to be reset at probe
time (and I also agree it's not necessarily a good thing, especially as far as
backlight is concerned, but that's the reality and dropping backlight support in
those cases doesn't seem like an appropriate course of action). This will result
in pwm_bl assuming that backlight was not enabled by the bootloader and thus
refuse to enable it at all times.
Comments and reactions are welcome, as I'd really like to find a sane way to
resolve this problem.
Cheers!
--
Paul Kocialkowski, developer of free digital technology and hardware support
Website: https://www.paulk.fr/
Coding blog: https://code.paulk.fr/
Git repositories: https://git.paulk.fr/ https://git.code.paulk.fr/
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next reply other threads:[~2017-07-04 20:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-04 20:13 Paul Kocialkowski [this message]
2017-07-05 10:24 ` PWM backlight initial state assumptions, or how pwm_bl killed my (nyan) cat^W backlight support Daniel Thompson
2017-07-05 10:41 ` Paul Kocialkowski
2017-07-05 11:07 ` Philipp Zabel
2017-07-05 11:47 ` Paul Kocialkowski
2017-07-06 12:41 ` Paul Kocialkowski
2017-07-06 12:57 ` Daniel Thompson
2017-07-06 13:02 ` Paul Kocialkowski
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=1499199214.1347.8.camel@paulk.fr \
--to=contact@paulk.fr \
--cc=daniel.thompson@linaro.org \
--cc=jingoohan1@gmail.com \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=thierry.reding@gmail.com \
--cc=torvalds@linux-foundation.org \
/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;
as well as URLs for NNTP newsgroup(s).