Bug 41562 - acer-wmi: acer aspire 721 bluetooth control doesn't work with kernel 3.0.0
Summary: acer-wmi: acer aspire 721 bluetooth control doesn't work with kernel 3.0.0
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Platform_x86 (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Lee, Chun-Yi
URL:
Keywords:
Depends on:
Blocks: 36912
  Show dependency tree
 
Reported: 2011-08-22 18:32 UTC by sbraz
Modified: 2012-07-03 01:59 UTC (History)
7 users (show)

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


Attachments
acpidump (66.49 KB, application/x-bzip)
2011-08-22 18:32 UTC, sbraz
Details
test.diff (1.03 KB, patch)
2011-08-23 03:17 UTC, Lee, Chun-Yi
Details | Diff
acer-wmi.c (44.65 KB, text/x-csrc)
2011-08-23 03:19 UTC, Lee, Chun-Yi
Details
dmesg with test.diff (56.53 KB, application/octet-stream)
2011-08-23 09:13 UTC, sbraz
Details
DSDT.hex (521.50 KB, application/octet-stream)
2011-08-24 08:58 UTC, Lee, Chun-Yi
Details
dmesg -> Comment #8 + test.diff (218.82 KB, application/x-bzip)
2011-08-24 11:02 UTC, sbraz
Details
dmesg-DSDT_DEBUG_acer-wmi.c-3.0.3 - no test.diff (224.45 KB, application/x-bzip)
2011-08-24 16:30 UTC, sbraz
Details
dmidecode (7.24 KB, text/x-log)
2012-03-10 10:35 UTC, sbraz
Details
dmidecode2 (9.19 KB, text/x-log)
2012-03-13 13:32 UTC, Michał Kozal
Details
0001-acer-wmi-Detect-communication-hot-key-number.patch (2.90 KB, patch)
2012-04-19 04:04 UTC, Lee, Chun-Yi
Details | Diff

Description sbraz 2011-08-22 18:32:05 UTC
Created attachment 69672 [details]
acpidump

i'm using ubuntu 10.10 amd64 with a patched vanilla kernel.  

after upgrading the kernel from 2.6.39.4 to 3.0.0 i could not turn bluetooth on anymore with Fn+F3 or rfkill, dmesg says this when i do:

acer_wmi: Get Current Device Status failed: 0xe1 - 0x0
Comment 1 Lee, Chun-Yi 2011-08-23 03:17:01 UTC
Created attachment 69682 [details]
test.diff

A test patch that only query 1 device status but not all. This patch will print out the result from wmi method and always return.

Just for verify the wmi result.
Comment 2 Lee, Chun-Yi 2011-08-23 03:19:51 UTC
Created attachment 69692 [details]
acer-wmi.c

If want to use:
Here is the acer-wmi.c from v3.0 kernel that was applied test.diff patch.

Just for verify the wmi result.
Comment 3 Lee, Chun-Yi 2011-08-23 03:21:56 UTC
This machine's WMAA method collect devices status by call SMI but not go through EC register.

It might have different behavior with other machine like TravelMate 8572.
Comment 4 sbraz 2011-08-23 09:11:39 UTC
i've patched the 3.0.3 acer-wmi.c and it's the same as the one you posted (diffed them). compiled, unloaded old acer-wmi.ko, copied new acer-wmi.ko under /lib/modules/3.0.3-custom/kernel/drivers/platform/x86/, rebooted.

i've attached "dmesg-test.diff-patch" but i think this under here is what you are looking for..?

root@sbraz-netbook:~# dmesg |grep -i acer
[    0.000000] DMI: Acer            Aspire One 721                 /Aspire One 721                 , BIOS V1.07           04/15/2010
[   10.524354] acer_wmi: Acer Laptop ACPI-WMI Extras
[   10.524587] acer_wmi: Function bitmap for Communication Button: 0x801
[   10.524995] acer_wmi: Brightness must be controlled by generic video driver
[   10.531589] input: Acer WMI hotkeys as /devices/virtual/input/input12
[   10.534196] acer_wmi: Get Device Status failed: 0xe1 - 0x0
[   10.536724] acer_wmi: Get Device Status failed: 0xe1 - 0x0
[   10.539348] acer_wmi: Get Current Device Status failed: 0xe1 - 0x0
[   11.137106] acer_wmi: Get Current Device Status failed: 0xe1 - 0x0
[   29.519570] acer_wmi: Get Current Device Status failed: 0xe1 - 0x0
Comment 5 sbraz 2011-08-23 09:13:02 UTC
Created attachment 69772 [details]
dmesg with test.diff
Comment 6 sbraz 2011-08-23 19:27:47 UTC
same problem. i've linked them here so we can share all the possible data.

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/759874
Comment 7 Lee, Chun-Yi 2011-08-24 07:49:38 UTC
There have the following if-else logic in WMAA method:

If (LEqual (Arg1, 0x02))        /* Method ID(0x2) GET Functions */
{
    Store (0x00, BGET)
    If (LEqual (AAFN, 0x01))    /* Function number(0x1) Get Device Status */
    {
        ASMI (0xF3, AAKN, 0x00, 0x00, AADM)
        Store (\_SB.PCI0.LPC0.WNVD, BGDM)
        Store (\_SB.PCI0.LPC0.WNVA, BGER)    /* possible return 0xe1 */
        Store (\_SB.PCI0.LPC0.WNVC, BGD0)
        Return (BGET)
    }

    Store (0xE1, BGER)          /* return 0xe1 */
    Return (BGET)
}

It return 0xe1 when the function number not support by the method. But, it's not make sense because acer-wmi driver already pass right function number(0x1):


        struct wmid3_gds_input_param params = {
                .function_num = 0x1,     /* function number is 0x1 */
                .hotkey_number = 0x01,
                .devices = device,
        };
        struct acpi_buffer input = {
                sizeof(struct wmid3_gds_input_param),
                &params
        };
        struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };

        status = wmi_evaluate_method(WMID_GUID3, 0, 0x2, &input, &output);
        if (ACPI_FAILURE(status))
                return status;

Might need add some debug log to DSDT, then need bug reporter's help to test.
Comment 8 Lee, Chun-Yi 2011-08-24 08:58:26 UTC
Created attachment 69832 [details]
DSDT.hex

I add some debug message to WMAA method in DSDT.

Could you please help to re-compiler kernel for include this DSDT.hex file then attached dmesg log on this bug?

A. copy DSDT.hex to /root

B. make sure your kernel config have the following setting:
CONFIG_STANDALONE=n
ACPI_CUSTOM_DSDT_FILE=/root/dsdt.hex
CONFIG_PM_DEBUG=y
CONFIG_ACPI_DEBUG=y
CONFIG_ACPI_DEBUG_FUNC_TRACE=y

C. compiler your kernel and install it to your system

D. add the following kernel parameter to /boot/grub/menu.lst
acpi.debug_level=0x0000004F acpi.debug_layer=0xffffffff log_buf_len=5M

E. reboot system and take the dmesg log
Comment 9 sbraz 2011-08-24 11:02:22 UTC
Created attachment 69902 [details]
dmesg -> Comment #8 + test.diff
Comment 10 sbraz 2011-08-24 11:10:50 UTC
done.

+i can control bluetooth with rfkill.
-cpu frequency scaler and possibly other things doesn't work anymore.

i haven't mentioned this before but i have "rfkill block bluetooth" added to rc.local, and this of course pop one additional "acer_wmi: Get Current Device Status failed: 0xe1 - 0x0" message on every dmesg i've posted so far.
Comment 11 sbraz 2011-08-24 12:38:01 UTC
i screwed up.
this last dmesg has been generated using acer-wmi.c from 2.6.39.4 on kernel 3.0. :(

i'll recompile asap and post the results again.
Comment 12 sbraz 2011-08-24 16:30:21 UTC
Created attachment 69932 [details]
dmesg-DSDT_DEBUG_acer-wmi.c-3.0.3 - no test.diff

here.
Comment 13 sbraz 2011-08-29 00:02:43 UTC
still buggy here. :)
Comment 14 Lee, Chun-Yi 2011-09-06 04:10:46 UTC
(In reply to comment #12)
> Created an attachment (id=69932) [details]
> no test.diff
> 
> here.

Checked the dsdt, confirm it try to launch SMI when acer-wmi evaluate WMAA method:

[   13.953867] [ACPI Debug]  String [0x10] "[dsdt]Arg1(0x02)"
[   13.954006] [ACPI Debug]  String [0x10] "[dsdt]AAFN(0x01)"

If (LEqual (Arg1, 0x02))
{  
    Store ("[dsdt]Arg1(0x02)", Debug)
    Store (0x00, BGET)
    If (LEqual (AAFN, 0x01))
    {  
        Store ("[dsdt]AAFN(0x01)", Debug)	/* confirm we feed 0x01 function */
        ASMI (0xF3, AAKN, 0x00, 0x00, AADM)	/* launch SMI, AAKN: key number, AADM: devices map */
        Store (\_SB.PCI0.LPC0.WNVD, BGDM)
        Store (\_SB.PCI0.LPC0.WNVA, BGER)	/* response 0xE1 (Function not support) */
        Store (\_SB.PCI0.LPC0.WNVC, BGD0)
        Return (BGET)
    }

    Store (0xE1, BGER)
    Store ("[dsdt]BGET.BSER(0xE1)", Debug)
    Return (BGET)
}

The problem is why SMI response 0xE1 on this machine.
We only can control 2 parameter from acer-wmi, one is Function Number (AAKN) , the other one is Devices Map (AADM).

We need try to change the parameter to poke this SMI call, if we cann't success, then I will add a workaround patch to acer-wmi for adapter it back to old wmi method on this machine.
Comment 15 Lee, Chun-Yi 2011-09-06 06:22:24 UTC
I am tracing DSDT, will attached a test patch.
Comment 16 Lee, Chun-Yi 2011-09-06 07:33:56 UTC
sbraz, 
Could you please also attach your dmidecode result on this bug?

    dmidecode > dmidecode.log

Then please attach dmidecode.log file, thank's
Comment 17 Florian Mickler 2012-01-24 22:52:25 UTC
Is this still a problem in 3.2 / 3.3-rc1 ?
Comment 18 Michał Kozal 2012-03-08 16:03:55 UTC
~$ uname -r
3.2.0-17-lowlatency

So it's still here I suppose ;)
And the /sys/devices/platform/acer-wmi/bluetooth doesn't even exist.
Comment 19 sbraz 2012-03-10 10:35:48 UTC
Created attachment 72564 [details]
dmidecode
Comment 20 sbraz 2012-03-10 10:38:11 UTC
FINALLY this site came back to life. good. :)

i've just attached the dmidecode as requested from Lee.
Comment 21 Michał Kozal 2012-03-13 13:32:46 UTC
Created attachment 72579 [details]
dmidecode2

Here is my dmidecode output, hope it helps.
Comment 22 Lee, Chun-Yi 2012-04-19 04:00:57 UTC
(In reply to comment #19)
> Created an attachment (id=72564) [details]
> dmidecode

04 02 01 08

Button n: 004		04 = button 3	(Communication key)		Hotkey number 0x04
Type of Button n: 02		02 = Fn key
Function of Button n: 0801 	0801 = Wireless, BT			get/set wireless, bt states
Comment 23 Lee, Chun-Yi 2012-04-19 04:02:19 UTC
(In reply to comment #21)
> Created an attachment (id=72579) [details]
> dmidecode2
> 
> Here is my dmidecode output, hope it helps.

The same!

04 02 01 08

Button n: 004		04 = button 3	(Communication key)		Hotkey number 0x04
Type of Button n: 02		02 = Fn key
Function of Button n: 0801 	0801 = Wireless, BT			get/set wireless, bt states
Comment 24 Lee, Chun-Yi 2012-04-19 04:04:45 UTC
Created attachment 72962 [details]
0001-acer-wmi-Detect-communication-hot-key-number.patch

Please try this patch, it already included in 3.4-rc1 kernel.
Comment 25 sbraz 2012-04-21 10:52:11 UTC
root@sbraz-netbook:/usr/src/linux-3.1.5/source# patch -p1 < /usr/src/kernel-patches/acer-wmi.patch_latest 
patching file drivers/platform/x86/acer-wmi.c
Hunk #1 succeeded at 171 (offset -6 lines).
Hunk #2 FAILED at 218.
Hunk #3 succeeded at 1107 (offset 184 lines).
Hunk #4 FAILED at 992.
Hunk #5 succeeded at 1223 (offset 191 lines).
Hunk #6 FAILED at 1105.
3 out of 6 hunks FAILED -- saving rejects to file drivers/platform/x86/acer-wmi.c.rej


root@sbraz-netbook:/usr/src/linux-3.1.5/source# cat drivers/platform/x86/acer-wmi.c.rej
--- drivers/platform/x86/acer-wmi.c
+++ drivers/platform/x86/acer-wmi.c
@@ -218,6 +223,7 @@
 static bool ec_raw_mode;
 static bool has_type_aa;
 static u16 commun_func_bitmap;
+static u8 commun_fn_key_number;
 
 module_param(mailled, int, 0444);
 module_param(brightness, int, 0444);
@@ -992,7 +998,7 @@
 	u16 devices;
 	struct wmid3_gds_input_param params = {
 		.function_num = 0x1,
-		.hotkey_number = 0x01,
+		.hotkey_number = commun_fn_key_number,
 		.devices = commun_func_bitmap,
 	};
 	struct acpi_buffer input = {
@@ -1105,6 +1111,8 @@
 		interface->capability |= ACER_CAP_THREEG;
 	if (type_aa->commun_func_bitmap & ACER_WMID3_GDS_BLUETOOTH)
 		interface->capability |= ACER_CAP_BLUETOOTH;
+
+	commun_fn_key_number = type_aa->commun_fn_key_number;
 }
 
 static acpi_status WMID_set_capabilities(void)




---------------------------

however, compiling acer-wmi.ko using the source code file from 3.4-rc3 actually works with some quirks which might not be depending from the module itself:


[ 2712.686910] acer_wmi: Acer Laptop WMI Extras unloaded
[ 2820.420368] acer_wmi: Acer Laptop ACPI-WMI Extras
[ 2820.420612] acer_wmi: Function bitmap for Communication Button: 0x801
[ 2820.421024] acer_wmi: Brightness must be controlled by generic video driver
[ 2820.426559] input: Acer WMI hotkeys as /devices/virtual/input/input14
[ 2820.430211] acer_wmi: Get Device Status failed: 0xe1 - 0x0
[ 2820.432597] acer_wmi: Get Device Status failed: 0xe1 - 0x0
[ 2835.239738] usb 5-3: new full speed USB device number 5 using ohci_hcd
[ 2843.842103] usb 5-3: USB disconnect, device number 5
[ 2843.844044] Bluetooth: hci0 urb ffff88007e65af00 submission failed
[ 3010.033070] usb 5-3: new full speed USB device number 6 using ohci_hcd
[ 3016.162663] usb 5-3: USB disconnect, device number 6
[ 3016.164612] Bluetooth: hci0 urb ffff880003ea3180 submission failed
[ 3023.399719] usb 5-3: new full speed USB device number 7 using ohci_hcd
[ 3037.523215] usb 5-3: USB disconnect, device number 7
[ 3037.525160] Bluetooth: hci0 urb ffff88007e7bcf00 submission failed
[ 3042.349962] usb 5-3: new full speed USB device number 8 using ohci_hcd
[ 3066.713375] usb 5-3: USB disconnect, device number 8
[ 3066.714743] Bluetooth: hci0 urb ffff88007e703f00 submission failed
[ 3066.804756] show_signal_msg: 48 callbacks suppressed
[ 3066.804761] bluetooth-apple[2212]: segfault at 8 ip 00007fa7d2fb29ee sp 00007fffab0a49e0 error 4 in libdbusmenu-glib.so.1.0.17[7fa7d2fae000+10000]
Comment 26 Michał Kozal 2012-04-21 17:04:43 UTC
Using yesterday's daily mainline kernel build everything works fine. Haven't checked turning Wi-Fi/BT on and off too extensively though ;)

On 2.6.38.x it had 4 possible configs:
WiFi/BT
off/off
off/on
on/off
on/on
Comment 27 Lee, Chun-Yi 2012-07-03 01:59:39 UTC
(In reply to comment #25)
> root@sbraz-netbook:/usr/src/linux-3.1.5/source# patch -p1 <
> /usr/src/kernel-patches/acer-wmi.patch_latest 
> patching file drivers/platform/x86/acer-wmi.c
> Hunk #1 succeeded at 171 (offset -6 lines).
> Hunk #2 FAILED at 218.
> Hunk #3 succeeded at 1107 (offset 184 lines).
> Hunk #4 FAILED at 992.
> Hunk #5 succeeded at 1223 (offset 191 lines).
> Hunk #6 FAILED at 1105.
> 3 out of 6 hunks FAILED -- saving rejects to file
> drivers/platform/x86/acer-wmi.c.rej
> 
> 
> root@sbraz-netbook:/usr/src/linux-3.1.5/source# cat
> drivers/platform/x86/acer-wmi.c.rej
> --- drivers/platform/x86/acer-wmi.c
> +++ drivers/platform/x86/acer-wmi.c
> @@ -218,6 +223,7 @@
>  static bool ec_raw_mode;
>  static bool has_type_aa;
>  static u16 commun_func_bitmap;
> +static u8 commun_fn_key_number;
> 
>  module_param(mailled, int, 0444);
>  module_param(brightness, int, 0444);
> @@ -992,7 +998,7 @@
>      u16 devices;
>      struct wmid3_gds_input_param params = {
>          .function_num = 0x1,
> -        .hotkey_number = 0x01,
> +        .hotkey_number = commun_fn_key_number,
>          .devices = commun_func_bitmap,
>      };
>      struct acpi_buffer input = {
> @@ -1105,6 +1111,8 @@
>          interface->capability |= ACER_CAP_THREEG;
>      if (type_aa->commun_func_bitmap & ACER_WMID3_GDS_BLUETOOTH)
>          interface->capability |= ACER_CAP_BLUETOOTH;
> +
> +    commun_fn_key_number = type_aa->commun_fn_key_number;
>  }
> 

We need send commun_fn_key_number through wmi to BIOS.

>  static acpi_status WMID_set_capabilities(void)
> 
> 
> 
> 
> ---------------------------
> 
> however, compiling acer-wmi.ko using the source code file from 3.4-rc3
> actually
> works with some quirks which might not be depending from the module itself:
> 
> 
> [ 2712.686910] acer_wmi: Acer Laptop WMI Extras unloaded
> [ 2820.420368] acer_wmi: Acer Laptop ACPI-WMI Extras
> [ 2820.420612] acer_wmi: Function bitmap for Communication Button: 0x801
> [ 2820.421024] acer_wmi: Brightness must be controlled by generic video
> driver
> [ 2820.426559] input: Acer WMI hotkeys as /devices/virtual/input/input14
> [ 2820.430211] acer_wmi: Get Device Status failed: 0xe1 - 0x0
> [ 2820.432597] acer_wmi: Get Device Status failed: 0xe1 - 0x0

Your machine still complain the get device status function doesn't support. But, per DSDT, your machine's function number the same with Michał Kozal.

Could you please test try v3.4 kernel?

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