[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1516759102-17549-1-git-send-email-baijiaju1990@gmail.com>
Date: Wed, 24 Jan 2018 09:58:22 +0800
From: Jia-Ju Bai <baijiaju1990@...il.com>
To: ning.sun@...el.com, tglx@...utronix.de, mingo@...hat.com,
hpa@...or.com
Cc: x86@...nel.org, tboot-devel@...ts.sourceforge.net,
linux-kernel@...r.kernel.org, Jia-Ju Bai <baijiaju1990@...il.com>
Subject: [PATCH] kernel: x86: tboot: Replace mdelay with usleep_range in tboot_wait_for_aps
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@...il.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
Powered by blists - more mailing lists