Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3327974rwb; Mon, 16 Jan 2023 06:42:50 -0800 (PST) X-Google-Smtp-Source: AMrXdXuDiFkLKVe6GZkN8TDFszXll6k3efztu0BseXqMLckivbNmWjrgli/aBYmhUea4wMvkJgzf X-Received: by 2002:a17:90a:ce8e:b0:227:22a6:cfdd with SMTP id g14-20020a17090ace8e00b0022722a6cfddmr28075041pju.17.1673880169903; Mon, 16 Jan 2023 06:42:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673880169; cv=none; d=google.com; s=arc-20160816; b=vsJioDPiwmv7gyHih6vTNZToz93fvsJGHA3afQxDoT5gU3kicOSC9sWDeY1sTT1d38 ndgIvXK+ulPrM5czJ+rrOLMUEIpVs0s2BC5zA4gP2ypRdiLr+K9Xy8oiV2Oyo/kOfYvi FRg8qScQm6h2VjCWeysy/kFIcfR1RirN/Vj67ZGJ/F0ACC/CY0Z7mZ/Dkm9KWeSdeSBU ygPufXD4rU961+qIi3uCFncCvAf3//3xWyrOS/ey12yQOp+U5ryy1GBcZhwQ+IkY2m9f UbxS9vTy/xzVVOT3c+FeY1IPfPOyjb65LAsc8v/yuvT9GQG0vD1wH4fsCL7PPt8zOSOG J3sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=c/usgNs9pfu7FbT7iKyXt726LjP2SjSeWRrj88OxrK8=; b=M6mjCe11xsTPEy3hzU+FKThijdpOgUsmBWnlCx1BOfLrTT4i4zP4RTs3+O/qo0mpWs rhKqwKZLDF2Iw4sDuEQTQROAE0LTGhT4VwBl4jUke5lN7VBo4Xd1KUdiLF9GOAONXnk+ 5GWG/SxL58muF05xznipHWI6WB6n2+7XFwtFcz+rAb1mpdgdrSBPgImkHbHei438XNwG 5QCuPWddAZ5vL3DmB0bOhfpR2TTUf3Anas0/0KmGQaT+/FMhU4emR3PZICeWEMKu8XNf L2l2ufmW58xsfe02hvzzSXMCpCWE0DryasnuqjUb+5aRGL3LyymBdQL5npkOzV2xBg7u jgpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=VawOqSVQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oa3-20020a17090b1bc300b0022627a153b9si8716581pjb.39.2023.01.16.06.42.44; Mon, 16 Jan 2023 06:42:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=VawOqSVQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232119AbjAPOIM (ORCPT + 50 others); Mon, 16 Jan 2023 09:08:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232027AbjAPOHL (ORCPT ); Mon, 16 Jan 2023 09:07:11 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A4FE241D4; Mon, 16 Jan 2023 06:03:37 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 17BBE60FCA; Mon, 16 Jan 2023 14:03:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F2B2C433F0; Mon, 16 Jan 2023 14:03:35 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="VawOqSVQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1673877811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=c/usgNs9pfu7FbT7iKyXt726LjP2SjSeWRrj88OxrK8=; b=VawOqSVQURtyfqU3uNej2kfSXR57CyMBmawE0EuKEiBo/bhl29iOcpkswenRdLS3P4nWV+ OsubsVJ0gAbx3obnJfFFDFjS7TalV968ODb/D3HG4dUE7zle3+USa1zlfhc8aoGT4WIfT3 HRTf7Jkm85MUuiO2N6KHjX2493gxXE0= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 94b23cb7 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 16 Jan 2023 14:03:30 +0000 (UTC) Received: by mail-yb1-f174.google.com with SMTP id d62so14209605ybh.8; Mon, 16 Jan 2023 06:03:30 -0800 (PST) X-Gm-Message-State: AFqh2kr2X2tdrM5zFGUQ0lTVO5oKFtKGUWZqXiAz8bzVj5hcyTwvc7BD 8bFICRvlbs5pKcHJDqsJbmDyErbeF29HjUBENts= X-Received: by 2002:a25:5189:0:b0:7bf:d201:60cb with SMTP id f131-20020a255189000000b007bfd20160cbmr1958247ybb.365.1673877808634; Mon, 16 Jan 2023 06:03:28 -0800 (PST) MIME-Version: 1.0 References: <20230106030156.3258307-1-Jason@zx2c4.com> In-Reply-To: From: "Jason A. Donenfeld" Date: Mon, 16 Jan 2023 15:03:17 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] tpm: Allow system suspend to continue when TPM suspend fails To: Jarkko Sakkinen Cc: Thorsten Leemhuis , James Bottomley , Peter Huewe , Jason Gunthorpe , Jan Dabros , regressions@lists.linux.dev, LKML , linux-integrity@vger.kernel.org, Dominik Brodowski , Herbert Xu , Johannes Altmanninger , stable@vger.kernel.org, Linus Torvalds , Vlastimil Babka Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jarkko, On Mon, Jan 16, 2023 at 9:12 AM Jarkko Sakkinen wrote: > > diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c > > index d69905233aff..6df9067ef7f9 100644 > > --- a/drivers/char/tpm/tpm-interface.c > > +++ b/drivers/char/tpm/tpm-interface.c > > @@ -412,7 +412,10 @@ int tpm_pm_suspend(struct device *dev) > > } > > > > suspended: > > - return rc; > > + if (rc) > > + pr_err("Unable to suspend tpm-%d (error %d), but continuing system suspend\n", > > + chip->dev_num, rc); > > + return 0; > > } > > EXPORT_SYMBOL_GPL(tpm_pm_suspend); > > > > -- > > 2.39.0 > > > > Let me read all the threads through starting from the original report. I've > had emails piling up because of getting sick before holiday, and holiday > season after that. > > This looks sane No, not really. I mean, it was sane under the circumstances of, "I'm not going to spend time fixing this for real if the maintainers aren't around," and it fixed the suspend issue. But it doesn't actually fix any real tpm issue. The real issue, AFAICT, is there's some sort of race between the tpm rng read command and either suspend or wakeup or selftest. One of these is missing some locking. And then commands step on each other and the tpm gets upset. This is probably something that should be fixed. I assume the "Fixes: ..." tag will actually go quite far back, with recent things only unearthing a somewhat old bug. But just a hunch. Jason