Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753794AbdHKVxq (ORCPT ); Fri, 11 Aug 2017 17:53:46 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:54275 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753533AbdHKVxp (ORCPT ); Fri, 11 Aug 2017 17:53:45 -0400 Subject: Re: Aw: Re: [tpmdd-devel] [PATCH] tpm: improve tpm_tis send() performance by ignoring burstcount Cc: linux-ima-devel@lists.sourceforge.net, linux-security-module@vger.kernel.org, tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <20170807114632.1339-1-nayna@linux.vnet.ibm.com> <20170808191145.kggmoczd5laiccrn@linux.intel.com> <819e3d38-3f16-a32b-1928-c425b763d5f8@linux.vnet.ibm.com> From: Ken Goldman Date: Fri, 11 Aug 2017 17:54:19 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17081121-0024-0000-0000-000017027560 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007527; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000220; SDB=6.00900937; UDB=6.00451097; IPR=6.00681140; BA=6.00005523; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016650; XFM=3.00000015; UTC=2017-08-11 21:53:42 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17081121-0025-0000-0000-00004C3F6B21 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-08-11_07:,, 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-1706020000 definitions=main-1708110345 To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1496 Lines: 37 On 8/9/2017 4:43 PM, Peter Huewe wrote: > > Yes that's bad, especially with current msleep(5) is actually > msleep(20). However, please also keep in mind SPI tpms show a much > higher burst count value, (255) our I2C TPM SLB9645 even shows > something in the range of 1k. :) One of our platforms has a TPM 1.2 with an 8 byte FIFO and a static burst count. This is where we're debugging. >> Would another solution be to reduce the burst count poll and sleep >> to, e.g., 100 usec or even 10 usec? This would probably help >> greatly, but till not incur the wait states that triggered the >> NACK. > > If you use sleep it's not guaranteed that you wakeup after exactly xx > specified amount of time. Just that you sleep at least xx amount of > time. Otherwise you would have to do delay/busywaiting. Understood. However, if the DD maintainers will not accept ignoring burstCount, would a short sleep (e.g., 10 usec) be acceptable. If so, we can benchmark it. > Imho the best option is to figure out whether any vendor can > determine the "FIFO flush time" i.e. how much time does it take to > empty the fifo and fillup the burstcount and use this on the lower > bound of an usleep range. I don't think tpms are in the range of < 10 > us... > > @Ken: Maybe can you check in DDWG? I asked this week. Nuvoton, ST Micro, and Infineon confirmed that the TPM empties a byte from the FIFO in under 1 usec. So, even with a static burst count, the entire FIFO would empty in under 10 usec.