Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
 
        int n_phy;
 
+       struct workqueue_struct *wq;
 
        int slot_index_count;
        unsigned long *slot_index_tags;
 
 
        hisi_sas_slot_index_init(hisi_hba);
 
+       hisi_hba->wq = create_singlethread_workqueue(dev_name(dev));
+       if (!hisi_hba->wq) {
+               dev_err(dev, "sas_alloc: failed to create workqueue\n");
+               goto err_out;
+       }
+
        return 0;
 err_out:
        return -ENOMEM;
                                  hisi_hba->sata_breakpoint,
                                  hisi_hba->sata_breakpoint_dma);
 
+       if (hisi_hba->wq)
+               destroy_workqueue(hisi_hba->wq);
 }
 
 static struct Scsi_Host *hisi_sas_shost_alloc(struct platform_device *pdev,