diff options
author | Jayamohan Kallickal <jayamohank@gmail.com> | 2013-04-05 23:38:21 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-05-02 10:54:38 -0400 |
commit | 0283fbb18c873993c606a6c9660d6ac78493b37a (patch) | |
tree | 637fdd3e4fa3bf7a3290438d3c3fb9d5a6605b2c /drivers | |
parent | 4f8d1bd273684385fa8e8e4f9b8bd6107016ece8 (diff) |
[SCSI] be2iscsi: Fix lack of uninitialize pattern to FW
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>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/be2iscsi/be_cmds.c | 51 | ||||
-rw-r--r-- | drivers/scsi/be2iscsi/be_cmds.h | 1 | ||||
-rw-r--r-- | drivers/scsi/be2iscsi/be_main.c | 1 |
3 files changed, 53 insertions, 0 deletions
diff --git a/drivers/scsi/be2iscsi/be_cmds.c b/drivers/scsi/be2iscsi/be_cmds.c index 5c87768c109c..0b44cc9bd966 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, | |||
732 | return status; | 732 | return status; |
733 | } | 733 | } |
734 | 734 | ||
735 | /** | ||
736 | * be_cmd_fw_initialize()- Initialize FW | ||
737 | * @ctrl: Pointer to function control structure | ||
738 | * | ||
739 | * Send FW initialize pattern for the function. | ||
740 | * | ||
741 | * return | ||
742 | * Success: 0 | ||
743 | * Failure: Non-Zero value | ||
744 | **/ | ||
735 | int be_cmd_fw_initialize(struct be_ctrl_info *ctrl) | 745 | int be_cmd_fw_initialize(struct be_ctrl_info *ctrl) |
736 | { | 746 | { |
737 | struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem); | 747 | 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) | |||
762 | return status; | 772 | return status; |
763 | } | 773 | } |
764 | 774 | ||
775 | /** | ||
776 | * be_cmd_fw_uninit()- Uinitialize FW | ||
777 | * @ctrl: Pointer to function control structure | ||
778 | * | ||
779 | * Send FW uninitialize pattern for the function | ||
780 | * | ||
781 | * return | ||
782 | * Success: 0 | ||
783 | * Failure: Non-Zero value | ||
784 | **/ | ||
785 | int be_cmd_fw_uninit(struct be_ctrl_info *ctrl) | ||
786 | { | ||
787 | struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem); | ||
788 | struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev); | ||
789 | int status; | ||
790 | u8 *endian_check; | ||
791 | |||
792 | spin_lock(&ctrl->mbox_lock); | ||
793 | memset(wrb, 0, sizeof(*wrb)); | ||
794 | |||
795 | endian_check = (u8 *) wrb; | ||
796 | *endian_check++ = 0xFF; | ||
797 | *endian_check++ = 0xAA; | ||
798 | *endian_check++ = 0xBB; | ||
799 | *endian_check++ = 0xFF; | ||
800 | *endian_check++ = 0xFF; | ||
801 | *endian_check++ = 0xCC; | ||
802 | *endian_check++ = 0xDD; | ||
803 | *endian_check = 0xFF; | ||
804 | |||
805 | be_dws_cpu_to_le(wrb, sizeof(*wrb)); | ||
806 | |||
807 | status = be_mbox_notify(ctrl); | ||
808 | if (status) | ||
809 | beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, | ||
810 | "BC_%d : be_cmd_fw_uninit Failed\n"); | ||
811 | |||
812 | spin_unlock(&ctrl->mbox_lock); | ||
813 | return status; | ||
814 | } | ||
815 | |||
765 | int beiscsi_cmd_cq_create(struct be_ctrl_info *ctrl, | 816 | int beiscsi_cmd_cq_create(struct be_ctrl_info *ctrl, |
766 | struct be_queue_info *cq, struct be_queue_info *eq, | 817 | struct be_queue_info *cq, struct be_queue_info *eq, |
767 | bool sol_evts, bool no_delay, int coalesce_wm) | 818 | 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 23397d51ac54..0f8c920b88c4 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, | |||
697 | uint32_t tag, struct be_mcc_wrb **wrb, void *cmd_va); | 697 | uint32_t tag, struct be_mcc_wrb **wrb, void *cmd_va); |
698 | /*ISCSI Functuions */ | 698 | /*ISCSI Functuions */ |
699 | int be_cmd_fw_initialize(struct be_ctrl_info *ctrl); | 699 | int be_cmd_fw_initialize(struct be_ctrl_info *ctrl); |
700 | int be_cmd_fw_uninit(struct be_ctrl_info *ctrl); | ||
700 | 701 | ||
701 | struct be_mcc_wrb *wrb_from_mbox(struct be_dma_mem *mbox_mem); | 702 | struct be_mcc_wrb *wrb_from_mbox(struct be_dma_mem *mbox_mem); |
702 | struct be_mcc_wrb *wrb_from_mccq(struct beiscsi_hba *phba); | 703 | 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 4e2733d23003..3fb997fc6015 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) | |||
3430 | beiscsi_cmd_q_destroy(ctrl, q, QTYPE_EQ); | 3430 | beiscsi_cmd_q_destroy(ctrl, q, QTYPE_EQ); |
3431 | } | 3431 | } |
3432 | be_mcc_queues_destroy(phba); | 3432 | be_mcc_queues_destroy(phba); |
3433 | be_cmd_fw_uninit(ctrl); | ||
3433 | } | 3434 | } |
3434 | 3435 | ||
3435 | static int be_mcc_queues_create(struct beiscsi_hba *phba, | 3436 | static int be_mcc_queues_create(struct beiscsi_hba *phba, |