Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

brcm80211: fmac: remove firmware requests from init_module syscall

As indicated in [1] on netdev mailing list drivers should not block
on the init_module() syscall. This patch defers the actual driver
registration to a workqueue so the init_module() syscall can complete
without delay.

[1] http://article.gmane.org/gmane.linux.network/217729/

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Arend van Spriel and committed by
John W. Linville
e64a4b70 549040ab

+14 -4
+14 -4
drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
··· 1181 1181 } 1182 1182 #endif /* DEBUG */ 1183 1183 1184 - static int __init brcmfmac_init(void) 1184 + static void brcmf_driver_init(struct work_struct *work) 1185 1185 { 1186 1186 #ifdef CONFIG_BRCMFMAC_SDIO 1187 1187 brcmf_sdio_init(); ··· 1189 1189 #ifdef CONFIG_BRCMFMAC_USB 1190 1190 brcmf_usb_init(); 1191 1191 #endif 1192 + } 1193 + static DECLARE_WORK(brcmf_driver_work, brcmf_driver_init); 1194 + 1195 + static int __init brcmfmac_module_init(void) 1196 + { 1197 + if (!schedule_work(&brcmf_driver_work)) 1198 + return -EBUSY; 1199 + 1192 1200 return 0; 1193 1201 } 1194 1202 1195 - static void __exit brcmfmac_exit(void) 1203 + static void __exit brcmfmac_module_exit(void) 1196 1204 { 1205 + cancel_work_sync(&brcmf_driver_work); 1206 + 1197 1207 #ifdef CONFIG_BRCMFMAC_SDIO 1198 1208 brcmf_sdio_exit(); 1199 1209 #endif ··· 1212 1202 #endif 1213 1203 } 1214 1204 1215 - module_init(brcmfmac_init); 1216 - module_exit(brcmfmac_exit); 1205 + module_init(brcmfmac_module_init); 1206 + module_exit(brcmfmac_module_exit);