]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
scsi: hisi_sas: Fix the conflict between dev gone and host reset
authorXiaofei Tan <tanxiaofei@huawei.com>
Thu, 31 May 2018 12:50:44 +0000 (20:50 +0800)
committerKhalid Elmously <khalid.elmously@canonical.com>
Sun, 1 Jul 2018 23:06:42 +0000 (23:06 +0000)
commit265dae8f8c35703e48fb602a8f1f171f254dbc22
treebb32d151d5f39a0474b1302f69cf7c4443d0261f
parent45651175552d650598a853ce4ba3c7dbc97cef35
scsi: hisi_sas: Fix the conflict between dev gone and host reset

BugLink: https://bugs.launchpad.net/bugs/1777696
There is a possible conflict when a device is removed and host reset occurs
concurrently.

The reason is that then the device is notified as gone, we try to clear the
ITCT, which is notified via an interrupt. The dev gone function pends on
this event with a completion, which is completed when the ITCT interrupt
occurs.

But host reset will disable all interrupts, the wait_for_completion() may
wait indefinitely.

This patch adds an semaphore to synchronise this two processes. The
semaphore is taken by the host reset as the basis of synchronising.

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>
(cherry picked from commit e5baf18c5e3146d4156f8a81e5da0c66bac8d037 scsi)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/scsi/hisi_sas/hisi_sas.h
drivers/scsi/hisi_sas/hisi_sas_main.c