From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Jonathan Woithe <jwoithe@just42.net>
Cc: Darren Hart <dvhart@infradead.org>,
Micha?? K??pie?? <kernel@kempniu.pl>,
Andy Shevchenko <andy.shevchenko@gmail.com>,
platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/4] fujitsu_init() cleanup
Date: Tue, 28 Feb 2017 13:33:00 +0100 [thread overview]
Message-ID: <20170228123300.GB31751@kroah.com> (raw)
In-Reply-To: <20170228111426.GA31575@marvin.atrad.com.au>
On Tue, Feb 28, 2017 at 09:44:26PM +1030, Jonathan Woithe wrote:
> On Tue, Feb 28, 2017 at 09:07:04AM +0100, Greg Kroah-Hartman wrote:
> > On Mon, Feb 27, 2017 at 10:17:55PM -0800, Darren Hart wrote:
> > > > > > > > The problem I have with this driver is that it is generally oblivious to
> > > > > > > > the user's chosen backlight provider. It was written before acpi_video
> > > > > > > > support for backlight control was automatically detected by the kernel
> > > > > > > > and as such it required a fix which was allegedly provided by
> > > > > > > > 7d5c89a615c5 ("fujitsu-laptop: fingers off backlight if video.ko is
> > > > > > > > serving this functionality"). However, that fix was superficial as the
> > > > > > > > module still registered its vendor-specific ACPI driver for backlight
> > > > > > > > control. That in turn caused SBLL/SBL2 to be called when brightness
> > > > > > > > hotkeys were pressed even when acpi_video was supposed to handle
> > > > > > > > brightness changes, which is exactly what that patch was hoping to
> > > > > > > > prevent. Moreover, the module unconditionally exports backlight-related
> > > > > > > > sysfs attributes which enable userspace to change the brightness level,
> > > > > > > > which should also only be possible when vendor backlight control is
> > > > > > > > used. Fast forward several years and on modern Fujitsu machines (e.g.
> > > > > > > > Lifebook E744), the kernel automatically detects that native backlight
> > > > > > > > control [1] should be used and SBLL becomes a noop [2]. This creates
> > > > > > > > confusion, because the driver claims that it can get/set LCD brightness
> > > > > > > > level via the platform device's sysfs attributes, but it actually
> > > > > > > > cannot. It gets even more confusing on Skylake machines on which the
> > > > > > > > FUJ02B1 ACPI device is not present at all.
> > >
> > > Right, evolved.... time to take a step back and clean it up.
> > >
> > > > > > > > The proposal I put forward in regard to the above is to remove the three
> > > > > > > > backlight-related attributes (brightness_changed, lcd_level,
> > > > > > > > max_brightness) from the platform driver's sysfs tree. I believe the
> > > > > > > > functions they implement should only be exposed through the backlight
> > > > > > > > device, because the latter is only created when the user explicitly
> > > > > > > > selects vendor backlight control or it is automatically selected by the
> > > > > > > > kernel (this should be the case for older machines).
> > >
> > > This seems to be a good approach as in combination with the discussion below re
> > > the ACPI device, it eliminates the sysfs attributes from the platform device
> > > completely and makes the driver more consistent with others in the subsystem.
>
> I have now had a chance to revisit the historical background, especially as
> it relates to the three sysfs attributes mentioned (brightness_changed,
> lcd_level, max_brightness). It seems to me that these are most likely left
> overs from a very early version of fujitsu-laptop, originally out-of-tree,
> merged to mainline by myself and others. Like Michael I doubt there is any
> userspace utility which makes use of these. Checking the scripts which I
> personally use on my S7020 I see that I only ever use the attributes
> provided under/sys/devices/virtual/backlight/fujitsu-laptop when controlling
> the backlight. Like Michael said, it's impossible to completely rule out
> the possiblity of an obscure Fujitsu-only utility somewhere in the universe
> which makes use of the /sys/devices/platform/fujitsu-laptop/ backlight
> attributes but I think the probability of such a thing existing is
> vanishingly small. Even if there was, there is a mostly trivial mapping
> from old to new (lcd_level -> brightness, max_brightness -> max_brightness).
> Only brightness_changed isn't replicated but I'm sure something could be
> hooked if necessary.
>
> What this means is that from my perspective it is highly unlikely that
> removing the three sysfs attributes as proposed by Michael
> (brightness_changed, lcd_level, max_brightness) will break userspace in a
> practical sense. Instead, it will improve the structure of the
> fujitsu-laptop driver and make it more consistent with other platform
> drivers. Putting all this together, I have no objections to the removal as
> proposed by Michael: there appears to be far more gains than losses.
As the person who wrote the original driver, for Fujitsu, I can almost
guarantee that there is no specific "fujitsu utility" that uses that
platform driver. We just used the "normal" backlight/led interface
instead, so all should be fine there.
thanks,
greg k-h
prev parent reply other threads:[~2017-02-28 12:35 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-13 11:02 [PATCH 0/4] fujitsu_init() cleanup Michał Kępień
2017-01-13 11:02 ` [PATCH 1/4] platform/x86: fujitsu-laptop: simplify acpi_bus_register_driver() error handling Michał Kępień
2017-01-13 11:02 ` [PATCH 2/4] platform/x86: fujitsu-laptop: register backlight device in a separate function Michał Kępień
2017-01-13 11:02 ` [PATCH 3/4] platform/x86: fujitsu-laptop: sync backlight power status in acpi_fujitsu_hotkey_add() Michał Kępień
2017-01-13 11:02 ` [PATCH 4/4] platform/x86: fujitsu-laptop: cleanup error labels in fujitsu_init() Michał Kępień
2017-01-13 12:17 ` [PATCH 0/4] fujitsu_init() cleanup Jonathan Woithe
2017-01-13 13:19 ` Michał Kępień
2017-01-24 11:53 ` Jonathan Woithe
2017-02-03 14:06 ` Michał Kępień
2017-02-03 14:13 ` Andy Shevchenko
2017-02-04 0:44 ` Darren Hart
2017-02-04 6:21 ` Michał Kępień
2017-02-04 14:11 ` Andy Shevchenko
2017-02-27 7:19 ` Michał Kępień
2017-02-28 6:17 ` Darren Hart
2017-02-28 8:07 ` Greg Kroah-Hartman
2017-02-28 8:33 ` Michał Kępień
2017-02-28 11:24 ` Jonathan Woithe
2017-02-28 13:24 ` Michał Kępień
2017-02-28 14:01 ` Greg Kroah-Hartman
2017-02-28 14:40 ` Andy Shevchenko
2017-03-01 3:19 ` Darren Hart
2017-02-28 11:14 ` Jonathan Woithe
2017-02-28 12:33 ` Greg Kroah-Hartman [this message]
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=20170228123300.GB31751@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=andy.shevchenko@gmail.com \
--cc=dvhart@infradead.org \
--cc=jwoithe@just42.net \
--cc=kernel@kempniu.pl \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.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