Skip to content

Commit 9fce3b3

Browse files
davejiangvinodkoul
authored andcommitted
dmaengine: idxd: remove interrupt flag for completion list spinlock
The list lock is never acquired in interrupt context. Therefore there is no need to disable interrupts. Remove interrupt flags for lock operations. Reviewed-by: Dan Williams <[email protected]> Signed-off-by: Dave Jiang <[email protected]> Link: https://lore.kernel.org/r/162826417450.3454650.3733188117742416238.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul <[email protected]>
1 parent 15cb032 commit 9fce3b3

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

drivers/dma/idxd/irq.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ static void irq_process_pending_llist(struct idxd_irq_entry *irq_entry)
176176
{
177177
struct idxd_desc *desc, *t;
178178
struct llist_node *head;
179-
unsigned long flags;
180179

181180
head = llist_del_all(&irq_entry->pending_llist);
182181
if (!head)
@@ -197,27 +196,26 @@ static void irq_process_pending_llist(struct idxd_irq_entry *irq_entry)
197196

198197
complete_desc(desc, IDXD_COMPLETE_NORMAL);
199198
} else {
200-
spin_lock_irqsave(&irq_entry->list_lock, flags);
199+
spin_lock(&irq_entry->list_lock);
201200
list_add_tail(&desc->list,
202201
&irq_entry->work_list);
203-
spin_unlock_irqrestore(&irq_entry->list_lock, flags);
202+
spin_unlock(&irq_entry->list_lock);
204203
}
205204
}
206205
}
207206

208207
static void irq_process_work_list(struct idxd_irq_entry *irq_entry)
209208
{
210-
unsigned long flags;
211209
LIST_HEAD(flist);
212210
struct idxd_desc *desc, *n;
213211

214212
/*
215213
* This lock protects list corruption from access of list outside of the irq handler
216214
* thread.
217215
*/
218-
spin_lock_irqsave(&irq_entry->list_lock, flags);
216+
spin_lock(&irq_entry->list_lock);
219217
if (list_empty(&irq_entry->work_list)) {
220-
spin_unlock_irqrestore(&irq_entry->list_lock, flags);
218+
spin_unlock(&irq_entry->list_lock);
221219
return;
222220
}
223221

@@ -228,7 +226,7 @@ static void irq_process_work_list(struct idxd_irq_entry *irq_entry)
228226
}
229227
}
230228

231-
spin_unlock_irqrestore(&irq_entry->list_lock, flags);
229+
spin_unlock(&irq_entry->list_lock);
232230

233231
list_for_each_entry(desc, &flist, list) {
234232
/*

drivers/dma/idxd/submit.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,13 @@ static void llist_abort_desc(struct idxd_wq *wq, struct idxd_irq_entry *ie,
106106
{
107107
struct idxd_desc *d, *t, *found = NULL;
108108
struct llist_node *head;
109-
unsigned long flags;
110109

111110
desc->completion->status = IDXD_COMP_DESC_ABORT;
112111
/*
113112
* Grab the list lock so it will block the irq thread handler. This allows the
114113
* abort code to locate the descriptor need to be aborted.
115114
*/
116-
spin_lock_irqsave(&ie->list_lock, flags);
115+
spin_lock(&ie->list_lock);
117116
head = llist_del_all(&ie->pending_llist);
118117
if (head) {
119118
llist_for_each_entry_safe(d, t, head, llnode) {
@@ -127,7 +126,7 @@ static void llist_abort_desc(struct idxd_wq *wq, struct idxd_irq_entry *ie,
127126

128127
if (!found)
129128
found = list_abort_desc(wq, ie, desc);
130-
spin_unlock_irqrestore(&ie->list_lock, flags);
129+
spin_unlock(&ie->list_lock);
131130

132131
if (found)
133132
complete_desc(found, IDXD_COMPLETE_ABORT);

0 commit comments

Comments
 (0)