ath10k: destroy sdio workqueue while remove sdio module
authorWen Gong <wgong@codeaurora.org>
Thu, 27 Jun 2019 18:21:51 +0000 (21:21 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jul 2019 05:28:31 +0000 (07:28 +0200)
[ Upstream commit 3ed39f8e747a7aafeec07bb244f2c3a1bdca5730 ]

The workqueue need to flush and destory while remove sdio module,
otherwise it will have thread which is not destory after remove
sdio modules.

Tested with QCA6174 SDIO with firmware
WLAN.RMH.4.4.1-00007-QCARMSWP-1.

Signed-off-by: Wen Gong <wgong@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/ath/ath10k/sdio.c

index c6440d28ab48ea73879ca38a04b8370f5a92a30a..0a1248ebccf5ffbc0f080647dde8c386a283c6df 100644 (file)
@@ -2076,6 +2076,9 @@ static void ath10k_sdio_remove(struct sdio_func *func)
        cancel_work_sync(&ar_sdio->wr_async_work);
        ath10k_core_unregister(ar);
        ath10k_core_destroy(ar);
+
+       flush_workqueue(ar_sdio->workqueue);
+       destroy_workqueue(ar_sdio->workqueue);
 }
 
 static const struct sdio_device_id ath10k_sdio_devices[] = {