mirror of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable.git
synced 2025-09-28 17:40:21 +10:00
Bluetooth: btmtksdio: Do close if SDIO card removed without close
commit0b6d58bc6e
upstream. To prevent Bluetooth SDIO card from be physically removed suddenly, driver needs to ensure btmtksdio_close is called before btmtksdio_remove to disable interrupts and txrx workqueue. Fixes:6ac4233afb
("Bluetooth: btmtksdio: Prevent enabling interrupts after IRQ handler removal") Signed-off-by: Chris Lu <chris.lu@mediatek.com> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
3e0dc2b4f6
commit
111a892a23
@ -1434,11 +1434,15 @@ static void btmtksdio_remove(struct sdio_func *func)
|
||||
if (!bdev)
|
||||
return;
|
||||
|
||||
hdev = bdev->hdev;
|
||||
|
||||
/* Make sure to call btmtksdio_close before removing sdio card */
|
||||
if (test_bit(BTMTKSDIO_FUNC_ENABLED, &bdev->tx_state))
|
||||
btmtksdio_close(hdev);
|
||||
|
||||
/* Be consistent the state in btmtksdio_probe */
|
||||
pm_runtime_get_noresume(bdev->dev);
|
||||
|
||||
hdev = bdev->hdev;
|
||||
|
||||
sdio_set_drvdata(func, NULL);
|
||||
hci_unregister_dev(hdev);
|
||||
hci_free_dev(hdev);
|
||||
|
Loading…
Reference in New Issue
Block a user