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

brcm80211: smac: 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 avatarAlwin Beukers <alwin@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent e64a4b70
...@@ -1169,25 +1169,31 @@ static struct bcma_driver brcms_bcma_driver = { ...@@ -1169,25 +1169,31 @@ static struct bcma_driver brcms_bcma_driver = {
/** /**
* This is the main entry point for the brcmsmac driver. * This is the main entry point for the brcmsmac driver.
* *
* This function determines if a device pointed to by pdev is a WL device, * This function is scheduled upon module initialization and
* and if so, performs a brcms_attach() on it. * does the driver registration, which result in brcms_bcma_probe()
* * call resulting in the driver bringup.
*/ */
static int __init brcms_module_init(void) static void brcms_driver_init(struct work_struct *work)
{ {
int error = -ENODEV; int error;
error = bcma_driver_register(&brcms_bcma_driver);
if (error)
pr_err("%s: register returned %d\n", __func__, error);
}
static DECLARE_WORK(brcms_driver_work, brcms_driver_init);
static int __init brcms_module_init(void)
{
#ifdef DEBUG #ifdef DEBUG
if (msglevel != 0xdeadbeef) if (msglevel != 0xdeadbeef)
brcm_msg_level = msglevel; brcm_msg_level = msglevel;
#endif /* DEBUG */ #endif
if (!schedule_work(&brcms_driver_work))
return -EBUSY;
error = bcma_driver_register(&brcms_bcma_driver);
pr_err("%s: register returned %d\n", __func__, error);
if (!error)
return 0; return 0;
return error;
} }
/** /**
...@@ -1199,6 +1205,7 @@ static int __init brcms_module_init(void) ...@@ -1199,6 +1205,7 @@ static int __init brcms_module_init(void)
*/ */
static void __exit brcms_module_exit(void) static void __exit brcms_module_exit(void)
{ {
cancel_work_sync(&brcms_driver_work);
bcma_driver_unregister(&brcms_bcma_driver); bcma_driver_unregister(&brcms_bcma_driver);
} }
......
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