From: Jack Morgenstein Date: Wed, 13 Feb 2008 14:23:50 +0000 (+0200) Subject: IPoIB: On P_Key change event, reset state properly X-Git-Tag: v2.6.25-rc2~8^2~4 X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=167c42655cca188657aa9bb4e06d1194af3c73a5;p=cascardo%2Flinux.git IPoIB: On P_Key change event, reset state properly In P_Key event handling, if the old P_Key is no longer available, the driver must call ipoib_ib_dev_stop() -- just as it does when the P_Key is still available (see procedure __ipoib_ib_dev_flush()). When a P_Key becomes available, the driver will perform ipoib_open(), which assumes that the QP is in RESET, the cm_id has been destroyed/deleted, etc. If ipoib_ib_dev_stop() is not called as described above, then these assumptions will be false, and the attempt to bring the interface up will fail. Found by Mellanox QA. Signed-off-by: Jack Morgenstein Signed-off-by: Roland Dreier --- diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index 9d3e778dc56d..08c4396cf418 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c @@ -780,6 +780,7 @@ static void __ipoib_ib_dev_flush(struct ipoib_dev_priv *priv, int pkey_event) if (ib_find_pkey(priv->ca, priv->port, priv->pkey, &new_index)) { clear_bit(IPOIB_PKEY_ASSIGNED, &priv->flags); ipoib_ib_dev_down(dev, 0); + ipoib_ib_dev_stop(dev, 0); ipoib_pkey_dev_delay_open(dev); return; }