diff options
author | Jitendra Bhivare <jitendra.bhivare@broadcom.com> | 2016-02-04 05:19:13 -0500 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-02-23 21:27:02 -0500 |
commit | a264f5e80d56ae675e25f0e4158e12f4df5efb9d (patch) | |
tree | 8dae55a9c97f5d171d4d425f8533815d02e676b6 /drivers/scsi | |
parent | 88840332a0f05833b2fea6c69584b5d20eb19ad8 (diff) |
be2iscsi: Remove be_mbox_notify_wait function
be_mbox_notify_wait does exactly same thing as be_mbox_notify.
Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/be2iscsi/be_cmds.c | 79 |
1 files changed, 4 insertions, 75 deletions
diff --git a/drivers/scsi/be2iscsi/be_cmds.c b/drivers/scsi/be2iscsi/be_cmds.c index 1fe8eb84333a..12b60dd8d1c9 100644 --- a/drivers/scsi/be2iscsi/be_cmds.c +++ b/drivers/scsi/be2iscsi/be_cmds.c | |||
@@ -625,8 +625,6 @@ int be_mbox_notify(struct be_ctrl_info *ctrl) | |||
625 | void __iomem *db = ctrl->db + MPU_MAILBOX_DB_OFFSET; | 625 | void __iomem *db = ctrl->db + MPU_MAILBOX_DB_OFFSET; |
626 | struct be_dma_mem *mbox_mem = &ctrl->mbox_mem; | 626 | struct be_dma_mem *mbox_mem = &ctrl->mbox_mem; |
627 | struct be_mcc_mailbox *mbox = mbox_mem->va; | 627 | struct be_mcc_mailbox *mbox = mbox_mem->va; |
628 | struct be_mcc_compl *compl = &mbox->compl; | ||
629 | struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev); | ||
630 | 628 | ||
631 | status = be_mbox_db_ready_poll(ctrl); | 629 | status = be_mbox_db_ready_poll(ctrl); |
632 | if (status) | 630 | if (status) |
@@ -654,77 +652,8 @@ int be_mbox_notify(struct be_ctrl_info *ctrl) | |||
654 | /* RDY is set; small delay before CQE read. */ | 652 | /* RDY is set; small delay before CQE read. */ |
655 | udelay(1); | 653 | udelay(1); |
656 | 654 | ||
657 | if (be_mcc_compl_is_new(compl)) { | 655 | status = beiscsi_process_mbox_compl(ctrl, &mbox->compl); |
658 | status = beiscsi_process_mbox_compl(ctrl, compl); | 656 | return status; |
659 | be_mcc_compl_use(compl); | ||
660 | if (status) { | ||
661 | beiscsi_log(phba, KERN_ERR, | ||
662 | BEISCSI_LOG_CONFIG | BEISCSI_LOG_MBOX, | ||
663 | "BC_%d : After beiscsi_process_mbox_compl\n"); | ||
664 | |||
665 | return status; | ||
666 | } | ||
667 | } else { | ||
668 | beiscsi_log(phba, KERN_ERR, | ||
669 | BEISCSI_LOG_CONFIG | BEISCSI_LOG_MBOX, | ||
670 | "BC_%d : Invalid Mailbox Completion\n"); | ||
671 | |||
672 | return -EBUSY; | ||
673 | } | ||
674 | return 0; | ||
675 | } | ||
676 | |||
677 | /* | ||
678 | * Insert the mailbox address into the doorbell in two steps | ||
679 | * Polls on the mbox doorbell till a command completion (or a timeout) occurs | ||
680 | */ | ||
681 | static int be_mbox_notify_wait(struct beiscsi_hba *phba) | ||
682 | { | ||
683 | int status; | ||
684 | u32 val = 0; | ||
685 | void __iomem *db = phba->ctrl.db + MPU_MAILBOX_DB_OFFSET; | ||
686 | struct be_dma_mem *mbox_mem = &phba->ctrl.mbox_mem; | ||
687 | struct be_mcc_mailbox *mbox = mbox_mem->va; | ||
688 | struct be_mcc_compl *compl = &mbox->compl; | ||
689 | struct be_ctrl_info *ctrl = &phba->ctrl; | ||
690 | |||
691 | status = be_mbox_db_ready_poll(ctrl); | ||
692 | if (status) | ||
693 | return status; | ||
694 | |||
695 | val |= MPU_MAILBOX_DB_HI_MASK; | ||
696 | /* at bits 2 - 31 place mbox dma addr msb bits 34 - 63 */ | ||
697 | val |= (upper_32_bits(mbox_mem->dma) >> 2) << 2; | ||
698 | iowrite32(val, db); | ||
699 | |||
700 | /* wait for ready to be set */ | ||
701 | status = be_mbox_db_ready_poll(ctrl); | ||
702 | if (status != 0) | ||
703 | return status; | ||
704 | |||
705 | val = 0; | ||
706 | /* at bits 2 - 31 place mbox dma addr lsb bits 4 - 33 */ | ||
707 | val |= (u32)(mbox_mem->dma >> 4) << 2; | ||
708 | iowrite32(val, db); | ||
709 | |||
710 | status = be_mbox_db_ready_poll(ctrl); | ||
711 | if (status != 0) | ||
712 | return status; | ||
713 | |||
714 | /* A cq entry has been made now */ | ||
715 | if (be_mcc_compl_is_new(compl)) { | ||
716 | status = beiscsi_process_mbox_compl(ctrl, &mbox->compl); | ||
717 | be_mcc_compl_use(compl); | ||
718 | if (status) | ||
719 | return status; | ||
720 | } else { | ||
721 | beiscsi_log(phba, KERN_ERR, | ||
722 | BEISCSI_LOG_CONFIG | BEISCSI_LOG_MBOX, | ||
723 | "BC_%d : invalid mailbox completion\n"); | ||
724 | |||
725 | return -EBUSY; | ||
726 | } | ||
727 | return 0; | ||
728 | } | 657 | } |
729 | 658 | ||
730 | void be_wrb_hdr_prepare(struct be_mcc_wrb *wrb, int payload_len, | 659 | void be_wrb_hdr_prepare(struct be_mcc_wrb *wrb, int payload_len, |
@@ -1039,7 +968,7 @@ int beiscsi_cmd_mccq_create(struct beiscsi_hba *phba, | |||
1039 | 968 | ||
1040 | be_cmd_page_addrs_prepare(req->pages, ARRAY_SIZE(req->pages), q_mem); | 969 | be_cmd_page_addrs_prepare(req->pages, ARRAY_SIZE(req->pages), q_mem); |
1041 | 970 | ||
1042 | status = be_mbox_notify_wait(phba); | 971 | status = be_mbox_notify(ctrl); |
1043 | if (!status) { | 972 | if (!status) { |
1044 | struct be_cmd_resp_mcc_create *resp = embedded_payload(wrb); | 973 | struct be_cmd_resp_mcc_create *resp = embedded_payload(wrb); |
1045 | mccq->id = le16_to_cpu(resp->id); | 974 | mccq->id = le16_to_cpu(resp->id); |
@@ -1381,7 +1310,7 @@ int beiscsi_cmd_reset_function(struct beiscsi_hba *phba) | |||
1381 | be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0); | 1310 | be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0); |
1382 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, | 1311 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, |
1383 | OPCODE_COMMON_FUNCTION_RESET, sizeof(*req)); | 1312 | OPCODE_COMMON_FUNCTION_RESET, sizeof(*req)); |
1384 | status = be_mbox_notify_wait(phba); | 1313 | status = be_mbox_notify(ctrl); |
1385 | 1314 | ||
1386 | mutex_unlock(&ctrl->mbox_lock); | 1315 | mutex_unlock(&ctrl->mbox_lock); |
1387 | return status; | 1316 | return status; |