summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Chan <mchan@broadcom.com>2011-06-08 19:29:35 +0000
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-07 12:32:08 -0800
commit51f01bfbf9012b165e9aeb72e016fd78033b99ce (patch)
tree40769246dbe12f35baa97c770db34c4e80a61794
parent3e8264dbebf6026b4d3a778414738d5f8617c54c (diff)
downloadlinux-stable-51f01bfbf9012b165e9aeb72e016fd78033b99ce.tar.gz
linux-stable-51f01bfbf9012b165e9aeb72e016fd78033b99ce.tar.bz2
linux-stable-51f01bfbf9012b165e9aeb72e016fd78033b99ce.zip
cnic: Improve NETDEV_UP event handling
commit db1d350fcb156b58f66a67680617077bcacfe6fc upstream. During NETDEV_UP, we use symbol_get() to get the net driver's cnic probe function. This sometimes doesn't work if NETDEV_UP happens right after NETDEV_REGISTER and the net driver is still running module init code. As a result, the cnic device may not be discovered. We fix this by probing on all NETDEV events if the device's netif_running state is up. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/net/cnic.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index 3bf1b04f2cab..227a2f9d6d96 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -2718,7 +2718,7 @@ static int cnic_netdev_event(struct notifier_block *this, unsigned long event,
dev = cnic_from_netdev(netdev);
- if (!dev && (event == NETDEV_REGISTER || event == NETDEV_UP)) {
+ if (!dev && (event == NETDEV_REGISTER || netif_running(netdev))) {
/* Check for the hot-plug device */
dev = is_cnic_dev(netdev);
if (dev) {
@@ -2734,7 +2734,7 @@ static int cnic_netdev_event(struct notifier_block *this, unsigned long event,
else if (event == NETDEV_UNREGISTER)
cnic_ulp_exit(dev);
- if (event == NETDEV_UP) {
+ if (event == NETDEV_UP || (new_dev && netif_running(netdev))) {
if (cnic_register_netdev(dev) != 0) {
cnic_put(dev);
goto done;