diff mbox series

mpt3sas: Call cpu_relax() before calling udelay()

Message ID 20210901152542.27866-1-sreekanth.reddy@broadcom.com
State New
Headers show
Series mpt3sas: Call cpu_relax() before calling udelay() | expand

Commit Message

Sreekanth Reddy Sept. 1, 2021, 3:25 p.m. UTC
Call cpu_relax() API while waiting for the current blk-mq polling
instance to complete.

Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
---
 drivers/scsi/mpt3sas/mpt3sas_base.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Bart Van Assche Sept. 2, 2021, 4:12 p.m. UTC | #1
On 9/1/21 8:25 AM, Sreekanth Reddy wrote:
> Call cpu_relax() API while waiting for the current blk-mq polling

> instance to complete.

Thanks!

Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Martin K. Petersen Sept. 14, 2021, 3:43 a.m. UTC | #2
On Wed, 1 Sep 2021 20:55:42 +0530, Sreekanth Reddy wrote:

> Call cpu_relax() API while waiting for the current blk-mq polling

> instance to complete.

> 

> 


Applied to 5.15/scsi-fixes, thanks!

[1/1] mpt3sas: Call cpu_relax() before calling udelay()
      https://git.kernel.org/mkp/scsi/c/e4953a93104c

-- 
Martin K. Petersen	Oracle Linux Engineering
diff mbox series

Patch

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 2528c4e7b0e0..c0d0d311d676 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -1582,8 +1582,10 @@  mpt3sas_base_pause_mq_polling(struct MPT3SAS_ADAPTER *ioc)
 	 * wait for current poll to complete.
 	 */
 	for (qid = 0; qid < iopoll_q_count; qid++) {
-		while (atomic_read(&ioc->io_uring_poll_queues[qid].busy))
+		while (atomic_read(&ioc->io_uring_poll_queues[qid].busy)) {
+			cpu_relax();
 			udelay(500);
+		}
 	}
 }