Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1907577pxu; Tue, 24 Nov 2020 11:46:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJw4jXb3c4TqV/hfivbkFv9rtJyxg/NBx4xrYDHl9/wNK9exPN0afC+zs1Mzjyl8ZomMob5t X-Received: by 2002:a17:906:3958:: with SMTP id g24mr13166eje.360.1606247180702; Tue, 24 Nov 2020 11:46:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606247180; cv=none; d=google.com; s=arc-20160816; b=EzlOuoLAP1ntahbI3XProIyg30E361AWMIxfqpC9DkhQerDs/+C8cmpvjhin+nim9D r3pz6MpNTe2DlFJIIJEa8YzCFMx0FwEFWKbbzUzblen6tSLKY2XObUmUEoscPV0X4ebL 45+M5P5tO3Yiug4qlF5wqjJZFWe6jB/809k+YdMmZunuy+4/5juRduTUlatCAIdN5fBX Y/BRF965nMmiRE/ww+pVhYykowikPkB5KPgyyIjObDSvc1lVgb2IxO9RmaQR8u6KW+to fhuw0mPB8FHB/AQ+amGn6+whQUx+8idFkileUeJuqx7WjLR/mGHyIzojzMXXpUKmOjKt Iw6w== 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=ZuZ2GthS/a4bVzB0fUU7zxdgEX/kV7/r5trAztKxsjY=; b=lAJiwYBN5xPTOH5dNBRlC5NVrg/nZM/OB/jHgf36gIONLOrZmo5tqskiYjnIOgbJ8/ 1iGZuyhOeMM9LWSANiQrQDk84i2jDyiv9cgJMeBxDuhIonAhihMofB44r3+bKZXUMJy/ bWNhX3/JX7TVWLtBu3dmlJkMbcTqq1lKOcg/mD0iZ8NcCeYnXAkRttRpc9XKizdthVA+ LhPoqlS0dII2dcR8My6Am3sr43+MS6CGJ2NIGeeaRG5eutoI7IzK+KPmK4+Qp/dfrTev 2MOaaePXTO4ySLzckL2Jf3ySolpRY5pVBF74S4hVy0+WtOygMEvxsTVE8xWLyEAienyw /xpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZIT7cn76; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e4si9082925ejq.356.2020.11.24.11.45.56; Tue, 24 Nov 2020 11:46:20 -0800 (PST) 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=pass header.i=@kernel.org header.s=default header.b=ZIT7cn76; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726729AbgKXD1c (ORCPT + 99 others); Mon, 23 Nov 2020 22:27:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:41418 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725797AbgKXD1b (ORCPT ); Mon, 23 Nov 2020 22:27:31 -0500 Received: from kernel.org (83-245-197-237.elisa-laajakaista.fi [83.245.197.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DC7B22085B; Tue, 24 Nov 2020 03:27:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606188450; bh=A43AcvWtl9yn3Mqy1szP65o8arQG3n6ceO3nkU7wnVw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZIT7cn764NDrv4bccHCMWduqtRaAn9GoUw1Jfz6O5fjLGhOVwJts/fWyQZEngyhqp 6Hk8v7Y4DuTB9HEJQbWPBPYps817fUEIud9z0G8f0egoIn05mo+FHtnmyLOYGik6av fMVwuJTM2xmI9cX4hAJSjqJcceU6G2Jp3mSykLVQ= Date: Tue, 24 Nov 2020 05:27:25 +0200 From: Jarkko Sakkinen To: Hans de Goede Cc: Jerry Snitselaar , Matthew Garrett , linux-integrity , Linux Kernel Mailing List , Peter Huewe , Jason Gunthorpe , James Bottomley Subject: Re: [PATCH] tpm_tis: Disable interrupts on ThinkPad T490s Message-ID: <20201124032725.GB40007@kernel.org> References: <20201015214430.17937-1-jsnitsel@redhat.com> <87d009c0pn.fsf@redhat.com> <77498b10-cf2c-690b-8dad-78cbd61712ba@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <77498b10-cf2c-690b-8dad-78cbd61712ba@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 19, 2020 at 03:42:35PM +0100, Hans de Goede wrote: > Hi, > > On 11/19/20 7:36 AM, Jerry Snitselaar wrote: > > > > Matthew Garrett @ 2020-10-15 15:39 MST: > > > >> On Thu, Oct 15, 2020 at 2:44 PM 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. > >> > >> I think an implication of this is that systems haven't been > >> well-tested with interrupts enabled. In general when we've found a > >> firmware issue in one place it ends up happening elsewhere as well, so > >> it wouldn't surprise me if there are other machines that will also be > >> unhappy with interrupts enabled. Would it be possible to automatically > >> detect this case (eg, if we get more than a certain number of > >> interrupts in a certain timeframe immediately after enabling the > >> interrupt) and automatically fall back to polling in that case? It > >> would also mean that users with fixed firmware wouldn't need to pass a > >> parameter. > > > > I believe Matthew is correct here. I found another system today > > with completely different vendor for both the system and the tpm chip. > > In addition another Lenovo model, the L490, has the issue. > > > > This initial attempt at a solution like Matthew suggested works on > > the system I found today, but I imagine it is all sorts of wrong. > > In the 2 systems where I've seen it, there are about 100000 interrupts > > in around 1.5 seconds, and then the irq code shuts down the interrupt > > because they aren't being handled. > > Is that with your patch? The IRQ should be silenced as soon as > devm_free_irq(chip->dev.parent, priv->irq, chip); is called. > > Depending on if we can get your storm-detection to work or not, > we might also choose to just never try to use the IRQ (at least on > x86 systems). AFAIK the TPM is never used for high-throughput stuff > so the polling overhead should not be a big deal (and I'm getting the feeling > that Windows always polls). > > Regards, > > Hans Yeah, this is what I've been wondering for a while. Why could not we just strip off IRQ code? Why does it matter? /Jarkko