Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 109012
b: refs/heads/master
c: a77a57a
h: refs/heads/master
v: v3
  • Loading branch information
Roland Dreier committed Aug 19, 2008
1 parent ad36b79 commit ae6c27d
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 24babadec0209e5f84c067cb89aca6515486d35c
refs/heads/master: a77a57a1a22afc31891d95879fe3cf2ab03838b0
2 changes: 1 addition & 1 deletion trunk/drivers/infiniband/hw/ipath/ipath_iba7220.c
Original file line number Diff line number Diff line change
Expand Up @@ -1720,7 +1720,7 @@ static void ipath_7220_put_tid(struct ipath_devdata *dd, u64 __iomem *tidptr,
"not 2KB aligned!\n", pa);
return;
}
if (chippa >= (1UL << IBA7220_TID_SZ_SHIFT)) {
if (pa >= (1UL << IBA7220_TID_SZ_SHIFT)) {
ipath_dev_err(dd,
"BUG: Physical page address 0x%lx "
"larger than supported\n", pa);
Expand Down
8 changes: 2 additions & 6 deletions trunk/drivers/infiniband/hw/ipath/ipath_ud.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ int ipath_make_ud_req(struct ipath_qp *qp)
u16 lrh0;
u16 lid;
int ret = 0;
int next_cur;

spin_lock_irqsave(&qp->s_lock, flags);

Expand All @@ -291,9 +290,8 @@ int ipath_make_ud_req(struct ipath_qp *qp)
goto bail;

wqe = get_swqe_ptr(qp, qp->s_cur);
next_cur = qp->s_cur + 1;
if (next_cur >= qp->s_size)
next_cur = 0;
if (++qp->s_cur >= qp->s_size)
qp->s_cur = 0;

/* Construct the header. */
ah_attr = &to_iah(wqe->wr.wr.ud.ah)->attr;
Expand All @@ -317,7 +315,6 @@ int ipath_make_ud_req(struct ipath_qp *qp)
qp->s_flags |= IPATH_S_WAIT_DMA;
goto bail;
}
qp->s_cur = next_cur;
spin_unlock_irqrestore(&qp->s_lock, flags);
ipath_ud_loopback(qp, wqe);
spin_lock_irqsave(&qp->s_lock, flags);
Expand All @@ -326,7 +323,6 @@ int ipath_make_ud_req(struct ipath_qp *qp)
}
}

qp->s_cur = next_cur;
extra_bytes = -wqe->length & 3;
nwords = (wqe->length + extra_bytes) >> 2;

Expand Down
19 changes: 9 additions & 10 deletions trunk/drivers/infiniband/ulp/ipoib/ipoib_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,8 @@ static int ipoib_stop(struct net_device *dev)

netif_stop_queue(dev);

/*
* Now flush workqueue to make sure a scheduled task doesn't
* bring our internal state back up.
*/
flush_workqueue(ipoib_workqueue);

ipoib_ib_dev_down(dev, 1);
ipoib_ib_dev_stop(dev, 1);
ipoib_ib_dev_down(dev, 0);
ipoib_ib_dev_stop(dev, 0);

if (!test_bit(IPOIB_FLAG_SUBINTERFACE, &priv->flags)) {
struct ipoib_dev_priv *cpriv;
Expand Down Expand Up @@ -1314,7 +1308,7 @@ static struct net_device *ipoib_add_port(const char *format,

register_failed:
ib_unregister_event_handler(&priv->event_handler);
flush_scheduled_work();
flush_workqueue(ipoib_workqueue);

event_failed:
ipoib_dev_cleanup(priv->dev);
Expand Down Expand Up @@ -1373,7 +1367,12 @@ static void ipoib_remove_one(struct ib_device *device)

list_for_each_entry_safe(priv, tmp, dev_list, list) {
ib_unregister_event_handler(&priv->event_handler);
flush_scheduled_work();

rtnl_lock();
dev_change_flags(priv->dev, priv->dev->flags & ~IFF_UP);
rtnl_unlock();

flush_workqueue(ipoib_workqueue);

unregister_netdev(priv->dev);
ipoib_dev_cleanup(priv->dev);
Expand Down
10 changes: 9 additions & 1 deletion trunk/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,16 @@ static int ipoib_mcast_join_complete(int status,
&priv->mcast_task, 0);
mutex_unlock(&mcast_mutex);

if (mcast == priv->broadcast)
if (mcast == priv->broadcast) {
/*
* Take RTNL lock here to avoid racing with
* ipoib_stop() and turning the carrier back
* on while a device is being removed.
*/
rtnl_lock();
netif_carrier_on(dev);
rtnl_unlock();
}

return 0;
}
Expand Down

0 comments on commit ae6c27d

Please sign in to comment.