linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jayamohan Kallickal <jayamohank@gmail.com>
To: jbottomley@parallels.com, linux-scsi@vger.kernel.org,
	michaelc@cs.wisc.edu
Cc: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>,
	John Soni Jose <sony.john-n@emulex.com>
Subject: [PATCH V2 03/18] be2iscsi: Fix MBX Command issues
Date: Fri,  5 Apr 2013 20:38:23 -0700	[thread overview]
Message-ID: <1365219519-3457-3-git-send-email-jayamohan.kallickal@emulex.com> (raw)
In-Reply-To: <1365219519-3457-1-git-send-email-jayamohan.kallickal@emulex.com>

 - 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>
---
 drivers/scsi/be2iscsi/be_cmds.c  |   10 +++++++++-
 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 3ad95c7..dfbe7e4 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)
 {
 	void __iomem *db = ctrl->db + MPU_MAILBOX_DB_OFFSET;
 	struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev);
-	int wait = 0;
+	uint32_t wait = 0;
 	u32 ready;
 
 	do {
@@ -540,6 +540,10 @@ int be_mbox_notify(struct be_ctrl_info *ctrl)
 	struct be_mcc_compl *compl = &mbox->compl;
 	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_HI_MASK;
 	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_ctrl_info *ctrl = &phba->ctrl;
 
+	status = be_mbox_db_ready_wait(ctrl);
+	if (status)
+		return status;
+
 	val |= MPU_MAILBOX_DB_HI_MASK;
 	/* at bits 2 - 31 place mbox dma addr msb bits 34 - 63 */
 	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 214d691..1097fa2 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,
 {
 	struct beiscsi_endpoint *beiscsi_ep = ep->dd_data;
 	struct beiscsi_hba *phba = beiscsi_ep->phba;
-	struct be_mcc_wrb *wrb;
 	struct tcp_connect_and_offload_out *ptcpcnct_out;
 	struct be_dma_mem nonemb_cmd;
 	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);
 	memset(nonemb_cmd.va, 0, nonemb_cmd.size);
 	tag = mgmt_open_connection(phba, dst_addr, beiscsi_ep, &nonemb_cmd);
-	if (!tag) {
+	if (tag <= 0) {
 		beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
 			    "BS_%d : mgmt_open_connection Failed for cid=%d\n",
 			    beiscsi_ep->ep_cid);
@@ -1066,7 +1065,7 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep,
 		return -EAGAIN;
 	}
 
-	ret = beiscsi_mccq_compl(phba, tag, &wrb, NULL);
+	ret = beiscsi_mccq_compl(phba, tag, NULL, nonemb_cmd.va);
 	if (ret) {
 		beiscsi_log(phba, KERN_ERR,
 			    BEISCSI_LOG_CONFIG | BEISCSI_LOG_MBOX,
@@ -1077,7 +1076,7 @@ static int beiscsi_open_conn(struct iscsi_endpoint *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->fw_handle = ptcpcnct_out->connection_handle;
 	beiscsi_ep->cid_vld = 1;
-- 
1.7.10.4


  parent reply	other threads:[~2013-04-06  3:38 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-06  3:38 [PATCH V2 01/18] be2iscsi: Fix lack of uninitialize pattern to FW Jayamohan Kallickal
2013-04-06  3:38 ` [PATCH V2 02/18] be2iscsi: Fix returning Failure when MBX fails with Insufficient buffer error Jayamohan Kallickal
2013-04-06  3:38 ` Jayamohan Kallickal [this message]
2013-04-06  3:38 ` [PATCH V2 04/18] be2iscsi: Fix MSIX support in SKH-R to 32 Jayamohan Kallickal
2013-04-06  3:38 ` [PATCH V2 05/18] be2iscsi: Fix freeing CXN specific driver resources Jayamohan Kallickal
2013-04-06  3:38 ` [PATCH V2 06/18] be2iscsi: Fix MACRO for checking the adapter type Jayamohan Kallickal
2013-04-06  3:38 ` [PATCH V2 07/18] be2iscsi: Fix support for DEFQ extension Jayamohan Kallickal
2013-04-06  3:38 ` [PATCH V2 08/18] be2iscsi: Fix displaying the FW Version from driver Jayamohan Kallickal
2013-04-06  3:38 ` [PATCH V2 09/18] be2iscsi: Fix displaying the Active Session Count " Jayamohan Kallickal
2013-04-06  3:38 ` [PATCH V2 10/18] be2iscsi: Fix the Port Link Status issue Jayamohan Kallickal
2013-04-06  3:38 ` [PATCH V2 11/18] be2iscsi : Fix the NOP-In handling code path Jayamohan Kallickal
2013-04-06  3:38 ` [PATCH V2 12/18] be2iscsi: Fix dynamic CID allocation Mechanism in driver Jayamohan Kallickal
2013-04-06  3:38 ` [PATCH V2 13/18] be2iscsi: Fix checking Adapter state while establishing CXN Jayamohan Kallickal
2013-04-06  3:38 ` [PATCH V2 14/18] be2scsi: Fix the copyright information Jayamohan Kallickal
2013-04-06  3:38 ` [PATCH V2 15/18] be2iscsi: Fix the session cleanup when reboot/shutdown happens Jayamohan Kallickal
2013-04-10 23:41   ` Mike Christie
2013-04-12 20:08     ` Kallickal, Jayamohan
2013-04-06  3:38 ` [PATCH V2 16/18] be2iscsi: Fix possible reentrancy issue in be_iopoll Jayamohan Kallickal
2013-05-02 15:20   ` James Bottomley
2013-04-06  3:38 ` [PATCH V2 17/18] be2iscsi: Fix issue in passing the exp_cmdsn and max_cmdsn Jayamohan Kallickal
2013-04-06  3:38 ` [PATCH V2 18/18] be2iscsi: Bump the driver version Jayamohan Kallickal
2013-04-06  3:38 ` be2iscsi: Patchset for be2iscsi Jayamohan Kallickal
2013-04-12 21:08   ` Mike Christie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1365219519-3457-3-git-send-email-jayamohan.kallickal@emulex.com \
    --to=jayamohank@gmail.com \
    --cc=jayamohan.kallickal@emulex.com \
    --cc=jbottomley@parallels.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=michaelc@cs.wisc.edu \
    --cc=sony.john-n@emulex.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).