Skip to content

Commit 111a892

Browse files
ChrisCH-Lugregkh
authored andcommitted
Bluetooth: btmtksdio: Do close if SDIO card removed without close
commit 0b6d58b 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: 6ac4233 ("Bluetooth: btmtksdio: Prevent enabling interrupts after IRQ handler removal") Signed-off-by: Chris Lu <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 3e0dc2b commit 111a892

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/bluetooth/btmtksdio.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,11 +1434,15 @@ static void btmtksdio_remove(struct sdio_func *func)
14341434
if (!bdev)
14351435
return;
14361436

1437+
hdev = bdev->hdev;
1438+
1439+
/* Make sure to call btmtksdio_close before removing sdio card */
1440+
if (test_bit(BTMTKSDIO_FUNC_ENABLED, &bdev->tx_state))
1441+
btmtksdio_close(hdev);
1442+
14371443
/* Be consistent the state in btmtksdio_probe */
14381444
pm_runtime_get_noresume(bdev->dev);
14391445

1440-
hdev = bdev->hdev;
1441-
14421446
sdio_set_drvdata(func, NULL);
14431447
hci_unregister_dev(hdev);
14441448
hci_free_dev(hdev);

0 commit comments

Comments
 (0)