diff options
30 files changed, 625 insertions, 210 deletions
diff --git a/drivers/infiniband/hw/amso1100/c2.c b/drivers/infiniband/hw/amso1100/c2.c index 7275e727e0f5..d53cf519f42a 100644 --- a/drivers/infiniband/hw/amso1100/c2.c +++ b/drivers/infiniband/hw/amso1100/c2.c | |||
| @@ -1238,15 +1238,4 @@ static struct pci_driver c2_pci_driver = { | |||
| 1238 | .remove = c2_remove, | 1238 | .remove = c2_remove, |
| 1239 | }; | 1239 | }; |
| 1240 | 1240 | ||
| 1241 | static int __init c2_init_module(void) | 1241 | module_pci_driver(c2_pci_driver); |
| 1242 | { | ||
| 1243 | return pci_register_driver(&c2_pci_driver); | ||
| 1244 | } | ||
| 1245 | |||
| 1246 | static void __exit c2_exit_module(void) | ||
| 1247 | { | ||
| 1248 | pci_unregister_driver(&c2_pci_driver); | ||
| 1249 | } | ||
| 1250 | |||
| 1251 | module_init(c2_init_module); | ||
| 1252 | module_exit(c2_exit_module); | ||
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c index c13745cde7fa..565bfb161c1a 100644 --- a/drivers/infiniband/hw/cxgb4/cm.c +++ b/drivers/infiniband/hw/cxgb4/cm.c | |||
| @@ -143,14 +143,28 @@ static void connect_reply_upcall(struct c4iw_ep *ep, int status); | |||
| 143 | static LIST_HEAD(timeout_list); | 143 | static LIST_HEAD(timeout_list); |
| 144 | static spinlock_t timeout_lock; | 144 | static spinlock_t timeout_lock; |
| 145 | 145 | ||
| 146 | static void deref_qp(struct c4iw_ep *ep) | ||
| 147 | { | ||
| 148 | c4iw_qp_rem_ref(&ep->com.qp->ibqp); | ||
| 149 | clear_bit(QP_REFERENCED, &ep->com.flags); | ||
| 150 | } | ||
| 151 | |||
| 152 | static void ref_qp(struct c4iw_ep *ep) | ||
| 153 | { | ||
| 154 | set_bit(QP_REFERENCED, &ep->com.flags); | ||
| 155 | c4iw_qp_add_ref(&ep->com.qp->ibqp); | ||
| 156 | } | ||
| 157 | |||
| 146 | static void start_ep_timer(struct c4iw_ep *ep) | 158 | static void start_ep_timer(struct c4iw_ep *ep) |
| 147 | { | 159 | { |
| 148 | PDBG("%s ep %p\n", __func__, ep); | 160 | PDBG("%s ep %p\n", __func__, ep); |
| 149 | if (timer_pending(&ep->timer)) { | 161 | if (timer_pending(&ep->timer)) { |
| 150 | PDBG("%s stopped / restarted timer ep %p\n", __func__, ep); | 162 | pr_err("%s timer already started! ep %p\n", |
| 151 | del_timer_sync(&ep->timer); | 163 | __func__, ep); |
| 152 | } else | 164 | return; |
| 153 | c4iw_get_ep(&ep->com); | 165 | } |
| 166 | clear_bit(TIMEOUT, &ep->com.flags); | ||
| 167 | c4iw_get_ep(&ep->com); | ||
| 154 | ep->timer.expires = jiffies + ep_timeout_secs * HZ; | 168 | ep->timer.expires = jiffies + ep_timeout_secs * HZ; |
| 155 | ep->timer.data = (unsigned long)ep; | 169 | ep->timer.data = (unsigned long)ep; |
| 156 | ep->timer.function = ep_timeout; | 170 | ep->timer.function = ep_timeout; |
| @@ -159,14 +173,10 @@ static void start_ep_timer(struct c4iw_ep *ep) | |||
| 159 | 173 | ||
| 160 | static void stop_ep_timer(struct c4iw_ep *ep) | 174 | static void stop_ep_timer(struct c4iw_ep *ep) |
| 161 | { | 175 | { |
| 162 | PDBG("%s ep %p\n", __func__, ep); | 176 | PDBG("%s ep %p stopping\n", __func__, ep); |
| 163 | if (!timer_pending(&ep->timer)) { | ||
| 164 | WARN(1, "%s timer stopped when its not running! " | ||
| 165 | "ep %p state %u\n", __func__, ep, ep->com.state); | ||
| 166 | return; | ||
| 167 | } | ||
| 168 | del_timer_sync(&ep->timer); | 177 | del_timer_sync(&ep->timer); |
| 169 | c4iw_put_ep(&ep->com); | 178 | if (!test_and_set_bit(TIMEOUT, &ep->com.flags)) |
| 179 | c4iw_put_ep(&ep->com); | ||
| 170 | } | 180 | } |
| 171 | 181 | ||
| 172 | static int c4iw_l2t_send(struct c4iw_rdev *rdev, struct sk_buff *skb, | 182 | static int c4iw_l2t_send(struct c4iw_rdev *rdev, struct sk_buff *skb, |
| @@ -271,11 +281,13 @@ void _c4iw_free_ep(struct kref *kref) | |||
| 271 | 281 | ||
| 272 | ep = container_of(kref, struct c4iw_ep, com.kref); | 282 | ep = container_of(kref, struct c4iw_ep, com.kref); |
| 273 | PDBG("%s ep %p state %s\n", __func__, ep, states[state_read(&ep->com)]); | 283 | PDBG("%s ep %p state %s\n", __func__, ep, states[state_read(&ep->com)]); |
| 284 | if (test_bit(QP_REFERENCED, &ep->com.flags)) | ||
| 285 | deref_qp(ep); | ||
| 274 | if (test_bit(RELEASE_RESOURCES, &ep->com.flags)) { | 286 | if (test_bit(RELEASE_RESOURCES, &ep->com.flags)) { |
| 287 | remove_handle(ep->com.dev, &ep->com.dev->hwtid_idr, ep->hwtid); | ||
| 275 | cxgb4_remove_tid(ep->com.dev->rdev.lldi.tids, 0, ep->hwtid); | 288 | cxgb4_remove_tid(ep->com.dev->rdev.lldi.tids, 0, ep->hwtid); |
| 276 | dst_release(ep->dst); | 289 | dst_release(ep->dst); |
| 277 | cxgb4_l2t_release(ep->l2t); | 290 | cxgb4_l2t_release(ep->l2t); |
| 278 | remove_handle(ep->com.dev, &ep->com.dev->hwtid_idr, ep->hwtid); | ||
| 279 | } | 291 | } |
| 280 | kfree(ep); | 292 | kfree(ep); |
| 281 | } | 293 | } |
| @@ -687,7 +699,7 @@ static int send_mpa_reject(struct c4iw_ep *ep, const void *pdata, u8 plen) | |||
| 687 | memset(mpa, 0, sizeof(*mpa)); | 699 | memset(mpa, 0, sizeof(*mpa)); |
| 688 | memcpy(mpa->key, MPA_KEY_REP, sizeof(mpa->key)); | 700 | memcpy(mpa->key, MPA_KEY_REP, sizeof(mpa->key)); |
| 689 | mpa->flags = MPA_REJECT; | 701 | mpa->flags = MPA_REJECT; |
| 690 | mpa->revision = mpa_rev; | 702 | mpa->revision = ep->mpa_attr.version; |
| 691 | mpa->private_data_size = htons(plen); | 703 | mpa->private_data_size = htons(plen); |
| 692 | 704 | ||
| 693 | if (ep->mpa_attr.version == 2 && ep->mpa_attr.enhanced_rdma_conn) { | 705 | if (ep->mpa_attr.version == 2 && ep->mpa_attr.enhanced_rdma_conn) { |
| @@ -863,7 +875,6 @@ static void close_complete_upcall(struct c4iw_ep *ep) | |||
| 863 | ep->com.cm_id->event_handler(ep->com.cm_id, &event); | 875 | ep->com.cm_id->event_handler(ep->com.cm_id, &event); |
| 864 | ep->com.cm_id->rem_ref(ep->com.cm_id); | 876 | ep->com.cm_id->rem_ref(ep->com.cm_id); |
| 865 | ep->com.cm_id = NULL; | 877 | ep->com.cm_id = NULL; |
| 866 | ep->com.qp = NULL; | ||
| 867 | set_bit(CLOSE_UPCALL, &ep->com.history); | 878 | set_bit(CLOSE_UPCALL, &ep->com.history); |
| 868 | } | 879 | } |
| 869 | } | 880 | } |
| @@ -906,7 +917,6 @@ static void peer_abort_upcall(struct c4iw_ep *ep) | |||
| 906 | ep->com.cm_id->event_handler(ep->com.cm_id, &event); | 917 | ep->com.cm_id->event_handler(ep->com.cm_id, &event); |
| 907 | ep->com.cm_id->rem_ref(ep->com.cm_id); | 918 | ep->com.cm_id->rem_ref(ep->com.cm_id); |
| 908 | ep->com.cm_id = NULL; | 919 | ep->com.cm_id = NULL; |
| 909 | ep->com.qp = NULL; | ||
| 910 | set_bit(ABORT_UPCALL, &ep->com.history); | 920 | set_bit(ABORT_UPCALL, &ep->com.history); |
| 911 | } | 921 | } |
| 912 | } | 922 | } |
| @@ -946,7 +956,6 @@ static void connect_reply_upcall(struct c4iw_ep *ep, int status) | |||
| 946 | if (status < 0) { | 956 | if (status < 0) { |
| 947 | ep->com.cm_id->rem_ref(ep->com.cm_id); | 957 | ep->com.cm_id->rem_ref(ep->com.cm_id); |
| 948 | ep->com.cm_id = NULL; | 958 | ep->com.cm_id = NULL; |
| 949 | ep->com.qp = NULL; | ||
| 950 | } | 959 | } |
| 951 | } | 960 | } |
| 952 | 961 | ||
| @@ -1291,11 +1300,13 @@ static void process_mpa_request(struct c4iw_ep *ep, struct sk_buff *skb) | |||
| 1291 | if (mpa->revision > mpa_rev) { | 1300 | if (mpa->revision > mpa_rev) { |
| 1292 | printk(KERN_ERR MOD "%s MPA version mismatch. Local = %d," | 1301 | printk(KERN_ERR MOD "%s MPA version mismatch. Local = %d," |
| 1293 | |||
