Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2859417pxb; Fri, 12 Feb 2021 03:19:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJzDUpJuobZDBDTbvDw68Cml/N2KkJYuVJ8ti/85pHMMKjFH8WHAWfhSC/nz3BnCcrseWpOw X-Received: by 2002:aa7:c418:: with SMTP id j24mr2804597edq.293.1613128783837; Fri, 12 Feb 2021 03:19:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613128783; cv=none; d=google.com; s=arc-20160816; b=CnKKJ7biQ1fOpf7sP69CT7grzu7+Pgjb+YDEC1ZDL8l8bw+kpbOHTcSZ2NFV0zk4BN OlfvGIj+6hbWVA5gHsE+CrAjOK/P3x57fSEFZafjvm/LguX8Jsi3p4uvuwHuZMxVgmUM EsJZfcbmSr37PCtsVjQYh0u3s0Pt2uOJM7UxOK+yceIYgaR6mlbESqghglwt99BxC0ga caBEzLzRC311n0qMv7H9i5Q6ekmEZk9cj6bY/JWr6RYzBe3n7nuxxv5DoDsEOKiDbQBV gpXmjFwatoibXyaJxtZFbYUADYKUiRJ/Larqfy4zdK5LA42FXCg7wZwrmz1Vtb5yBrKo 1rgQ== 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=90CarRj1h6yZpa+sN1FXOdUqDKTGSKn/SbHvHXKdbpY=; b=KimVxTawuSOF/GYkhoj5tcuywCDn1gGCDI9QZQ8ODcn8e/56l7krQS67nRLH4E/7rf 6u+S8jVsmTs5W34Veq3uqNFms1wsNe0bNycy9bEwJzkze9hZf6f4p+Rkmp22ybqdDXAr /ZDfgCzHAk84fXjFVth/6cQ4O7P4AuM2vyDqVRdCR7kmQtaYvlK9ljJqzL1fH68ja/uh zgWl5qLtK0dasB0fac7v20Fwxftdvms+88BfZzgwcQyB6APPJU7ZZscK03HbqAWFxK9c pEpEbWEbqMdEFd3sbzOnitU7rOh368NnqDjet/7xMbOsv52Z2C2/veOKQL0EqS7ZTvCN 7rgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Z1c5KuWm; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ce20si6005875edb.138.2021.02.12.03.19.19; Fri, 12 Feb 2021 03:19:43 -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=@linuxfoundation.org header.s=korg header.b=Z1c5KuWm; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229908AbhBLLR1 (ORCPT + 99 others); Fri, 12 Feb 2021 06:17:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:36550 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229718AbhBLLRY (ORCPT ); Fri, 12 Feb 2021 06:17:24 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 035AB60C41; Fri, 12 Feb 2021 11:16:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1613128603; bh=3cBFgSXoPKtGmZ39QTAsBzgIxi9rHYwIcUPbJHWDSvA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Z1c5KuWmeNAsE0v455SwagTiWRv6dcQYqpQH0ZEMdip5vz2k1HUhbGChnLuEdDHrv wEnadPY6ZiJlQkk7Wf55dpnB289oOo9AcsaYD5d46AuU1iu+PeT34hp711kSy2Gf5l T1g9RrkGsCgLWRZaNy2Uq8Aw2GnLGsClvE+/9vsk= Date: Fri, 12 Feb 2021 12:16:41 +0100 From: Greg KH To: Lukasz Majczak Cc: Guenter Roeck , Jarkko Sakkinen , James Bottomley , Tj , Dirk Gouders , Peter Huewe , Jason Gunthorpe , linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Radoslaw Biernacki , Marcin Wojtas , Alex Levin , upstream@semihalf.com Subject: Re: [PATCH v5] tpm_tis: Add missing tpm_request/relinquish_locality() calls Message-ID: References: <20210212110600.19216-1-lma@semihalf.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210212110600.19216-1-lma@semihalf.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 12, 2021 at 12:06:00PM +0100, Lukasz Majczak wrote: > There are missing calls to tpm_request_locality() before the calls to > the tpm_get_timeouts() and tpm_tis_probe_irq_single() - both functions > internally send commands to the tpm using tpm_tis_send_data() > which in turn, at the very beginning, calls the tpm_tis_status(). > This one tries to read TPM_STS register, what fails and propagates > this error upward. The read fails due to lack of acquired locality, > as it is described in > TCG PC Client Platform TPM Profile (PTP) Specification, > paragraph 6.1 FIFO Interface Locality Usage per Register, > Table 39 Register Behavior Based on Locality Setting for FIFO > - a read attempt to TPM_STS_x Registers returns 0xFF in case of lack > of locality. The described situation manifests itself with > the following warning trace: > > [ 4.324298] TPM returned invalid status > [ 4.324806] WARNING: CPU: 2 PID: 1 at drivers/char/tpm/tpm_tis_core.c:275 tpm_tis_status+0x86/0x8f > > Tested on Samsung Chromebook Pro (Caroline), TPM 1.2 (SLB 9670) > Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()") > > Signed-off-by: Lukasz Majczak > Reviewed-by: Guenter Roeck > --- This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read: https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html for how to do this properly.