Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5590613imm; Tue, 12 Jun 2018 10:04:23 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI3otmRmxK0lvp2QNHeP5ClQMzyPuF7Up84c3uSQ3+MI08ibzQXarKvrMEGAuCC0EV+cclY X-Received: by 2002:a63:7f44:: with SMTP id p4-v6mr1044903pgn.416.1528823063429; Tue, 12 Jun 2018 10:04:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528823063; cv=none; d=google.com; s=arc-20160816; b=HYw0CdTQ2gek7rRyG0ITM07pRG/N64DEsqDcyYZ/+q1aQdSMlRc++bl+U7vtdLbA+f W2Kr7Z3RbFnXg5mw97EI9cWGzKdwZLxgqWWxzOwe+AC0wFhFyQIWkDulfhob6wWLO8DK DgR1131AOFOsjm1b4vBMrbBSX9IsSQRYfpNO/P9NT+BKPjQOuv2SK0bw81M1pMEzQsGn E0ul1ctrKf3uJon159lv29z8t/h/QekjA/D5HtpMuy/hgagVz7NP82FE/PGrXc8scAQV UY134BLmprohnSPJREFkeOWtpvPWzooYqoOYKHEHRhYpbcazn5dvMmEMKqCs81L4thNy hV9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=TbldPoJOq5azfm1NdxbloX+SQtE5wOLe/ESp1IyQWB0=; b=VjqjiBPG0xujJL0v54UHuV9ao1Q/7UDFMpEL7J3Lnm9u6p5ljqJ3g+Ujqkx5YTJ96Q kSpZABrvx7veZPrdpzCfmGXus2kYuCdnhAXOkU+YIcZ76ifqxbG1GofU7Muw8RLdgkfR e2XRAknEGul5D0mbf322NoINqaxSPv2z95AOGFtCPDIGwBiA2Gbm/ZL/EQsFS/dCG7ES i9QNWsf9SY3Xe+ek3Qf8zbJo9THfvoW1nYSdWItLP5smnmPysjybbELgPxwmOgYuWps1 fTsvpFkj6TCeBzqXTMgj2DdF0Qp1xAgIvCbgrn9LsHBBbufnIGmuPBQ3GGKlqeFRPtQt mfzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iB8RGGgE; 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 1-v6si532403plo.20.2018.06.12.10.04.09; Tue, 12 Jun 2018 10:04:23 -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=@kernel.org header.s=default header.b=iB8RGGgE; 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 S934579AbeFLRB1 (ORCPT + 99 others); Tue, 12 Jun 2018 13:01:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:51264 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934815AbeFLQxL (ORCPT ); Tue, 12 Jun 2018 12:53:11 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 85BF3208B7; Tue, 12 Jun 2018 16:53:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1528822391; bh=WKYv9xzYbwrj1+B7dsmjwf0KhkTxO3n3XmIssv37FPY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iB8RGGgEXdrasHLbMkRfgZx0d54NBq21OUSfUfYeAuWyI0ufBVGjNKE29Ze6xJDTL PPjlIbisc1Vw0RzZQhINlZ3MhRk4danJHWTlJjt+ZY6B/lUiWhbeaMOv997KcKh4Dc f+mLnVvv9iD8/kVQYuBfOrvDNQE6ZSiYKVJiYqaM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chris Chiu , Daniel Drake , Jarkko Sakkinen Subject: [PATCH 4.4 02/24] tpm: self test failure should not cause suspend to fail Date: Tue, 12 Jun 2018 18:51:46 +0200 Message-Id: <20180612164816.700938132@linuxfoundation.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612164816.587001852@linuxfoundation.org> References: <20180612164816.587001852@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Chris Chiu commit 0803d7befa15cab5717d667a97a66214d2a4c083 upstream. The Acer Acer Veriton X4110G has a TPM device detected as: tpm_tis 00:0b: 1.2 TPM (device-id 0xFE, rev-id 71) After the first S3 suspend, the following error appears during resume: tpm tpm0: A TPM error(38) occurred continue selftest Any following S3 suspend attempts will now fail with this error: tpm tpm0: Error (38) sending savestate before suspend PM: Device 00:0b failed to suspend: error 38 Error 38 is TPM_ERR_INVALID_POSTINIT which means the TPM is not in the correct state. This indicates that the platform BIOS is not sending the usual TPM_Startup command during S3 resume. >From this point onwards, all TPM commands will fail. The same issue was previously reported on Foxconn 6150BK8MC and Sony Vaio TX3. The platform behaviour seems broken here, but we should not break suspend/resume because of this. When the unexpected TPM state is encountered, set a flag to skip the affected TPM_SaveState command on later suspends. Cc: stable@vger.kernel.org Signed-off-by: Chris Chiu Signed-off-by: Daniel Drake Link: http://lkml.kernel.org/r/CAB4CAwfSCvj1cudi+MWaB5g2Z67d9DwY1o475YOZD64ma23UiQ@mail.gmail.com Link: https://lkml.org/lkml/2011/3/28/192 Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=591031 Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen Signed-off-by: Greg Kroah-Hartman --- drivers/char/tpm/tpm-interface.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/char/tpm/tpm-interface.c +++ b/drivers/char/tpm/tpm-interface.c @@ -787,6 +787,10 @@ int tpm_do_selftest(struct tpm_chip *chi 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) */