Bug 48671 - Sony-laptop doesn't detect Fn keys and doesn't show keyboard backlight controls on VPCS11E7E
Summary: Sony-laptop doesn't detect Fn keys and doesn't show keyboard backlight contro...
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Platform (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Mattia Dongili
URL:
Keywords:
: 45281 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-10-10 10:51 UTC by Fabrizio Narni
Modified: 2013-01-19 22:59 UTC (History)
6 users (show)

See Also:
Kernel Version: 3.5
Tree: Mainline
Regression: Yes


Attachments
Decompiled DSDT (450.35 KB, text/x-dsl)
2012-10-26 10:07 UTC, Fabrizio Narni
Details
dmesg (8.74 KB, text/x-log)
2012-10-26 10:09 UTC, Fabrizio Narni
Details
attempt at fixing and printing additional debug information (1.11 KB, patch)
2012-10-26 23:13 UTC, Mattia Dongili
Details | Diff
dmesg with patched module (71.78 KB, text/plain)
2012-10-27 11:35 UTC, mus.svz
Details
dmesg with patched sony-laptop (7.22 KB, text/x-log)
2012-10-27 12:42 UTC, Fabrizio Narni
Details

Description Fabrizio Narni 2012-10-10 10:51:38 UTC
I have a Sony Vaio VPCS11E7E and since Linux 3.5 (3.6 too) I can no longer use my Fn keys such as screen backlight up/down anymore. They are not even detected by acpi_listen.
Moreover kbd_backlight and kbd_backlight_timeout disappeared from /sys/devices/platform/sony-laptop (although the new thermal_* controls are there).
Reverting to 3.4.x solves the problems.

I am new here and I don't know what info you may need for this, so please ask me for anything.
Comment 1 Fabrizio Narni 2012-10-21 10:52:10 UTC
After a few testing, I think that's the root of the problem:

root@VPCS11E7E:/usr/src/linux-stable# git bisect bad
5fe801a7427cb13c530af59e2b77b30d789d9b9a is the first bad commit
commit 5fe801a7427cb13c530af59e2b77b30d789d9b9a
Author: Marco Chiappero <marco@absence.it>
Date:   Sat May 19 22:35:48 2012 +0900

    sony-laptop: improve SNC initialization and acpi notify callback code
    
    Loop through the list of SNC handles and run the proper initialization
    function for each of the known handles. Also return void in function
    where we are not checking the return value anyway.
    For notifications we also know which handle is linked to the event and
    the code becomes simpler to read with a switch rather than using
    convoluted ifs.
    
    [malattia@linux.it: Code reworked to merge the initialization code
    improvements and the notify callback changes. Modified the code paths to
    allow easier error exit paths.  Also fixed some missing break statements
    and spelling mistakes.]
    
    Signed-off-by: Marco Chiappero <marco@absence.it>
    Signed-off-by: Mattia Dongili <malattia@linux.it>
    Signed-off-by: Matthew Garrett <mjg@redhat.com>

:040000 040000 eaea189cb16a74b5fc10a6e5ad8f7a59e68693c8 2be889391b731842440173913e8a605a8e6eb0fa M	drivers
Comment 2 Mattia Dongili 2012-10-25 21:48:26 UTC
Hi,

could you please attach the DSDT of you laptop and the kernel log (dmesg) after loading sony-laptop with 'modprobe sony-laptop debug=1'?

To get the DSDT you can run
  acpidump -t DSDT -b -o DSDT.aml
or 
  cat /sys/firmware/acpi/tables/DSDT > DSDT.aml

then you can decompile the resulting file using:
  iasl -d DSDT.aml

you can attach either the binary file or the decompiled one.

also, maybe you're also seeing this issue:
https://bugzilla.kernel.org/show_bug.cgi?id=45281
Comment 3 Fabrizio Narni 2012-10-26 10:07:14 UTC
Created attachment 84941 [details]
Decompiled DSDT
Comment 4 Fabrizio Narni 2012-10-26 10:09:19 UTC
Created attachment 84951 [details]
dmesg
Comment 5 Fabrizio Narni 2012-10-26 10:19:55 UTC
Well, at first glance my dmesg output looks very similar to id=45281, but I can't say the module "crashed", since I have thermal_control and thermal_profiles under /sys/devices/platform/sony-laptop/
Comment 6 Mattia Dongili 2012-10-26 23:13:35 UTC
Created attachment 85011 [details]
attempt at fixing and printing additional debug information

Fabrizio, could you please try this patch and again attach the kernel log after loading the driver with debug=1 ?
Comment 7 Mattia Dongili 2012-10-26 23:17:30 UTC
*** Bug 45281 has been marked as a duplicate of this bug. ***
Comment 8 mus.svz 2012-10-27 11:34:40 UTC
I applied the patch against kernel 3.6.3 and it seems to fix bug 45281 for me, the module loads and the brightness keys work again.

dmesg attached.

thanks!
Comment 9 mus.svz 2012-10-27 11:35:48 UTC
Created attachment 85021 [details]
dmesg with patched module
Comment 10 Fabrizio Narni 2012-10-27 12:42:49 UTC
Created attachment 85031 [details]
dmesg with patched sony-laptop
Comment 11 Fabrizio Narni 2012-10-27 12:48:34 UTC
Same for me. Fn keys work and kbd_backlight* are shown.
Comment 12 Fabrizio Narni 2012-10-27 17:00:13 UTC
After resuming from suspend however the module starts acting oddly: keyboard backlight lights up (even if kbd_backlight was/is set to 0, but setting it to 0 again turns it off) and Fn keys stop working.
Comment 13 mus.svz 2012-10-27 18:22:01 UTC
I got another problem: Sometimes the backlight keys start to act weird after some time. They are only triggered after pressing them multiple times or don't work at all in between. It's kind of hard to explain and I'm not sure what triggers this behaviour. I noticed however that this stops after resuming from suspend and the keys work fine again. I'm gonna try to find out when/how exactly this starts happening.

can't comment on the keyboard backlight, my model (VPCS11C5E) doesn't have it.

As a side note, I really wanna smack this laptop against a wall, I've always had some kind of new problem with every new kernel release and there never was a point where everything "just worked".
Don't get me wrong, I'm not blaming the Linux devs, I'm blaming Sony for what I'm guessing are crappy BIOS/ACPI implementations. Sorry, I needed to say this. ;)
Comment 14 Fabrizio Narni 2012-10-27 19:37:20 UTC
My bad, I booted the wrong kernel. Everything seems ok with 3.6.3 and I haven't had the multiple pressing problem so far.
Comment 15 Mattia Dongili 2012-10-28 00:08:33 UTC
(In reply to comment #13)
> I got another problem: Sometimes the backlight keys start to act weird after
> some time. They are only triggered after pressing them multiple times or
> don't
> work at all in between. It's kind of hard to explain and I'm not sure what
> triggers this behaviour. I noticed however that this stops after resuming
> from
> suspend and the keys work fine again. I'm gonna try to find out when/how
> exactly this starts happening.

you can try to run sony-laptop with the debug=1 parameter and see if it logs any activity. Or reload the module to see if it's related to 
sony-laptop at all.
In any case it sounds unrelated to the issue reported here, if you want we can keep discussing separately.

Thanks both for your help!
Comment 16 Florian Mickler 2013-01-19 22:59:32 UTC
A patch referencing this bug report has been merged in Linux v3.8-rc4:

commit dcbeec264d73b7228ffdfe767eab69b2353099b1
Author: Mattia Dongili <malattia@linux.it>
Date:   Fri Dec 21 07:21:09 2012 +0900

    sony-laptop: fix SNC buffer calls when SN06 returns Integers

Note You need to log in before you can comment on or make changes to this bug.