From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1CD73C3A59F for ; Thu, 29 Aug 2019 14:42:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E3C87233FF for ; Thu, 29 Aug 2019 14:42:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727860AbfH2OmC (ORCPT ); Thu, 29 Aug 2019 10:42:02 -0400 Received: from mga11.intel.com ([192.55.52.93]:28334 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727794AbfH2OmB (ORCPT ); Thu, 29 Aug 2019 10:42:01 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Aug 2019 07:42:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,443,1559545200"; d="scan'208";a="332533478" Received: from friedlmi-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.54.26]) by orsmga004.jf.intel.com with ESMTP; 29 Aug 2019 07:41:56 -0700 Date: Thu, 29 Aug 2019 17:41:54 +0300 From: Jarkko Sakkinen To: Jerry Snitselaar Cc: linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Huewe , Jason Gunthorpe , Alexey Klimov Subject: Re: [PATCH 2/2 v2] tpm_tis: override durations for STM tpm with firmware 1.2.8.28 Message-ID: <20190829144140.6xaygqkfhsnmm67s@linux.intel.com> References: <20190828004621.29050-1-jsnitsel@redhat.com> <20190828004621.29050-3-jsnitsel@redhat.com> <20190829144002.zhuqxnsswgl65pnm@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190829144002.zhuqxnsswgl65pnm@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: NeoMutt/20180716 Sender: linux-integrity-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org On Thu, Aug 29, 2019 at 05:40:40PM +0300, Jarkko Sakkinen wrote: > On Tue, Aug 27, 2019 at 05:46:21PM -0700, Jerry Snitselaar wrote: > > There was revealed a bug in the STM TPM chipset used in Dell R415s. > > Bug is observed so far only on chipset firmware 1.2.8.28 > > (1.2 TPM, device-id 0x0, rev-id 78). After some number of > > operations chipset hangs and stays in inconsistent state: > > > > tpm_tis 00:09: Operation Timed out > > tpm_tis 00:09: tpm_transmit: tpm_send: error -5 > > > > Durations returned by the chip are the same like on other > > firmware revisions but apparently with specifically 1.2.8.28 fw > > durations should be reset to 2 minutes to enable tpm chip work > > properly. No working way of updating firmware was found. > > > > This patch adds implementation of ->update_durations method > > that matches only STM devices with specific firmware version. > > > > Cc: Peter Huewe > > Cc: Jarkko Sakkinen > > Cc: Jason Gunthorpe > > Signed-off-by: Alexey Klimov > > Signed-off-by: Jerry Snitselaar > > --- > > v2: Make suggested changes from Jarkko > > - change struct field name to durations from durs > > - formatting cleanups > > - turn into void function like update_timeouts and > > use chip->duration_adjusted to track whether adjustment occurred. > > The code repetition looks horrible so I wrote a patch that should help: > > https://patchwork.kernel.org/patch/11121475/ > > Read the remar that prepends the diffstat. Forgot from that remark that I did not have TPM 1.x available at hand (WFH today) so please also review and test it. /Jrakko