Bug 9663 - in 2.6.24-rc6 function keys stopped working - toshiba u300-13m, FSC V5505
Summary: in 2.6.24-rc6 function keys stopped working - toshiba u300-13m, FSC V5505
Status: CLOSED DUPLICATE of bug 9627
Alias: None
Product: ACPI
Classification: Unclassified
Component: EC (show other bugs)
Hardware: All Linux
: P1 high
Assignee: Alexey Starikovskiy
URL:
Keywords:
Depends on:
Blocks: 9243
  Show dependency tree
 
Reported: 2007-12-29 16:07 UTC by Mihail Keepa
Modified: 2008-10-17 21:23 UTC (History)
4 users (show)

See Also:
Kernel Version: 2.6.24-rc6
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments
results of acpidump (186.33 KB, text/plain)
2008-01-07 10:54 UTC, Mihail Keepa
Details
dmesg result (24.75 KB, text/plain)
2008-01-07 10:55 UTC, Mihail Keepa
Details

Description Mihail Keepa 2007-12-29 16:07:00 UTC
Most recent kernel where this bug did not occur: 2.6.23.12
Distribution: debian unstable
Hardware Environment: toshiba u300-13m
Software Environment: -
Problem Description: function keys that tune the brightness of lcd on my notebook stop to work. function key that enable/disable touchpad stop to work. on 2.6.23.12 kernel it work fine, but atkbd.c always report about unknown key code but keys work! on .24 kernel no such reports happen but keys doesn`t work!

Steps to reproduce: install 2.6.24-rc6 kernel
Comment 1 Anonymous Emailer 2007-12-29 18:38:05 UTC
Reply-To: akpm@linux-foundation.org


Another regression.

Begin forwarded message:

Date: Sat, 29 Dec 2007 16:07:30 -0800 (PST)
From: bugme-daemon@bugzilla.kernel.org
To: bugme-new@lists.osdl.org
Subject: [Bugme-new] [Bug 9663] New: in 2.6.24-rc6 function keys on my notebook doesn`t work


http://bugzilla.kernel.org/show_bug.cgi?id=9663

           Summary: in 2.6.24-rc6 function keys on my notebook doesn`t work
           Product: ACPI
           Version: 2.5
     KernelVersion: 2.6.24-rc6
          Platform: All
        OS/Version: Linux
              Tree: Mainline
            Status: NEW
          Severity: high
          Priority: P1
         Component: ACPICA-Core
        AssignedTo: acpi_acpica-core@kernel-bugs.osdl.org
        ReportedBy: msnkipa@mail.ru


Most recent kernel where this bug did not occur: 2.6.23.12
Distribution: debian unstable
Hardware Environment: toshiba u300-13m
Software Environment: -
Problem Description: function keys that tune the brightness of lcd on my
notebook stop to work. function key that enable/disable touchpad stop to work.
on 2.6.23.12 kernel it work fine, but atkbd.c always report about unknown key
code but keys work! on .24 kernel no such reports happen but keys doesn`t work!

Steps to reproduce: install 2.6.24-rc6 kernel
Comment 2 Jan-Simon Möller 2007-12-30 05:11:50 UTC
I can confirm this on a FSC V5505. Brightness-buttons stop working here, too.

Best regards
Jan-Simon
Comment 3 Len Brown 2007-12-30 22:29:12 UTC
The first thing to figure out is if this has anything to do
with ACPI or not.

With working 2.6.23, if you kill acpid and cat /proc/acpi/event
and press the hotkeys, do you see any events come out?
(press the power, sleep, or lid switch to test that this
 mechanism is working at all)  If no events on working
hotkeys in ACPI mode, then these laptops are not using
ACPI for hotkeys and this bug belongs in a different category.

Do hotkeys function properly in 2.6.23 with "acpi=off"?
If yes, do they still function properly in 2.6.24 with "acpi=off"?

Any chance that you can git bisect to find which change
during 2.6.24 development caused this regression?

> on 2.6.23.12 kernel it work fine, but atkbd.c always report
> about unknown key code but keys work! on .24 kernel no such
> reports happen but keys doesn`t work!

Hmmm, this doesn't sound like ACPI is underneath, but we'll see.

Are you running the acpi vidoe driver toshiba_acpi driver in both cases?

> I can confirm this on a FSC V5505. Brightness-buttons stop working here, too.

Are you running the acpi video driver or fujitsu-laptop driver in both cases?

Can you attach the dmesg -s64000 output for the working and failing cases?
Comment 4 Rafael J. Wysocki 2008-01-01 11:31:31 UTC
On Sunday, 30 of December 2007, Andrew Morton wrote:
> 
> Another regression.

Added to the list, thanks.


> Begin forwarded message:
> 
> Date: Sat, 29 Dec 2007 16:07:30 -0800 (PST)
> From: bugme-daemon@bugzilla.kernel.org
> To: bugme-new@lists.osdl.org
> Subject: [Bugme-new] [Bug 9663] New: in 2.6.24-rc6 function keys on my
> notebook doesn`t work
> 
> 
> http://bugzilla.kernel.org/show_bug.cgi?id=9663
> 
>            Summary: in 2.6.24-rc6 function keys on my notebook doesn`t work
>            Product: ACPI
>            Version: 2.5
>      KernelVersion: 2.6.24-rc6
>           Platform: All
>         OS/Version: Linux
>               Tree: Mainline
>             Status: NEW
>           Severity: high
>           Priority: P1
>          Component: ACPICA-Core
>         AssignedTo: acpi_acpica-core@kernel-bugs.osdl.org
>         ReportedBy: msnkipa@mail.ru
> 
> 
> Most recent kernel where this bug did not occur: 2.6.23.12
> Distribution: debian unstable
> Hardware Environment: toshiba u300-13m
> Software Environment: -
> Problem Description: function keys that tune the brightness of lcd on my
> notebook stop to work. function key that enable/disable touchpad stop to
> work.
> on 2.6.23.12 kernel it work fine, but atkbd.c always report about unknown key
> code but keys work! on .24 kernel no such reports happen but keys doesn`t
> work!
> 
> Steps to reproduce: install 2.6.24-rc6 kernel
Comment 5 Zhang Rui 2008-01-06 23:48:10 UTC
Hi, moller,
please ansewer the question in comment#3 first.
Please attach the acpidump as well, the latest pmtools can be found at
http://www.kernel.org/pub/linux/kernel/people/lenb/acpi/utils/
Comment 6 Mihail Keepa 2008-01-07 10:54:47 UTC
Created attachment 14328 [details]
results of acpidump

results of acpidump
Comment 7 Mihail Keepa 2008-01-07 10:55:34 UTC
Created attachment 14329 [details]
dmesg result
Comment 8 Mihail Keepa 2008-01-07 10:56:14 UTC
Hi!
I can answer to the comment #3

>With working 2.6.23, if you kill acpid and cat /proc/acpi/event
and press the hotkeys, do you see any events come out?

This metod works I can see ACPI events (lid, Power button) but no ACPI event associated with hotkeys

>Do hotkeys function properly in 2.6.23 with "acpi=off"?
If yes, do they still function properly in 2.6.24 with "acpi=off"?

In my configuration kernel doesn`t booting! Boot propcess stops at the stage of
io scheduler cfq registered (default)

Are you running the acpi vidoe driver toshiba_acpi driver in both cases?

yes but no toshiba_acpi becaute U300 has phoenix BIOS :(

I`ve attached acpidump and dmesg results
Mihail
Comment 9 Len Brown 2008-01-07 12:04:08 UTC
> I can see ACPI events (lid, Power button) but no ACPI event
> associated with hotkeys.

> no toshiba_acpi

Okay, that eliminates ACPI events and user-space from the picture,
and also eliminates the toshiba_acpi driver.

Please confirm that if you remove the ACPI video driver from 2.6.23,
that the hotkey actions you describe stop working.

What do you see if you revert drivers/acpi/video.c in 2.6.24
to the version that shipped in 2.6.23?

note that the brightness keys and the touchpad keys
may be different problems.  brightness is likely related
to ACPI video driver changes, touchpad may be related
to something else in the Linux input system.
Comment 10 Mihail Keepa 2008-01-07 14:37:58 UTC
I can say that:

>Please confirm that if you remove the ACPI video driver from 2.6.23,
that the hotkey actions you describe stop working.

No it`s not true! I can remove this driver and brightness keys continue to work. It work in grub also and began to work!

>What do you see if you revert drivers/acpi/video.c in 2.6.24
to the version that shipped in 2.6.23?

Nothing happens! Expect that in .23
echo [value] > /sys/class/backlight/acpi_video0/brightness
doesnt work but it work in .24 very well!

In 24 brightness keys as I notice rty to work in console but not in X! On toshoba there are 7 states of brighness. So in console I can reduce from 7 to 0 via 5 3 1 steps and grow via 1 2 4 6 states - it`s unnormal! And it only began to work if I tune brightness during kernel booting process :)

In .23 works all fn+F[1-11] + fn+Esc keys! They generate event`s in atkbd.c so I have an opportunitu to write programm to manage them - as in windows. Toshutils doesn`t work in loptops wiht phoenix bios :( . But now with .24 kernel I can`t do this. I think It would be good idea to return old .23 behavior (expect broken software brightness management in /sys/class/backlight/acpi_video0/brightness ). But I don`t understand how.

Is anywhere patches only beween old .23 and new .24 acpi subsutem? All other part of .23 kernel I don`t want to upgrade. The Idea is to upgrade only ACPI and see to the results...

Mihail.
Comment 11 Zhang Rui 2008-01-07 23:25:20 UTC
Hmm, I don;t think this is an ACPI issue then.
>I can remove this driver and brightness keys continue to work.
>It work in grub also and began to work!
> I can see ACPI events (lid, Power button) but no ACPI event
> associated with hotkeys.
No hotkey events go via ACPI.
I think this is probably a kerboard driver regression rather than an ACPI issue.
What do you think, len?
Comment 12 Mihail Keepa 2008-01-08 01:11:04 UTC
Hi
I compere keyboard drivers atkbd.c in .23 and .24 and I have found out that there are only one change: BIT(x) ->BIT_MASK(x)
I change it back but nothing happen, hotkeys aren`t work!
If I add 
#define ATKBD_DEBUG
directive in atkbd.c I can find out that it doesn`t calls when I press fh key! (in .23 in calls)
I meen
static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
			unsigned int flags)
function.
There also some changements in drivers/char/keyboard.c, drivers/input/input.c but for now I don`t know how they affec to to the promlem.
Comment 13 Jan-Simon Möller 2008-01-08 14:25:33 UTC
Hi !
Apologies for my late reply. 

I checked these builds now:
2.6.23-acpi.git (~ Sep 07)  with _and_ without acpi=off -> WORKS
2.6.24-rc6 from git  with no cmdline-option -> works NOT
2.6.24-rc6 from git  with acpi=off -> WORKS !!

I'm running a openSuSE 10.3 with updated kernels, because of sound, wlan and acpi.

I'm just compiling a checkout of rc7. Will report. If you need some lsmod/dmesg/acpidumps from these environments, drop me a note please.
Comment 14 Mihail Keepa 2008-01-08 15:02:52 UTC
 
So I have mentioned one interesting thing
For keyboard we have such sequence:

drivers/input/serio/i8042.c:
static irqreturn_t i8042_interrupt(int irq, void *dev_id)
---->
drivers/input/serio/serio.c:
irqreturn_t serio_interrupt(struct serio *serio,
                unsigned char data, unsigned int dfl)
---------->
drivers/input/keyboard/atkbd.c
static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
                        unsigned int flags)
/this function in .23 kernel generates messages about unknown key codes fo fn
keys using printk()/

in this sequence i8042_interrupt is registereg with request_irq function in
kernel to trap keyboard (not only) interupts. And in .23 kernel we have such
interupt from fn key but in .24 THERE ARE NO INTERUPTS AT ALL!

But there are more interesting thing
fn+f9 - which control touchpad - works correctly with messages in atkbd.c
fn+[f1,f3,f11] - generates interupts in i8042.c but not later (why I don`t
know)

I try to change i8042 driver from new .24 to old .23 but nothing happen
I try to change drivers/char/keyboard.c from new .24 to old .23 version but
nothing happen
I don`t try to to change full /drivers/input from new to old but diff showa
that serio.c and atkbd.c haven`t got principal differences in new in old
version

So I have got some questions:
Where the implementation of request_irq for x86-32 platform? I can`t find it in
asm-x86/kernel/irq.c 
Where the lowerest fuction to trace IRQ`s - the first one in the sequence?
Mabye fn key generates irq but doesn`t call the i8042 handler...
I will be very glad to hear ypur comment`s and answers.
Mihail
Comment 15 Mihail Keepa 2008-01-08 15:22:27 UTC
I also trid to start with acpi=off command and nothing happen! Mo over stops to work all fn keys!
Comment 16 Jan-Simon Möller 2008-01-08 16:31:34 UTC
Test on 2.6.24-rc7: acpi=off   Works !
        2.6.24-rc7: no cmdline  doesn't work ...
Comment 17 Len Brown 2008-01-08 20:54:51 UTC
> 2.6.24-rc7: no cmdline  doesn't work ...
> 2.6.23-acpi.git (~ Sep 07)  with _and_ without acpi=off -> WORKS

Jan, Keepa,
is there any chance you can git-bisect to see what
commit between 2.6.23 and 2.6.24-rc6 broke the function keys in acpi mode?
Comment 18 Jan-Simon Möller 2008-01-08 22:16:41 UTC
Hmmm, my Laptop was affected by this "my eth0 died" issue between 2.6.24-rc2 and 2.6.24-rc5. Any Idea how i could exclude the problematic section ?
Hmmm or i could use a kernelconfig without the network-driver built. I think i'll do this. I'll start with mainline.
Comment 19 Jan-Simon Möller 2008-01-09 03:54:34 UTC
From bisection i know already that it was introduced somewhere in late -rc2 or early -rc3 cycle. Still 82 revisions left.
Comment 20 Mihail Keepa 2008-01-09 04:31:31 UTC
OK, as far as I understand I ought to take 2.6.23 kernel and appply to them patch-2.6.24rc[x]-git[x] one after another and cath the place where fn key stop to work?
So it mabye long but I tried to...
Comment 21 Jan-Simon Möller 2008-01-09 06:28:08 UTC
I bisected mainline-git now down to:
5870a8cd23181703cc76f88f630372f8602c7648 is first bad commit
commit 5870a8cd23181703cc76f88f630372f8602c7648
Author: Alexey Starikovskiy <astarikovskiy@suse.de>
Date:   Thu Nov 15 21:52:47 2007 +0300

    ACPI: EC: Don't init EC early if it has no _INI

    Option to init EC early inserted to handle #8598 ASUS problem,
    introduced several others.

    EC driver in this particular case has fake _INI method, not present on
    other machines, which don't need or break from this workaround, so lets use
    its presence as a flag for early init.

    http://bugzilla.kernel.org/show_bug.cgi?id=9262
    http://bugzilla.kernel.org/show_bug.cgi?id=8598
    https://bugzilla.novell.com/show_bug.cgi?id=334806

    Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
    Signed-off-by: Len Brown <len.brown@intel.com>

:040000 040000 d52245543c908defe7722baf1f16cfaaa00a55b9 8b5b7c12bc88ba8f5d4a0f4e67150a70318a754a M      drivers


bisect-log:
git-bisect start
# bad: [927a395a6e735fb84fcb47eacf7ec65a4422351f] battery fix
git-bisect bad 927a395a6e735fb84fcb47eacf7ec65a4422351f
# good: [bbf25010f1a6b761914430f5fca081ec8c7accd1] Linux 2.6.23
git-bisect good bbf25010f1a6b761914430f5fca081ec8c7accd1
# good: [fc8a327db6c46de783b1a4276d846841b9abc24c] Merge branch 'linus' of master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa
git-bisect good fc8a327db6c46de783b1a4276d846841b9abc24c
# good: [79da0874410c0af8958f0ee3a50aa5b67eecc640] x86 gart: make some variables and functions static
git-bisect good 79da0874410c0af8958f0ee3a50aa5b67eecc640
# bad: [f4d53cedce872fe1439818d15e067b497b5d466f] Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
git-bisect bad f4d53cedce872fe1439818d15e067b497b5d466f
# good: [8fc543c8f004fc9dfe0a262dc452dfe2eca4589b] Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
git-bisect good 8fc543c8f004fc9dfe0a262dc452dfe2eca4589b
# good: [9ac625a3986034d79938baf9604210280fae35fa] uml: fix spurious IRQ testing
git-bisect good 9ac625a3986034d79938baf9604210280fae35fa
# good: [0048e1c44a4529d4ea93e6920fa5468730c68c94] Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
git-bisect good 0048e1c44a4529d4ea93e6920fa5468730c68c94
# bad: [a3f095ade0f5fd2a09a7f523632d762314452871] Pull bugzilla-9327 into release branch
git-bisect bad a3f095ade0f5fd2a09a7f523632d762314452871
# bad: [95b00786f3b8fa99f53931361beeb4c10504ad87] Pull cpuidle into release branch
git-bisect bad 95b00786f3b8fa99f53931361beeb4c10504ad87
# good: [3d9befd2cdf65b1768b0d3078a65cc0ae9aa6412] x86: check boundary in count setup resource
git-bisect good 3d9befd2cdf65b1768b0d3078a65cc0ae9aa6412
# good: [7833b4ae466e084a865542c6fd83394a3d274144] Pull bugzilla-9153 into release branch
git-bisect good 7833b4ae466e084a865542c6fd83394a3d274144
# bad: [22201f7402851b9a47e64139ca589bd8555f7138] Pull bugzilla-9327 into release branch
git-bisect bad 22201f7402851b9a47e64139ca589bd8555f7138
# bad: [5824b4512650db90ddd5fdbea7f8aea3c7df3a94] Pull bugzilla-9262 into release branch
git-bisect bad 5824b4512650db90ddd5fdbea7f8aea3c7df3a94
# bad: [5870a8cd23181703cc76f88f630372f8602c7648] ACPI: EC: Don't init EC early if it has no _INI
git-bisect bad 5870a8cd23181703cc76f88f630372f8602c7648
Comment 22 Jan-Simon Möller 2008-01-09 08:50:35 UTC
Ther keys work here if 5870a8cd23181703cc76f88f630372f8602c7648 is reverted even with 2.6.24-rc7.

Patch to revert this commit would be:

------------------------------ drivers/acpi/ec.c ------------------------------
index d411017..7d6b841 100644
@@ -913,20 +913,12 @@ int __init acpi_ec_ecdt_probe(void)
 		boot_ec->gpe = ecdt_ptr->gpe;
 		boot_ec->handle = ACPI_ROOT_OBJECT;
 	} else {
-		/* This workaround is needed only on some broken machines,
-		 * which require early EC, but fail to provide ECDT */
-		acpi_handle x;
 		printk(KERN_DEBUG PREFIX "Look up EC in DSDT\n");
 		status = acpi_get_devices(ec_device_ids[0].id, ec_parse_device,
 						boot_ec, NULL);
 		/* Check that acpi_get_devices actually find something */
 		if (ACPI_FAILURE(status) || !boot_ec->handle)
 			goto error;
-		/* We really need to limit this workaround, the only ASUS,
-		 * which needs it, has fake EC._INI method, so use it as flag.
-		 */
-		if (ACPI_FAILURE(acpi_get_handle(boot_ec->handle, "_INI", &x)))
-			goto error;
 	}
 
 	ret = ec_install_handlers(boot_ec);


I don't know if this has any other side-effects (beside the asus laptop the patch was meant for). It works here on the first try.

Have phun !
Comment 23 Mihail Keepa 2008-01-09 10:40:04 UTC
Hi
Yes It solve one promlem but there is another!
If I appy this patch to 2.6.24-rc7 I return to the behavior of the .32 kernel where I cat control brightness with fn+[Fx] keys but I can`t control brightness from software via /sys/class/backlight/acpi_video0/brightness!

So as result for today we have:
1) Working fn+[Fx] keys with their function, But disworking echo [x] > /sys/class/backlight/acpi_video0/brightness method
2) Disworking fn+[Fx] keys with their function, But working echo [x] > /sys/class/backlight/acpi_video0/brightness method

This bug is in driver for EC controller.

So, mabye there is a solution which allow working together 
- fn+[Fx] keys with their function
- echo [x] > /sys/class/backlight/acpi_video0/brightness method
???
Comment 24 Alexey Starikovskiy 2008-01-11 14:29:01 UTC

*** This bug has been marked as a duplicate of bug 9627 ***
Comment 25 Jan-Simon Möller 2008-01-17 16:19:28 UTC
NACK for the V5505.
With a build of 2.6.24-rc8 the keys don't work and the backlight is not controllable.
Comment 26 Mihail Keepa 2008-01-17 18:26:08 UTC
Ok, Jan, can you see bug #9724 - there are some patch that I have wrote for my toshoba laptop. It`s correct video.c driver. Would it solve the problem on your laptop?
Comment 27 Thomas Wendt 2008-01-21 12:09:00 UTC
(In reply to comment #26)
> Ok, Jan, can you see bug #9724 - there are some patch that I have wrote for
> my
> toshoba laptop. It`s correct video.c driver. Would it solve the problem on
> your
> laptop?
> 
I have the same laptop and problems as Jan. I testet the 2.6.24rc8 kernel with the commit a7da60f41551abb3c520b03d42ec05dd7decfc7f and your patch applied but the hotkeys do not work.

Fn + F8 shows the setkeycodes messages in the dmesg output but Fn + F9 shows nothing. I can't control the brightness via the gnome-power-manager but I can control it with /proc/acpi/video/GFX0/DD03/brightness.

And why is this bug closed as a duplicate of 9627? Should it be reopened?
Comment 28 Mihail Keepa 2008-01-21 13:52:12 UTC
I think that you shoul read bud 9627 and
open ec.c ant add to the acpi_ec_gpe_query() 
and to the acpi_video_device_notify() in video.c something like
printk("DBG: xx_xxx_xxx_xxx called event %x \n", event);
recompile kernel and try to press keys. Then see dmesg output, for one press there shoul be two new lines from printk...
Comment 29 Thomas Wendt 2008-01-22 10:56:06 UTC
(In reply to comment #28)
> I think that you shoul read bud 9627 and
> open ec.c ant add to the acpi_ec_gpe_query() 
> and to the acpi_video_device_notify() in video.c something like
> printk("DBG: xx_xxx_xxx_xxx called event %x \n", event);
> recompile kernel and try to press keys. Then see dmesg output, for one press
> there shoul be two new lines from printk...
> 
Did that and nothing changes. No "DBG: ..." in the dmesg output and in other files. Either I did something wrong or the functions don't get called on a key press.
Comment 30 Mihail Keepa 2008-01-22 16:46:39 UTC
Right! 
When yoy have Fn + F8 shows the setkeycodes messages in the dmesg output (atkbd.c driver am I right?) Fn keys doesn`t handles by acpi! You problem more deeper in EC controller driver than solution from me. So my patch doesn`t work because your problem doesn`t touch thes driver yet.

Try to add "printk" into .24-rc8 kernel without any other patches.

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