.. | .. |
---|
181 | 181 | } while (size > 0); |
---|
182 | 182 | cmdq->seq_num++; |
---|
183 | 183 | |
---|
184 | | - cmdq_prod = hwq->prod; |
---|
| 184 | + cmdq_prod = hwq->prod & 0xFFFF; |
---|
185 | 185 | if (test_bit(FIRMWARE_FIRST_FLAG, &cmdq->flags)) { |
---|
186 | 186 | /* The very first doorbell write |
---|
187 | 187 | * is required to set this flag |
---|
.. | .. |
---|
295 | 295 | } |
---|
296 | 296 | |
---|
297 | 297 | static int bnxt_qplib_process_qp_event(struct bnxt_qplib_rcfw *rcfw, |
---|
298 | | - struct creq_qp_event *qp_event) |
---|
| 298 | + struct creq_qp_event *qp_event, |
---|
| 299 | + u32 *num_wait) |
---|
299 | 300 | { |
---|
300 | 301 | struct creq_qp_error_notification *err_event; |
---|
301 | 302 | struct bnxt_qplib_hwq *hwq = &rcfw->cmdq.hwq; |
---|
.. | .. |
---|
304 | 305 | u16 cbit, blocked = 0; |
---|
305 | 306 | struct pci_dev *pdev; |
---|
306 | 307 | unsigned long flags; |
---|
| 308 | + u32 wait_cmds = 0; |
---|
307 | 309 | __le16 mcookie; |
---|
308 | 310 | u16 cookie; |
---|
309 | 311 | int rc = 0; |
---|
.. | .. |
---|
363 | 365 | crsqe->req_size = 0; |
---|
364 | 366 | |
---|
365 | 367 | if (!blocked) |
---|
366 | | - wake_up(&rcfw->cmdq.waitq); |
---|
| 368 | + wait_cmds++; |
---|
367 | 369 | spin_unlock_irqrestore(&hwq->lock, flags); |
---|
368 | 370 | } |
---|
| 371 | + *num_wait += wait_cmds; |
---|
369 | 372 | return rc; |
---|
370 | 373 | } |
---|
371 | 374 | |
---|
.. | .. |
---|
379 | 382 | struct creq_base *creqe; |
---|
380 | 383 | u32 sw_cons, raw_cons; |
---|
381 | 384 | unsigned long flags; |
---|
| 385 | + u32 num_wakeup = 0; |
---|
382 | 386 | |
---|
383 | 387 | /* Service the CREQ until budget is over */ |
---|
384 | 388 | spin_lock_irqsave(&hwq->lock, flags); |
---|
.. | .. |
---|
397 | 401 | switch (type) { |
---|
398 | 402 | case CREQ_BASE_TYPE_QP_EVENT: |
---|
399 | 403 | bnxt_qplib_process_qp_event |
---|
400 | | - (rcfw, (struct creq_qp_event *)creqe); |
---|
| 404 | + (rcfw, (struct creq_qp_event *)creqe, |
---|
| 405 | + &num_wakeup); |
---|
401 | 406 | creq->stats.creq_qp_event_processed++; |
---|
402 | 407 | break; |
---|
403 | 408 | case CREQ_BASE_TYPE_FUNC_EVENT: |
---|
.. | .. |
---|
425 | 430 | rcfw->res->cctx, true); |
---|
426 | 431 | } |
---|
427 | 432 | spin_unlock_irqrestore(&hwq->lock, flags); |
---|
| 433 | + if (num_wakeup) |
---|
| 434 | + wake_up_nr(&rcfw->cmdq.waitq, num_wakeup); |
---|
428 | 435 | } |
---|
429 | 436 | |
---|
430 | 437 | static irqreturn_t bnxt_qplib_creq_irq(int irq, void *dev_instance) |
---|
.. | .. |
---|
595 | 602 | rcfw->cmdq_depth = BNXT_QPLIB_CMDQE_MAX_CNT_8192; |
---|
596 | 603 | |
---|
597 | 604 | sginfo.pgsize = bnxt_qplib_cmdqe_page_size(rcfw->cmdq_depth); |
---|
598 | | - hwq_attr.depth = rcfw->cmdq_depth; |
---|
| 605 | + hwq_attr.depth = rcfw->cmdq_depth & 0x7FFFFFFF; |
---|
599 | 606 | hwq_attr.stride = BNXT_QPLIB_CMDQE_UNITS; |
---|
600 | 607 | hwq_attr.type = HWQ_TYPE_CTX; |
---|
601 | 608 | if (bnxt_qplib_alloc_init_hwq(&cmdq->hwq, &hwq_attr)) { |
---|
.. | .. |
---|
633 | 640 | struct bnxt_qplib_creq_ctx *creq; |
---|
634 | 641 | |
---|
635 | 642 | creq = &rcfw->creq; |
---|
| 643 | + |
---|
| 644 | + if (!creq->requested) |
---|
| 645 | + return; |
---|
| 646 | + |
---|
636 | 647 | tasklet_disable(&creq->creq_tasklet); |
---|
637 | 648 | /* Mask h/w interrupts */ |
---|
638 | 649 | bnxt_qplib_ring_nq_db(&creq->creq_db.dbinfo, rcfw->res->cctx, false); |
---|
.. | .. |
---|
641 | 652 | if (kill) |
---|
642 | 653 | tasklet_kill(&creq->creq_tasklet); |
---|
643 | 654 | |
---|
644 | | - if (creq->requested) { |
---|
645 | | - free_irq(creq->msix_vec, rcfw); |
---|
646 | | - creq->requested = false; |
---|
647 | | - } |
---|
| 655 | + free_irq(creq->msix_vec, rcfw); |
---|
| 656 | + kfree(creq->irq_name); |
---|
| 657 | + creq->irq_name = NULL; |
---|
| 658 | + creq->requested = false; |
---|
648 | 659 | } |
---|
649 | 660 | |
---|
650 | 661 | void bnxt_qplib_disable_rcfw_channel(struct bnxt_qplib_rcfw *rcfw) |
---|
.. | .. |
---|
676 | 687 | bool need_init) |
---|
677 | 688 | { |
---|
678 | 689 | struct bnxt_qplib_creq_ctx *creq; |
---|
| 690 | + struct bnxt_qplib_res *res; |
---|
679 | 691 | int rc; |
---|
680 | 692 | |
---|
681 | 693 | creq = &rcfw->creq; |
---|
| 694 | + res = rcfw->res; |
---|
682 | 695 | |
---|
683 | 696 | if (creq->requested) |
---|
684 | 697 | return -EFAULT; |
---|
.. | .. |
---|
688 | 701 | tasklet_setup(&creq->creq_tasklet, bnxt_qplib_service_creq); |
---|
689 | 702 | else |
---|
690 | 703 | tasklet_enable(&creq->creq_tasklet); |
---|
| 704 | + |
---|
| 705 | + creq->irq_name = kasprintf(GFP_KERNEL, "bnxt_re-creq@pci:%s", |
---|
| 706 | + pci_name(res->pdev)); |
---|
| 707 | + if (!creq->irq_name) |
---|
| 708 | + return -ENOMEM; |
---|
691 | 709 | rc = request_irq(creq->msix_vec, bnxt_qplib_creq_irq, 0, |
---|
692 | | - "bnxt_qplib_creq", rcfw); |
---|
693 | | - if (rc) |
---|
| 710 | + creq->irq_name, rcfw); |
---|
| 711 | + if (rc) { |
---|
| 712 | + kfree(creq->irq_name); |
---|
| 713 | + creq->irq_name = NULL; |
---|
| 714 | + tasklet_disable(&creq->creq_tasklet); |
---|
694 | 715 | return rc; |
---|
| 716 | + } |
---|
695 | 717 | creq->requested = true; |
---|
696 | 718 | |
---|
697 | | - bnxt_qplib_ring_nq_db(&creq->creq_db.dbinfo, rcfw->res->cctx, true); |
---|
| 719 | + bnxt_qplib_ring_nq_db(&creq->creq_db.dbinfo, res->cctx, true); |
---|
698 | 720 | |
---|
699 | 721 | return 0; |
---|
700 | 722 | } |
---|