Message ID | 20230613180259.3525-1-Alexander.Steffen@infineon.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp741436vqr; Tue, 13 Jun 2023 11:16:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7ibLoEhPO+ou0KUw60KHeXz2YoPKTgYe5QdxJ03EROYdnPRDtDk2om/aHZ3Z9C+gfcjuP7 X-Received: by 2002:a05:6a20:6a0e:b0:10b:5ce1:beb9 with SMTP id p14-20020a056a206a0e00b0010b5ce1beb9mr15965091pzk.33.1686680183483; Tue, 13 Jun 2023 11:16:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686680183; cv=none; d=google.com; s=arc-20160816; b=IwSFFJShwBEh9KBGSYPKVfqzD4AVpm/RGpgpy2ME0xx7cK8N4Yp61jasRkPsbSa6fj 5pYiwP7ot6XEXaVeaWEtYHxVrDI+6eMKy1s3Ex5TsuoPw5rzWN2A4lTyZwWgFIvWutwY ZurwdLD1nTN3xL9/GyCSvr2IuzjlJZcfB8ZqbGfimejH/4cUDHtxrQuJVJh5uAK6VyxN ZhMO3xQUW/qBnsCWzqLAu+t5cLj5aGJNiH4MT9cVOKi118miiBlTfKgfKLwlCMFDss67 kLdzpkrzxwpho5mnOSh7lDWZ99TKQJh91F3rQ/h1BwQKECnBFOviQBo4Ax+OZuGaNG9I rpMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=+xvLO2aJU1wf73PQSPVITj4nHq9LThPocnruySh4mHo=; b=tshElp8ZMBEsdGZLHp9ljyhIDXbsbo8Fe3SkCA8rjgdl4OSReVMPfGb+Y4zaQsP/UZ coMeJ4yDc4cQylw/wHA29lJ4ahu9IcmShsljmqLlyBiOMSsddIQVhMkUscVTQEM9Xmr2 19vAbSQh9KoYwhzv+xf594mxjkJhBydLN8ygf+REXRXPcfvUCb1q88gKx35Oxdil0b1R ZxQH+J6M2+b2RSwpvCNxwLzDm1UenAdhmhWak3r2ebAbBZXYM/2zt/QbQmrKbNaop5Yt bRGz7KMBl/LLD2+1AmW9uI1DgTKeYiRSZhi+GYHulQbG1jnRJO2VShUaWk7nvn8qJvpk RsiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infineon.com header.s=IFXMAIL header.b=DHWv5aYU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=infineon.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z123-20020a633381000000b005303a26dbfbsi8750888pgz.728.2023.06.13.11.16.09; Tue, 13 Jun 2023 11:16:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@infineon.com header.s=IFXMAIL header.b=DHWv5aYU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=infineon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240059AbjFMSDU (ORCPT <rfc822;lekhanya01809@gmail.com> + 99 others); Tue, 13 Jun 2023 14:03:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232105AbjFMSDS (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 13 Jun 2023 14:03:18 -0400 Received: from smtp2.infineon.com (smtp2.infineon.com [IPv6:2a00:18f0:1e00:4::4]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 870C910F7; Tue, 13 Jun 2023 11:03:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infineon.com; i=@infineon.com; q=dns/txt; s=IFXMAIL; t=1686679398; x=1718215398; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=B4ZD5tbd5kcrG2mZGow9/hJKyOdGd/RWXV0OEPt+meg=; b=DHWv5aYUqUzTxjsZePzeSyauy59hOx+7/z+WVGvUgVYuW41WpfJec4Zo +hr6BbJUhn+uOnQDzsprzHYDLHN06dibAqagOAaEZr68da+zHUVP/vGne YZDrUWgrcSDozqe3gV/mqhW+HATHLBQ0I9EyG+lM99lTJAeF4fkqv5Upf A=; X-IronPort-AV: E=McAfee;i="6600,9927,10740"; a="41820519" X-IronPort-AV: E=Sophos;i="6.00,240,1681164000"; d="scan'208";a="41820519" Received: from unknown (HELO MUCSE822.infineon.com) ([172.23.29.53]) by smtp2.infineon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jun 2023 20:03:15 +0200 Received: from KLUSE818.infineon.com (172.28.156.171) by MUCSE822.infineon.com (172.23.29.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Tue, 13 Jun 2023 20:03:15 +0200 Received: from ISCNPC0VBFBX.infineon.com (10.161.6.196) by KLUSE818.infineon.com (172.28.156.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Tue, 13 Jun 2023 20:03:15 +0200 From: Alexander Steffen <Alexander.Steffen@infineon.com> To: <jarkko@kernel.org>, <linux-integrity@vger.kernel.org>, <linux-kernel@vger.kernel.org> CC: Alexander Steffen <Alexander.Steffen@infineon.com> Subject: [PATCH v3 0/4] Recovery from data transfer errors for tpm_tis Date: Tue, 13 Jun 2023 20:02:55 +0200 Message-ID: <20230613180259.3525-1-Alexander.Steffen@infineon.com> X-Mailer: git-send-email 2.28.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.161.6.196] X-ClientProxiedBy: MUCSE821.infineon.com (172.23.29.47) To KLUSE818.infineon.com (172.28.156.171) X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768612360351434681?= X-GMAIL-MSGID: =?utf-8?q?1768612360351434681?= |
Series |
Recovery from data transfer errors for tpm_tis
|
|
Message
Alexander Steffen
June 13, 2023, 6:02 p.m. UTC
Data transfer to/from hardware TPM devices is not always fully reliable. The existing driver code contains already many checks to detect corrupted data (e.g. unexpected register values, CRC failures, etc.) and usually returns EIO in such cases. This series adds automatic retries to the command/response transmission in tpm_tis_send/tpm_tis_recv, so that occasional communication errors do not cause the command execution to fail and the perceived reliability of the TPM device is increased. v3: * Rename tpm_tis_recv* functions * Other small cleanups that were suggested in comments v2: * Remove Change-Ids accidentially left in commit messages Alexander Steffen (4): tpm_tis: Explicitly check for error code tpm_tis: Move CRC check to generic send routine tpm_tis: Use responseRetry to recover from data transfer errors tpm_tis: Resend command to recover from data transfer errors drivers/char/tpm/tpm_tis_core.c | 69 ++++++++++++++++++++++++--------- drivers/char/tpm/tpm_tis_core.h | 1 + 2 files changed, 52 insertions(+), 18 deletions(-)