aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-09-24 20:06:01 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-24 20:06:01 -0400
commitd7757be133cc05620608af46acd178686681b7ef (patch)
tree32f68fd9d1fc58337a74c75db3e29790df219f67 /drivers/infiniband
parent94e0fb086fc5663c38bbc0fe86d698be8314f82f (diff)
parent216c7f92b9ca7766600a3a04b9dda445a9217832 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: IPoIB: Don't turn on carrier for a non-active port IB/mthca: Fix access to freed memory in catastrophic event handling mlx4_core: Pass cache line size to device FW RDMA/nes: Remove duplicate .ndo_set_mac_address field initialization IB/mad: Fix lock-lock-timer deadlock in RMPP code
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/core/mad_rmpp.c17
-rw-r--r--drivers/infiniband/hw/mthca/mthca_catas.c11
-rw-r--r--drivers/infiniband/hw/nes/nes_nic.c1
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_multicast.c7
4 files changed, 28 insertions, 8 deletions
diff --git a/drivers/infiniband/core/mad_rmpp.c b/drivers/infiniband/core/mad_rmpp.c
index 57a3c6f947b2..4e0f2829e0e5 100644
--- a/drivers/infiniband/core/mad_rmpp.c
+++ b/drivers/infiniband/core/mad_rmpp.c
@@ -37,7 +37,8 @@
37enum rmpp_state { 37enum rmpp_state {
38 RMPP_STATE_ACTIVE, 38 RMPP_STATE_ACTIVE,
39 RMPP_STATE_TIMEOUT, 39 RMPP_STATE_TIMEOUT,
40 RMPP_STATE_COMPLETE 40 RMPP_STATE_COMPLETE,
41 RMPP_STATE_CANCELING
41}; 42};
42 43
43struct mad_rmpp_recv { 44struct mad_rmpp_recv {
@@ -87,18 +88,22 @@ void ib_cancel_rmpp_recvs(struct ib_mad_agent_private *agent)
87 88
88 spin_lock_irqsave(&agent->lock, flags); 89 spin_lock_irqsave(&agent->lock, flags);
89 list_for_each_entry(rmpp_recv, &agent->rmpp_list, list) { 90 list_for_each_entry(rmpp_recv, &agent->rmpp_list, list) {
91 if (rmpp_recv->state != RMPP_STATE_COMPLETE)
92 ib_free_recv_mad(rmpp_recv->rmpp_wc);
93 rmpp_recv->state = RMPP_STATE_CANCELING;
94 }
95 spin_unlock_irqrestore(&agent->lock, flags);
96
97 list_for_each_entry(rmpp_recv, &agent->rmpp_list, list) {
90 cancel_delayed_work(&rmpp_recv->timeout_work); 98 cancel_delayed_work(&rmpp_recv->timeout_work);
91 cancel_delayed_work(&rmpp_recv->cleanup_work); 99 cancel_delayed_work(&rmpp_recv->cleanup_work);
92 } 100 }
93 spin_unlock_irqrestore(&agent->lock, flags);
94 101
95 flush_workqueue(agent->qp_info->port_priv->wq); 102 flush_workqueue(agent->qp_info->port_priv->wq);
96 103
97 list_for_each_entry_safe(rmpp_recv, temp_rmpp_recv, 104 list_for_each_entry_safe(rmpp_recv, temp_rmpp_recv,
98 &agent->rmpp_list, list) { 105 &agent->rmpp_list, list) {
99 list_del(&rmpp_recv->list); 106 list_del(&rmpp_recv->list);
100 if (rmpp_recv->state != RMPP_STATE_COMPLETE)
101 ib_free_recv_mad(rmpp_recv->rmpp_wc);
102 destroy_rmpp_recv(rmpp_recv); 107 destroy_rmpp_recv(rmpp_recv);
103 } 108 }
104} 109}
@@ -260,6 +265,10 @@ static void recv_cleanup_handler(struct work_struct *work)
260 unsigned long flags; 265 unsigned long flags;
261 266
262 spin_lock_irqsave(&rmpp_recv->agent->lock, flags); 267 spin_lock_irqsave(&rmpp_recv->agent->lock, flags);
268 if (rmpp_recv->state == RMPP_STATE_CANCELING) {
269 spin_unlock_irqrestore(&rmpp_recv->agent->lock, flags);
270 return;
271 }
263 list_del(&rmpp_recv->list); 272 list_del(&rmpp_recv->list);
264 spin_unlock_irqrestore(&rmpp_recv->agent->lock, flags); 273 spin_unlock_irqrestore(&rmpp_recv->agent->lock, flags);
265 destroy_rmpp_recv(rmpp_recv); 274 destroy_rmpp_recv(rmpp_recv);
diff --git a/drivers/infiniband/hw/mthca/mthca_catas.c b/drivers/infiniband/hw/mthca/mthca_catas.c
index 056b2a4c6970..0aa0110e4b6c 100644
--- a/drivers/infiniband/hw/mthca/mthca_catas.c
+++ b/drivers/infiniband/hw/mthca/mthca_catas.c
@@ -68,11 +68,16 @@ static void catas_reset(struct work_struct *work)
68 spin_unlock_irq(&catas_lock); 68 spin_unlock_irq(&catas_lock);
69 69
70 list_for_each_entry_safe(dev, tmpdev, &tlist, catas_err.list) { 70 list_for_each_entry_safe(dev, tmpdev, &tlist, catas_err.list) {
71 struct pci_dev *pdev = dev->pdev;
71 ret = __mthca_restart_one(dev->pdev); 72 ret = __mthca_restart_one(dev->pdev);
73 /* 'dev' now is not valid */
72 if (ret) 74 if (ret)
73 mthca_err(dev, "Reset failed (%d)\n", ret); 75 printk(KERN_ERR "mthca %s: Reset failed (%d)\n",
74 else 76 pci_name(pdev), ret);
75 mthca_dbg(dev, "Reset succeeded\n"); 77 else {
78 struct mthca_dev *d = pci_get_drvdata(pdev);
79 mthca_dbg(d, "Reset succeeded\n");
80 }
76 } 81 }
77 82
78 mutex_unlock(&mthca_device_mutex); 83 mutex_unlock(&mthca_device_mutex);
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c
index 538e409d4515..e593af3354b8 100644
--- a/drivers/infiniband/hw/nes/nes_nic.c
+++ b/drivers/infiniband/hw/nes/nes_nic.c
@@ -1566,7 +1566,6 @@ static const struct net_device_ops nes_netdev_ops = {
1566 .ndo_set_mac_address = nes_netdev_set_mac_address, 1566 .ndo_set_mac_address = nes_netdev_set_mac_address,
1567 .ndo_set_multicast_list = nes_netdev_set_multicast_list, 1567 .ndo_set_multicast_list = nes_netdev_set_multicast_list,
1568 .ndo_change_mtu = nes_netdev_change_mtu, 1568 .ndo_change_mtu = nes_netdev_change_mtu,
1569 .ndo_set_mac_address = eth_mac_addr,
1570 .ndo_validate_addr = eth_validate_addr, 1569 .ndo_validate_addr = eth_validate_addr,
1571 .ndo_vlan_rx_register = nes_netdev_vlan_rx_register, 1570 .ndo_vlan_rx_register = nes_netdev_vlan_rx_register,
1572}; 1571};
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
index 25874fc680c9..8763c1ea5eb4 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@ -362,12 +362,19 @@ void ipoib_mcast_carrier_on_task(struct work_struct *work)
362{ 362{
363 struct ipoib_dev_priv *priv = container_of(work, struct ipoib_dev_priv, 363 struct ipoib_dev_priv *priv = container_of(work, struct ipoib_dev_priv,
364 carrier_on_task); 364 carrier_on_task);
365 struct ib_port_attr attr;
365 366
366 /* 367 /*
367 * Take rtnl_lock to avoid racing with ipoib_stop() and 368 * Take rtnl_lock to avoid racing with ipoib_stop() and
368 * turning the carrier back on while a device is being 369 * turning the carrier back on while a device is being
369 * removed. 370 * removed.
370 */ 371 */
372 if (ib_query_port(priv->ca, priv->port, &attr) ||
373 attr.state != IB_PORT_ACTIVE) {
374 ipoib_dbg(priv, "Keeping carrier off until IB port is active\n");
375 return;
376 }
377
371 rtnl_lock(); 378 rtnl_lock();
372 netif_carrier_on(priv->dev); 379 netif_carrier_on(priv->dev);
373 rtnl_unlock(); 380 rtnl_unlock();