Message ID | 20221017235732.10145-12-LinoSanfilippo@gmx.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1699966wrs; Mon, 17 Oct 2022 17:09:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5PgmlyZ3oEJrMVRFTqBH0IQ4Ainy7jRZWZtIze+gVEuFuUXxrsBc/5aEnBiIc22T4kGZBQ X-Received: by 2002:a17:907:1c08:b0:78d:b6f5:26b7 with SMTP id nc8-20020a1709071c0800b0078db6f526b7mr213390ejc.678.1666051795218; Mon, 17 Oct 2022 17:09:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666051795; cv=none; d=google.com; s=arc-20160816; b=05H53HGT+YvzwzIJAsz7S/l6FKSeTMnmaD2k2JTFVz7IjAFjh3DxD5YtImOYzwCksu kF08mtaK1Iq4C4pxofySr2OdUl/BzcHAJJkEysxT8Y2gPzXiFsgrdz+aTu4x29YIJ9Kq uUTjbq2LwDuESj2NH58nCG6I33/9njkDLWnrbECdXm++5S41tj/nxUhjePGv94NBPkaN wZV7C1sNBjkcP2ZakD56dX0U0XLiuk8dw6QY6DsIMVbLMTVQmOMoMgzh0if+SQWwH7Ax JH6QrdwflZtbEEp7Q2nZJFJC0lFHhXpWonW/jD3EyKaUboiYl29Ny7ZjOlHV5yFCUTrP TnLw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=buEw+w1lPaY9DnLnvIwHNA83JT8Bq6RdLmvLWuRAigo=; b=n8m+PDxEpzgNXnIkbZi2hpkRJBa6wq6f9qoqWoaV8R6AvR28qfnEZnk+CrF8qA5zxv /DwdBhoowOWxFxO8LhrF78hEcaPwNFwwEH7uNH055nrbEhXK2gbutoMcBQxSnabyooZk njZDKaykSIAvz/0bVTz16QHiYJXtel45fm24fNK9ZKjzbO+ZlX70EJ2uJCwRmntdN5Ys 1ySJQSlUdO17+WBw52VWdUVYrjBIBgzj6zlnYenNN2qp9cuH+XYGifzjAvvtl5fJbthY elfOFSaEnneS7hNwuh28OoeGCn4dJne+B4ggOJSoRBML0BF1nmln7YrN4rNxUxK1hPRo 5XDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=C1uKCl14; 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=gmx.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb26-20020a1709077e9a00b0078db3762061si10329588ejc.439.2022.10.17.17.09.29; Mon, 17 Oct 2022 17:09:55 -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=pass header.i=@gmx.net header.s=badeba3b8450 header.b=C1uKCl14; 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=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231339AbiJQX6v (ORCPT <rfc822;kernel.ruili@gmail.com> + 99 others); Mon, 17 Oct 2022 19:58:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231173AbiJQX6T (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 17 Oct 2022 19:58:19 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FDC586802; Mon, 17 Oct 2022 16:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1666051074; bh=buEw+w1lPaY9DnLnvIwHNA83JT8Bq6RdLmvLWuRAigo=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=C1uKCl14AdWDIjY1KVavFgtxvfuBAr1j1iTRRE/BySwSCXiv6Znp7HDjevv+52ZID L1oHKz2kXBovl1q6qaBsK9Sw+91gJEssdVR4zM8qDq+nDiG7aiigu6TWCIsjcsNbNQ J/E5jgQvsUCswnLf0b4ztRBa8Q1kZMVVMcRT4TXk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from Venus.speedport.ip ([84.162.5.241]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MbivG-1pGsbn48pq-00dDlQ; Tue, 18 Oct 2022 01:57:54 +0200 From: Lino Sanfilippo <LinoSanfilippo@gmx.de> To: peterhuewe@gmx.de, jarkko@kernel.org, jgg@ziepe.ca Cc: stefanb@linux.vnet.ibm.com, linux@mniewoehner.de, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, jandryuk@gmail.com, pmenzel@molgen.mpg.de, l.sanfilippo@kunbus.com, LinoSanfilippo@gmx.de, lukas@wunner.de, p.rosenberger@kunbus.com Subject: [PATCH v8 11/11] tpm, tpm_tis: Enable interrupt test Date: Tue, 18 Oct 2022 01:57:32 +0200 Message-Id: <20221017235732.10145-12-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221017235732.10145-1-LinoSanfilippo@gmx.de> References: <20221017235732.10145-1-LinoSanfilippo@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:G/UrceEJMQh7OfbfZywk0mbMyJC0ez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A9jP6D1Rsjt7vGaWrNGULwJFCXTJiKu0hbEChlpEX/5I0S3y T/FYk3pMOybO4XTedIcgfV69Kn3iV4pH8Dm9G6FjJPmDNpXwlMOSGZblsFKcvOpbUiiBrSQOv aTJmSnrw7nDxR/9jTlvk88AYa/sWMlcSq0nwwr+fwFSSW78DpfPJUlHiS5D8aU/vNbESyx7xX GrTPV8WzEytkk3wOm3usd8513weXHEQqhfHh2YRIVM1lTs2yRfeZiz2+VDogMQH/FHBLKH55H HhiEFLv7ZDWjX+OQbfGdptMcqyQRdgRUu3kFjOBx7ZrbcYNEfT43K92mV709W5bQhhxOInP41 b7p1Nwh/ZsBYZ5ieM16+ck81WmukEzB0umQSlQLz6NcrmRq4JPZjK5plWGe75KECuxzNvFyRh XH4sMpp9trEufWmlshbGeXCKJt/0wdpgD9i+z5D0MW2Lr6KjByg9VqXtMhZhs6bOcIC1v5ZkF BO9tMQQLZDmvRXm6A7kSGT7LXt/ISdsMOgs1UgUT6oA9Y8/DQKRI/EuvTBd7BwdxqA+unFIeI m0XtwrFn2aBlLpqr5KOFKb6PeVUvg9Zxf/6+jfsIB6iD4EcSJ5zLehjsBL14BofJAnLEEZzvu VXExgh1HDTr/+FoqN9FpG7r3qg9eG7rwn3HW2/eJmB0vwy5kpsB3lthlMrpYdWpWhFirlKz0q NRG0ebXnmw9p8AJg404PCV7nGEN75uhCARkSFONWkKy6b X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS 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?1746981927120234489?= X-GMAIL-MSGID: =?utf-8?q?1746981927120234489?= |
Series |
TPM IRQ fixes
|
|
Commit Message
Lino Sanfilippo
Oct. 17, 2022, 11:57 p.m. UTC
From: Lino Sanfilippo <l.sanfilippo@kunbus.com> The test for interrupts in tpm_tis_send() is skipped if the flag TPM_CHIP_FLAG_IRQ is not set. Since the current code never sets the flag initially the test is never executed. Fix this by setting the flag in tpm_tis_gen_interrupt() right after interrupts have been enabled and before the test is executed. Signed-off-by: Lino Sanfilippo <l.sanfilippo@kunbus.com> Tested-by: Michael Niewöhner <linux@mniewoehner.de> --- drivers/char/tpm/tpm_tis_core.c | 5 +++++ 1 file changed, 5 insertions(+)
Comments
On Tue, Oct 18, 2022 at 01:57:32AM +0200, Lino Sanfilippo wrote: > From: Lino Sanfilippo <l.sanfilippo@kunbus.com> > > The test for interrupts in tpm_tis_send() is skipped if the flag > TPM_CHIP_FLAG_IRQ is not set. Since the current code never sets the flag > initially the test is never executed. > > Fix this by setting the flag in tpm_tis_gen_interrupt() right after > interrupts have been enabled and before the test is executed. > > Signed-off-by: Lino Sanfilippo <l.sanfilippo@kunbus.com> > Tested-by: Michael Niewöhner <linux@mniewoehner.de> > --- > drivers/char/tpm/tpm_tis_core.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c > index 42f628e52cde..9778860e1598 100644 > --- a/drivers/char/tpm/tpm_tis_core.c > +++ b/drivers/char/tpm/tpm_tis_core.c > @@ -793,11 +793,16 @@ static int tpm_tis_gen_interrupt(struct tpm_chip *chip) > if (ret < 0) > return ret; > > + chip->flags |= TPM_CHIP_FLAG_IRQ; > + > if (chip->flags & TPM_CHIP_FLAG_TPM2) > ret = tpm2_get_tpm_pt(chip, 0x100, &cap2, desc); > else > ret = tpm1_getcap(chip, TPM_CAP_PROP_TIS_TIMEOUT, &cap, desc, 0); > > + if (ret) > + chip->flags &= ~TPM_CHIP_FLAG_IRQ; > + > tpm_tis_release_locality(chip, 0); > > return ret; > -- > 2.36.1 > Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org> BR, Jarkko
On Tue, Oct 18, 2022 at 01:57:32AM +0200, Lino Sanfilippo wrote: > From: Lino Sanfilippo <l.sanfilippo@kunbus.com> > > The test for interrupts in tpm_tis_send() is skipped if the flag > TPM_CHIP_FLAG_IRQ is not set. Since the current code never sets the flag > initially the test is never executed. > > Fix this by setting the flag in tpm_tis_gen_interrupt() right after > interrupts have been enabled and before the test is executed. > > Signed-off-by: Lino Sanfilippo <l.sanfilippo@kunbus.com> > Tested-by: Michael Niewöhner <linux@mniewoehner.de> > --- > drivers/char/tpm/tpm_tis_core.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c > index 42f628e52cde..9778860e1598 100644 > --- a/drivers/char/tpm/tpm_tis_core.c > +++ b/drivers/char/tpm/tpm_tis_core.c > @@ -793,11 +793,16 @@ static int tpm_tis_gen_interrupt(struct tpm_chip *chip) > if (ret < 0) > return ret; > > + chip->flags |= TPM_CHIP_FLAG_IRQ; > + > if (chip->flags & TPM_CHIP_FLAG_TPM2) > ret = tpm2_get_tpm_pt(chip, 0x100, &cap2, desc); > else > ret = tpm1_getcap(chip, TPM_CAP_PROP_TIS_TIMEOUT, &cap, desc, 0); > > + if (ret) > + chip->flags &= ~TPM_CHIP_FLAG_IRQ; > + > tpm_tis_release_locality(chip, 0); > > return ret; > -- > 2.36.1 > Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org> BR, Jarkko
diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c index 42f628e52cde..9778860e1598 100644 --- a/drivers/char/tpm/tpm_tis_core.c +++ b/drivers/char/tpm/tpm_tis_core.c @@ -793,11 +793,16 @@ static int tpm_tis_gen_interrupt(struct tpm_chip *chip) if (ret < 0) return ret; + chip->flags |= TPM_CHIP_FLAG_IRQ; + if (chip->flags & TPM_CHIP_FLAG_TPM2) ret = tpm2_get_tpm_pt(chip, 0x100, &cap2, desc); else ret = tpm1_getcap(chip, TPM_CAP_PROP_TIS_TIMEOUT, &cap, desc, 0); + if (ret) + chip->flags &= ~TPM_CHIP_FLAG_IRQ; + tpm_tis_release_locality(chip, 0); return ret;