From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751695AbdINJZu (ORCPT ); Thu, 14 Sep 2017 05:25:50 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:36852 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751646AbdINJZs (ORCPT ); Thu, 14 Sep 2017 05:25:48 -0400 Subject: Re: [PATCH v2 4/4] tpm: use tpm_msleep() value as max delay To: Jarkko Sakkinen Cc: tpmdd-devel@lists.sourceforge.net, peterhuewe@gmx.de, tpmdd@selhorst.net, jgunthorpe@obsidianresearch.com, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, linux-ima-devel@lists.sourceforge.net, patrickc@us.ibm.com References: <20170906125643.5070-1-nayna@linux.vnet.ibm.com> <20170906125643.5070-5-nayna@linux.vnet.ibm.com> <20170913004703.wtebzfp7mlgk57xf@linux.intel.com> From: Nayna Jain Date: Thu, 14 Sep 2017 14:55:34 +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: <20170913004703.wtebzfp7mlgk57xf@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: 17091409-0044-0000-0000-0000038F5424 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007729; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000227; SDB=6.00916832; UDB=6.00460437; IPR=6.00697059; BA=6.00005588; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017149; XFM=3.00000015; UTC=2017-09-14 09:25:45 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17091409-0045-0000-0000-000007BE54E1 Message-Id: <54cc7899-28df-3630-3337-684b561f3760@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-09-14_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1709140139 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/13/2017 06:17 AM, Jarkko Sakkinen wrote: > On Wed, Sep 06, 2017 at 08:56:39AM -0400, Nayna Jain wrote: >> Currently, tpm_msleep() uses delay_msec as the minimum value in >> usleep_range. However, that is the maximum time we want to wait. >> The function is modified to use the delay_msec as the maximum >> value, not the minimum value. >> >> After this change, performance on a TPM 1.2 with an 8 byte >> burstcount for 1000 extends improved from ~9sec to ~8sec. >> >> Signed-off-by: Nayna Jain >> Acked-by: Mimi Zohar >> --- >> 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 eb2f8818eded..ff5a8b7b80b9 100644 >> --- a/drivers/char/tpm/tpm.h >> +++ b/drivers/char/tpm/tpm.h >> @@ -533,8 +533,8 @@ int wait_for_tpm_stat(struct tpm_chip *chip, u8 mask, unsigned long timeout, >> >> static inline void tpm_msleep(unsigned int delay_msec) >> { >> - usleep_range(delay_msec * 1000, >> - (delay_msec * 1000) + TPM_TIMEOUT_RANGE_US); >> + usleep_range((delay_msec * 1000) - TPM_TIMEOUT_RANGE_US, >> + delay_msec * 1000); >> }; >> >> struct tpm_chip *tpm_chip_find_get(int chip_num); >> -- >> 2.13.3 >> > Doesn't this need a Fixes tag? Yeah.. will add.    - Nayna > /Jarkko >