Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3418203ybc; Thu, 14 Nov 2019 08:50:32 -0800 (PST) X-Google-Smtp-Source: APXvYqy3WHrYouT5feu8rwWtCd49S4EiQB5nICWmfN/7cA43guBMIC69S1GrdoTVG6bdSgHb1vZM X-Received: by 2002:a50:9f65:: with SMTP id b92mr2373762edf.63.1573750231244; Thu, 14 Nov 2019 08:50:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573750231; cv=none; d=google.com; s=arc-20160816; b=gQd7WOWAquIkeUUK+LPDCbov31MVrEBF/YrCkbpz4v7MK2OtBs6xh6PlcQxNxmoQs+ SNnGE8ZdbHJ7oQ1bCt3+QbEb2/CEqbeZeYnqs67XGUsqTA1hyZTHR8ly5bxCJ/1HGqhG Pvxbgjray1wB/y87+lOkPKHhE9hLovzjCQZpjGQlI4qjkJcelQc1LEE7H1EBBeSEXvN0 upjQb/V7Gw4dxAdCcFEu32Kt0xgS9gsx2t+1P1yjh9G4UWbFDB4fQH5IQc2eIwNwK28i 5Ysez1PYerwwU3yR5+h3GUe5d5OR3Ns/SP7V9sm8KavW2wkabtdKOiOywmxQZ8Je97tn gQTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=heKUYweA/gxj2o9+P1cFwtiz4p8rrTaCCT1IhMHRzGE=; b=yGRZzUTB7xyhBzS/oigmCq/Eu9aIOm5rvI1aS4TuaidlGJy8K+zGgdVZyGLUZZsN+s TZ1a/+I9lfRuvfQ1YZABh6o0hUmyCmIU0VYOx0crc8ObsBWl0G+xV+nYONCqRSGNU3v+ Ei7I3n5s7DXZWQxVwnD3t5uDQ2KWqxSDR1M6o6wS5SaHFbZJDKanXkuWjJ7B+uBhH5F9 QxjKR/MsFOpvJQ2520c1jcn+5gDzcKg+keYuhEI4yv+6uwrC1oz9RRXsYPSGl+/rHLNC XYH6O+QOGM1SP7KtIuF3O31rlxJDFYiyC27AtOvOUjKzl2Q880ZhpdYySAldmCIDrZRB RKzg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id mj10si3726288ejb.7.2019.11.14.08.50.04; Thu, 14 Nov 2019 08:50:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726852AbfKNQsq (ORCPT + 99 others); Thu, 14 Nov 2019 11:48:46 -0500 Received: from mga01.intel.com ([192.55.52.88]:41737 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726214AbfKNQsq (ORCPT ); Thu, 14 Nov 2019 11:48:46 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Nov 2019 08:48:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,304,1569308400"; d="scan'208";a="379628441" Received: from pkamlakx-mobl1.gar.corp.intel.com (HELO localhost) ([10.252.10.73]) by orsmga005.jf.intel.com with ESMTP; 14 Nov 2019 08:48:43 -0800 Date: Thu, 14 Nov 2019 18:48:41 +0200 From: Jarkko Sakkinen To: Stefan Berger Cc: linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: question about setting TPM_CHIP_FLAG_IRQ in tpm_tis_core_init Message-ID: <20191114164841.GD9528@linux.intel.com> References: <20191112033637.kxotlhm6mtr5irvd@cantor> <20191112200703.GB11213@linux.intel.com> <20191112201734.sury5nd3cptkckgb@cantor> <50290fc8-4d22-3eb5-c930-079f8b819a8e@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <50290fc8-4d22-3eb5-c930-079f8b819a8e@linux.ibm.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 12, 2019 at 03:30:51PM -0500, Stefan Berger wrote: > On 11/12/19 3:17 PM, Jerry Snitselaar wrote: > > On Tue Nov 12 19, Jarkko Sakkinen wrote: > > > On Mon, Nov 11, 2019 at 08:36:37PM -0700, Jerry Snitselaar wrote: > > > > Question about 1ea32c83c699 ("tpm_tis_core: Set TPM_CHIP_FLAG_IRQ > > > > before probing for interrupts").? Doesn't tpm_tis_send set this flag, > > > > and setting it here in tpm_tis_core_init short circuits what > > > > tpm_tis_send was doing before? There is a bug report of an interrupt > > > > storm from a tpm on a t490s laptop with the Fedora 31 kernel (5.3), > > > > and I'm wondering if this change could cause that. Before they got the > > > > warning about interrupts not working, and using polling instead. > > > > > > Looks like it. Stefan? > > > > > > /Jarkko > > > > > > > Stefan is right about the condition check at the beginning of > > tpm_tis_send. > > > > ????if (!(chip->flags & TPM_CHIP_FLAG_IRQ) || priv->irq_tested) > > ??????? return tpm_tis_send_main(chip, buf, len); > > > > Before his change it would've gone straight to calling > > tpm_tis_send_main instead of jumping down and doing the irq test, due > > to the flag not being set. With his change it should now skip this > > tpm_tis_send_main call when tpm_tis_gen_interrupt is called, and then > > after that time through tpm_tis_send priv->irq_tested will be set, and > > the flag should be set as to whether or not irqs were working. > > > > I should hopefully have access to a t490s in a few days so I can look at > > it, > > and try to figure out what is happening. > > > I hope the t490s is an outlier. Give the patch I just posted a try. First I must be first that it is the best way to fix the bug. Also, it did not have fixes tag. /Jarkko