From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751694AbeAYJfi (ORCPT ); Thu, 25 Jan 2018 04:35:38 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:34394 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751665AbeAYJfe (ORCPT ); Thu, 25 Jan 2018 04:35:34 -0500 Date: Thu, 25 Jan 2018 10:35:17 +0100 (CET) From: Thomas Gleixner To: "Sun, Ning" cc: Jia-Ju Bai , "mingo@redhat.com" , "hpa@zytor.com" , "x86@kernel.org" , "tboot-devel@lists.sourceforge.net" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] kernel: x86: tboot: Replace mdelay with usleep_range in tboot_wait_for_aps In-Reply-To: <83BE7A8C0111FD48951B68B36BEFDFD40D135D39@ORSMSX107.amr.corp.intel.com> Message-ID: References: <1516759102-17549-1-git-send-email-baijiaju1990@gmail.com> <83BE7A8C0111FD48951B68B36BEFDFD40D135D39@ORSMSX107.amr.corp.intel.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 24 Jan 2018, Sun, Ning wrote: Please do NOT top post and do NOT include the whole mail header in your reply. > >> 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? > > > 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. > It looks like tboot_wait_for_aps(...) is not called in atomic context . You are both failing to look at the calling context of this. Care to follow the invocation chain and look at the context? Thanks, tglx