[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>hifive-unleashed-5.1
parent
a8081e346a
commit
1e234bbbea
|
@ -492,7 +492,7 @@ static int be_mbox_db_ready_wait(struct be_ctrl_info *ctrl)
|
||||||
{
|
{
|
||||||
void __iomem *db = ctrl->db + MPU_MAILBOX_DB_OFFSET;
|
void __iomem *db = ctrl->db + MPU_MAILBOX_DB_OFFSET;
|
||||||
struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev);
|
struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev);
|
||||||
int wait = 0;
|
uint32_t wait = 0;
|
||||||
u32 ready;
|
u32 ready;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
@ -540,6 +540,10 @@ int be_mbox_notify(struct be_ctrl_info *ctrl)
|
||||||
struct be_mcc_compl *compl = &mbox->compl;
|
struct be_mcc_compl *compl = &mbox->compl;
|
||||||
struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev);
|
struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev);
|
||||||
|
|
||||||
|
status = be_mbox_db_ready_wait(ctrl);
|
||||||
|
if (status)
|
||||||
|
return status;
|
||||||
|
|
||||||
val &= ~MPU_MAILBOX_DB_RDY_MASK;
|
val &= ~MPU_MAILBOX_DB_RDY_MASK;
|
||||||
val |= MPU_MAILBOX_DB_HI_MASK;
|
val |= MPU_MAILBOX_DB_HI_MASK;
|
||||||
val |= (upper_32_bits(mbox_mem->dma) >> 2) << 2;
|
val |= (upper_32_bits(mbox_mem->dma) >> 2) << 2;
|
||||||
|
@ -593,6 +597,10 @@ static int be_mbox_notify_wait(struct beiscsi_hba *phba)
|
||||||
struct be_mcc_compl *compl = &mbox->compl;
|
struct be_mcc_compl *compl = &mbox->compl;
|
||||||
struct be_ctrl_info *ctrl = &phba->ctrl;
|
struct be_ctrl_info *ctrl = &phba->ctrl;
|
||||||
|
|
||||||
|
status = be_mbox_db_ready_wait(ctrl);
|
||||||
|
if (status)
|
||||||
|
return status;
|
||||||
|
|
||||||
val |= MPU_MAILBOX_DB_HI_MASK;
|
val |= MPU_MAILBOX_DB_HI_MASK;
|
||||||
/* at bits 2 - 31 place mbox dma addr msb bits 34 - 63 */
|
/* at bits 2 - 31 place mbox dma addr msb bits 34 - 63 */
|
||||||
val |= (upper_32_bits(mbox_mem->dma) >> 2) << 2;
|
val |= (upper_32_bits(mbox_mem->dma) >> 2) << 2;
|
||||||
|
|
|
@ -1009,7 +1009,6 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep,
|
||||||
{
|
{
|
||||||
struct beiscsi_endpoint *beiscsi_ep = ep->dd_data;
|
struct beiscsi_endpoint *beiscsi_ep = ep->dd_data;
|
||||||
struct beiscsi_hba *phba = beiscsi_ep->phba;
|
struct beiscsi_hba *phba = beiscsi_ep->phba;
|
||||||
struct be_mcc_wrb *wrb;
|
|
||||||
struct tcp_connect_and_offload_out *ptcpcnct_out;
|
struct tcp_connect_and_offload_out *ptcpcnct_out;
|
||||||
struct be_dma_mem nonemb_cmd;
|
struct be_dma_mem nonemb_cmd;
|
||||||
unsigned int tag;
|
unsigned int tag;
|
||||||
|
@ -1055,7 +1054,7 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep,
|
||||||
nonemb_cmd.size = sizeof(struct tcp_connect_and_offload_in);
|
nonemb_cmd.size = sizeof(struct tcp_connect_and_offload_in);
|
||||||
memset(nonemb_cmd.va, 0, nonemb_cmd.size);
|
memset(nonemb_cmd.va, 0, nonemb_cmd.size);
|
||||||
tag = mgmt_open_connection(phba, dst_addr, beiscsi_ep, &nonemb_cmd);
|
tag = mgmt_open_connection(phba, dst_addr, beiscsi_ep, &nonemb_cmd);
|
||||||
if (!tag) {
|
if (tag <= 0) {
|
||||||
beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
|
beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
|
||||||
"BS_%d : mgmt_open_connection Failed for cid=%d\n",
|
"BS_%d : mgmt_open_connection Failed for cid=%d\n",
|
||||||
beiscsi_ep->ep_cid);
|
beiscsi_ep->ep_cid);
|
||||||
|
@ -1066,7 +1065,7 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep,
|
||||||
return -EAGAIN;
|
return -EAGAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = beiscsi_mccq_compl(phba, tag, &wrb, NULL);
|
ret = beiscsi_mccq_compl(phba, tag, NULL, nonemb_cmd.va);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
beiscsi_log(phba, KERN_ERR,
|
beiscsi_log(phba, KERN_ERR,
|
||||||
BEISCSI_LOG_CONFIG | BEISCSI_LOG_MBOX,
|
BEISCSI_LOG_CONFIG | BEISCSI_LOG_MBOX,
|
||||||
|
@ -1077,7 +1076,7 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep,
|
||||||
goto free_ep;
|
goto free_ep;
|
||||||
}
|
}
|
||||||
|
|
||||||
ptcpcnct_out = embedded_payload(wrb);
|
ptcpcnct_out = (struct tcp_connect_and_offload_out *)nonemb_cmd.va;
|
||||||
beiscsi_ep = ep->dd_data;
|
beiscsi_ep = ep->dd_data;
|
||||||
beiscsi_ep->fw_handle = ptcpcnct_out->connection_handle;
|
beiscsi_ep->fw_handle = ptcpcnct_out->connection_handle;
|
||||||
beiscsi_ep->cid_vld = 1;
|
beiscsi_ep->cid_vld = 1;
|
||||||
|
|
Loading…
Reference in New Issue