* [PATCH v2 2/2] scsi: arcmsr: Confirm getting a free ccb is in spin_lock circle
@ 2020-10-27 3:39 ching Huang
0 siblings, 0 replies; only message in thread
From: ching Huang @ 2020-10-27 3:39 UTC (permalink / raw)
To: martin.petersen, James.Bottomley, linux-scsi, Linux Kernel Mailing List
From: ching Huang <ching2048@areca.com.tw>
Confirm getting a free ccb is in spin_lock circle.
Signed-off-by: ching Huang <ching2048@areca.com.tw>
---
diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
index 7cfae1d..127fe50 100644
--- a/drivers/scsi/arcmsr/arcmsr_hba.c
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c
@@ -3162,10 +3162,12 @@ message_out:
static struct CommandControlBlock *arcmsr_get_freeccb(struct AdapterControlBlock *acb)
{
- struct list_head *head = &acb->ccb_free_list;
+ struct list_head *head;
struct CommandControlBlock *ccb = NULL;
unsigned long flags;
+
spin_lock_irqsave(&acb->ccblist_lock, flags);
+ head = &acb->ccb_free_list;
if (!list_empty(head)) {
ccb = list_entry(head->next, struct CommandControlBlock, list);
list_del_init(&ccb->list);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-10-27 3:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-27 3:39 [PATCH v2 2/2] scsi: arcmsr: Confirm getting a free ccb is in spin_lock circle ching Huang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).