diff options
author | Jayamohan Kallickal <jayamohank@gmail.com> | 2013-04-05 23:38:23 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-05-02 11:08:13 -0400 |
commit | 1e234bbbea10de2638f6d95a22379bc487e762cb (patch) | |
tree | 23a2316c3c284feafc01e24cb47231f1679947bf /drivers/scsi/be2iscsi | |
parent | a8081e346ad3f8bc2449052908095c2675a9996f (diff) |
[SCSI] be2iscsi: Fix MBX Command issues
- Check Ready Bit before posting the BMBX Hi Address
- Fix the parameters passed to beiscsi_mccq_compl
in beiscsi_open_conn()
- Fix tag value check in beiscsi_ep_connect.
Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/be2iscsi')
-rw-r--r-- | drivers/scsi/be2iscsi/be_cmds.c | 10 | ||||
-rw-r--r-- | drivers/scsi/be2iscsi/be_iscsi.c | 7 |
2 files changed, 12 insertions, 5 deletions
diff --git a/drivers/scsi/be2iscsi/be_cmds.c b/drivers/scsi/be2iscsi/be_cmds.c index 3ad95c7041a9..dfbe7e43574a 100644 --- a/drivers/scsi/be2iscsi/be_cmds.c +++ b/drivers/scsi/be2iscsi/be_cmds.c | |||
@@ -492,7 +492,7 @@ static int be_mbox_db_ready_wait(struct be_ctrl_info *ctrl) | |||
492 | { | 492 | { |
493 | void __iomem *db = ctrl->db + MPU_MAILBOX_DB_OFFSET; | 493 | void __iomem *db = ctrl->db + MPU_MAILBOX_DB_OFFSET; |
494 | struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev); | 494 | struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev); |
495 | int wait = 0; | 495 | uint32_t wait = 0; |
496 | u32 ready; | 496 | u32 ready; |
497 | 497 | ||
498 | do { | 498 | do { |
@@ -540,6 +540,10 @@ int be_mbox_notify(struct be_ctrl_info *ctrl) | |||
540 | struct be_mcc_compl *compl = &mbox->compl; | 540 | struct be_mcc_compl *compl = &mbox->compl; |
541 | struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev); | 541 | struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev); |
542 | 542 | ||
543 | status = be_mbox_db_ready_wait(ctrl); | ||
544 | if (status) | ||
545 | return status; | ||
546 | |||
543 | val &= ~MPU_MAILBOX_DB_RDY_MASK; | 547 | val &= ~MPU_MAILBOX_DB_RDY_MASK; |
544 | val |= MPU_MAILBOX_DB_HI_MASK; | 548 | val |= MPU_MAILBOX_DB_HI_MASK; |
545 | val |= (upper_32_bits(mbox_mem->dma) >> 2) << 2; | 549 | val |= (upper_32_bits(mbox_mem->dma) >> 2) << 2; |
@@ -593,6 +597,10 @@ static int be_mbox_notify_wait(struct beiscsi_hba *phba) | |||
593 | struct be_mcc_compl *compl = &mbox->compl; | 597 | struct be_mcc_compl *compl = &mbox->compl; |
594 | struct be_ctrl_info *ctrl = &phba->ctrl; | 598 | struct be_ctrl_info *ctrl = &phba->ctrl; |
595 | 599 | ||
600 | status = be_mbox_db_ready_wait(ctrl); | ||
601 | if (status) | ||
602 | return status; | ||
603 | |||
596 | val |= MPU_MAILBOX_DB_HI_MASK; | 604 | val |= MPU_MAILBOX_DB_HI_MASK; |
597 | /* at bits 2 - 31 place mbox dma addr msb bits 34 - 63 */ | 605 | /* at bits 2 - 31 place mbox dma addr msb bits 34 - 63 */ |
598 | val |= (upper_32_bits(mbox_mem->dma) >> 2) << 2; | 606 | val |= (upper_32_bits(mbox_mem->dma) >> 2) << 2; |
diff --git a/drivers/scsi/be2iscsi/be_iscsi.c b/drivers/scsi/be2iscsi/be_iscsi.c index 9014690fe841..461f859cfbf6 100644 --- a/drivers/scsi/be2iscsi/be_iscsi.c +++ b/drivers/scsi/be2iscsi/be_iscsi.c | |||
@@ -1009,7 +1009,6 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep, | |||
1009 | { | 1009 | { |
1010 | struct beiscsi_endpoint *beiscsi_ep = ep->dd_data; | 1010 | struct beiscsi_endpoint *beiscsi_ep = ep->dd_data; |
1011 | struct beiscsi_hba *phba = beiscsi_ep->phba; | 1011 | struct beiscsi_hba *phba = beiscsi_ep->phba; |
1012 | struct be_mcc_wrb *wrb; | ||
1013 | struct tcp_connect_and_offload_out *ptcpcnct_out; | 1012 | struct tcp_connect_and_offload_out *ptcpcnct_out; |
1014 | struct be_dma_mem nonemb_cmd; | 1013 | struct be_dma_mem nonemb_cmd; |
1015 | unsigned int tag; | 1014 | unsigned int tag; |
@@ -1055,7 +1054,7 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep, | |||
1055 | nonemb_cmd.size = sizeof(struct tcp_connect_and_offload_in); | 1054 | nonemb_cmd.size = sizeof(struct tcp_connect_and_offload_in); |
1056 | memset(nonemb_cmd.va, 0, nonemb_cmd.size); | 1055 | memset(nonemb_cmd.va, 0, nonemb_cmd.size); |
1057 | tag = mgmt_open_connection(phba, dst_addr, beiscsi_ep, &nonemb_cmd); | 1056 | tag = mgmt_open_connection(phba, dst_addr, beiscsi_ep, &nonemb_cmd); |
1058 | if (!tag) { | 1057 | if (tag <= 0) { |
1059 | beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, | 1058 | beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, |
1060 | "BS_%d : mgmt_open_connection Failed for cid=%d\n", | 1059 | "BS_%d : mgmt_open_connection Failed for cid=%d\n", |
1061 | beiscsi_ep->ep_cid); | 1060 | beiscsi_ep->ep_cid); |
@@ -1066,7 +1065,7 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep, | |||
1066 | return -EAGAIN; | 1065 | return -EAGAIN; |
1067 | } | 1066 | } |
1068 | 1067 | ||
1069 | ret = beiscsi_mccq_compl(phba, tag, &wrb, NULL); | 1068 | ret = beiscsi_mccq_compl(phba, tag, NULL, nonemb_cmd.va); |
1070 | if (ret) { | 1069 | if (ret) { |
1071 | beiscsi_log(phba, KERN_ERR, | 1070 | beiscsi_log(phba, KERN_ERR, |
1072 | BEISCSI_LOG_CONFIG | BEISCSI_LOG_MBOX, | 1071 | BEISCSI_LOG_CONFIG | BEISCSI_LOG_MBOX, |
@@ -1077,7 +1076,7 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep, | |||
1077 | goto free_ep; | 1076 | goto free_ep; |
1078 | } | 1077 | } |
1079 | 1078 | ||
1080 | ptcpcnct_out = embedded_payload(wrb); | 1079 | ptcpcnct_out = (struct tcp_connect_and_offload_out *)nonemb_cmd.va; |
1081 | beiscsi_ep = ep->dd_data; | 1080 | beiscsi_ep = ep->dd_data; |
1082 | beiscsi_ep->fw_handle = ptcpcnct_out->connection_handle; | 1081 | beiscsi_ep->fw_handle = ptcpcnct_out->connection_handle; |
1083 | beiscsi_ep->cid_vld = 1; | 1082 | beiscsi_ep->cid_vld = 1; |