scsi: hisi_sas: Sync complete queue for poll queue
authorXiang Chen <chenxiang66@hisilicon.com>
Tue, 7 Mar 2023 06:09:14 +0000 (14:09 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 10 Mar 2023 02:50:02 +0000 (21:50 -0500)
commitb711ef5e176bf47c10c0d24e21c1486b5331d33f
treea57a16af6c773f1b58c274425a570050da478efd
parent0e47effa77067d0e5fdd41871941d2b3d38a0e61
scsi: hisi_sas: Sync complete queue for poll queue

Currently we sync irq to avoid freeing task before using task in I/O
completion. After adding io_uring support, we need to do something similar
for poll queues.  As the process of CQ entries on poll queue are protected
by spinlock cq->lock, we can use spin_lock() + spin_unlock() on cq->lock to
make sure that CQ entries are processed to completion and then the complete
queue is synced.

Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Link: https://lore.kernel.org/r/1678169355-76215-4-git-send-email-chenxiang66@hisilicon.com
Reviewed-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