* [PATCH] scsi: hisi_sas: Fix spin lock management in slot_index_alloc_quirk_v2_hw()
@ 2018-10-16 15:00 ` John Garry
0 siblings, 0 replies; 4+ messages in thread
From: John Garry @ 2018-10-16 15:00 UTC (permalink / raw)
To: jejb, martin.petersen
Cc: linux-scsi, linux-kernel, julia.lawall, linuxarm, John Garry
Currently a spin_unlock_irqrestore() call is missing on the error path, so
add it.
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: John Garry <john.garry@huawei.com>
diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
index 70d6b28..cc36b64 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
@@ -806,8 +806,10 @@ static u32 hisi_sas_phy_read32(struct hisi_hba *hisi_hba,
while (1) {
start = find_next_zero_bit(bitmap,
hisi_hba->slot_index_count, start);
- if (start >= end)
+ if (start >= end) {
+ spin_unlock_irqrestore(&hisi_hba->lock, flags);
return -SAS_QUEUE_FULL;
+ }
/*
* SAS IPTT bit0 should be 1, and SATA IPTT bit0 should be 0.
*/
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] scsi: hisi_sas: Fix spin lock management in slot_index_alloc_quirk_v2_hw()
@ 2018-10-16 15:00 ` John Garry
0 siblings, 0 replies; 4+ messages in thread
From: John Garry @ 2018-10-16 15:00 UTC (permalink / raw)
To: jejb, martin.petersen
Cc: linux-scsi, linux-kernel, julia.lawall, linuxarm, John Garry
Currently a spin_unlock_irqrestore() call is missing on the error path, so
add it.
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: John Garry <john.garry@huawei.com>
diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
index 70d6b28..cc36b64 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
@@ -806,8 +806,10 @@ static u32 hisi_sas_phy_read32(struct hisi_hba *hisi_hba,
while (1) {
start = find_next_zero_bit(bitmap,
hisi_hba->slot_index_count, start);
- if (start >= end)
+ if (start >= end) {
+ spin_unlock_irqrestore(&hisi_hba->lock, flags);
return -SAS_QUEUE_FULL;
+ }
/*
* SAS IPTT bit0 should be 1, and SATA IPTT bit0 should be 0.
*/
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi: hisi_sas: Fix spin lock management in slot_index_alloc_quirk_v2_hw()
2018-10-16 15:00 ` John Garry
@ 2018-10-16 21:51 ` Martin K. Petersen
-1 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2018-10-16 21:51 UTC (permalink / raw)
To: John Garry
Cc: jejb, martin.petersen, linux-scsi, linux-kernel, julia.lawall, linuxarm
John,
> Currently a spin_unlock_irqrestore() call is missing on the error path, so
> add it.
Applied to 4.20/scsi-queue. Thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi: hisi_sas: Fix spin lock management in slot_index_alloc_quirk_v2_hw()
@ 2018-10-16 21:51 ` Martin K. Petersen
0 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2018-10-16 21:51 UTC (permalink / raw)
To: John Garry
Cc: jejb, martin.petersen, linux-scsi, linux-kernel, julia.lawall, linuxarm
John,
> Currently a spin_unlock_irqrestore() call is missing on the error path, so
> add it.
Applied to 4.20/scsi-queue. Thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-10-16 21:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-16 15:00 [PATCH] scsi: hisi_sas: Fix spin lock management in slot_index_alloc_quirk_v2_hw() John Garry
2018-10-16 15:00 ` John Garry
2018-10-16 21:51 ` Martin K. Petersen
2018-10-16 21:51 ` Martin K. Petersen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.