Thread (2 messages) 2 messages, 1 author, 2011-01-21

How to close bluetooth? Using rfkill?

From: zhangfei gao <hidden>
Date: 2011-01-21 05:51:34

Hi Johan,

Is there any general method to open/close bluetooth, using rfkill or
pm_runtime_get/put_* API.

Currently we use rfkill to close bluetooth, however we met dead lock
issue, for mutex_lock(&rfkill_global_mutex).
So we use workaround to rmmod bt.ko first, or revert the rfkill patch
in hci_core.c.

BT/WIFI device have chip select pin, we register one rfkill with
sd8x_set_block, and control chip select pin to open/close bt/wifi/fm.
for example:
rfkill unblock bluetooth to open bt
rfkill block bluetooth to close bt

When "rfkill block bluetooth",
rfkill_fop_write->mutex_lock(&rfkill_global_mutex)->rfkill_set_block->sd8x_set_block->waiting
for card is freed.
BT driver will call
hci_unregister_dev->rfkill_unregister->mutex_lock(&rfkill_global_mutex);
So mutex_lock(&rfkill_global_mutex) will be dead locked.

If so, do we have to use other method to control chip select pin to
control bt power, such as pm_runtime_get/put_* API.

Thanks in advance.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help