Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp841901pxu; Fri, 4 Dec 2020 17:47:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJyDor58BCvNl7hZ8ZY4lr1NTaeZTKYgyKpH8u6wd/cq8p/ErqfN/N/6YTMEfOQ/IvsTqyhH X-Received: by 2002:a17:906:e082:: with SMTP id gh2mr9363977ejb.406.1607132879215; Fri, 04 Dec 2020 17:47:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607132879; cv=none; d=google.com; s=arc-20160816; b=t3HIBqZevFJr71uzqRXFe2EZIJ625rSSbFJOQ13A1H2drxqIsMsrXlkJTWTBR1rYMF LzQolfNBqKjcIoE0mqkcksiCI9BI8JDHtiXe9vYFRMDRSiK9qH+jrw2og1lQsakWGh1j UMB4xMNMhncW67POPm8H61Sy43b3d8Y2CDcFKjMxAxg05zlN9MQNDbQ9kYw+iCDn2ioG 0OPK61bmZqeQ7bEMBP7CdNy99YqTG5Fxf4tmYTttInA7gPV9hOf/jLefIDFYjXHovLzB hudjtBZzSQbC/BLNB5WmZXLTqSOKOE8zkhCiuDKbRZ1mDUJfLBuZMIZtssoVorcoPqfY SW7w== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=LW+4VRCw8R3F3WRgitjgSML8vOT8dg+Dh8HEUAO8kA4=; b=rVtQXojxdpglRU9MfZuYh0Y1YdTsGh/N9c57GnwS72oNRskr5a+6VroIb9xTjeUyfg BHSMBWwbNR5XwNYiy/Q65i2AHSCWv1YnyVzQ2hRIi+HYc5/wPmkSgc4WgU97yXsNy+Wl V9MpKFqhXOuH41McKVmYsyXx8MJs4FdKJloF6Kn6yH4LIX1uqK/FG55pU8KrA28ngF+A utT1Je4xh98/kvtVUcdpFIHuMEH1rBp0naakh1DfOGAw4nltd4yr9EnZNw7nmI/XnvG8 An3PFnc/xVhCaRPbTMnw0hytIj3OMfjNZawpjyTd7V8hkGtp5+uBeEW04cZv/SrqWKdV MG5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=W0OKCTNq; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c1si809562edm.144.2020.12.04.17.47.36; Fri, 04 Dec 2020 17:47:59 -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=@redhat.com header.s=mimecast20190719 header.b=W0OKCTNq; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730958AbgLEBpQ (ORCPT + 99 others); Fri, 4 Dec 2020 20:45:16 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56241 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727514AbgLEBpP (ORCPT ); Fri, 4 Dec 2020 20:45:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607132629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=LW+4VRCw8R3F3WRgitjgSML8vOT8dg+Dh8HEUAO8kA4=; b=W0OKCTNq7KGzu0ZLo7MCB4+jJ8N99EiX9JEoXJmykTZsvPP4BP69iRJBbOMdFLAqvHuW95 +ai63SBpSDahY1W5c4D4z8zfaZGtkeappsoctrFeSKVExmUJHaOEDUkRbBMbNW04P6dVcx q8qMy9jfR4Tck302mL3s8zzNxrnotNY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-101-85zLLKAcNpie_eVxFlDWIA-1; Fri, 04 Dec 2020 20:43:45 -0500 X-MC-Unique: 85zLLKAcNpie_eVxFlDWIA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2E6E0518E; Sat, 5 Dec 2020 01:43:43 +0000 (UTC) Received: from cantor.redhat.com (ovpn-114-119.phx2.redhat.com [10.3.114.119]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9787160936; Sat, 5 Dec 2020 01:43:41 +0000 (UTC) From: Jerry Snitselaar To: linux-kernel@vger.kernel.org Cc: linux-integrity@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Thomas Gleixner , Jani Nikula , Rodrigo Vivi , David Airlie , Daniel Vetter , Jarkko Sakkinen , Jason Gunthorpe , Peter Huewe , James Bottomley , Matthew Garrett , Hans de Goede Subject: [PATCH v3 0/4] tpm_tis: Detect interrupt storms Date: Fri, 4 Dec 2020 18:43:36 -0700 Message-Id: <20201205014340.148235-1-jsnitsel@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset is an attempt to try and catch tpm_tis devices that have interrupt storm issues, disable the interrupt, and use polling. In 2016 the tpm_tis interrupt code was accidently disabled, and polling was just being used. When we initially tried to enable interrupts again there were some reports of systems being hit with interrupt storms. It turned out that the ThinkPad T490s had misconfigured a gpio pin being used for the interrupt. The problem is more widespread though, with interrupt storms also being seen on other platforms and different TPM vendors. With the L490 the system hangs at tpm_tis initialization even with the detection code, so change the earlier detection code that used dmi to look for the T490s to instead look for the L490 and disable interrupts. Since kstat_irqs needs to be exported to allow building of tpm_tis as a module, I've included a patch to change the i915_pmu code to use kstat_irqs where before it was using its own version. If this isn't desired it can be dropped. I've been testing this on top of James' proposed patchset which re-enables interrupts for tpm_tis. With the patchsets applied it detects the problem on the T490s and on the Ice Lake development system where I found the issue. I have Lenovo verifying that the dmi detection code will now detect the L490 and avoid the hang it experiences. I'm also working on getting access to an L490 to see if I can figure out what the underlying issue is. Changes from v2: - Export kstat_irqs to allow building tpm_tis as a module. - Change i915_pmu.c to use kstat_irqs instead of it's own version count_interrupts. - Change include from linux/kernel_stat.h to linux/irq.h. - Change dmi checking code to now look for L490 instead of T490s. Changes from v1: - drop tpm_tis specific workqueue and use just system_w. Jerry Snitselaar (4): irq: export kstat_irqs drm/i915/pmu: Use kstat_irqs to get interrupt count tpm_tis: Disable interrupts if interrupt storm detected tpm_tis: Disable Interrupts on the ThinkPad L490 Cc: Thomas Gleixner Cc: Jani Nikula Cc: Rodrigo Vivi Cc: David Airlie Cc: Daniel Vetter Cc: intel-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Cc: Jarkko Sakkinen Cc: Jason Gunthorpe Cc: Peter Huewe Cc: James Bottomley Cc: Matthew Garrett Cc: Hans de Goede Cc: linux-integrity@vger.kernel.org drivers/char/tpm/tpm_tis.c | 4 ++-- drivers/char/tpm/tpm_tis_core.c | 27 +++++++++++++++++++++++++++ drivers/char/tpm/tpm_tis_core.h | 2 ++ drivers/gpu/drm/i915/i915_pmu.c | 18 +----------------- include/linux/irqdesc.h | 1 + kernel/irq/irqdesc.c | 1 + 6 files changed, 34 insertions(+), 19 deletions(-) -- 2.27.0