Received: by 10.213.65.68 with SMTP id h4csp1752392imn; Thu, 5 Apr 2018 03:13:55 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/u0sMMte+6TO/873Z6j0TLM2baDpmMsG+t57+J2Zv/281Uij9v9ymj3bZ+ZDmbqYMXpZcu X-Received: by 2002:a17:902:8f8c:: with SMTP id z12-v6mr22563025plo.400.1522923235404; Thu, 05 Apr 2018 03:13:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522923235; cv=none; d=google.com; s=arc-20160816; b=0qkm31VvTEPEfwg2sRuHM5rp0IWkeBpV4TLSRgMwSENPgiPFinMJCmkIfQ2eN+QuEM wBCulkX15fwHqxdKE2xFeskbFaLZ5Q3UMAlrQWBfQ69Icox1j9aoAX0ssSVpaVYhBwAb HaV8Nvol7Zo534saiC/93CuyK6J+QV1puXHK4cbac4S0KxVtwGOppxttwOrK+qrCqTwy I9TPFvjXYHYV5zjo70bs8t99IxkRCpS3En0hYGAONvLXEZHJD4GVRBPxVGr57nkn/Uqe XVsDoZRxKM+C2Mj6e5kR4HCjbPKCpgQh0ZvM0FlDZz2ZcMJZxhPzPdXupDhPVFrTah7C Altg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=z180cty9F9MC5w8WjyeP68R3NoFwjl05NYRhO6rvjYg=; b=pMILtl5cwlj9dqlXdPcL9Wjk1D5JKBB8iUPJ1E5TMszm9NJl6nTzAzysyM679UdXor +q/J94Knem9QuE6uJPj0J/1Ro19xD31P15mYRA7lO/Ta4Yb4k8Sp496x9TJfyK+Duqlb zkpt3YeASEVpf+fIw7s9i0sTPtghq7RG/v40rQs9m0w/ahEdzwdw0sByJU3Ixix29adz Z3EmqUOip+5qZ465SRSdHhwBMUUE7tBcsdMm9kqTMrdHL7xNiKV5egwe1k3SqmXQtpul XgRBnOxdvvLIPJQ16DqyMwYk3QZYGlzisqjX5uTAXRW7fBIDYxwBrnco2xOPSbuAN6l6 7Rag== 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 31-v6si5424404plz.261.2018.04.05.03.13.41; Thu, 05 Apr 2018 03:13:55 -0700 (PDT) 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 S1751530AbeDEKMh (ORCPT + 99 others); Thu, 5 Apr 2018 06:12:37 -0400 Received: from mga02.intel.com ([134.134.136.20]:7322 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751278AbeDEKMf (ORCPT ); Thu, 5 Apr 2018 06:12:35 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Apr 2018 03:12:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,410,1517904000"; d="scan'208";a="188860631" Received: from boersen-mobl.ger.corp.intel.com (HELO localhost) ([10.249.254.222]) by orsmga004.jf.intel.com with ESMTP; 05 Apr 2018 03:12:20 -0700 Date: Thu, 5 Apr 2018 13:12:10 +0300 From: Jarkko Sakkinen To: Nayna Jain Cc: linux-integrity@vger.kernel.org, zohar@linux.vnet.ibm.com, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, peterhuewe@gmx.de, tpmdd@selhorst.net, jgunthorpe@obsidianresearch.com Subject: Re: [PATCH] tpm: moves the delay_msec increment after sleep in tpm_transmit() Message-ID: <20180405101210.GA21636@linux.intel.com> References: <20180402162006.5030-1-nayna@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180402162006.5030-1-nayna@linux.vnet.ibm.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 02, 2018 at 09:50:06PM +0530, Nayna Jain wrote: > Commit e2fb992d82c6 ("tpm: add retry logic") introduced a new loop to > handle the TPM2_RC_RETRY error. The loop retries the command after > sleeping for the specified time, which is incremented exponentially in > every iteration. This patch fixes the initial sleep to be the default > sleep time. I think I understand the code change but do not understand what the long description. > > Fixes: commit e2fb992d82c6 ("tpm: add retry logic") > Signed-off-by: Nayna Jain > Reviewed-by: Mimi Zohar > --- > drivers/char/tpm/tpm-interface.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c > index c43a9e28995e..6201aab374e6 100644 > --- a/drivers/char/tpm/tpm-interface.c > +++ b/drivers/char/tpm/tpm-interface.c > @@ -587,7 +587,7 @@ ssize_t tpm_transmit(struct tpm_chip *chip, struct tpm_space *space, > */ > if (rc == TPM2_RC_TESTING && cc == TPM2_CC_SELF_TEST) > break; > - delay_msec *= 2; > + Extra whitespace > if (delay_msec > TPM2_DURATION_LONG) { > if (rc == TPM2_RC_RETRY) > dev_err(&chip->dev, "in retry loop\n"); > @@ -597,6 +597,7 @@ ssize_t tpm_transmit(struct tpm_chip *chip, struct tpm_space *space, > break; > } > tpm_msleep(delay_msec); > + delay_msec *= 2; > memcpy(buf, save, save_size); > } > return ret; > -- > 2.13.6 > /Jarkko