All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/8] be2iscsi: Fix retrieving MCCQ_WRB in non-embedded Mbox path
@ 2014-05-06  1:41 Jay Kallickal
  2014-05-06  1:41 ` [PATCH 2/8] be2iscsi: Fix exposing Host in sysfs after adapter initialization is complete Jay Kallickal
                   ` (7 more replies)
  0 siblings, 8 replies; 20+ messages in thread
From: Jay Kallickal @ 2014-05-06  1:41 UTC (permalink / raw)
  To: jbottomley, linux-scsi, michaelc; +Cc: Jayamohan Kallickal, John Soni Jose

From: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>

 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>
---
 drivers/scsi/be2iscsi/be_mgmt.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c
index 088bdf7..712911f 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,
 					 struct be_dma_mem *nonemb_cmd)
 {
 	struct be_cmd_resp_hdr *resp;
-	struct be_mcc_wrb *wrb = wrb_from_mccq(phba);
-	struct be_sge *mcc_sge = nonembedded_sgl(wrb);
+	struct be_mcc_wrb *wrb;
+	struct be_sge *mcc_sge;
 	unsigned int tag = 0;
 	struct iscsi_bsg_request *bsg_req = job->request;
 	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,
 	req->sector = sector;
 	req->offset = offset;
 	spin_lock(&ctrl->mbox_lock);
-	memset(wrb, 0, sizeof(*wrb));
 
 	switch (bsg_req->rqst_data.h_vendor.vendor_cmd[0]) {
 	case BEISCSI_WRITE_FLASH:
@@ -495,6 +494,8 @@ unsigned int mgmt_vendor_specific_fw_cmd(struct be_ctrl_info *ctrl,
 		return tag;
 	}
 
+	wrb = wrb_from_mccq(phba);
+	mcc_sge = nonembedded_sgl(wrb);
 	be_wrb_hdr_prepare(wrb, nonemb_cmd->size, false,
 			   job->request_payload.sg_cnt);
 	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)
 	int status = 0;
 
 	spin_lock(&ctrl->mbox_lock);
-	memset(wrb, 0, sizeof(*wrb));
 
 	be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);
 	be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI,
@@ -702,7 +702,6 @@ int mgmt_open_connection(struct beiscsi_hba *phba,
 		return tag;
 	}
 	wrb = wrb_from_mccq(phba);
-	memset(wrb, 0, sizeof(*wrb));
 	sge = nonembedded_sgl(wrb);
 
 	req = nonemb_cmd->va;
@@ -804,7 +803,7 @@ static int mgmt_exec_nonemb_cmd(struct beiscsi_hba *phba,
 				int resp_buf_len)
 {
 	struct be_ctrl_info *ctrl = &phba->ctrl;
-	struct be_mcc_wrb *wrb = wrb_from_mccq(phba);
+	struct be_mcc_wrb *wrb;
 	struct be_sge *sge;
 	unsigned int tag;
 	int rc = 0;
@@ -816,7 +815,8 @@ static int mgmt_exec_nonemb_cmd(struct beiscsi_hba *phba,
 		rc = -ENOMEM;
 		goto free_cmd;
 	}
-	memset(wrb, 0, sizeof(*wrb));
+
+	wrb = wrb_from_mccq(phba);
 	wrb->tag0 |= tag;
 	sge = nonembedded_sgl(wrb);
 
-- 
1.8.5.3


^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2014-06-02 20:32 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-06  1:41 [PATCH 1/8] be2iscsi: Fix retrieving MCCQ_WRB in non-embedded Mbox path Jay Kallickal
2014-05-06  1:41 ` [PATCH 2/8] be2iscsi: Fix exposing Host in sysfs after adapter initialization is complete Jay Kallickal
2014-05-06  1:41 ` [PATCH 3/8] be2iscsi: Fix interrupt Coalescing mechanism Jay Kallickal
2014-05-06  1:41 ` [PATCH 4/8] be2iscsi: Fix TCP parameters while connection offloading Jay Kallickal
2014-05-06  1:41 ` [PATCH 5/8] be2iscsi: Fix memory corruption in MBX path Jay Kallickal
2014-05-06  1:41 ` [PATCH 6/8] be2iscsi: Fix destroy MCC-CQ before MCC-EQ is destroyed Jay Kallickal
2014-05-06  1:41 ` [PATCH 7/8] be2iscsi: Fix processing cqe for cxn whose endpoint is freed Jay Kallickal
2014-05-07 22:18   ` Mike Christie
2014-05-28 15:51     ` Christoph Hellwig
2014-06-02  5:52     ` Sony John-N
2014-06-02  6:46       ` Christoph Hellwig
2014-06-02 19:22         ` James Bottomley
2014-06-02 19:33           ` hch
2014-06-02 20:02             ` James Bottomley
2014-06-02 20:05             ` Linus Torvalds
2014-06-02 20:08               ` hch
2014-06-02 20:24                 ` Linus Torvalds
2014-06-02 20:32                   ` hch
2014-05-06  1:41 ` [PATCH 8/8] be2iscsi: Bump the driver version Jay Kallickal
2014-05-06  1:41 ` [PATCH 0/8] be2iscsi: update to 10.2.273.0 Jay Kallickal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.