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 01/18] be2iscsi: Fix lack of uninitialize pattern to FW
Date: Fri, 5 Apr 2013 20:38:21 -0700 [thread overview]
Message-ID: <1365219519-3457-1-git-send-email-jayamohan.kallickal@emulex.com> (raw)
This patch sends uninitialize pattern to FW during driver unload
which is expected by FW for cleanup
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 | 51 +++++++++++++++++++++++++++++++++++++++
drivers/scsi/be2iscsi/be_cmds.h | 1 +
drivers/scsi/be2iscsi/be_main.c | 1 +
3 files changed, 53 insertions(+)
diff --git a/drivers/scsi/be2iscsi/be_cmds.c b/drivers/scsi/be2iscsi/be_cmds.c
index 5c87768..0b44cc9 100644
--- a/drivers/scsi/be2iscsi/be_cmds.c
+++ b/drivers/scsi/be2iscsi/be_cmds.c
@@ -732,6 +732,16 @@ int beiscsi_cmd_eq_create(struct be_ctrl_info *ctrl,
return status;
}
+/**
+ * be_cmd_fw_initialize()- Initialize FW
+ * @ctrl: Pointer to function control structure
+ *
+ * Send FW initialize pattern for the function.
+ *
+ * return
+ * Success: 0
+ * Failure: Non-Zero value
+ **/
int be_cmd_fw_initialize(struct be_ctrl_info *ctrl)
{
struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem);
@@ -762,6 +772,47 @@ int be_cmd_fw_initialize(struct be_ctrl_info *ctrl)
return status;
}
+/**
+ * be_cmd_fw_uninit()- Uinitialize FW
+ * @ctrl: Pointer to function control structure
+ *
+ * Send FW uninitialize pattern for the function
+ *
+ * return
+ * Success: 0
+ * Failure: Non-Zero value
+ **/
+int be_cmd_fw_uninit(struct be_ctrl_info *ctrl)
+{
+ struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem);
+ struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev);
+ int status;
+ u8 *endian_check;
+
+ spin_lock(&ctrl->mbox_lock);
+ memset(wrb, 0, sizeof(*wrb));
+
+ endian_check = (u8 *) wrb;
+ *endian_check++ = 0xFF;
+ *endian_check++ = 0xAA;
+ *endian_check++ = 0xBB;
+ *endian_check++ = 0xFF;
+ *endian_check++ = 0xFF;
+ *endian_check++ = 0xCC;
+ *endian_check++ = 0xDD;
+ *endian_check = 0xFF;
+
+ be_dws_cpu_to_le(wrb, sizeof(*wrb));
+
+ status = be_mbox_notify(ctrl);
+ if (status)
+ beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
+ "BC_%d : be_cmd_fw_uninit Failed\n");
+
+ spin_unlock(&ctrl->mbox_lock);
+ return status;
+}
+
int beiscsi_cmd_cq_create(struct be_ctrl_info *ctrl,
struct be_queue_info *cq, struct be_queue_info *eq,
bool sol_evts, bool no_delay, int coalesce_wm)
diff --git a/drivers/scsi/be2iscsi/be_cmds.h b/drivers/scsi/be2iscsi/be_cmds.h
index 23397d5..0f8c920 100644
--- a/drivers/scsi/be2iscsi/be_cmds.h
+++ b/drivers/scsi/be2iscsi/be_cmds.h
@@ -697,6 +697,7 @@ int beiscsi_mccq_compl(struct beiscsi_hba *phba,
uint32_t tag, struct be_mcc_wrb **wrb, void *cmd_va);
/*ISCSI Functuions */
int be_cmd_fw_initialize(struct be_ctrl_info *ctrl);
+int be_cmd_fw_uninit(struct be_ctrl_info *ctrl);
struct be_mcc_wrb *wrb_from_mbox(struct be_dma_mem *mbox_mem);
struct be_mcc_wrb *wrb_from_mccq(struct beiscsi_hba *phba);
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 4e2733d..3fb997f 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -3430,6 +3430,7 @@ static void hwi_cleanup(struct beiscsi_hba *phba)
beiscsi_cmd_q_destroy(ctrl, q, QTYPE_EQ);
}
be_mcc_queues_destroy(phba);
+ be_cmd_fw_uninit(ctrl);
}
static int be_mcc_queues_create(struct beiscsi_hba *phba,
--
1.7.10.4
next 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 Jayamohan Kallickal [this message]
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 ` [PATCH V2 03/18] be2iscsi: Fix MBX Command issues Jayamohan Kallickal
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-1-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).