Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3053192pxu; Mon, 19 Oct 2020 02:38:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvBw1+uNq5mmzGgoSdHdrHESiztmWlpg8tOE7DFxrsSTX+1nvYxvnTuDMWu9ZYI3kBHRoM X-Received: by 2002:a17:906:1c50:: with SMTP id l16mr16063685ejg.144.1603100320814; Mon, 19 Oct 2020 02:38:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603100320; cv=none; d=google.com; s=arc-20160816; b=oWZSUSksvBeb1rwJlZ8fxBHyZfQYYTB5jncZSJwyZRrNzppci2xvu51UrXiujH2xOO h3cRNObop4J1+XZ63XHoc0r6prLmQ269QLorhrXEA+VLOYphSdLrVn1/S0tAPzVddNH0 J97Am2HgeA+2d3Nck3FlbfBEIVyWX+hmzXg7XOcJR13//rHruq2rED5Yr/CIK8yAYARx /LfrnE0+ymO8vaHtJ0MBmvLo0MOmiYAFZ3bwmtFa2fdBaHAdmCZZ8eQL3mx+Fceg++yW ZoELHsSfUoL9B5KHSXhiKKy0ppMaAH6NFJO39YQwPFFV7IA0/dEXziP2FfNlmERVwj8E z5Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=rwlD0i+Gji/DQfCWgJihttK1p3QsdOsw/Q0vx5uztvU=; b=Suv7uPJokH7XdMNtxHD+PeVguPU1U03jangBXhE9RUWQdM2T7qd5AtvGRgAIIG/CvP 8PbZ4Q+SFgaKi/DrMBQI3ALdzaRIk2SW2ZXIGn9a1BcfD7hmy8eGq8eA6W2PrCU2YlFs mIN/3TYeHNWwwqRlW0JYp+RiTDarPtFeXsIbNSqabKSNe4XxGhbezka3VoI58MpCzBfD U/vcVimN0LNbuXO8rDHqe46Uk8ikrZ2Srqf4Gp3kTX0rHk25WdQu4gsfTMGK638B9aW+ y6KgK5923uhV75wMDTWRaZ1ZSAcnj46ROAEac61nlC2PLo1rKuqoDF5MNHFp20hA2TEI c8fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kapsi.fi header.s=20161220 header.b=Lb3hFbiK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p2si7716533edm.265.2020.10.19.02.38.18; Mon, 19 Oct 2020 02:38:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@kapsi.fi header.s=20161220 header.b=Lb3hFbiK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727736AbgJRVLq (ORCPT + 99 others); Sun, 18 Oct 2020 17:11:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726656AbgJRVLq (ORCPT ); Sun, 18 Oct 2020 17:11:46 -0400 X-Greylist: delayed 125 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sun, 18 Oct 2020 14:11:45 PDT Received: from mail.kapsi.fi (mail.kapsi.fi [IPv6:2001:67c:1be8::25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9A45C061755; Sun, 18 Oct 2020 14:11:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kapsi.fi; s=20161220; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=rwlD0i+Gji/DQfCWgJihttK1p3QsdOsw/Q0vx5uztvU=; b=Lb3hFbiK2JW6hqjPMwPt7dpAFo X99d5Yc0bNqX+pmMiQAQz3Sqpr0n8dPLtP/shdnBS/X3BfFEW1jwSYu8yqcFsPJJbnwDkgNYrgC5h IUswxA+x9UPo0sqVlosKX3ggVmUjdTDmH9XXzXHXS+nlKe078OIn82LL/JPV7Uy+vlx7C+WbLNk34 Z2/ONHI199dCH9S8o84OWEA0vGv+xZOBR587K4RawVJ0FTvnFGDOzrLiv2jvd9XskG2H2AK2tROIm PGRnCtQ3VN9Ik2Hc7JnpuBkQyCcjkzUqoWSZ8zTNlVgWG0oQ4zPpWiYpy4SpYP3EtZsw2F6kDw0PR 3fdW8Dbg==; Received: from 83-245-197-237.elisa-laajakaista.fi ([83.245.197.237] helo=localhost) by mail.kapsi.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1kUFxw-0002fn-5e; Mon, 19 Oct 2020 00:11:44 +0300 Date: Mon, 19 Oct 2020 00:11:43 +0300 From: Jarkko Sakkinen To: Jerry Snitselaar Cc: linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, jarkko@kernel.org, Peter Huewe , Jason Gunthorpe , Hans de Goede , James Bottomley Subject: Re: [PATCH] tpm_tis: Disable interrupts on ThinkPad T490s Message-ID: <20201018211143.GC575510@kapsi.fi> References: <20201015214430.17937-1-jsnitsel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201015214430.17937-1-jsnitsel@redhat.com> X-SA-Exim-Connect-IP: 83.245.197.237 X-SA-Exim-Mail-From: jarkko.sakkinen@iki.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 15, 2020 at 02:44:30PM -0700, Jerry Snitselaar wrote: > There is a misconfiguration in the bios of the gpio pin used for the > interrupt in the T490s. When interrupts are enabled in the tpm_tis > driver code this results in an interrupt storm. This was initially > reported when we attempted to enable the interrupt code in the tpm_tis > driver, which previously wasn't setting a flag to enable it. Due to > the reports of the interrupt storm that code was reverted and we went back > to polling instead of using interrupts. Now that we know the T490s problem > is a firmware issue, add code to check if the system is a T490s and > disable interrupts if that is the case. This will allow us to enable > interrupts for everyone else. If the user has a fixed bios they can > force the enabling of interrupts with tpm_tis.interrupts=1 on the > kernel command line. > > Cc: jarkko@kernel.org > Cc: Peter Huewe > Cc: Jason Gunthorpe > Cc: Hans de Goede > Reviewed-by: James Bottomley > Signed-off-by: Jerry Snitselaar Reviewed-by: Jarkko Sakkinen I'll apply this and make it available in linux-next. /Jarkko > --- > drivers/char/tpm/tpm_tis.c | 29 +++++++++++++++++++++++++++-- > 1 file changed, 27 insertions(+), 2 deletions(-) > > diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c > index 0b214963539d..4ed6e660273a 100644 > --- a/drivers/char/tpm/tpm_tis.c > +++ b/drivers/char/tpm/tpm_tis.c > @@ -27,6 +27,7 @@ > #include > #include > #include > +#include > #include "tpm.h" > #include "tpm_tis_core.h" > > @@ -49,8 +50,8 @@ static inline struct tpm_tis_tcg_phy *to_tpm_tis_tcg_phy(struct tpm_tis_data *da > return container_of(data, struct tpm_tis_tcg_phy, priv); > } > > -static bool interrupts = true; > -module_param(interrupts, bool, 0444); > +static int interrupts = -1; > +module_param(interrupts, int, 0444); > MODULE_PARM_DESC(interrupts, "Enable interrupts"); > > static bool itpm; > @@ -63,6 +64,28 @@ module_param(force, bool, 0444); > MODULE_PARM_DESC(force, "Force device probe rather than using ACPI entry"); > #endif > > +static int tpm_tis_disable_irq(const struct dmi_system_id *d) > +{ > + if (interrupts == -1) { > + pr_notice("tpm_tis: %s detected: disabling interrupts.\n", d->ident); > + interrupts = 0; > + } > + > + return 0; > +} > + > +static const struct dmi_system_id tpm_tis_dmi_table[] = { > + { > + .callback = tpm_tis_disable_irq, > + .ident = "ThinkPad T490s", > + .matches = { > + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T490s"), > + }, > + }, > + {} > +}; > + > #if defined(CONFIG_PNP) && defined(CONFIG_ACPI) > static int has_hid(struct acpi_device *dev, const char *hid) > { > @@ -192,6 +215,8 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info) > int irq = -1; > int rc; > > + dmi_check_system(tpm_tis_dmi_table); > + > rc = check_acpi_tpm2(dev); > if (rc) > return rc; > -- > 2.28.0 > >