Comment 0 for bug 949311

Revision history for this message
Maxim Mikityanskiy (maxtram95) wrote :

After upgrading to Ubuntu 10.04 LTS two years ago some special keys on my laptop stopped working. They don't send any scan codes or ACPI events ("showkey -s" and "acpi_listen" don't show anything), but they did it on Ubuntu 9.10 and they still do it on Gentoo with vanilla kernel. I expect that these keys have to work (to send scan codes and ACPI events) in newer Ubuntu than 9.10.

It was obvious that problem is in Ubuntu kernel patchset, because the thing works on vanilla kernel and doesn't work on Ubuntu-patched kernel. So, I decided to debug patched kernel, found the problem and have written the patch to fix it. The bug is in the file "drivers/acpi/video.c" in function acpi_video_bus_start_devices().

There is a line in the function in vanilla kernel:

return acpi_video_bus_DOS(video, 0, 0);

But in Ubuntu-patched kernel it is:

return acpi_video_bus_DOS(video, 0, 1);

The difference is the last argument: there is 0 in vanilla kernel and 1 in Ubuntu kernel.

If I change the last argument to 0 (like in vanilla kernel), my laptop's problem disappears.

But there should be 1 on other laptops, because setting the last argument to 1 on other laptops disables automatic display backlight brightness changing by BIOS when AC power appears/disappears: this behavior is provided by power manager in userspace and BIOS shouldn't interfere gnome-power-manager. It is correct on some other laptops, but my BIOS doesn't touch brightness on AC/DC power switch. However, it disables Fn+F* keys instead of disabling brightness autoswitch.

So, I think, there should be some settings to set the last parameter to 1 on the most laptops and to 0 on MSI Wind laptops. I'm attaching the patch. It doesn't change the current behavior by default, but it does if special kernel command line parameter is used. I hope you will accept this patch. It doesn't affect anything unless you add kernel command line parameter "video.brightness_autoswitch_on_power_events=1", but it fixes the bug on MSI Wind laptop if you add this parameter.

The problem exists in all Ubuntu versions from 10.04 to 12.04 with all kernels from 2.6.32 to current 3.2.0.

Excuse my poor English.