From patchwork Thu Aug 31 17:18:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Steffen X-Patchwork-Id: 9932591 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 B14D2602F0 for ; Thu, 31 Aug 2017 17:19:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9541C28A3C for ; Thu, 31 Aug 2017 17:19:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 89BF728A3E; Thu, 31 Aug 2017 17:19:55 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1605728A3C for ; Thu, 31 Aug 2017 17:19:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751879AbdHaRTL (ORCPT ); Thu, 31 Aug 2017 13:19:11 -0400 Received: from smtp11.infineon.com ([217.10.52.105]:19038 "EHLO smtp11.infineon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751872AbdHaRTI (ORCPT ); Thu, 31 Aug 2017 13:19:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infineon.com; i=@infineon.com; q=dns/txt; s=IFXMAIL; t=1504199948; x=1535735948; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=TWp/fYJlHHrardgC4wen6NJmCo4p1k37OqxvMuFxuls=; b=BtCJSwpyBdWuWI1Q4cQQVrrjkPQwBORWcRMWtyt0KQ7FVDlf16YfEmqc YYOWgvfCAnT7PInyXYc4lmRZNdEyxzt9beQI9G76B/tw3j2Hc1odZ/Vcp tTlbrT8hdR+3DWyh8PXhRWa5Mn7oBKCcKfvzYDkjdkncLxV2CYA64L5aW E=; X-SBRS: None Received: from unknown (HELO mucxv002.muc.infineon.com) ([172.23.11.17]) by smtp11.infineon.com with ESMTP/TLS/AES256-GCM-SHA384; 31 Aug 2017 19:19:07 +0200 Received: from MUCSE608.infineon.com (mucse608.infineon.com [172.23.7.109]) by mucxv002.muc.infineon.com (Postfix) with ESMTPS; Thu, 31 Aug 2017 19:19:06 +0200 (CEST) Received: from MUCSE603.infineon.com (172.23.7.104) by MUCSE608.infineon.com (172.23.7.109) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Thu, 31 Aug 2017 19:19:06 +0200 Received: from ABGN5CG4522MQD.eu.infineon.com (172.29.170.103) by MUCSE603.infineon.com (172.23.7.104) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Thu, 31 Aug 2017 19:19:06 +0200 From: Alexander Steffen To: , CC: , , Alexander Steffen Subject: [PATCH RESEND v2 1/3] tpm2-cmd: Trigger only missing self tests Date: Thu, 31 Aug 2017 19:18:56 +0200 Message-ID: <20170831171858.13252-2-Alexander.Steffen@infineon.com> X-Mailer: git-send-email 2.11.1.windows.1 In-Reply-To: <20170831171858.13252-1-Alexander.Steffen@infineon.com> References: <20170831171858.13252-1-Alexander.Steffen@infineon.com> MIME-Version: 1.0 X-Originating-IP: [172.29.170.103] X-ClientProxiedBy: MUCSE601.infineon.com (172.23.7.102) To MUCSE603.infineon.com (172.23.7.104) Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP tpm2_do_selftest is only used during initialization of the TPM to ensure that the device functions correctly. Therefore, it is sufficient to request only missing self tests (parameter full_test=0), not a reexecution of all self tests, as was done before. This allows for a faster execution of this command. Signed-off-by: Alexander Steffen Reviewed-by: Jarkko Sakkinen --- drivers/char/tpm/tpm2-cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm/tpm2-cmd.c index e1a41b7..8e940a5 100644 --- a/drivers/char/tpm/tpm2-cmd.c +++ b/drivers/char/tpm/tpm2-cmd.c @@ -865,7 +865,7 @@ static int tpm2_start_selftest(struct tpm_chip *chip, bool full) } /** - * tpm2_do_selftest() - run a full self test + * tpm2_do_selftest() - ensure that all self tests have passed * * @chip: TPM chip to use * @@ -886,7 +886,7 @@ static int tpm2_do_selftest(struct tpm_chip *chip) loops = jiffies_to_msecs(duration) / delay_msec; - rc = tpm2_start_selftest(chip, true); + rc = tpm2_start_selftest(chip, false); if (rc) return rc;