public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kernel: x86: tboot: Replace mdelay with usleep_range in tboot_wait_for_aps
@ 2018-01-24  1:58 Jia-Ju Bai
  2018-01-24 11:47 ` Thomas Gleixner
  0 siblings, 1 reply; 5+ messages in thread
From: Jia-Ju Bai @ 2018-01-24  1:58 UTC (permalink / raw)
  To: ning.sun, tglx, mingo, hpa; +Cc: x86, tboot-devel, linux-kernel, Jia-Ju Bai

The function tboot_wait_for_aps is not called in atomic context.
Thus mdelay can be replaced with usleep_range, to reduce busy wait.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
---
 arch/x86/kernel/tboot.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c
index a4eb279..c1d523e 100644
--- a/arch/x86/kernel/tboot.c
+++ b/arch/x86/kernel/tboot.c
@@ -317,7 +317,7 @@ static int tboot_wait_for_aps(int num_aps)
 	timeout = AP_WAIT_TIMEOUT*HZ;
 	while (atomic_read((atomic_t *)&tboot->num_in_wfs) != num_aps &&
 	       timeout) {
-		mdelay(1);
+		usleep_range(1000, 2000);
 		timeout--;
 	}
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-01-25  9:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-24  1:58 [PATCH] kernel: x86: tboot: Replace mdelay with usleep_range in tboot_wait_for_aps Jia-Ju Bai
2018-01-24 11:47 ` Thomas Gleixner
2018-01-24 13:37   ` Jia-Ju Bai
2018-01-24 17:20     ` Sun, Ning
2018-01-25  9:35       ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox