aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorYossi Etigin <yosefe@Voltaire.COM>2008-11-12 13:24:36 -0500
committerRoland Dreier <rolandd@cisco.com>2008-11-12 13:24:36 -0500
commitfe25c56190bbc0951d7c53b4ccd148e669d69938 (patch)
tree014505ce749ad84073d76f4c12e8212c1be59076 /drivers/infiniband
parent332edc2f7fa58b818dfed1cede60272eecc27c0a (diff)
IPoIB: Don't enable NAPI when it's already enabled
If a P_Key is not present when an interface is created, ipoib_open() will return after doing napi_enable(). ipoib_open() will be called again from ipoib_pkey_poll() when the P_Key appears, after NAPI has already been enabled, and try to enable it again. This triggers a BUG_ON() in napi_enable(). Fix this by moving the call to napi_enable() to after the test for P_Key presence. Signed-off-by: Yossi Etigin <yosefe@voltaire.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index fddded7900d1..b1eeb5a427ca 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -106,12 +106,13 @@ int ipoib_open(struct net_device *dev)
106 106
107 ipoib_dbg(priv, "bringing up interface\n"); 107 ipoib_dbg(priv, "bringing up interface\n");
108 108
109 napi_enable(&priv->napi);
110 set_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags); 109 set_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags);
111 110
112 if (ipoib_pkey_dev_delay_open(dev)) 111 if (ipoib_pkey_dev_delay_open(dev))
113 return 0; 112 return 0;
114 113
114 napi_enable(&priv->napi);
115
115 if (ipoib_ib_dev_open(dev)) { 116 if (ipoib_ib_dev_open(dev)) {
116 napi_disable(&priv->napi); 117 napi_disable(&priv->napi);
117 return -EINVAL; 118 return -EINVAL;