From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752453AbdK0NWj (ORCPT ); Mon, 27 Nov 2017 08:22:39 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:33756 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752120AbdK0NWg (ORCPT ); Mon, 27 Nov 2017 08:22:36 -0500 Subject: Re: [PATCH v4 2/4] tpm: ignore burstcount to improve tpm_tis send() performance From: Mimi Zohar To: Leendert van Doorn , Jarkko Sakkinen , Nayna Jain Cc: "Alexander.Steffen@infineon.com" , "linux-integrity@vger.kernel.org" , "linux-security-module@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "peterhuewe@gmx.de" , "tpmdd@selhorst.net" , "patrickc@us.ibm.com" , "Safford, David (GE Global Research, US)" Date: Mon, 27 Nov 2017 08:22:28 -0500 In-Reply-To: <694703AB-68E1-4026-937C-61DBBE08DB4B@paramecium.org> References: <20171017203232.2262-1-nayna@linux.vnet.ibm.com> <20171017203232.2262-3-nayna@linux.vnet.ibm.com> <5ef60315f2254b3b8bcc217a572280e5@infineon.com> <3ff12c6536de4379aa61cb09ebc9d105@infineon.com> <20171123144742.GC8862@swastik> <20171126152218.c5fsr7uhs3ipwwha@linux.intel.com> <1511714261.4361.13.camel@linux.vnet.ibm.com> <694703AB-68E1-4026-937C-61DBBE08DB4B@paramecium.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 17112713-0016-0000-0000-00000505F52A X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17112713-0017-0000-0000-00002841D4D2 Message-Id: <1511788948.4361.39.camel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-27_07:,, 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=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1711270184 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Leendert! On Mon, 2017-11-27 at 07:08 +0000, Leendert van Doorn wrote: > Hmm, this is almost 20 years old code ( > > I think the original code did a burst write and didn't check for > error conditions until the very last byte write. I seem to remember > that there was some text in the original standard to that effect > (this may have gone back as far as IBM's ESS spec). I really appreciate your responding with your recollections. > The current code does check for error conditions after each write > byte(s) so I don't think there is any reason for this anymore. > Changing the while condition to count < len and setting burstcnt = > min_t(int, burstcnt, len - count) and remove the > tpm_tis_write8/wait_for_tpm_stat/tpm_tis_status clauses after the > while loop should be sufficient. The context for my question was about removing the while loop and sending all of the data at once, relying on the bus wait states.  Before making the change, I wanted to make sure there wasn't anything special about the last byte. thanks, Mimi