Received: by 10.213.65.68 with SMTP id h4csp378836imn; Fri, 6 Apr 2018 01:37:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/kZaLF2scm/pjpqC7wSCDdOgL8ALxMEDnVNGAKt5yZjZFPKPxnrrQYVtC6LclHrc46glxC X-Received: by 2002:a17:902:2b84:: with SMTP id l4-v6mr26894176plb.65.1523003868887; Fri, 06 Apr 2018 01:37:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523003868; cv=none; d=google.com; s=arc-20160816; b=D2Oa78wbfcF4MeT6HqkUhna805b81f1285a38eDF9F0mwVNbrFYgm3Dw1XrcZgtxh6 H5urHtxIhV27TYRc9Kl/diYuIDGBmxf4qwiIfBzjNff/M6myjAPoGWE53FHwZoDVzTOG pu4GzdhYldOzs08Gs2TAyC/4qGJZ37bYIFN8QaJh4/qv6nwUt9y7fpFi19azwiFt+ABK BW2Er3xmYFy28SS0E3KglD+TNgzyk1d58s6RESPmmH/SVSYnrBdq0rSjVNgbgRWm+/vF k2sbbJZmxwRoqGhVQQbvvcfCWC5JffkNs55Pi6ko+CPwNWW8D0dlQwNO3hrsXVaHhJfA wzdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :from:references:cc:to:subject:arc-authentication-results; bh=owKz8LpNxnRfchTnsfTgzjm3Lbxr6nbrksy+U+XmfdQ=; b=moNOkUOhZ7JB5LXT3twDj99Xj39JuedqiXokkZHxnPhVgpx/X5x04OpznM82H27mr2 TwKAbKFbP5r5OxHZAH4a03ANQQ5FW/DEpwDpZqwULECIlxPNqdcXXKMBLDnkbw+n1bb7 Da03/5/QwTedFJuqwvvgIV7ptMYhAt28TSuSp3rhluRd+VrJBPc7KcDe5Cq7D8EQep3I kPwOXSucReTIvbenQ5zE8Wlcj2KW2sInVVWWjstRq6HDDrhJ6gxm+qRhAea1FTR4g/LS KKcucZCW+VuNJGGThsyqC4zmyhVKKVsok74W9mvshtKxNJ4yqt13FP3VQaAANkmx147B u0HQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 72si7713605pfn.44.2018.04.06.01.37.34; Fri, 06 Apr 2018 01:37:48 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751862AbeDFIfN (ORCPT + 99 others); Fri, 6 Apr 2018 04:35:13 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:55914 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751678AbeDFIfJ (ORCPT ); Fri, 6 Apr 2018 04:35:09 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w368Y5X5060617 for ; Fri, 6 Apr 2018 04:35:09 -0400 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0a-001b2d01.pphosted.com with ESMTP id 2h647xkb1d-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Fri, 06 Apr 2018 04:35:09 -0400 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 6 Apr 2018 02:35:08 -0600 Received: from b03cxnp08025.gho.boulder.ibm.com (9.17.130.17) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 6 Apr 2018 02:35:06 -0600 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w368Z5Fh11141576; Fri, 6 Apr 2018 01:35:06 -0700 Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E937213603A; Fri, 6 Apr 2018 02:35:05 -0600 (MDT) Received: from [9.124.31.53] (unknown [9.124.31.53]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP id ACCE5136044; Fri, 6 Apr 2018 02:35:03 -0600 (MDT) Subject: Re: [PATCH] tpm: moves the delay_msec increment after sleep in tpm_transmit() To: Jarkko Sakkinen 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 References: <20180402162006.5030-1-nayna@linux.vnet.ibm.com> <20180405101210.GA21636@linux.intel.com> From: Nayna Jain Date: Fri, 6 Apr 2018 14:03:37 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20180405101210.GA21636@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-TM-AS-GCONF: 00 x-cbid: 18040608-0012-0000-0000-000016016C85 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008812; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000256; SDB=6.01013855; UDB=6.00516823; IPR=6.00793115; MB=3.00020446; MTD=3.00000008; XFM=3.00000015; UTC=2018-04-06 08:35:08 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18040608-0013-0000-0000-0000522C9FD5 Message-Id: <95af65a1-e618-5cdf-fb81-56434f1aa973@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-04-06_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1804060092 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/05/2018 03:42 PM, Jarkko Sakkinen wrote: > 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. It tells that the first sleep is delay_msec * 2 and not delay_msec. > >> 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 I left just for clarity, but if not needed then I can remove it. Thanks & Regards,    - Nayna > >> 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 >