Message ID | 20221120133134.28926-4-LinoSanfilippo@gmx.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1116259wrr; Sun, 20 Nov 2022 05:33:06 -0800 (PST) X-Google-Smtp-Source: AA0mqf76L34PPVkQN4Cm3v1cr/mykHa2YdeVOPd4v/p+tH9UeBugiyzvG1eMUUygEqPTncFrUmoY X-Received: by 2002:a63:e509:0:b0:474:4380:cca6 with SMTP id r9-20020a63e509000000b004744380cca6mr13984375pgh.229.1668951186347; Sun, 20 Nov 2022 05:33:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668951186; cv=none; d=google.com; s=arc-20160816; b=TEuX6ya9xJxMrmoNHe5mr+xX5YeYLIAxYgfJhcl490u5e81w2jXadYDxR5rmsf5neV 9H+brkQJReWsZAzbwaJhYpY9ZIWiWNFhOjJ1nip6lmtGYsYG94Fu0OR+wwa0AyKntY8m svwukJGL0dDEwaA9uyR/uDY1NaM2yyaEDpl+mcoR7wv0I47Oks93oK6ZuDqvypK+8fzX FLV5A48dvUD83m3cuRexBNjmTA8oRzYhCGfAf+E0CksmtcP5V+8O+Dnre6rBFBBN4A/m nAba6Q/YJlne3GEqDj9nnenKiDJR5glnxfrGsAvbKoabGRHrWvBfsTfX2OdxT3ewWI00 Dgtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vmr8i0HILdqGMwVhgOxfm//3j+C4M5iWtBnT+hrsrRw=; b=ZchDxHx2+yC77g69OQFes67aJq5I62Ng5uiH9ZqRGCm6PudZTVP7UgITSDdIL2dYIX QsdFp31Iy6MS3o9EqA8EV+E/soeGEnv2rZhEuBnKSw6Xd72I1Rl8+L1xtoRQOldkrkeq lOxhMCZD47UbPraaWEvMGb5lQmLx1/ffvah2QaPR9K/hzT1FZAxRyS2Pfo0DBKE7K6aE hPe8ACxEhUdGWstKP4TuYl5C7DX4pEdyoAFLFHeFoUz4D1o08NkgDcZHjvS8HYyKxRl6 SuRBrwHJCT8LW91Fdp/o0qnD2477cHWuvkJeg3ln99S1YroAFnhAN40PTsX1rN4wV8Tf Z9Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=TMP3jz03; 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=pass (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 f5-20020a17090a664500b0020a774637a6si12087159pjm.67.2022.11.20.05.32.52; Sun, 20 Nov 2022 05:33:06 -0800 (PST) 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.de header.s=s31663417 header.b=TMP3jz03; 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=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229598AbiKTNcZ (ORCPT <rfc822;yuanzuo1009@gmail.com> + 99 others); Sun, 20 Nov 2022 08:32:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbiKTNcX (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 20 Nov 2022 08:32:23 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB5D128E13; Sun, 20 Nov 2022 05:32:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1668951125; bh=vmr8i0HILdqGMwVhgOxfm//3j+C4M5iWtBnT+hrsrRw=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=TMP3jz03SMBORLJ1Osq4NJBLaCq5d0dw8jsLS1ocyJhst++3mlOZzBTmQBqZWjKWv Voxzb/CQ6RCoeo7qn6/J/9C71Ry/WZsSFaulE6y7ESVN793wcmhDVAj4MNXBq0AP9i qdDmg6LDUbciSZdaXi+No2YJpxW3W0J+D//iRMt8zl5D6anEc723u8h63zHiFywoUn L2a+9hPW0AOGMc4wG450lLEID/gHX41CCJoWqkV1f9yuO2eIHhJmZlZoyMAvXHHPhG 29ZrSrj2z8vJlqhCF83PQLt/o1ecqy2FmXV2Y4U5L8n/yy4g2SHxLP58OTgMWQ8r8+ SWTw8fUQKRfOA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from Venus.speedport.ip ([84.162.7.17]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MXp5a-1oQt8j2T4W-00Y6vT; Sun, 20 Nov 2022 14:32:05 +0100 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 v10 03/14] tpm, tpm_tis: Disable interrupts if tpm_tis_probe_irq() failed Date: Sun, 20 Nov 2022 14:31:23 +0100 Message-Id: <20221120133134.28926-4-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221120133134.28926-1-LinoSanfilippo@gmx.de> References: <20221120133134.28926-1-LinoSanfilippo@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:b4C2M5Qz3awQq0TkuQ6vgiwoMtTbqIlRfmnv0OiMblSzZLZq228 BaaIfCHUp0oCYSs1lVBZoDmGSQvGKfk9Znbbm1oKwMdK2GDQaSlNOQZOsHVfh1BDxtrFT+k Yi6UqX2Us0VDNI6jgP4INwB8nW5Yb4JMr6X+4AO4MkeXetbnwqeuafOMSrROsMP/or/mK8t xuz7RZR61pEoZ12pTwE7A== UI-OutboundReport: notjunk:1;M01:P0:Z7y9UfKX6mM=;Q1Umg7DU5Dvyq+vxVLBm7PMycSI L2FyUFkk5FKNJrGCKp5FvID1bZEq0odl/FRjq0YEwP3L4dQQovH6krb1gCk14wDVhiVK4wJNu a8HELXz+JRZ512cQkSVNSAMkAcspVnucQY0pqK6jta2zxSIGp34sKkK/77stXgNHYbWwRdS6T fbW6ZWy7y7eaWYE5Ts3a9fFietpRoed7fxzdomjClJsP1RTUxJpMezu95k3UnsQjc4RFqZixf w9f/KP6fAWomT6HBgYx1CxSasp8jOgIZN7wUDOpRy3TUF+wUSGVX/ldKJKNtRJDFI82D1haMl syvZxABa8z0D+R6j3tpKL5VAmrlPShNx7y9JSaehAikJYGvLqnB+ezSLxGHBrrfZXPvMVmbj9 UeJ3OB/DQe2SLkLvX9noAAf5G9K3tOSXyB+YrgdRRF6DJ6NfK0sI+4AjYgOFgsxUil7UFky1a 687Ll/PTJXIfWnCJHh5wVC3GBhuU7ydCH9JuGT2PA/X+OtW1MYLORZKwWFEk1YgPQCCMTI2Kn /7oy/r4/IN8diVkGJ62JSEj6BhXqj7nNgMyFH2KHONxDMIm0Wk08mzEq/O3zEraaKB4daXJIP pmabEL0l3tts7IFCzaqBg65iFjtxDe8nOQvXtEEjU9tilCSCcc4mWmn8q9UIB1evQIFi55LM2 pohbrFj958CkB1EG9ZoRFwMFgp3W/yPhknNFV5JGKAq6cz0xSfk4Spd8EqUEAZ38kuycZT9nN y7VCtKo9PfT6zU9MUBbqfSWH1g0vsQQd2g4bk5xOZTkUtIfDhOn0R2d9TMfBEv5b3PXJDKtjw mLmZ2KSzWJRmgVpe87AAWYJNgLzkx7jXTU4hwvV+iDQ6wZAXBbkH3JHcC7up42Lggmn/r1Ec8 VoWJ8eq03qGNaAmXmXPCWlcslbajAJEYMIO4NC4UlCpljM7flBilgxD+o/HwV4ZgGnWEuC5x1 GnvWiA== X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,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?1750022159199195107?= X-GMAIL-MSGID: =?utf-8?q?1750022159199195107?= |
Series |
TPM IRQ fixes
|
|
Commit Message
Lino Sanfilippo
Nov. 20, 2022, 1:31 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); } }