Received: by 10.213.65.68 with SMTP id h4csp1557566imn; Thu, 15 Mar 2018 03:12:41 -0700 (PDT) X-Google-Smtp-Source: AG47ELuQ+0Rmc+CXmMPLyl7xEsnKeqohoynIUki9RfOOmR50xVg7viC3lIC8LHfflq1V/TOj4YuV X-Received: by 2002:a17:902:44c:: with SMTP id 70-v6mr7563718ple.354.1521108761760; Thu, 15 Mar 2018 03:12:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521108761; cv=none; d=google.com; s=arc-20160816; b=KKqomiNdc7sI8K+s/ldl3YJBYMf0q+3plIhz21Z6cUD12gSB7h31AjOxHuauli4gaM /QPowJYwIf0Jgr+AyXTa4j78OpL/SP2CisdlrZmlnmViGOhbrD1eKZJhSpd4bg0ilyTg b/fkeRyUhS0KVlf5mNo8PZBRLt54T2XR1CClUNtro02RTRJz7rCB06FnypTWWNbOaUu/ zsOIPkFd/ezMfJlaruToT9l/SbFgEDtRjGmjdGLPvRHgtVgy47aKOPjoB4GAqe+BgtAY x2HmAhCWpYz0stz86V0fb+1c52kKy/oiVvSruHgSeJHdWJdCdrHBsQ+p6/6S7TI2JHWX 1wKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=hUoCPKBMLjbUvERQ1CT9hZSuLieKPxe4DVIyFb0bdLU=; b=Y3n+m/CgkEPVBaVA2JbhoSsghCJO8k/tjm1hNGqDIxlFgCA2+hvHul5jD+84tsAQMo lhUQl06qox5ggL+uf8gqacglIYP8M5KwtJrpnDlaUgue1XELKqGXWggL770LvYvP0iKR ncwg4ruZJcLz+PTfbJWJAC9AS/d1RelUgXRtLQ4g02knWjK/oipy21I7kCbibS+0teLu HWC8EB69ui8UDvpfiD2jPrse2De3nDxtlRLaoA59KGt6KYCVggFqIbf2MeO3sHbZAptr 0mvkbt6ivv1XIwasOnArRAGYjYnssGZ48UGXHHxVkQ/ohXzCU309H9Nv4ve4e5dpaZP4 nYuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@endlessm-com.20150623.gappssmtp.com header.s=20150623 header.b=pOMMPrEz; 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 n34-v6si3759036pld.603.2018.03.15.03.12.27; Thu, 15 Mar 2018 03:12:41 -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; dkim=pass header.i=@endlessm-com.20150623.gappssmtp.com header.s=20150623 header.b=pOMMPrEz; 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 S1751762AbeCOKL1 (ORCPT + 99 others); Thu, 15 Mar 2018 06:11:27 -0400 Received: from mail-pg0-f44.google.com ([74.125.83.44]:45884 "EHLO mail-pg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751289AbeCOKLZ (ORCPT ); Thu, 15 Mar 2018 06:11:25 -0400 Received: by mail-pg0-f44.google.com with SMTP id s13so2567354pgn.12 for ; Thu, 15 Mar 2018 03:11:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=endlessm-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hUoCPKBMLjbUvERQ1CT9hZSuLieKPxe4DVIyFb0bdLU=; b=pOMMPrEzL5xtGHhjkMt3EMj0HrApeVhpfr0mZX2pMxVJuLAqLDK4LXn5jEF+6lwDrB I9FDxuYCnXlmvU44v4g5V43MT3haTGuG7bCUfx3YVrSUvTc23U96XlAVoRmp6GaOYFAC S4SdvEnZrXdPjkATxlF8x4M+MxW22Ruqd7XwSS1KFmoEnvSN0walEmXYh3JCkuE7OPrC 9U8dL4dcoExl9FunkAbbh/j5dFmHhlgzGfTbMGGzFCcoopKCbQOtEzDNt6Eg0V1Och0z 8OYRSsVpQoSupodTWlKSuTBS+a0Z3RNLbsh7gAOStxwkYmtkShXLzk1h9kAEGSrEU6Y7 mQKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hUoCPKBMLjbUvERQ1CT9hZSuLieKPxe4DVIyFb0bdLU=; b=uTQypB8aNNZPsQWRGkcV1OMDBZVUewttdlBjvnh1bkC1Zq04FjwIzy0tBo/EBITId+ X2WUillAAJIbAifgyVuLExsVGnFrToH8Lkzb2YgpWUbBv4aKHetFYhozk+qf6HRLZvjV DzUBn/o68HtnoJS0T/E+Xfs8YmNvozIAQGPX2OEIARNCRvXJEWxkzUkJEncQnUWnpY/C 3LTOS7P4nC7A5btBFQY4WEwjduF40Fh4UWcNl3ma6EqASI25LfyBd1IEQD1nsdm7LQuk ni6nkNWsjPvk4VffVYTq8B4RmptucUdTYyd1OLyasjIsbtjzTfRriofcZPdvzF2n08dM CRPg== X-Gm-Message-State: AElRT7E0ssCXMIO2J7IomtrajKZtTg9zf/lz9QvxtPw7zS1SGjrKKBnW d7UPfvb8g64Il0uaHpUpJ4Nzdg== X-Received: by 10.99.110.11 with SMTP id j11mr6356047pgc.294.1521108684938; Thu, 15 Mar 2018 03:11:24 -0700 (PDT) Received: from limbo.local (125-227-158-176.HINET-IP.hinet.net. [125.227.158.176]) by smtp.gmail.com with ESMTPSA id 12sm10687022pfr.108.2018.03.15.03.11.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Mar 2018 03:11:23 -0700 (PDT) From: Daniel Drake To: jarkko.sakkinen@linux.intel.com 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 Date: Thu, 15 Mar 2018 18:11:19 +0800 Message-Id: <20180315101119.30222-1-drake@endlessm.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180102144305.jjjss4nj5yviyiwd@linux.intel.com> References: <20180102144305.jjjss4nj5yviyiwd@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? 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