]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
scsi: hisi_sas: initialize dq spinlock before use
authorXiang Chen <chenxiang66@hisilicon.com>
Fri, 8 Dec 2017 17:16:32 +0000 (01:16 +0800)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 6 Jun 2018 19:13:05 +0000 (15:13 -0400)
BugLink: https://bugs.launchpad.net/bugs/1774472
It is required to initialize the dq spinlock before use, which was not being
done, so fix it. This issue can be detected when CONFIG_DEBUG_SPINLOCK is
enabled.

Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 39bade0c9fb11e04945a5749e01e65a376e4eb02)
[dannf: Included as a dependency for later patch
 "scsi: hisi_sas: Don't lock DQ for complete task sending"]
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/scsi/hisi_sas/hisi_sas_main.c

index 38ad2b72f29c831c7176795641a7233bade3f1fe..49c1fa6438030bd4f0bba526b1a8bcc2c27c50b4 100644 (file)
@@ -1797,6 +1797,7 @@ int hisi_sas_alloc(struct hisi_hba *hisi_hba, struct Scsi_Host *shost)
                cq->hisi_hba = hisi_hba;
 
                /* Delivery queue structure */
+               spin_lock_init(&dq->lock);
                dq->id = i;
                dq->hisi_hba = hisi_hba;