Message ID | 20170923090839.GC21630@marvin.atrad.com.au (mailing list archive) |
---|---|
State | Rejected, archived |
Delegated to: | Darren Hart |
Headers | show |
On Sat, Sep 23, 2017 at 06:38:40PM +0930, Jonathan Woithe wrote: > Hi Darren > > The more detailed follow-up, as promised. :-) Sorry for the delay. > > On Fri, Sep 22, 2017 at 05:00:48PM -0700, Darren Hart wrote: > > On Mon, Sep 18, 2017 at 11:00:59PM +0300, Ville Syrjala wrote: > > > From: Ville Syrjälä <ville.syrjala@linux.intel.com> > > > > > > My Fujitsu-Siemens Lifebook S6120 doesn't have the FUJ02E3 device, > > > but it does have FUJ02B1. That means we do register the backlight > > > device (and it even seems to work), but the code will oops as soon > > > as we try to set the backlight brightness because it's trying to > > > > I'm curious by what you mean with "it even seems to work". Since it > > crashes when adjusting, what does it do that "works" ? > > As mentioned earlier, I have assumed that this means the backlight > adjustment works correctly if the suggested patch has been applied. Yes. > Having > thought about this some more I am unconvinced: if fext is NULL then > call_fext_func() (with the check added) can't have any effect. The > backlight adjustment might still work, but it's not due to this code path. It still calls set_lcd_level() which I assume is the thing that makes it work.
On Mon, Sep 25, 2017 at 03:14:41PM +0300, Ville Syrjälä wrote: > On Sat, Sep 23, 2017 at 06:38:40PM +0930, Jonathan Woithe wrote: > > > I'm curious by what you mean with "it even seems to work". Since it > > > crashes when adjusting, what does it do that "works" ? > > > > As mentioned earlier, I have assumed that this means the backlight > > adjustment works correctly if the suggested patch has been applied. > > Yes. Great - thanks for confirming. > > Having > > thought about this some more I am unconvinced: if fext is NULL then > > call_fext_func() (with the check added) can't have any effect. The > > backlight adjustment might still work, but it's not due to this code path. > > It still calls set_lcd_level() which I assume is the thing that makes it > work. Yes, of course. Thanks, I was overthinking things. :-) Darren: this confirms that the idea of only registering FUJ02B1 if FUJ02E3 exists is no good: the S6120 (and probably others) needs FUJ02B1 but doesn't have a FUJ02E3. This means that at least for the purposes of addressing this regression, the null device check is the best option: either in bl_update_status() (Ville's original patch) or in call_fext_func() (as suggested by Michel, with a suggested patch in my post on the 24th). Regards jonathan
--- a/drivers/platform/x86/fujitsu-laptop.c 2017-09-23 18:24:47.258058706 +0930 +++ b/drivers/platform/x86/fujitsu-laptop.c 2017-09-23 18:27:24.938052251 +0930 @@ -153,6 +153,10 @@ static int call_fext_func(struct acpi_de unsigned long long value; acpi_status status; + if (!device) { + return 0; + } + status = acpi_evaluate_integer(device->handle, "FUNC", &arg_list, &value); if (ACPI_FAILURE(status)) {