Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1240977ybl; Wed, 18 Dec 2019 15:07:48 -0800 (PST) X-Google-Smtp-Source: APXvYqz4IWYm6T5f+AQGcrCpwgDBGAxfitlE/TRqi8FsKZfp478d7oWYHSDASZu9xBYhode2sYA7 X-Received: by 2002:a9d:66c1:: with SMTP id t1mr4492678otm.73.1576710468728; Wed, 18 Dec 2019 15:07:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576710468; cv=none; d=google.com; s=arc-20160816; b=RNLcOwB/YxW0ALOmOZMUHNQxNXfrtGkuvdh1+3bCyqZo7pUC94B4CoLdhNMSIvLK5F LTQxotPYG6+3/kiua169O+ebIfI02jDee1yFEpyRzIGqkCclKpPX1Z23Odh92dWxRjUT gyzAZosCzo5mPyzONilM+QItkBcAgOk9ZbdRyrgKyS8tgvd9yCOBCUhNXVMj1NPPMxdS NApyPviVqnKKkS/nPTHaAYuqPm+4pVc3xUO81TKvXDvWCwxO3nIvR4crrYpeXS6rsLxP pCSs4Xbj4exMeCLKVbxRzszsBvuMVNtjxr6TeL2u9AuPfJW5k1h9hehuvyjkPSN1K78n I92w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:organization:references:in-reply-to:date:cc:to:from :subject:message-id; bh=p/+wT64JHQ6fMPOd8x2Htww8tRLFl8o+96EP1Ac6R+o=; b=mJnyvv14zgcnkoY27uaQ/bLVmTroRAxojBTlVsENX8AdvZS/gSaNthA5lOgW9seyup 4+wQzFn6Dkdzyzi2ghgQCtDIJj23DR8pmO6MVac0tbXzif16dtsAghCudoOoSxvOlbbz na6vd3eNmsEAbqID1obwC9c8TDOZeNIwCI0huwXR2YemtlW6gliSb22eu3yRFpAdiXz5 gmvmLgwaf0ImjhXQ7IyXIkRoDjMKFOMaQ27Kcaz3rbL6AKCvvAgysJDEuu1oQTtB5qy9 aG1QsMzh533QDIaGpUqEj8TE8d9JoaU6M12eyYU+DN4nfOxAHe5TMuGDT60DvbUpzmof zv/g== 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 w4si2177216otj.148.2019.12.18.15.07.36; Wed, 18 Dec 2019 15:07:48 -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 S1726623AbfLRXGw (ORCPT + 99 others); Wed, 18 Dec 2019 18:06:52 -0500 Received: from mga06.intel.com ([134.134.136.31]:27557 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726518AbfLRXGw (ORCPT ); Wed, 18 Dec 2019 18:06:52 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Dec 2019 15:06:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,330,1571727600"; d="scan'208";a="240952181" Received: from jtreacy-mobl1.ger.corp.intel.com ([10.251.82.127]) by fmsmga004.fm.intel.com with ESMTP; 18 Dec 2019 15:06:47 -0800 Message-ID: <37f4ed0d6145dbe1e8724a5d05d0da82b593bf9c.camel@linux.intel.com> Subject: Re: [PATCH v2] tpm_tis: reserve chip for duration of tpm_tis_core_init From: Jarkko Sakkinen To: Jerry Snitselaar Cc: Dan Williams , Linux Kernel Mailing List , Christian Bundy , Peter Huewe , Jason Gunthorpe , Stefan Berger , stable , linux-integrity@vger.kernel.org Date: Thu, 19 Dec 2019 01:06:40 +0200 In-Reply-To: <20191217171844.huqlj5csr262zkkk@cantor> References: <20191211231758.22263-1-jsnitsel@redhat.com> <20191211235455.24424-1-jsnitsel@redhat.com> <5aef0fbe28ed23b963c53d61445b0bac6f108642.camel@linux.intel.com> <20191217020022.knh7uxt4pn77wk5m@cantor> <5d0763334def7d7ae1e7cf931ef9b14184dce238.camel@linux.intel.com> <20191217171844.huqlj5csr262zkkk@cantor> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.1-2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2019-12-17 at 10:18 -0700, Jerry Snitselaar wrote: > On Tue Dec 17 19, Jarkko Sakkinen wrote: > > On Mon, 2019-12-16 at 18:14 -0800, Dan Williams wrote: > > > On Mon, Dec 16, 2019 at 6:00 PM Jerry Snitselaar wrote: > > > > On Mon Dec 16 19, Dan Williams wrote: > > > > > On Mon, Dec 16, 2019 at 4:59 PM Jarkko Sakkinen > > > > > wrote: > > > > > > On Wed, 2019-12-11 at 16:54 -0700, Jerry Snitselaar wrote: > > > > > > > Instead of repeatedly calling tpm_chip_start/tpm_chip_stop when > > > > > > > issuing commands to the tpm during initialization, just reserve the > > > > > > > chip after wait_startup, and release it when we are ready to call > > > > > > > tpm_chip_register. > > > > > > > > > > > > > > Cc: Christian Bundy > > > > > > > Cc: Dan Williams > > > > > > > Cc: Peter Huewe > > > > > > > Cc: Jarkko Sakkinen > > > > > > > Cc: Jason Gunthorpe > > > > > > > Cc: Stefan Berger > > > > > > > Cc: stable@vger.kernel.org > > > > > > > Cc: linux-integrity@vger.kernel.org > > > > > > > Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()") > > > > > > > Fixes: 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's") > > > > > > > Signed-off-by: Jerry Snitselaar > > > > > > > > > > > > I pushed to my master with minor tweaks and added my tags. > > > > > > > > > > > > Please check before I put it to linux-next. > > > > > > > > > > I don't see it yet here: > > > > > > > > > > http://git.infradead.org/users/jjs/linux-tpmdd.git/shortlog/refs/heads/master > > > > > > > > > > However, I wanted to make sure you captured that this does *not* fix > > > > > the interrupt issue. I.e. make sure you remove the "Fixes: > > > > > 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")" > > > > > tag. > > > > > > > > > > With that said, are you going to include the revert of: > > > > > > > > > > 1ea32c83c699 tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before probing for interrupts > > > > > > > > Dan, with the above reverted do you still get the screaming interrupt? > > > > > > Yes, the screaming interrupt goes away, although it is replaced by > > > these messages when the driver starts: > > > > > > [ 3.725131] tpm_tis IFX0740:00: 2.0 TPM (device-id 0x1B, rev-id 16) > > > [ 3.725358] tpm tpm0: tpm_try_transmit: send(): error -5 > > > [ 3.725359] tpm tpm0: [Firmware Bug]: TPM interrupt not working, > > > polling instead > > > > > > If the choice is "error message + polled-mode" vs "pinning a cpu with > > > interrupts" I'd accept the former, but wanted Jarkko with his > > > maintainer hat to weigh in. > > > > > > Is there a simple sanity check I can run to see if the TPM is still > > > operational in this state? > > > > What about T490S? > > > > /Jarkko > > > > Hi Jarkko, I'm waiting to hear back from the t490s user, but I imagine > it still has the problem as well. > > Christian, were you able to try this patch and verify it still > resolves the issue you were having with the kernel failing to get the > timeouts and durations from the tpm? Including those reverts would be a bogus change at this point. The fix that I already applied obviously fixes an issue even if it does not fix all the issues. /Jarkko