Based on the code in the rtx200 directories that has a call to
input_allocate_device() that was not
present in b43, I made a modification to drivers/net/wireless/b43/rfkill.c as
follows:
Index: wireless-2.6/drivers/net/wireless/b43/rfkill.c
===================================================================
--- wireless-2.6.orig/drivers/net/wireless/b43/rfkill.c
+++ wireless-2.6/drivers/net/wireless/b43/rfkill.c
@@ -133,6 +133,16 @@ void b43_rfkill_init(struct b43_wldev *d
rfk->poll_dev->poll = b43_rfkill_poll;
rfk->poll_dev->poll_interval = 1000; /* msecs */
+ rfk->poll_dev->input = input_allocate_device();
+ if (!rfk->poll_dev->input)
+ goto err_free_polldev;
+
+ rfk->poll_dev->input->name = rfk->name;
+ rfk->poll_dev->input->id.bustype = BUS_HOST;
+ rfk->poll_dev->input->id.vendor = dev->dev->bus->boardinfo.vendor;
+ rfk->poll_dev->input->evbit[0] = BIT(EV_KEY);
+ set_bit(KEY_WLAN, rfk->poll_dev->input->keybit);
+
err = rfkill_register(rfk->rfkill);
if (err)
goto err_free_polldev;
With this change, the input device is attached to b43. The message now is
"input: b43-phy0 as
/class/input/input7" rather than the "input: Unspecified device as
/class/input/input7" that I had
before. When the radio switch is toggled, I see the expected output:
b43-phy0: Radio hardware status changed to DISABLED
eth1: No ProbeResp from current AP 00:1a:70:46:ba:b1 - assume out of range
eth1: No STA entry for own AP 00:1a:70:46:ba:b1
b43-phy0: Radio hardware status changed to ENABLED
We then get a locking problem:
=======================================================
[ INFO: possible circular locking dependency detected ]
2.6.24-rc3-L2.6-g65d438bf-dirty #24
-------------------------------------------------------
events/0/9 is trying to acquire lock:
(&wl->mutex){--..}, at: [<ffffffff882a31e1>] b43_rfkill_soft_toggle+0x33/0xb2
[b43]
but task is already holding lock:
(&rfkill->mutex){--..}, at: [<ffffffff8040b927>] rfkill_toggle_radio+0x1f/0x7d
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #2 (&rfkill->mutex){--..}:
[<ffffffff8025951c>] __lock_acquire+0xb34/0xd47
[<ffffffff8040b927>] rfkill_toggle_radio+0x1f/0x7d
[<ffffffff802597b4>] lock_acquire+0x85/0xa9
[<ffffffff8040b927>] rfkill_toggle_radio+0x1f/0x7d
[<ffffffff8040e32e>] mutex_lock_interruptible_nested+0x113/0x31e
[<ffffffff8040b927>] rfkill_toggle_radio+0x1f/0x7d
[<ffffffff8040b927>] rfkill_toggle_radio+0x1f/0x7d
[<ffffffff8040bd64>] rfkill_register+0x9b/0x107
[<ffffffff882a3040>] b43_rfkill_init+0x15e/0x1cb [b43]
[<ffffffff88293ad4>] b43_wireless_core_init+0x682/0x784 [b43]
[<ffffffff882948a6>] b43_op_start+0x33/0x74 [b43]
[<ffffffff881f2a76>] ieee80211_open+0x1c7/0x3dd [mac80211]
[<ffffffff803b2fda>] dev_open+0x4e/0x88
[<ffffffff803b18a2>] dev_change_flags+0xaf/0x16b
[<ffffffff803b9f9d>] do_setlink+0x27a/0x346
[<ffffffff8040fa9c>] _read_unlock+0x26/0x2b
[<ffffffff803bb233>] rtnl_setlink+0xf9/0x11c
[<ffffffff803bb0d3>] rtnetlink_rcv_msg+0x1b6/0x1d5
[<ffffffff803baf1d>] rtnetlink_rcv_msg+0x0/0x1d5
[<ffffffff803c36a5>] netlink_rcv_skb+0x3e/0xaa
[<ffffffff803baf14>] rtnetlink_rcv+0x20/0x29
[<ffffffff803c344c>] netlink_unicast+0x1d9/0x23a
[<ffffffff803ac19e>] __alloc_skb+0x8a/0x138
[<ffffffff803c3c79>] netlink_sendmsg+0x2aa/0x2bd
[<ffffffff803a6249>] sock_sendmsg+0xdf/0xf8
[<ffffffff8024db89>] autoremove_wake_function+0x0/0x38
[<ffffffff8024db89>] autoremove_wake_function+0x0/0x38
[<ffffffff8025970e>] __lock_acquire+0xd26/0xd47
[<ffffffff803a6b7f>] move_addr_to_kernel+0x40/0x49
[<ffffffff803ad5b9>] verify_iovec+0x4f/0x8e
[<ffffffff803a6443>] sys_sendmsg+0x1e1/0x253
[<ffffffff80250916>] up_read+0x26/0x2a
[<ffffffff8022581f>] do_page_fault+0x3bf/0x764
[<ffffffff803a72c4>] sys_getsockname+0x66/0x8c
[<ffffffff80258540>] trace_hardirqs_on+0x11c/0x147
[<ffffffff8040f5b8>] trace_hardirqs_on_thunk+0x35/0x3a
[<ffffffff8020c0de>] system_call+0x7e/0x83
[<ffffffffffffffff>] 0xffffffffffffffff
-> #1 (rfkill_mutex){--..}:
[<ffffffff8025951c>] __lock_acquire+0xb34/0xd47
[<ffffffff8040bd50>] rfkill_register+0x87/0x107
[<ffffffff802597b4>] lock_acquire+0x85/0xa9
[<ffffffff8040bd50>] rfkill_register+0x87/0x107
[<ffffffff8040bd50>] rfkill_register+0x87/0x107
[<ffffffff8040e78a>] mutex_lock_nested+0x10e/0x2b6
[<ffffffff8040bd50>] rfkill_register+0x87/0x107
[<ffffffff882a3040>] b43_rfkill_init+0x15e/0x1cb [b43]
[<ffffffff88293ad4>] b43_wireless_core_init+0x682/0x784 [b43]
[<ffffffff882948a6>] b43_op_start+0x33/0x74 [b43]
[<ffffffff881f2a76>] ieee80211_open+0x1c7/0x3dd [mac80211]
[<ffffffff803b2fda>] dev_open+0x4e/0x88
[<ffffffff803b18a2>] dev_change_flags+0xaf/0x16b
[<ffffffff803b9f9d>] do_setlink+0x27a/0x346
[<ffffffff8040fa9c>] _read_unlock+0x26/0x2b
[<ffffffff803bb233>] rtnl_setlink+0xf9/0x11c
[<ffffffff803bb0d3>] rtnetlink_rcv_msg+0x1b6/0x1d5
[<ffffffff803baf1d>] rtnetlink_rcv_msg+0x0/0x1d5
[<ffffffff803c36a5>] netlink_rcv_skb+0x3e/0xaa
[<ffffffff803baf14>] rtnetlink_rcv+0x20/0x29
[<ffffffff803c344c>] netlink_unicast+0x1d9/0x23a
[<ffffffff803ac19e>] __alloc_skb+0x8a/0x138
[<ffffffff803c3c79>] netlink_sendmsg+0x2aa/0x2bd
[<ffffffff803a6249>] sock_sendmsg+0xdf/0xf8
[<ffffffff8024db89>] autoremove_wake_function+0x0/0x38
[<ffffffff8024db89>] autoremove_wake_function+0x0/0x38
[<ffffffff8025970e>] __lock_acquire+0xd26/0xd47
[<ffffffff803a6b7f>] move_addr_to_kernel+0x40/0x49
[<ffffffff803ad5b9>] verify_iovec+0x4f/0x8e
[<ffffffff803a6443>] sys_sendmsg+0x1e1/0x253
[<ffffffff80250916>] up_read+0x26/0x2a
[<ffffffff8022581f>] do_page_fault+0x3bf/0x764
[<ffffffff803a72c4>] sys_getsockname+0x66/0x8c
[<ffffffff80258540>] trace_hardirqs_on+0x11c/0x147
[<ffffffff8040f5b8>] trace_hardirqs_on_thunk+0x35/0x3a
[<ffffffff8020c0de>] system_call+0x7e/0x83
[<ffffffffffffffff>] 0xffffffffffffffff
-> #0 (&wl->mutex){--..}:
[<ffffffff80256dd7>] print_circular_bug_entry+0x48/0x4f
[<ffffffff8025941e>] __lock_acquire+0xa36/0xd47
[<ffffffff882a31e1>] b43_rfkill_soft_toggle+0x33/0xb2 [b43]
[<ffffffff802597b4>] lock_acquire+0x85/0xa9
[<ffffffff882a31e1>] b43_rfkill_soft_toggle+0x33/0xb2 [b43]
[<ffffffff882a31e1>] b43_rfkill_soft_toggle+0x33/0xb2 [b43]
[<ffffffff8040e78a>] mutex_lock_nested+0x10e/0x2b6
[<ffffffff8040b927>] rfkill_toggle_radio+0x1f/0x7d
[<ffffffff8040bf6f>] rfkill_task_handler+0x0/0x54
[<ffffffff882a31e1>] b43_rfkill_soft_toggle+0x33/0xb2 [b43]
[<ffffffff8040b944>] rfkill_toggle_radio+0x3c/0x7d
[<ffffffff8040be96>] rfkill_switch_all+0x3e/0x78
[<ffffffff8040bfab>] rfkill_task_handler+0x3c/0x54
[<ffffffff80249914>] run_workqueue+0xeb/0x200
[<ffffffff8024a500>] worker_thread+0xed/0xfe
[<ffffffff8024db89>] autoremove_wake_function+0x0/0x38
[<ffffffff8024a413>] worker_thread+0x0/0xfe
[<ffffffff8024da6e>] kthread+0x49/0x77
[<ffffffff8020d018>] child_rip+0xa/0x12
[<ffffffff8020c72f>] restore_args+0x0/0x30
[<ffffffff8024da25>] kthread+0x0/0x77
[<ffffffff8020d00e>] child_rip+0x0/0x12
[<ffffffffffffffff>] 0xffffffffffffffff
other info that might help us debug this:
5 locks held by events/0/9:
#0: (events){--..}, at: [<ffffffff802498c9>] run_workqueue+0xa0/0x200
#1: (rfkill_wlan.work){--..}, at: [<ffffffff802498c9>]
run_workqueue+0xa0/0x200
#2: (rfkill_wlan.mutex){--..}, at: [<ffffffff8040bf8d>]
rfkill_task_handler+0x1e/0x54
#3: (rfkill_mutex){--..}, at: [<ffffffff8040be74>] rfkill_switch_all+0x1c/0x78
#4: (&rfkill->mutex){--..}, at: [<ffffffff8040b927>]
rfkill_toggle_radio+0x1f/0x7d
stack backtrace:
Call Trace:
[<ffffffff8025779c>] print_circular_bug_tail+0x70/0x7b
[<ffffffff80256dd7>] print_circular_bug_entry+0x48/0x4f
[<ffffffff8025941e>] __lock_acquire+0xa36/0xd47
[<ffffffff882a31e1>] :b43:b43_rfkill_soft_toggle+0x33/0xb2
[<ffffffff802597b4>] lock_acquire+0x85/0xa9
[<ffffffff882a31e1>] :b43:b43_rfkill_soft_toggle+0x33/0xb2
[<ffffffff882a31e1>] :b43:b43_rfkill_soft_toggle+0x33/0xb2
[<ffffffff8040e78a>] mutex_lock_nested+0x10e/0x2b6
[<ffffffff8040b927>] rfkill_toggle_radio+0x1f/0x7d
[<ffffffff8040bf6f>] rfkill_task_handler+0x0/0x54
[<ffffffff882a31e1>] :b43:b43_rfkill_soft_toggle+0x33/0xb2
[<ffffffff8040b944>] rfkill_toggle_radio+0x3c/0x7d
[<ffffffff8040be96>] rfkill_switch_all+0x3e/0x78
[<ffffffff8040bfab>] rfkill_task_handler+0x3c/0x54
[<ffffffff80249914>] run_workqueue+0xeb/0x200
[<ffffffff8024a500>] worker_thread+0xed/0xfe
[<ffffffff8024db89>] autoremove_wake_function+0x0/0x38
[<ffffffff8024a413>] worker_thread+0x0/0xfe
[<ffffffff8024da6e>] kthread+0x49/0x77
[<ffffffff8020d018>] child_rip+0xa/0x12
[<ffffffff8020c72f>] restore_args+0x0/0x30
[<ffffffff8024da25>] kthread+0x0/0x77
[<ffffffff8020d00e>] child_rip+0x0/0x12
During all this, the LED is not turned on.
I'm hoping it won't be too difficult to sort this out. I've gotten in a little
deeper than I want.
Thanks,
Larry
_______________________________________________
Bcm43xx-dev mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev