Received: by 10.213.65.68 with SMTP id h4csp401585imn; Fri, 16 Mar 2018 06:45:29 -0700 (PDT) X-Google-Smtp-Source: AG47ELsb0yIha6OwVhc4QkVQvAT7aq4OmeFcCyPd4/vxLFVVCrp9FBI1PoTCY0/Hksr9Bhf2p5zk X-Received: by 10.98.75.18 with SMTP id y18mr1661752pfa.124.1521207929824; Fri, 16 Mar 2018 06:45:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521207929; cv=none; d=google.com; s=arc-20160816; b=H16EfXDd90ctmaayvXqIfnVmwvqCEguI8ugpjFQUg+0JGhW11AyozhxBpNDJi8svME t6rbhrHQSNR4pkli8apLoa4u7xTh3LkTm8mgnSyo1NrT5XbRt260F/2hgbSUKrcVtvLm OmryZfmW2aPdjr+lDao3QcyeBCH+J5qFdMbQvEVrrVZbgeW6XeE3IFHsAPErcP9CU9ly UI6I3ktMInsSxtvdyRLFiMjOklJvlXxyP6eOPl4dD4tWDlZ61uNry4Mo3o1+rmxYFcBz 4TNZEJsc26w/Ms6glPV83IpWavoRyJG1LuvFtJUlXaYlBHxV0JcJFkraG2Sks8Ro/DoO yNAw== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=f6cNoZB1pHJOOnolkX83/ZEOkyr3/eR6aVV5maBFXcE=; b=Xap2KglrK6C/cuqLPZkuqV5PY/YgAtgbGlRD2kdCNwT1sLKo947rxJK74HrqttUI6M z2XRglxiDXQcogEGYkc3Zk53PB4vOta3bIHMQag3s26VWMvIyN5sVbxkESJKN36NquOB OpllLOw63IbE/wywPF9I8AW2NBhAR04SOiUqLLMHsCoBIDcbRGnOX67uvwbBOu12cstu Og4IPu1EMade5o8lNmw6e9pnQuBlKFxrMZ4PmZhFdDV494TbGTjb6MYyYA31vKQn4ExS DIvTSBBD8hngqvRhauOKXyaD4aJ0twA5WIfB/W9roNHoyPN7w6Iodef06lyRB36Eivvp uKtg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g2si5002767pgq.496.2018.03.16.06.45.14; Fri, 16 Mar 2018 06:45:29 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752873AbeCPNoW (ORCPT + 99 others); Fri, 16 Mar 2018 09:44:22 -0400 Received: from mga09.intel.com ([134.134.136.24]:63482 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750749AbeCPNoV (ORCPT ); Fri, 16 Mar 2018 09:44:21 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Mar 2018 06:44:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,316,1517904000"; d="scan'208";a="39512680" Received: from krogh-mobl.ger.corp.intel.com (HELO localhost) ([10.249.254.77]) by orsmga001.jf.intel.com with ESMTP; 16 Mar 2018 06:44:17 -0700 Date: Fri, 16 Mar 2018 15:44:17 +0200 From: Jarkko Sakkinen To: Daniel Drake Cc: chiu@endlessm.com, linux@endlessm.com, peterhuewe@gmx.de, jgg@ziepe.ca, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: TPM driver breaks S3 suspend Message-ID: <20180316134417.GB7387@linux.intel.com> References: <20180102144305.jjjss4nj5yviyiwd@linux.intel.com> <20180315101119.30222-1-drake@endlessm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180315101119.30222-1-drake@endlessm.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 15, 2018 at 06:11:19PM +0800, Daniel Drake wrote: > Hi, > > Sorry for the delayed response. > > Unfortunately we had to return the affected machine to the vendor > (Acer Veriton X4110G) although given we have a fairly complete > understanding of the problem, perhaps we can find and push a fix > anyway. > > Jarkko Sakkinen wrote: > > Can you try it on git://git.infradead.org/users/jjs/linux-tpmdd.git ? > > Maybe it is related to the LPC #CLKRUN issues we've had. > > I don't see anything relevant in that git tree, and it seems like > a distant issue from the CLKRUN changes that have been made. > > To recap, the first suspend works OK, and then the TPM shows shows the > following message on the first resume: > tpm tpm0: A TPM error(38) occured continue selftest > And error(38) is TPM_ERR_INVALID_POSTINIT which means the TPM is > not in the correct state. Then the following suspend will always > fail with the following messages. > tpm tpm0: Error (38) sending savestate before suspend > PM: Device 00:0b failed to suspend: error 38 > > tpm_crb is the driver here (not tpm2). > > This exact problem was also discussed in depth years ago at > https://lists.gt.net/linux/kernel/1358716 > > The patch that we used to avoid the issue is below. What do you think? I think this would work for me. /Jarkko > > Thanks > Daniel > > > --- > drivers/char/tpm/tpm-interface.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c > index 1d6729be4cd6..444ae2df4a06 100644 > --- a/drivers/char/tpm/tpm-interface.c > +++ b/drivers/char/tpm/tpm-interface.c > @@ -953,6 +953,10 @@ int tpm_do_selftest(struct tpm_chip *chip) > loops = jiffies_to_msecs(duration) / delay_msec; > > rc = tpm_continue_selftest(chip); > + if (rc == TPM_ERR_INVALID_POSTINIT) { > + chip->flags |= TPM_CHIP_FLAG_ALWAYS_POWERED; > + dev_info(&chip->dev, "TPM not ready (%d)\n", rc); > + } > /* This may fail if there was no TPM driver during a suspend/resume > * cycle; some may return 10 (BAD_ORDINAL), others 28 (FAILEDSELFTEST) > */ > -- > 2.14.1 >