Received: by 10.223.176.46 with SMTP id f43csp1895541wra; Thu, 25 Jan 2018 01:37:46 -0800 (PST) X-Google-Smtp-Source: AH8x2261JwKweckQg4AYIyV+fkjfrNGWQDmj1Q3UDwRWiIO3kspKOjbkHL8HqAWjduUHtH9dgNNC X-Received: by 2002:a17:902:b7c3:: with SMTP id v3-v6mr1099999plz.307.1516873066563; Thu, 25 Jan 2018 01:37:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516873066; cv=none; d=google.com; s=arc-20160816; b=0ktMp0BD6LOdYRRIAkaYL2rdsWvA4LHwx9LnECvfkziEDpi7GGBsw3jSpIpXIfpa9L YCM1F3Eix27K15QDOCxE8elD1WXYN2mMcwUF0KpKE6RfOZB0iV6yVLrXa6Q9fcNFp4Fu zmXhZaasWCwIalH4+EOFtDyKulca1gY0aCZZmHtQqXSkzl3dfSZJxNFZUGXRKCMMIuDy LX5Wp2lfr+NrRT2d4Za312dHsNOxFH2m7ZGlCe5ZMtgrR6ANmHCGBu4HfNTWWO28WpCr x/xlLUcGDocQcfMkF0d1vyyXDBWh5gCMS0OI1iZoTn9okYPQlPTvQBx+eFXRoGE7c5DT gUOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=VAvDkjktzILY9wPTq4hXf7GI/NAwJJemcsiUQxQEg1Y=; b=yWv5gYaPLBNrQIl+cBthAD6G7m4EHhNoUrAhr/MtexAJKy8eEFp30tWQOxdVGsqXeM 53iurDBrbXA+WyE/tsDsGk2FrqRk5u3FSOtgHVxfJKsaB4M9m/9G/T3YVtnv/pf9E1ET xjFrm3lgepWYobI6Kdq1uBNvrEX3Nj1F5fq29ozMykb4kpYGppo5rm+c/b4OizkEMG8O /tzolj/eHeEnJA7L+fQlRFkjGpM/hahsIb12s1H3Epv2sFHMQvGD6YTdAfZ3P2xDV8hK beeYoY/HyG/AAtlhbeQtPRvKaHDh3MJeb+nIY6s2YZJ2LwPtJb5KvhPw4IRQ0lSeoPCH DmpQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z75si4331736pfd.119.2018.01.25.01.37.32; Thu, 25 Jan 2018 01:37:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751689AbeAYJfh (ORCPT + 99 others); Thu, 25 Jan 2018 04:35:37 -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 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1eedtc-0007px-HZ; Thu, 25 Jan 2018 10:32:36 +0100 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 Precedence: bulk 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