summaryrefslogtreecommitdiff
path: root/drivers/scsi/pm8001/pm8001_sas.h
diff options
context:
space:
mode:
authorAjish Koshy <Ajish.Koshy@microchip.com>2021-09-06 20:04:02 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2021-09-15 05:29:11 +0300
commitb27a40534ef76a22628a5c12f98ea489823a8ba5 (patch)
tree346426a6850a533dc7ced04bd2915066db22a678 /drivers/scsi/pm8001/pm8001_sas.h
parent08d0a992131a4db7328b0c2f5a0259732e4d0d12 (diff)
downloadlinux-b27a40534ef76a22628a5c12f98ea489823a8ba5.tar.xz
scsi: pm80xx: Fix lockup in outbound queue management
Commit 1f02beff224e ("scsi: pm80xx: Remove global lock from outbound queue processing") introduced a lock per outbound queue. Prior to that change the driver was using a global lock for all outbound queues. While processing the I/O responses and events the driver takes the outbound queue spinlock and is supposed to release it in pm8001_ccb_task_free_done() before calling command done(). Since the older code was using a global lock, pm8001_ccb_task_free_done() was releasing the global spin lock. The change that split the lock per outbound queue did not consider this and pm8001_ccb_task_free_done() was still releasing the global lock. Link: https://lore.kernel.org/r/20210906170404.5682-3-Ajish.Koshy@microchip.com Fixes: 1f02beff224e ("scsi: pm80xx: Remove global lock from outbound queue processing") Acked-by: Jack Wang <jinpu.wang@ionos.com> Signed-off-by: Ajish Koshy <Ajish.Koshy@microchip.com> Signed-off-by: Viswas G <Viswas.G@microchip.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/pm8001/pm8001_sas.h')
-rw-r--r--drivers/scsi/pm8001/pm8001_sas.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/scsi/pm8001/pm8001_sas.h b/drivers/scsi/pm8001/pm8001_sas.h
index 1a016a421280..3274d88a9ccc 100644
--- a/drivers/scsi/pm8001/pm8001_sas.h
+++ b/drivers/scsi/pm8001/pm8001_sas.h
@@ -458,6 +458,7 @@ struct outbound_queue_table {
__le32 producer_index;
u32 consumer_idx;
spinlock_t oq_lock;
+ unsigned long lock_flags;
};
struct pm8001_hba_memspace {
void __iomem *memvirtaddr;
@@ -740,9 +741,7 @@ pm8001_ccb_task_free_done(struct pm8001_hba_info *pm8001_ha,
{
pm8001_ccb_task_free(pm8001_ha, task, ccb, ccb_idx);
smp_mb(); /*in order to force CPU ordering*/
- spin_unlock(&pm8001_ha->lock);
task->task_done(task);
- spin_lock(&pm8001_ha->lock);
}
#endif