From patchwork Thu Jan 12 18:08:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej S. Szmigiero" X-Patchwork-Id: 9513785 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 782DD60476 for ; Thu, 12 Jan 2017 18:09:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C511286F3 for ; Thu, 12 Jan 2017 18:09:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5ECB9286FB; Thu, 12 Jan 2017 18:09:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0D6A4286F3 for ; Thu, 12 Jan 2017 18:09:14 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1cRjoG-0008Mh-Sr; Thu, 12 Jan 2017 18:09:12 +0000 Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1cRjoF-0008Mc-KN for tpmdd-devel@lists.sourceforge.net; Thu, 12 Jan 2017 18:09:11 +0000 X-ACL-Warn: Received: from vps-vb.mhejs.net ([37.28.154.113]) by sog-mx-4.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1cRjoE-0005Pk-4M for tpmdd-devel@lists.sourceforge.net; Thu, 12 Jan 2017 18:09:11 +0000 Received: by vps-vb.mhejs.net with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.87) (envelope-from ) id 1cRjny-0000yL-MQ; Thu, 12 Jan 2017 19:08:54 +0100 From: "Maciej S. Szmigiero" To: tpmdd-devel@lists.sourceforge.net Message-ID: <08953fb6-c332-ef29-2614-6335570023be@maciej.szmigiero.name> Date: Thu, 12 Jan 2017 19:08:53 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 X-Headers-End: 1cRjoE-0005Pk-4M Cc: Christophe Ricard , linux-kernel Subject: [tpmdd-devel] [PATCH] tpm_tis: override reported C and D timeouts for Atmel 3203 X-BeenThere: tpmdd-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Tpm Device Driver maintainance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces@lists.sourceforge.net X-Virus-Scanned: ClamAV using ClamSMTP Since commit 1107d065fdf1 ("tpm_tis: Introduce intermediate layer for TPM access") Atmel 3203 TPM on ThinkPad X61S (TPM firmware version 13.9) no longer works. It turns out the initialization proceeds fine until we get and start using chip-reported timeouts - and the chip reports C and D timeouts of zero. Since these are clearly not long enough let's add an override for them to TPM TIS default values, just as we do for Atmel 3204. A and B timeouts are set to the same values as the chip normally reports. Signed-off-by: Maciej S. Szmigiero Fixes: 1107d065fdf1 ("tpm_tis: Introduce intermediate layer for TPM access") Cc: stable@vger.kernel.org --- drivers/char/tpm/tpm_tis_core.c | 3 +++ 1 file changed, 3 insertions(+) ------------------------------------------------------------------------------ Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today. http://sdm.link/xeonphi diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c index 7993678954a2..e42e5a6a3c2f 100644 --- a/drivers/char/tpm/tpm_tis_core.c +++ b/drivers/char/tpm/tpm_tis_core.c @@ -421,6 +421,9 @@ struct tis_vendor_timeout_override { }; static const struct tis_vendor_timeout_override vendor_timeout_overrides[] = { + /* Atmel 3203 */ + { 0x32031114, { (10*1000), (10*1000), + (TIS_SHORT_TIMEOUT*1000), (TIS_SHORT_TIMEOUT*1000) } }, /* Atmel 3204 */ { 0x32041114, { (TIS_SHORT_TIMEOUT*1000), (TIS_LONG_TIMEOUT*1000), (TIS_SHORT_TIMEOUT*1000), (TIS_SHORT_TIMEOUT*1000) } },