]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
scsi: be2iscsi: Add FUNCTION_RESET during driver unload
authorJitendra Bhivare <jitendra.bhivare@broadcom.com>
Fri, 19 Aug 2016 09:50:20 +0000 (15:20 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 24 Aug 2016 02:42:44 +0000 (22:42 -0400)
Driver unload should call COMMON_FUNCTION_RESET. For TPE feature, this
ensures that FW has knowledge about driver getting unloaded and can
reset its bit vector.

Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/be2iscsi/be_cmds.c
drivers/scsi/be2iscsi/be_cmds.h
drivers/scsi/be2iscsi/be_main.c

index ad7405d6821f1cba1d86573eb00bd4fe78e2e7ce..5fe1610295851712af33591d80d415505c20888b 100644 (file)
@@ -1595,7 +1595,7 @@ int beiscsi_check_fw_rdy(struct beiscsi_hba *phba)
        return rdy;
 }
 
-static int beiscsi_cmd_function_reset(struct beiscsi_hba  *phba)
+int beiscsi_cmd_function_reset(struct beiscsi_hba *phba)
 {
        struct be_ctrl_info *ctrl = &phba->ctrl;
        struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem);
index 26d7921f48a4cfe52b0c64be6a4aaaa1aeea37e3..8283344c3f938c77e8e540b469dec9b47dae16a7 100644 (file)
@@ -762,6 +762,8 @@ struct be_cmd_set_features {
        } param;
 } __packed;
 
+int beiscsi_cmd_function_reset(struct beiscsi_hba *phba);
+
 int beiscsi_cmd_special_wrb(struct be_ctrl_info *ctrl, u32 load);
 
 int beiscsi_check_fw_rdy(struct beiscsi_hba *phba);
index cf82973e278981a1abbe308f216f68bc0e98c45e..3aa2f04e71a762f5c4801a56cee0198b0878812f 100644 (file)
@@ -3771,9 +3771,12 @@ static void hwi_cleanup_port(struct beiscsi_hba *phba)
                        beiscsi_cmd_q_destroy(ctrl, q, QTYPE_EQ);
                }
        }
+       /* this ensures complete FW cleanup */
+       beiscsi_cmd_function_reset(phba);
        /* last communication, indicate driver is unloading */
        beiscsi_cmd_special_wrb(&phba->ctrl, 0);
 }
+
 static int hwi_init_port(struct beiscsi_hba *phba)
 {
        struct hwi_controller *phwi_ctrlr;