diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-30 18:26:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-30 18:26:56 -0400 |
commit | 53173920dab204a31ef37e7d2cb25b964a8a7752 (patch) | |
tree | 9dce73580961b298a160d6ea496184adde360c51 /drivers/infiniband | |
parent | e403149c92a2a0643211debbbb0a9ec7cc04cff7 (diff) | |
parent | 3f776e8a25a9d281125490562e1cc5bd7c14cf7c (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:
IB/fmr_pool: Stop ib_fmr threads from contributing to load average
IB/ipath: Fix incorrect use of sizeof on msg buffer (function argument)
IB/ipath: Limit length checksummed in eeprom
IB/ipath: Fix a race where s_last is updated without lock held
IB/mlx4: Lock SQ lock in mlx4_ib_post_send()
IPoIB/cm: Fix receive QP cleanup
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/core/fmr_pool.c | 8 | ||||
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_eeprom.c | 10 | ||||
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_intr.c | 18 | ||||
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_ruc.c | 14 | ||||
-rw-r--r-- | drivers/infiniband/hw/mlx4/qp.c | 4 | ||||
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_cm.c | 2 |
6 files changed, 34 insertions, 22 deletions
diff --git a/drivers/infiniband/core/fmr_pool.c b/drivers/infiniband/core/fmr_pool.c index d7f64525469b..e8d5f6b64998 100644 --- a/drivers/infiniband/core/fmr_pool.c +++ b/drivers/infiniband/core/fmr_pool.c | |||
@@ -291,10 +291,10 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd, | |||
291 | atomic_set(&pool->flush_ser, 0); | 291 | atomic_set(&pool->flush_ser, 0); |
292 | init_waitqueue_head(&pool->force_wait); | 292 | init_waitqueue_head(&pool->force_wait); |
293 | 293 | ||
294 | pool->thread = kthread_create(ib_fmr_cleanup_thread, | 294 | pool->thread = kthread_run(ib_fmr_cleanup_thread, |
295 | pool, | 295 | pool, |
296 | "ib_fmr(%s)", | 296 | "ib_fmr(%s)", |
297 | device->name); | 297 | device->name); |
298 | if (IS_ERR(pool->thread)) { | 298 | if (IS_ERR(pool->thread)) { |
299 | printk(KERN_WARNING PFX "couldn't start cleanup thread\n"); | 299 | printk(KERN_WARNING PFX "couldn't start cleanup thread\n"); |
300 | ret = PTR_ERR(pool->thread); | 300 | ret = PTR_ERR(pool->thread); |
diff --git a/drivers/infiniband/hw/ipath/ipath_eeprom.c b/drivers/infiniband/hw/ipath/ipath_eeprom.c index bcfa3ccb555f..e7c25dbbcdc9 100644 --- a/drivers/infiniband/hw/ipath/ipath_eeprom.c +++ b/drivers/infiniband/hw/ipath/ipath_eeprom.c | |||
@@ -538,7 +538,15 @@ static u8 flash_csum(struct ipath_flash *ifp, int adjust) | |||
538 | u8 *ip = (u8 *) ifp; | 538 | u8 *ip = (u8 *) ifp; |
539 | u8 csum = 0, len; | 539 | u8 csum = 0, len; |
540 | 540 | ||
541 | for (len = 0; len < ifp->if_length; len++) | 541 | /* |
542 | * Limit length checksummed to max length of actual data. | ||
543 | * Checksum of erased eeprom will still be bad, but we avoid | ||
544 | * reading past the end of the buffer we were passed. | ||
545 | */ | ||
546 | len = ifp->if_length; | ||
547 | if (len > sizeof(struct ipath_flash)) | ||
548 | len = sizeof(struct ipath_flash); | ||
549 | while (len--) | ||
542 | csum += *ip++; | 550 | csum += *ip++; |
543 | csum -= ifp->if_csum; | 551 | csum -= ifp->if_csum; |
544 | csum = ~csum; | 552 | csum = ~csum; |
diff --git a/drivers/infiniband/hw/ipath/ipath_intr.c b/drivers/infiniband/hw/ipath/ipath_intr.c index 6a5dd5cd773d..c61f9da2964a 100644 --- a/drivers/infiniband/hw/ipath/ipath_intr.c +++ b/drivers/infiniband/hw/ipath/ipath_intr.c | |||
@@ -453,7 +453,7 @@ skip_ibchange: | |||
453 | } | 453 | } |
454 | 454 | ||
455 | static void handle_supp_msgs(struct ipath_devdata *dd, | 455 | static void handle_supp_msgs(struct ipath_devdata *dd, |
456 | unsigned supp_msgs, char msg[512]) | 456 | unsigned supp_msgs, char *msg, int msgsz) |
457 | { | 457 | { |
458 | /* | 458 | /* |
459 | * Print the message unless it's ibc status change only, which | 459 | * Print the message unless it's ibc status change only, which |
@@ -461,9 +461,9 @@ static void handle_supp_msgs(struct ipath_devdata *dd, | |||
461 | */ | 461 | */ |
462 | if (dd->ipath_lasterror & ~INFINIPATH_E_IBSTATUSCHANGED) { | 462 | if (dd->ipath_lasterror & ~INFINIPATH_E_IBSTATUSCHANGED) { |
463 | int iserr; | 463 | int iserr; |
464 | iserr = ipath_decode_err(msg, sizeof msg, | 464 | iserr = ipath_decode_err(msg, msgsz, |
465 | dd->ipath_lasterror & | 465 | dd->ipath_lasterror & |
466 | ~INFINIPATH_E_IBSTATUSCHANGED); | 466 | ~INFINIPATH_E_IBSTATUSCHANGED); |
467 | if (dd->ipath_lasterror & | 467 | if (dd->ipath_lasterror & |
468 | ~(INFINIPATH_E_RRCVEGRFULL | | 468 | ~(INFINIPATH_E_RRCVEGRFULL | |
469 | INFINIPATH_E_RRCVHDRFULL | INFINIPATH_E_PKTERRS)) | 469 | INFINIPATH_E_RRCVHDRFULL | INFINIPATH_E_PKTERRS)) |
@@ -492,8 +492,8 @@ static void handle_supp_msgs(struct ipath_devdata *dd, | |||
492 | } | 492 | } |
493 | 493 | ||
494 | static unsigned handle_frequent_errors(struct ipath_devdata *dd, | 494 | static unsigned handle_frequent_errors(struct ipath_devdata *dd, |
495 | ipath_err_t errs, char msg[512], | 495 | ipath_err_t errs, char *msg, |
496 | int *noprint) | 496 | int msgsz, int *noprint) |
497 | { | 497 | { |
498 | unsigned long nc; | 498 | unsigned long nc; |
499 | static unsigned long nextmsg_time; | 499 | static unsigned long nextmsg_time; |
@@ -512,7 +512,7 @@ static unsigned handle_frequent_errors(struct ipath_devdata *dd, | |||
512 | nextmsg_time = nc + HZ * 3; | 512 | nextmsg_time = nc + HZ * 3; |
513 | } | 513 | } |
514 | else if (supp_msgs) { | 514 | else if (supp_msgs) { |
515 | handle_supp_msgs(dd, supp_msgs, msg); | 515 | handle_supp_msgs(dd, supp_msgs, msg, msgsz); |
516 | supp_msgs = 0; | 516 | supp_msgs = 0; |
517 | nmsgs = 0; | 517 | nmsgs = 0; |
518 | } | 518 | } |
@@ -525,14 +525,14 @@ static unsigned handle_frequent_errors(struct ipath_devdata *dd, | |||
525 | 525 | ||
526 | static int handle_errors(struct ipath_devdata *dd, ipath_err_t errs) | 526 | static int handle_errors(struct ipath_devdata *dd, ipath_err_t errs) |
527 | { | 527 | { |
528 | char msg[512]; | 528 | char msg[128]; |
529 | u64 ignore_this_time = 0; | 529 | u64 ignore_this_time = 0; |
530 | int i, iserr = 0; | 530 | int i, iserr = 0; |
531 | int chkerrpkts = 0, noprint = 0; | 531 | int chkerrpkts = 0, noprint = 0; |
532 | unsigned supp_msgs; | 532 | unsigned supp_msgs; |
533 | int log_idx; | 533 | int log_idx; |
534 | 534 | ||
535 | supp_msgs = handle_frequent_errors(dd, errs, msg, &noprint); | 535 | supp_msgs = handle_frequent_errors(dd, errs, msg, sizeof msg, &noprint); |
536 | 536 | ||
537 | /* don't report errors that are masked */ | 537 | /* don't report errors that are masked */ |
538 | errs &= ~dd->ipath_maskederrs; | 538 | errs &= ~dd->ipath_maskederrs; |
diff --git a/drivers/infiniband/hw/ipath/ipath_ruc.c b/drivers/infiniband/hw/ipath/ipath_ruc.c index 4b6b7ee8e5c1..54c61a972de2 100644 --- a/drivers/infiniband/hw/ipath/ipath_ruc.c +++ b/drivers/infiniband/hw/ipath/ipath_ruc.c | |||
@@ -630,11 +630,8 @@ bail:; | |||
630 | void ipath_send_complete(struct ipath_qp *qp, struct ipath_swqe *wqe, | 630 | void ipath_send_complete(struct ipath_qp *qp, struct ipath_swqe *wqe, |
631 | enum ib_wc_status status) | 631 | enum ib_wc_status status) |
632 | { | 632 | { |
633 | u32 last = qp->s_last; | 633 | unsigned long flags; |
634 | 634 | u32 last; | |
635 | if (++last == qp->s_size) | ||
636 | last = 0; | ||
637 | qp->s_last = last; | ||
638 | 635 | ||
639 | /* See ch. 11.2.4.1 and 10.7.3.1 */ | 636 | /* See ch. 11.2.4.1 and 10.7.3.1 */ |
640 | if (!(qp->s_flags & IPATH_S_SIGNAL_REQ_WR) || | 637 | if (!(qp->s_flags & IPATH_S_SIGNAL_REQ_WR) || |
@@ -658,4 +655,11 @@ void ipath_send_complete(struct ipath_qp *qp, struct ipath_swqe *wqe, | |||
658 | wc.port_num = 0; | 655 | wc.port_num = 0; |
659 | ipath_cq_enter(to_icq(qp->ibqp.send_cq), &wc, 0); | 656 | ipath_cq_enter(to_icq(qp->ibqp.send_cq), &wc, 0); |
660 | } | 657 | } |
658 | |||
659 | spin_lock_irqsave(&qp->s_lock, flags); | ||
660 | last = qp->s_last; | ||
661 | if (++last >= qp->s_size) | ||
662 | last = 0; | ||
663 | qp->s_last = last; | ||
664 | spin_unlock_irqrestore(&qp->s_lock, flags); | ||
661 | } | 665 | } |
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c index 6b3322486b5e..8cba9c532e64 100644 --- a/drivers/infiniband/hw/mlx4/qp.c +++ b/drivers/infiniband/hw/mlx4/qp.c | |||
@@ -1282,7 +1282,7 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, | |||
1282 | int size; | 1282 | int size; |
1283 | int i; | 1283 | int i; |
1284 | 1284 | ||
1285 | spin_lock_irqsave(&qp->rq.lock, flags); | 1285 | spin_lock_irqsave(&qp->sq.lock, flags); |
1286 | 1286 | ||
1287 | ind = qp->sq.head; | 1287 | ind = qp->sq.head; |
1288 | 1288 | ||
@@ -1448,7 +1448,7 @@ out: | |||
1448 | (qp->sq.wqe_cnt - 1)); | 1448 | (qp->sq.wqe_cnt - 1)); |
1449 | } | 1449 | } |
1450 | 1450 | ||
1451 | spin_unlock_irqrestore(&qp->rq.lock, flags); | 1451 | spin_unlock_irqrestore(&qp->sq.lock, flags); |
1452 | 1452 | ||
1453 | return err; | 1453 | return err; |
1454 | } | 1454 | } |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c index 87610772a979..059cf92b60a5 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c | |||
@@ -60,7 +60,7 @@ static struct ib_qp_attr ipoib_cm_err_attr = { | |||
60 | .qp_state = IB_QPS_ERR | 60 | .qp_state = IB_QPS_ERR |
61 | }; | 61 | }; |
62 | 62 | ||
63 | #define IPOIB_CM_RX_DRAIN_WRID 0x7fffffff | 63 | #define IPOIB_CM_RX_DRAIN_WRID 0xffffffff |
64 | 64 | ||
65 | static struct ib_send_wr ipoib_cm_rx_drain_wr = { | 65 | static struct ib_send_wr ipoib_cm_rx_drain_wr = { |
66 | .wr_id = IPOIB_CM_RX_DRAIN_WRID, | 66 | .wr_id = IPOIB_CM_RX_DRAIN_WRID, |