@@ -173,6 +173,7 @@ static int irq_process_pending_llist(struct idxd_irq_entry *irq_entry,
173
173
struct llist_node * head ;
174
174
int queued = 0 ;
175
175
176
+ * processed = 0 ;
176
177
head = llist_del_all (& irq_entry -> pending_llist );
177
178
if (!head )
178
179
return 0 ;
@@ -197,6 +198,7 @@ static int irq_process_work_list(struct idxd_irq_entry *irq_entry,
197
198
struct list_head * node , * next ;
198
199
int queued = 0 ;
199
200
201
+ * processed = 0 ;
200
202
if (list_empty (& irq_entry -> work_list ))
201
203
return 0 ;
202
204
@@ -218,10 +220,9 @@ static int irq_process_work_list(struct idxd_irq_entry *irq_entry,
218
220
return queued ;
219
221
}
220
222
221
- irqreturn_t idxd_wq_thread ( int irq , void * data )
223
+ static int idxd_desc_process ( struct idxd_irq_entry * irq_entry )
222
224
{
223
- struct idxd_irq_entry * irq_entry = data ;
224
- int rc , processed = 0 , retry = 0 ;
225
+ int rc , processed , total = 0 ;
225
226
226
227
/*
227
228
* There are two lists we are processing. The pending_llist is where
@@ -244,15 +245,26 @@ irqreturn_t idxd_wq_thread(int irq, void *data)
244
245
*/
245
246
do {
246
247
rc = irq_process_work_list (irq_entry , & processed );
247
- if ( rc != 0 ) {
248
- retry ++ ;
248
+ total += processed ;
249
+ if ( rc != 0 )
249
250
continue ;
250
- }
251
251
252
252
rc = irq_process_pending_llist (irq_entry , & processed );
253
- } while (rc != 0 && retry != 10 );
253
+ total += processed ;
254
+ } while (rc != 0 );
255
+
256
+ return total ;
257
+ }
258
+
259
+ irqreturn_t idxd_wq_thread (int irq , void * data )
260
+ {
261
+ struct idxd_irq_entry * irq_entry = data ;
262
+ int processed ;
254
263
264
+ processed = idxd_desc_process (irq_entry );
255
265
idxd_unmask_msix_vector (irq_entry -> idxd , irq_entry -> id );
266
+ /* catch anything unprocessed after unmasking */
267
+ processed += idxd_desc_process (irq_entry );
256
268
257
269
if (processed == 0 )
258
270
return IRQ_NONE ;
0 commit comments