From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752094AbeAXBx5 (ORCPT ); Tue, 23 Jan 2018 20:53:57 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:45985 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751807AbeAXBx4 (ORCPT ); Tue, 23 Jan 2018 20:53:56 -0500 X-Google-Smtp-Source: AH8x225WmbL4AFzw2R10K0vXGK4P/CA7Hc+2iRxbBEbIFopSEfM6Yp1trhtIHgBRamIPUrH8fLZzyA== From: Jia-Ju Bai To: ning.sun@intel.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com Cc: x86@kernel.org, tboot-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] kernel: x86: tboot: Replace mdelay with usleep_range in tboot_wait_for_aps Date: Wed, 24 Jan 2018 09:58:22 +0800 Message-Id: <1516759102-17549-1-git-send-email-baijiaju1990@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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