Commit e64a4b70 authored by Arend van Spriel's avatar Arend van Spriel Committed by John W. Linville

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: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: default avatarFranky (Zhenhui) Lin <frankyl@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 549040ab
......@@ -1181,7 +1181,7 @@ int brcmf_write_to_file(struct brcmf_pub *drvr, const u8 *buf, int size)
}
#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);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment