]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
scsi: libsas: Use dynamic alloced work to avoid sas event lost
authorJason Yan <yanaijie@huawei.com>
Fri, 8 Dec 2017 09:42:04 +0000 (17:42 +0800)
committerSeth Forshee <seth.forshee@canonical.com>
Wed, 28 Feb 2018 14:47:01 +0000 (08:47 -0600)
commit6bd9033af3d5bfa1d1280e1ebaf8e83f277802c5
treeb975fb2ded0e37d4447c32b6632da0b29b797f55
parent95fda20c3fd53de4bfca1780c996a90073d38212
scsi: libsas: Use dynamic alloced work to avoid sas event lost

BugLink: https://bugs.launchpad.net/bugs/1752146
Now libsas hotplug work is static, every sas event type has its own
static work, LLDD driver queues the hotplug work into shost->work_q.  If
LLDD driver burst posts lots hotplug events to libsas, the hotplug
events may pending in the workqueue like

shost->work_q
new work[PORTE_BYTES_DMAED] --> |[PHYE_LOSS_OF_SIGNAL][PORTE_BYTES_DMAED] -> processing
                                |<-------wait worker to process-------->|

In this case, a new PORTE_BYTES_DMAED event coming, libsas try to queue
it to shost->work_q, but this work is already pending, so it would be
lost. Finally, libsas delete the related sas port and sas devices, but
LLDD driver expect libsas add the sas port and devices(last sas event).

This patch use dynamic allocated work to avoid this issue.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
CC: John Garry <john.garry@huawei.com>
CC: Johannes Thumshirn <jthumshirn@suse.de>
CC: Ewan Milne <emilne@redhat.com>
CC: Christoph Hellwig <hch@lst.de>
CC: Tomas Henzl <thenzl@redhat.com>
CC: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 1c393b970e0f4070e4376d45f89a2d19a5c895d0)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/scsi/libsas/sas_event.c
drivers/scsi/libsas/sas_init.c
drivers/scsi/libsas/sas_internal.h
drivers/scsi/libsas/sas_phy.c
drivers/scsi/libsas/sas_port.c
include/scsi/libsas.h