diff options
author | Jayamohan Kallickal <jayamohan.kallickal@emulex.com> | 2014-05-05 21:41:24 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-05-28 12:13:14 -0400 |
commit | daa8dc081cd801635b2757aa6f257a79d9ac6d2c (patch) | |
tree | dd7383719a53073ed57965a8bdb8286f21de6fbb /drivers/scsi/be2iscsi | |
parent | e8e7f27139d5ba5b9f05fdee3f6224116ce8427c (diff) |
be2iscsi: Fix retrieving MCCQ_WRB in non-embedded Mbox path
Getting WRB for MCCQ posting was done before looking if tag is
available or not. This lead to increase phba->ctrl.mcc_obj.q.used
variable and the WARN_ON message was coming from wrb_from_mccq().
Moved getting wrb from mccq after checking for the tag.
In wrb_from_mccq(), memset is done before returning wrb ptr.
Removed memset of mccq wrb from all other functions.
Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/be2iscsi')
-rw-r--r-- | drivers/scsi/be2iscsi/be_mgmt.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c index 088bdf752cfa..712911fba075 100644 --- a/drivers/scsi/be2iscsi/be_mgmt.c +++ b/drivers/scsi/be2iscsi/be_mgmt.c | |||
@@ -447,8 +447,8 @@ unsigned int mgmt_vendor_specific_fw_cmd(struct be_ctrl_info *ctrl, | |||
447 | struct be_dma_mem *nonemb_cmd) | 447 | struct be_dma_mem *nonemb_cmd) |
448 | { | 448 | { |
449 | struct be_cmd_resp_hdr *resp; | 449 | struct be_cmd_resp_hdr *resp; |
450 | struct be_mcc_wrb *wrb = wrb_from_mccq(phba); | 450 | struct be_mcc_wrb *wrb; |
451 | struct be_sge *mcc_sge = nonembedded_sgl(wrb); | 451 | struct be_sge *mcc_sge; |
452 | unsigned int tag = 0; | 452 | unsigned int tag = 0; |
453 | struct iscsi_bsg_request *bsg_req = job->request; | 453 | struct iscsi_bsg_request *bsg_req = job->request; |
454 | struct be_bsg_vendor_cmd *req = nonemb_cmd->va; | 454 | struct be_bsg_vendor_cmd *req = nonemb_cmd->va; |
@@ -465,7 +465,6 @@ unsigned int mgmt_vendor_specific_fw_cmd(struct be_ctrl_info *ctrl, | |||
465 | req->sector = sector; | 465 | req->sector = sector; |
466 | req->offset = offset; | 466 | req->offset = offset; |
467 | spin_lock(&ctrl->mbox_lock); | 467 | spin_lock(&ctrl->mbox_lock); |
468 | memset(wrb, 0, sizeof(*wrb)); | ||
469 | 468 | ||
470 | switch (bsg_req->rqst_data.h_vendor.vendor_cmd[0]) { | 469 | switch (bsg_req->rqst_data.h_vendor.vendor_cmd[0]) { |
471 | case BEISCSI_WRITE_FLASH: | 470 | case BEISCSI_WRITE_FLASH: |
@@ -495,6 +494,8 @@ unsigned int mgmt_vendor_specific_fw_cmd(struct be_ctrl_info *ctrl, | |||
495 | return tag; | 494 | return tag; |
496 | } | 495 | } |
497 | 496 | ||
497 | wrb = wrb_from_mccq(phba); | ||
498 | mcc_sge = nonembedded_sgl(wrb); | ||
498 | be_wrb_hdr_prepare(wrb, nonemb_cmd->size, false, | 499 | be_wrb_hdr_prepare(wrb, nonemb_cmd->size, false, |
499 | job->request_payload.sg_cnt); | 500 | job->request_payload.sg_cnt); |
500 | mcc_sge->pa_hi = cpu_to_le32(upper_32_bits(nonemb_cmd->dma)); | 501 | mcc_sge->pa_hi = cpu_to_le32(upper_32_bits(nonemb_cmd->dma)); |
@@ -525,7 +526,6 @@ int mgmt_epfw_cleanup(struct beiscsi_hba *phba, unsigned short ulp_num) | |||
525 | int status = 0; | 526 | int status = 0; |
526 | 527 | ||
527 | spin_lock(&ctrl->mbox_lock); | 528 | spin_lock(&ctrl->mbox_lock); |
528 | memset(wrb, 0, sizeof(*wrb)); | ||
529 | 529 | ||
530 | be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0); | 530 | be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0); |
531 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI, | 531 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI, |
@@ -702,7 +702,6 @@ int mgmt_open_connection(struct beiscsi_hba *phba, | |||
702 | return tag; | 702 | return tag; |
703 | } | 703 | } |
704 | wrb = wrb_from_mccq(phba); | 704 | wrb = wrb_from_mccq(phba); |
705 | memset(wrb, 0, sizeof(*wrb)); | ||
706 | sge = nonembedded_sgl(wrb); | 705 | sge = nonembedded_sgl(wrb); |
707 | 706 | ||
708 | req = nonemb_cmd->va; | 707 | req = nonemb_cmd->va; |
@@ -804,7 +803,7 @@ static int mgmt_exec_nonemb_cmd(struct beiscsi_hba *phba, | |||
804 | int resp_buf_len) | 803 | int resp_buf_len) |
805 | { | 804 | { |
806 | struct be_ctrl_info *ctrl = &phba->ctrl; | 805 | struct be_ctrl_info *ctrl = &phba->ctrl; |
807 | struct be_mcc_wrb *wrb = wrb_from_mccq(phba); | 806 | struct be_mcc_wrb *wrb; |
808 | struct be_sge *sge; | 807 | struct be_sge *sge; |
809 | unsigned int tag; | 808 | unsigned int tag; |
810 | int rc = 0; | 809 | int rc = 0; |
@@ -816,7 +815,8 @@ static int mgmt_exec_nonemb_cmd(struct beiscsi_hba *phba, | |||
816 | rc = -ENOMEM; | 815 | rc = -ENOMEM; |
817 | goto free_cmd; | 816 | goto free_cmd; |
818 | } | 817 | } |
819 | memset(wrb, 0, sizeof(*wrb)); | 818 | |
819 | wrb = wrb_from_mccq(phba); | ||
820 | wrb->tag0 |= tag; | 820 | wrb->tag0 |= tag; |
821 | sge = nonembedded_sgl(wrb); | 821 | sge = nonembedded_sgl(wrb); |
822 | 822 | ||