Message ID | 20221017235732.10145-4-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 y7csp1696083wrs; Mon, 17 Oct 2022 16:59:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7dBFxzFx6ghBmscO/faOG45/AKjOdpImOihVKa5SHjz8MwE6//LYDbQhmyBM57NWO4Ug4/ X-Received: by 2002:aa7:d38f:0:b0:458:8d32:d642 with SMTP id x15-20020aa7d38f000000b004588d32d642mr186592edq.208.1666051148543; Mon, 17 Oct 2022 16:59:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666051148; cv=none; d=google.com; s=arc-20160816; b=lTbHi5gj5Ka8XbWEHeGUYkCSTcB+tb4RNHRkRnmvgTn5jrXjHElDoZUp68Hk5zZZ4e Bv514SU/R1+5Xp0KnPrlsG0isXUjKtRUQ5Wxyxwc0BoOwGOlBeHZ4Zwu3QapVOh2bMSC yfc8Ff/cgqUQ3j7JZy3p/6vesFUKbJI/+7lmdloQ3yk/7rKFWCKCZe2idiUycdRQbgQX Y7pOMGTknkS2YGqJpPi/P03VEzI9hI2FN2l8+RuNJjAYoBa0ZEzPKj0P3GS4I0uHSpAM d3xoDsS+RS8d00Budfqjofd8t7dhZU3VcaJSEbfPgX8EKBZqs+5DJNR4oqJOnuyyDpBu bulg== 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=vmr8i0HILdqGMwVhgOxfm//3j+C4M5iWtBnT+hrsrRw=; b=tWCaRfaqsRdm/soEkWlPtjjtHUboa0kaK/Qaw0r1mvxj1hB81sWRmeO4Bh9ie1j9BQ iUNKnRobb8+qJDJ02W+cl7g0juph2UM9RTBCcM6rkGChII/qIAsoXSSzLxSIAoHXwqdk Vf19x45fEyCBwOKheFeQBIJTWNTzyq/xUksDIruFkAk+v+3RIDemJPr9GrOhqYJcFISr B/HRdqEeBaITay9yiOuWEM7a/Z4qiDc4g1XYOdI/48nEtP0DdBeBajqFCnd8YULYBHHX FZhc+iaZGuCsGcpexSYOuWvHi4manAF4l7b97TM3jHZk42HdpVeGQpyPwgVPGlbyqHun OSpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=UGR6R5tt; 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 y19-20020a1709064b1300b007879808e995si8613309eju.55.2022.10.17.16.58.42; Mon, 17 Oct 2022 16:59:08 -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=UGR6R5tt; 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 S230152AbiJQX6O (ORCPT <rfc822;kernel.ruili@gmail.com> + 99 others); Mon, 17 Oct 2022 19:58:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229828AbiJQX6M (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 17 Oct 2022 19:58:12 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B94F87E320; Mon, 17 Oct 2022 16:58:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1666051071; bh=vmr8i0HILdqGMwVhgOxfm//3j+C4M5iWtBnT+hrsrRw=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=UGR6R5tth0NiE2sA+sAhH8DeYrTP+DQD34wTB2Wlw0RCmkXhFI6No+HlWROdxyAeP PEYttZNttt5RXA/1U8R/o99TEuYgGKoDjji0pZT2CdQDzKFTu/VR+0BksmmQtzCKOl ijJVnIpnkVNup3ylMPgX4aapOK4wrjV1iZ9YyZcQ= 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 1Mwfac-1p4jAL1OIc-00yD3U; Tue, 18 Oct 2022 01:57:51 +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 03/11] tpm, tpm_tis: Disable interrupts if tpm_tis_probe_irq() failed Date: Tue, 18 Oct 2022 01:57:24 +0200 Message-Id: <20221017235732.10145-4-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:hwsqVwRGmzxbK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BqJoUGYSMxAOTwd1lEd/niN+TQ+JiIRSrd2/iaw13NGINwPVEG1VJyNXtkzt72 vzR9EC/kYYRrFzirzLLqDzFz8C8wd1TaFMk/nWwe8AMZ76Xfl+g8OXeRcm8owVHoiWFuaXbTF oK424Mo21Z1Bj6vLUD2IP+rRZf7CtpWUM7HInGsXv9wlB2v14QJifKNPWbeBa+LOratVtBQBE /44+wpUGmGnqF1ryjNWKKa6Mzf9sYVrNA08uckZO7Bk6PcHIX4UgOarWUsQ0HIINgqoLUMSYD znNxcTzI6ma5S51w5TJNQCOlU/SPkdn/2r4fJuqWukdOv77gRPWNA14qjm6bvao0bNCq2Lbso 1mw38xRtG6puqwTzmI+LseVvPlw0hSdrx6NKN+cYWgBQv0FHPQfimUDL/sNLJaWNH1HSkNEoq it3YMPXgXKnetGD4DQEuYeX9Ndhepk6ssBIQSkIjoysdAYXavcJdPxFGIxKftwW5qG+gxWWXY 1Y2+RHUAd9VgSZNLploXaWMYPWrbaEASLU1UnT147svmsirifjx0TxiouQuqskzROt+r4hJjh +aIR0xtkhmhjlVYfCAv60IkDYHYOyt9H3zmMAc4RNsqamNeXVyxJgS22cFqlHzBp5/bbKlKBw maOiSmc5D+TQit/tBaPkjj5r8TH+OgbTLrTMW1N6fAq2Alt6jyfEhq3HBliJHChs9lcwYWu4M ntXcDj552AgAwEiWwgLE88aUeTllycuX5qlAYqk1UBL4t 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?1746981249167983803?= X-GMAIL-MSGID: =?utf-8?q?1746981249167983803?= |
Series |
TPM IRQ fixes
|
|
Commit Message
Lino Sanfilippo
Oct. 17, 2022, 11:57 p.m. UTC
From: Lino Sanfilippo <l.sanfilippo@kunbus.com> Both functions tpm_tis_probe_irq_single() and tpm_tis_probe_irq() may setup the interrupts and then return with an error. This case is indicated by a missing TPM_CHIP_FLAG_IRQ flag in chip->flags. Currently the interrupt setup is only undone if tpm_tis_probe_irq_single() fails. Undo the setup also if tpm_tis_probe_irq() fails. Signed-off-by: Lino Sanfilippo <l.sanfilippo@kunbus.com> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org> Tested-by: Michael Niewöhner <linux@mniewoehner.de> --- drivers/char/tpm/tpm_tis_core.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c index d2c9c9d76893..603b82ca56da 100644 --- a/drivers/char/tpm/tpm_tis_core.c +++ b/drivers/char/tpm/tpm_tis_core.c @@ -1091,21 +1091,21 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq, goto out_err; } - if (irq) { + if (irq) tpm_tis_probe_irq_single(chip, intmask, IRQF_SHARED, irq); - if (!(chip->flags & TPM_CHIP_FLAG_IRQ)) { - dev_err(&chip->dev, FW_BUG + else + tpm_tis_probe_irq(chip, intmask); + + if (!(chip->flags & TPM_CHIP_FLAG_IRQ)) { + dev_err(&chip->dev, FW_BUG "TPM interrupt not working, polling instead\n"); - rc = request_locality(chip, 0); - if (rc < 0) - goto out_err; - disable_interrupts(chip); - release_locality(chip, 0); - } - } else { - tpm_tis_probe_irq(chip, intmask); + rc = request_locality(chip, 0); + if (rc < 0) + goto out_err; + disable_interrupts(chip); + release_locality(chip, 0); } }