From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933739AbeAXNiJ (ORCPT ); Wed, 24 Jan 2018 08:38:09 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:39438 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933660AbeAXNiI (ORCPT ); Wed, 24 Jan 2018 08:38:08 -0500 X-Google-Smtp-Source: AH8x225WG6SpxWLh8noLw9O2I1ueZWpNd5wYEYIwOqMqnQyt4dOLShRfUPlqtFkzgnzWo7Rf7bcu+A== Subject: Re: [PATCH] kernel: x86: tboot: Replace mdelay with usleep_range in tboot_wait_for_aps To: Thomas Gleixner Cc: ning.sun@intel.com, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, tboot-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <1516759102-17549-1-git-send-email-baijiaju1990@gmail.com> From: Jia-Ju Bai Message-ID: Date: Wed, 24 Jan 2018 21:37:46 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/1/24 19:47, Thomas Gleixner wrote: > On Wed, 24 Jan 2018, Jia-Ju Bai wrote: > >> The function tboot_wait_for_aps is not called in atomic context. >> Thus mdelay can be replaced with usleep_range, to reduce busy wait. > And how did you establish that it's not called in atomic context? > > Thanks, > > tglx It is reported by a static analysis tool written by myself. This tool finds that mdelay in tboot_wait_for_aps is not called by holding a spinlock or in an interrupt handler, thus mdelay can be replaced. Thanks, Jia-Ju Bai