All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Oldřich Jedlička" <oldium.pro-9Vj9tDbzfuSlVyrhU4qvOw@public.gmane.org>
To: Joey Lee <jlee-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org>
Cc: Al Cho <ACho-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org>,
	mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org,
	linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-bluetooth-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	platform-driver-x86-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: acer-wmi: rfkill and bluetooth enabling doesn't work as in 2.6.37
Date: Wed, 16 Mar 2011 07:32:15 +0100	[thread overview]
Message-ID: <201103160732.15488.oldium.pro@seznam.cz> (raw)
In-Reply-To: <4D7FE4260200002300029D70-jb/6P8Q/KsjOKUPnnb0SpZ/xhEQF/MHJojBamW5iJbs@public.gmane.org>

Hi Joey Lee,

On Tuesday 15 March 2011 12:11:50 Joey Lee wrote:
> Hi Oldřich,
> 
> 於 五,2011-03-11 於 14:45 -0700,Joey Lee 提到:
> 
> > Hi Oldřich,
> > 
> > > > > > > > > 1. I have to enable the HW bluetooth switch to get the
> > > > > > > > > bluetooth LED running (USB device appears in lsusb). The
> > > > > > > > > acer-bluetooth SW rfkill is unblocked, the SW rfkill of
> > > > > > > > > hci0 is blocked.
> > > > > > > > 
> > > > > > > > Yes, this is also right behavior, because acer-wmi driver
> > > > > > > > will maintain the killswitch status with BIOS.
> > > > > > > > 
> > > > > > > > > 2. Next I have to unblock SW rfkill on hci0 by a call to
> > > > > > > > > `rfkill unblock <number of hci0>`.
> > > > > > > > > 3. Last I have to enable the HCI by the call to `hciconfig
> > > > > > > > > hci0 up`.
> > > > > 
> > > > > `rfkill list` shows the following
> > > > > 
> > > > > 1) Before I enable the SW killswitch:
> > > > > 
> > > > > 0: acer-wireless: Wireless LAN
> > > > > 
> > > > >         Soft blocked: no
> > > > >         Hard blocked: no
> > > > > 
> > > > > 1: acer-bluetooth: Bluetooth
> > > > > 
> > > > >         Soft blocked: yes
> > > > >         Hard blocked: no
> > > > > 
> > > > > 2: acer-threeg: Wireless WAN
> > > > > 
> > > > >         Soft blocked: yes
> > > > >         Hard blocked: no
> > > > > 
> > > > > 3: phy0: Wireless LAN
> > > > > 
> > > > >         Soft blocked: no
> > > > >         Hard blocked: no
> > > > > 
> > > > > 2) After I run `rfkill unblock 1`:
> > > > > 
> > > > > 0: acer-wireless: Wireless LAN
> > > > > 
> > > > >         Soft blocked: no
> > > > >         Hard blocked: no
> > > > > 
> > > > > 1: acer-bluetooth: Bluetooth
> > > > > 
> > > > >         Soft blocked: no
> > > > >         Hard blocked: no
> > > > > 
> > > > > 2: acer-threeg: Wireless WAN
> > > > > 
> > > > >         Soft blocked: yes
> > > > >         Hard blocked: no
> > > > > 
> > > > > 3: phy0: Wireless LAN
> > > > > 
> > > > >         Soft blocked: no
> > > > >         Hard blocked: no
> > > > > 
> > > > > 6: hci0: Bluetooth
> > > > > 
> > > > >         Soft blocked: yes
> > > > >         Hard blocked: no
> > > > > 
> > > > > I've repeated it several times, so hci0 has number 6 now.
> > > > > 
> > > > > Thanks for help,
> > > > > Oldřich.
> > > > 
> > > > Thank's for your test result.
> > > > Want to double confirm with you...
> > > > The above result is base on CONFIG_RFKILL_INPUT=N ?
> > > 
> > > No, that was just a formatting problem of a "reply" to a mail. That
> > > wasn't my reaction, it was just a word from the previous line. I'm
> > > still using CONFIG_RFKILL_INPUT=Y.
> > > 
> > > Oldřich.
> > 
> > That's make sense now!
> > 
> > Thank's for your bug report, I am tracing and try to find out solution.
> > Joey Lee
> 
> After trace rfkill-input stuff, I thought this is rfkill-input's normal
> behavior but not a bug.
> 
> Unfortunately, I didn't find any workaround way when a driver need to
> call rfkill_init_sw_state, e.g. acer-wmi driver.
> 
> The rfkill-input will sync the rfkill state to all killswitchs that have
> the same type. For example, acer-wmi set the initial software switch to
> _BLOCK_ when driver initial, then rfkill-input will also set any new
> bluetooth killswitch state to _BLOCK_ .

The rfkill_sync_work syncs with rfkill_global_states, which is set during 
intitialization or by rfkill_switch_all, if I read it correctly. This should 
be independent to acer-bluetooth state. The rfkill_global_states[BLUETOOTH] 
should be unblocked initially, I need to verify it.

There is some magic in rfkill/input.c that plays with global states, but I 
don't know if or how that one is used in my case.

> Acer's BIOS default setup bluetooth's state is disable when system cold
> boot, and BIOS also can save the connection devices' state when system
> reboot. Currently, acer-wmi driver have right behavior to sync the state
> with BIOS.
>
> Face to your situation, my suggestion is:
> 
> - Use userland application to correct killswitch state.
>   highly suggest You can try urfkill daemon:
> http://www.freedesktop.org/wiki/Software/urfkill or
>   write a startup script to enable bluetooth when system boot.
> 
> - Disable rfkill-input module if you didn't real use it.
>   The TravelMate 5730G have wifi hotkey that only emit KEY_WLAN, but
>   doesn't emit KEY_BLUETOOTH, that means rfkill-input cann't help you
>   enable bluetooth killswitch.

I didn't have time to look at the problem more deeply to identify who is 
setting the global state to "blocked" or what really happens. Anyway, I did 
some testing with pressing the HW bluetooth switch and I saw the following 
immediately _after_ pressing the HW switch to enable bluetooth:

oldium ~ # rfkill list
0: acer-wireless: Wireless LAN
        Soft blocked: no
        Hard blocked: no
1: acer-bluetooth: Bluetooth
        Soft blocked: no
        Hard blocked: no
2: acer-threeg: Wireless WAN
        Soft blocked: yes
        Hard blocked: no
3: phy0: Wireless LAN
        Soft blocked: no
        Hard blocked: no

I had this output 3 times immediately after each other. I'm using keyboard 
"up" and "enter" to repeat the last shell command, so this is a relatively 
slow operation. So the state when the acer-bluetooth was unblocked stayed for 
relatively long time before hci0 appeared in rfkill. Afterwards I saw:

oldium ~ # rfkill list
0: acer-wireless: Wireless LAN
        Soft blocked: no
        Hard blocked: no
1: acer-bluetooth: Bluetooth
        Soft blocked: no
        Hard blocked: no
2: acer-threeg: Wireless WAN
        Soft blocked: yes
        Hard blocked: no
3: phy0: Wireless LAN
        Soft blocked: no
        Hard blocked: no
5: hci0: Bluetooth
        Soft blocked: yes
        Hard blocked: no

So it looks like the hci0 went blocked even when the acer-bluetooth switch was 
unblocked. So it looks like the hci0 state is independent on the initial acer-
bluetooth state.

Hopefully I have some time this evening (CET timezone) to add some stack 
traces and logs to see what really happens on my system.

Cheers,
Oldřich.

> 
> Thank's a lot!
> Joey Lee

  parent reply	other threads:[~2011-03-16  6:32 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-10 22:02 acer-wmi: rfkill and bluetooth enabling doesn't work as in 2.6.37 Joey Lee
2011-03-11 20:21 ` Oldřich Jedlička
2011-03-11 20:34   ` Joey Lee
2011-03-11 20:54     ` Oldřich Jedlička
2011-03-11 21:25       ` Joey Lee
2011-03-11 21:34         ` Oldřich Jedlička
2011-03-11 21:45           ` Joey Lee
     [not found]             ` <4D7B32B10200002300029B5E-jb/6P8Q/KsjOKUPnnb0SpZ/xhEQF/MHJojBamW5iJbs@public.gmane.org>
2011-03-15 11:11               ` Joey Lee
     [not found]                 ` <4D7FE4260200002300029D70-jb/6P8Q/KsjOKUPnnb0SpZ/xhEQF/MHJojBamW5iJbs@public.gmane.org>
2011-03-16  6:32                   ` Oldřich Jedlička [this message]
2011-03-16  8:59                     ` Joey Lee
2011-03-20 20:09                       ` Oldřich Jedlička
2011-03-21 11:26                         ` Joey Lee
2011-03-21 11:43                           ` Johannes Berg
2011-03-21 13:57                             ` Joey Lee
2011-03-21 14:35                               ` Johannes Berg
2011-03-21 16:25                                 ` Joey Lee
     [not found]                                   ` <4D881693020000230002A2FC-jb/6P8Q/KsjOKUPnnb0SpZ/xhEQF/MHJojBamW5iJbs@public.gmane.org>
2011-03-23 12:17                                     ` Johannes Berg
     [not found]                                       ` <1300882647.3790.17.camel-8upI4CBIZJIJvtFkdXX2HixXY32XiHfO@public.gmane.org>
2011-03-24  7:01                                         ` Joey Lee
2011-03-24  8:35                                           ` Johannes Berg
2011-03-24 12:55                                             ` Joey Lee
2011-03-24 12:58                                               ` Johannes Berg
2011-03-24 13:36                                                 ` Joey Lee
2011-03-21 19:27                                 ` Oldřich Jedlička
     [not found]                                   ` <201103212027.01952.oldium.pro-9Vj9tDbzfuSlVyrhU4qvOw@public.gmane.org>
2011-03-23 11:58                                     ` Johannes Berg
2011-03-23 21:38                                       ` Oldřich Jedlička
2011-03-24  8:36                                         ` Johannes Berg
     [not found]                                           ` <1300955793.3807.6.camel-8upI4CBIZJIJvtFkdXX2HixXY32XiHfO@public.gmane.org>
2011-03-24 13:13                                             ` Joey Lee
2011-03-24 13:13                                               ` Joey Lee
     [not found]                                               ` <201103242234.03598.oldium.pro@seznam.cz>
2011-03-25  6:29                                                 ` Oldřich Jedlička
     [not found]                                                 ` <201103242234.03598.oldium.pro-9Vj9tDbzfuSlVyrhU4qvOw@public.gmane.org>
2011-03-25  8:13                                                   ` Joey Lee
2011-03-25 19:22                                                     ` Oldřich Jedlička
2011-03-25 22:35                                                       ` Joey Lee
2011-03-27 17:09                                                         ` Dmitry Torokhov
2011-03-28  8:51                                                           ` Joey Lee
2011-03-31  5:23                                                           ` Oldřich Jedlička
     [not found]                                                             ` <AANLkTi=QREK2r6zbvo6RyTNMG4=NCf+kCUWi52ZwjOhS@mail.gmail.com>
2011-03-31  7:51                                                               ` Joey Lee
2011-03-31  8:09                                                                 ` Joey Lee
2011-03-31  9:10                                                                   ` Joey Lee
2011-03-31 20:27                                                                     ` Oldřich Jedlička
     [not found]                                                       ` <201103252022.26766.oldium.pro-9Vj9tDbzfuSlVyrhU4qvOw@public.gmane.org>
2011-03-28  9:04                                                         ` Joey Lee
2011-03-30 18:49                                                           ` Oldřich Jedlička
2011-03-11 22:00           ` Oldřich Jedlička
  -- strict thread matches above, loose matches on Subject: below --
2011-03-21 17:52 Joey Lee
2011-03-21 17:52 ` Joey Lee
2011-03-21 20:44 ` Oldřich Jedlička
2011-03-22  2:32   ` Joey Lee
2011-03-24 21:56     ` Oldřich Jedlička
2011-03-10 18:37 Oldřich Jedlička

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201103160732.15488.oldium.pro@seznam.cz \
    --to=oldium.pro-9vj9tdbzfuslvyrhu4qvow@public.gmane.org \
    --cc=ACho-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org \
    --cc=jlee-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org \
    --cc=linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-bluetooth-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org \
    --cc=platform-driver-x86-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.