]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: hisi_sas: add hisi_hba.rst_work init for v3 hw
authorXiaofei Tan <tanxiaofei@huawei.com>
Tue, 24 Oct 2017 15:51:45 +0000 (23:51 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 31 Oct 2017 16:28:00 +0000 (12:28 -0400)
Add init code of hisi_hba->rst_work for v3 hw. Because v3 hw also need
it to recover controller when some hw errors occurs.

Signed-off-by: Xiaofei Tan <tanxiaofei@huawei.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/hisi_sas/hisi_sas.h
drivers/scsi/hisi_sas/hisi_sas_main.c
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

index d2d384b5efb7b9755576a2e5641b9440cbc7d506..c65d151411e0fd10af8eb9de075ab9bcbffad510 100644 (file)
@@ -425,4 +425,5 @@ extern void hisi_sas_slot_task_free(struct hisi_hba *hisi_hba,
                                    struct sas_task *task,
                                    struct hisi_sas_slot *slot);
 extern void hisi_sas_init_mem(struct hisi_hba *hisi_hba);
+extern void hisi_sas_rst_work_handler(struct work_struct *work);
 #endif
index 6b4dabdeb4a991354a2bef50d6d4528088d08eeb..1d417a4138f2e7e138b385229b928f230d4d1b27 100644 (file)
@@ -1785,13 +1785,14 @@ void hisi_sas_free(struct hisi_hba *hisi_hba)
 }
 EXPORT_SYMBOL_GPL(hisi_sas_free);
 
-static void hisi_sas_rst_work_handler(struct work_struct *work)
+void hisi_sas_rst_work_handler(struct work_struct *work)
 {
        struct hisi_hba *hisi_hba =
                container_of(work, struct hisi_hba, rst_work);
 
        hisi_sas_controller_reset(hisi_hba);
 }
+EXPORT_SYMBOL_GPL(hisi_sas_rst_work_handler);
 
 int hisi_sas_get_fw_info(struct hisi_hba *hisi_hba)
 {
index 818bd5754b7ad020b9731feaf28a25a545d7fe79..1f8995bfdb8e4683c3fd71b00eb0c9aded0d9e6f 100644 (file)
@@ -1840,6 +1840,7 @@ hisi_sas_shost_alloc_pci(struct pci_dev *pdev)
        }
        hisi_hba = shost_priv(shost);
 
+       INIT_WORK(&hisi_hba->rst_work, hisi_sas_rst_work_handler);
        hisi_hba->hw = &hisi_sas_v3_hw;
        hisi_hba->pci_dev = pdev;
        hisi_hba->dev = dev;