summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorArend van Spriel <arend@broadcom.com>2012-03-02 22:55:49 +0100
committerJohn W. Linville <linville@tuxdriver.com>2012-03-05 21:53:59 +0100
commite64a4b708fd5b719b54f7f969895b66bcba71486 (patch)
treeae1b14679701533c2c65b364f325222fa5f34cea /drivers/net/wireless
parentbrcm80211: fmac: initialize host interface drivers regardless result (diff)
downloadlinux-e64a4b708fd5b719b54f7f969895b66bcba71486.tar.xz
linux-e64a4b708fd5b719b54f7f969895b66bcba71486.zip
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>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
index e7345569e9de..2a1e5ae0c402 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
@@ -1181,7 +1181,7 @@ exit:
}
#endif /* DEBUG */
-static int __init brcmfmac_init(void)
+static void brcmf_driver_init(struct work_struct *work)
{
#ifdef CONFIG_BRCMFMAC_SDIO
brcmf_sdio_init();
@@ -1189,11 +1189,21 @@ static int __init brcmfmac_init(void)
#ifdef CONFIG_BRCMFMAC_USB
brcmf_usb_init();
#endif
+}
+static DECLARE_WORK(brcmf_driver_work, brcmf_driver_init);
+
+static int __init brcmfmac_module_init(void)
+{
+ if (!schedule_work(&brcmf_driver_work))
+ return -EBUSY;
+
return 0;
}
-static void __exit brcmfmac_exit(void)
+static void __exit brcmfmac_module_exit(void)
{
+ cancel_work_sync(&brcmf_driver_work);
+
#ifdef CONFIG_BRCMFMAC_SDIO
brcmf_sdio_exit();
#endif
@@ -1202,5 +1212,5 @@ static void __exit brcmfmac_exit(void)
#endif
}
-module_init(brcmfmac_init);
-module_exit(brcmfmac_exit);
+module_init(brcmfmac_module_init);
+module_exit(brcmfmac_module_exit);