Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3091745iob; Mon, 16 May 2022 12:54:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCL24zlLcy4FsNnTm7myibcaaZqcYbWuoRAjR8TYem3yvFpUkpacaYDC/NMHOqI2lS43xd X-Received: by 2002:a05:6a00:1881:b0:50e:1a:f452 with SMTP id x1-20020a056a00188100b0050e001af452mr18935855pfh.75.1652730846506; Mon, 16 May 2022 12:54:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652730846; cv=none; d=google.com; s=arc-20160816; b=ZXvCX+xoPKC8bpkvGESanTxHaXZDyhVl1vmF0sdItpzrPAOVneQyEFTyrQ+/+ce8B5 NnJ+vprAl/2KJEiY7TGk9Es4mnV8o5x7Ap4IrCcBO0FE7U5Zzake1Rj2MwT1BNj3qDaA nosMzNNB9VSFepdjEV2ITRrSnbTNTpFlvuuvE9Yf9hx0rk7n0AemdzoUWg5VNH05BZ4T CCDMJpWHv9Iw1r0f+bBghSkWN7rQA1KQKfTh6QUui8f0J+xbPDo2E9GLP7SdCB+2SDEY +p8k7d8+6J+kFElqmyUh75FogW6tfQiPndc0mx4ZCGUpMf7CzJOSIc8iomgrnPb8D2kQ GaJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=g+/1AHM9DI4cg3FNLXhUdnvPgi2+Ej8niU6BBfpwdv4=; b=Skx3BQNh88gVzWfqVn77gPr42i6so6TYO8HvWEmqo7RqLSHV2grr9f2NvXxUsNJ0HC DyJmisKZt3qRFe+CN3QvH/7L/vMitHaNhWWNgrSvxgq+ICbN+BkHi4NJgXy4NkDFnLgp G1Lbw3P+6s5qM/6pReryC99Y/mfU30mqwCzEF1zxlrdqc+3m6uT81F0ABMH0c8we8Nrl EWfQolCT5bk9CC4qjWdyUNH0Qey9nRC5cL/JQZqErBq9tpWX0ShAEmokzbawEXELuAb8 P7CMN+GQfNYX1SwDJgHAogmLrMjjKqUg6UXsD+oki8jA39K5+fTQGPbObdVOY7bD80SZ /Eig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XdsOZPA+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 190-20020a6303c7000000b003a75aa6cc74si13960145pgd.814.2022.05.16.12.53.55; Mon, 16 May 2022 12:54:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XdsOZPA+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237817AbiEPRzw (ORCPT + 99 others); Mon, 16 May 2022 13:55:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230453AbiEPRzu (ORCPT ); Mon, 16 May 2022 13:55:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D34661FA4D; Mon, 16 May 2022 10:55:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6F13361328; Mon, 16 May 2022 17:55:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79485C385AA; Mon, 16 May 2022 17:55:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652723747; bh=goXFeXlLpONwFnhWgolTtOIqWpucoeNyIZd7yZ63G8I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XdsOZPA+/BUEtLbSivCtZZwJuxQuGJXMUKKGdG4MBng3xZN9iF7EQ3w5ngbpsNv7A BVoivSm4VxmWF9R34FX93AB9LP55jOwrJ+goUqGXYv9LIXmv4+AV/8LT9+k0jQxXTY D3CxqoYU93eX7QC0VxnOBFNNPL0pa+KqrQNd/SSQ4val2+62PCN7HrWM80y1fpu/FS PyDE8IAgaipY06SDw8mDghglChuxRBC2Tl9dEhPcHq70D/MT53+6FA/2dmebMHJE/t RSNAvZmv7fjWUND55bFMquyv2OJeoSFZV0A0LNhJViikYkc76rDZphcEp1chZ7FNuY zXooKYJBZeZxQ== Date: Mon, 16 May 2022 20:54:12 +0300 From: Jarkko Sakkinen To: Mimi Zohar Cc: Johannes Holland , Nayna , linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, peterhuewe@gmx.de, jgg@ziepe.ca Subject: Re: [PATCH] tpm: sleep at least <...> ms in tpm_msleep() Message-ID: References: <20220510112902.23213-1-johannes.holland@infineon.com> <99541f08e8b554dea59334005cafb0af978f9a05.camel@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <99541f08e8b554dea59334005cafb0af978f9a05.camel@linux.ibm.com> X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 12, 2022 at 08:21:17AM -0400, Mimi Zohar wrote: > On Wed, 2022-05-11 at 18:16 +0300, Jarkko Sakkinen wrote: > > On Tue, May 10, 2022 at 01:29:03PM +0200, Johannes Holland wrote: > > > To comply with protocol requirements, minimum polling times must often > > > be adhered to. Therefore, a macro like tpm_msleep() should sleep at > > > least the given amount of time (not up to the given period). Have > > > tpm_msleep() sleep at least the given number of milliseconds. > > > > > > Signed-off-by: Johannes Holland > > > --- > > > drivers/char/tpm/tpm.h | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h > > > index 2163c6ee0d36..0971b55fffe3 100644 > > > --- a/drivers/char/tpm/tpm.h > > > +++ b/drivers/char/tpm/tpm.h > > > @@ -185,8 +185,8 @@ int tpm_pm_resume(struct device *dev); > > > > > > static inline void tpm_msleep(unsigned int delay_msec) > > > { > > > - usleep_range((delay_msec * 1000) - TPM_TIMEOUT_RANGE_US, > > > - delay_msec * 1000); > > > + usleep_range(delay_msec * 1000, (delay_msec * 1000) > > > + + TPM_TIMEOUT_RANGE_US); > > > }; > > > > > > int tpm_chip_start(struct tpm_chip *chip); > > > -- > > > 2.34.1 > > > > > > > For this I would really like to hear a 2nd opinion from Nayna and Mimi. > > This patch reverts commit 5ef924d9e2e8 ("tpm: use tpm_msleep() value as > max delay"). Are you experiencing TPM issues that require it? > > thanks, > > Mimi Yeah, there's no data to support making anything. Without a live system having issues with this, I guess this quite definitive NAK. BR, Jarkko