Bug 10670

Summary: BUG: linux-2.6.26-rc1 oops at thinkpad_acpi:led_set_status
Product: Drivers Reporter: Rafael J. Wysocki (rjw)
Component: PlatformAssignee: Henrique de Moraes Holschuh (hmh)
Status: CLOSED PATCH_ALREADY_AVAILABLE    
Severity: normal CC: acpi-bugzilla, bunk, hmh, lmctlx
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.26-rc1 Subsystem:
Regression: Yes Bisected commit-id:
Bug Depends on:    
Bug Blocks: 10492    
Attachments: Object code generated by the compiler
[PATCH] ACPI: thinkpad-acpi: fix LED handling on older ThinkPads

Description Rafael J. Wysocki 2008-05-11 12:46:24 UTC
Subject    : BUG: linux-2.6.26-rc1 oops at thinkpad_acpi:led_set_status
Submitter  : Karol Lewandowski <lmctlx@gmail.com>
Date       : 2008-05-08 23:12
References : http://marc.info/?l=linux-kernel&m=121028841527994&w=4
Handled-By : Henrique de Moraes Holschuh <hmh@hmh.eng.br>

This entry is being used for tracking a regression from 2.6.25.  Please don't
close it until the problem is fixed in the mainline.
Comment 1 Henrique de Moraes Holschuh 2008-05-11 21:37:38 UTC
So far, this looks like a compiler bug.  Here's the data I got from the bug reporter.

Bug shows up when compiling the kernel with no stack frames, and -Os.

Affected GCC version:
gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
Comment 2 Henrique de Moraes Holschuh 2008-05-11 21:39:20 UTC
Created attachment 16104 [details]
Object code generated by the compiler

The tarball contains two files sent by the reporter of the bug.

fp means frame-pointer.  This thinkpad-acpi does NOT exibit the OOPS.
nofp means no-frame-pointer.  This thinkpad-acpi DOES exibit the OOPS.
Comment 3 Henrique de Moraes Holschuh 2008-05-11 21:41:27 UTC
I request help from someone which understands gcc to verify if it is indeed a compiler bug.
Comment 4 Henrique de Moraes Holschuh 2008-05-14 19:13:19 UTC
Adrian Bunk found the problem: tpacpi_led_state_cache[led] = <something> could be used with led redefined to be (1 << led).  This would overwrite random memory at positions tpacpi_led_state_cache[led] + 0x80/0x40/0x20/0x10/0x08.

A fix will be ready soon.
Comment 5 Henrique de Moraes Holschuh 2008-05-14 21:30:01 UTC
Created attachment 16153 [details]
[PATCH] ACPI: thinkpad-acpi: fix LED handling on older ThinkPads

Please test.
Comment 6 Karol Lewandowski 2008-05-15 06:06:30 UTC
I can't reproduce oops with this patch.  Bug fixed.

Thanks.
Comment 7 Rafael J. Wysocki 2008-05-15 14:46:42 UTC
Regressions list annotation:
References : http://lkml.org/lkml/2008/5/12/12
Comment 8 Rafael J. Wysocki 2008-05-20 15:16:28 UTC
Regressions list annotation:
Patch : http://bugzilla.kernel.org/attachment.cgi?id=16153&action=view
Comment 9 Henrique de Moraes Holschuh 2008-05-20 15:36:21 UTC
Still waiting for merge upstream.
Comment 10 Shaohua 2008-05-28 00:46:22 UTC
mark this as resolved so Len can take it.
Comment 11 Adrian Bunk 2008-06-12 01:29:54 UTC
fix is not in Linus' tree as commit 24e45bbe695719dca8c20e03d386eb6ea86526b5