@@ -306,11 +306,13 @@ void ufshcd_mcq_compl_all_cqes_lock(struct ufs_hba *hba,
306
306
spin_unlock_irqrestore (& hwq -> cq_lock , flags );
307
307
}
308
308
309
- static unsigned long ufshcd_mcq_poll_cqe_nolock (struct ufs_hba * hba ,
310
- struct ufs_hw_queue * hwq )
309
+ unsigned long ufshcd_mcq_poll_cqe_lock (struct ufs_hba * hba ,
310
+ struct ufs_hw_queue * hwq )
311
311
{
312
312
unsigned long completed_reqs = 0 ;
313
+ unsigned long flags ;
313
314
315
+ spin_lock_irqsave (& hwq -> cq_lock , flags );
314
316
ufshcd_mcq_update_cq_tail_slot (hwq );
315
317
while (!ufshcd_mcq_is_cq_empty (hwq )) {
316
318
ufshcd_mcq_process_cqe (hba , hwq );
@@ -320,17 +322,6 @@ static unsigned long ufshcd_mcq_poll_cqe_nolock(struct ufs_hba *hba,
320
322
321
323
if (completed_reqs )
322
324
ufshcd_mcq_update_cq_head (hwq );
323
-
324
- return completed_reqs ;
325
- }
326
-
327
- unsigned long ufshcd_mcq_poll_cqe_lock (struct ufs_hba * hba ,
328
- struct ufs_hw_queue * hwq )
329
- {
330
- unsigned long completed_reqs , flags ;
331
-
332
- spin_lock_irqsave (& hwq -> cq_lock , flags );
333
- completed_reqs = ufshcd_mcq_poll_cqe_nolock (hba , hwq );
334
325
spin_unlock_irqrestore (& hwq -> cq_lock , flags );
335
326
336
327
return completed_reqs ;
0 commit comments