Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3438920rwb; Fri, 20 Jan 2023 16:30:18 -0800 (PST) X-Google-Smtp-Source: AMrXdXtuiTl9uLiPx4k7LS+x/WtI5x+Vo15g6JapF3fp7cXP5tXTS4dleVt/jMj6pN5vIXiflbAA X-Received: by 2002:a05:6a20:3ca8:b0:b8:a56f:7612 with SMTP id b40-20020a056a203ca800b000b8a56f7612mr21786976pzj.55.1674261018260; Fri, 20 Jan 2023 16:30:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674261018; cv=none; d=google.com; s=arc-20160816; b=AKaArQ+MCuSRMjZ1yKfDd9vjMD6z/6+s60DMUJxt7xwD2ukC0vqeZTwv7hbO2KtfHk 0fuh5ulLCxNRgXpXeAROfBzue+U96r9oVU0SmWv/vTUiA3TKEMsfslpdyYNvbRGSaPF8 QampJSoMjdVtE537lhpiOWuasL0Wlz8OXQWBDMhDCFPBZOk4wo5ZHnLQ8L3khGXMaHRI 5/HDOh7ZilNg1zQq8P+qfRM6TDGkmrHSOTqKO+P1vbMl4CprjlIz5szDIUleicFIQiyL U/uXw37bYkCKlW7kabdNjypnlaUvmu7xcR4nzg7QrBH6XRyohMMz6I8FPnWeYeKINt2b slow== 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=lCRe3tvJyDD0irlo6ODXc5N2Dxy6Wv2/4oqosHL2BXU=; b=xHIDrYNlLP10wT04T4mfSkHPwmywD8KdNbCnWiFK1CqLhOTE5ntdzubWNZp7MMGO95 3ZSopE+d/V/+QAVe5cPwwvYEr1cJn1wzILNuLyisqx+DmzJg1EWQS6cAkT7SlVY6AmvX HFbUEcnA3VmmxT4CmZpTHtax3fHaWdpfSVnFEGCR9ZdBw7O4rcBg5zDAOlul+WJRsNBN kUit0tHVOLsbmTcXwrx55XL8dLu3XC9NkxWLpPpI6TBqIXc7qzdNaFTa4oYOG27XAjwt 0auG33sazASHFvKV6Zoi0cxljKAVeNScZxiXINJfO58wEDyaa31HWAKqxnGpJxElNOgc jmig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YELDPd1k; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j185-20020a638bc2000000b004cff99eb23asi11078661pge.772.2023.01.20.16.30.09; Fri, 20 Jan 2023 16:30:18 -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=@kernel.org header.s=k20201202 header.b=YELDPd1k; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229690AbjAUAHS (ORCPT + 52 others); Fri, 20 Jan 2023 19:07:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229525AbjAUAHR (ORCPT ); Fri, 20 Jan 2023 19:07:17 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6389C7B2FF; Fri, 20 Jan 2023 16:07:12 -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 EF47B620BE; Sat, 21 Jan 2023 00:07:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A019C433EF; Sat, 21 Jan 2023 00:07:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674259631; bh=p3Y079nnkl3K5cMAQ/Y53zKuPpFrZ5vU9hR0A7lmpqk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YELDPd1k9OyyD5e4D/rOONQPFPMDNok955AbR4Zgm2U5vhyJy8sg44W4YO/E92Una hCXxltJOYLqdhoVvJAsTFT52PYG25MDOtQFSZ0BJskTyh4A0/oR3nyoz+Imz6RXRP/ AKsotEJ/KiBui8rBDxjyifweSTDzkG4dObOzfupoKA/tJepmJBzQyU1vp50XboctRB HV8zJ3Ytu5z4cgmmKOvUq84ZrjN9i1vO8dfKpyTD52tIbSACo0icjst2YFyyyQxZfc MpTnapVsEV/6HbuUi0ZZHwxuOTuddbzOJ5+iOssbDEqgDuiCiki3qsDVAShRbxOv6c LaHwJ+u0lRIpw== Date: Sat, 21 Jan 2023 00:07:08 +0000 From: Jarkko Sakkinen To: "Jason A. Donenfeld" 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 Subject: Re: [PATCH v2] tpm: Allow system suspend to continue when TPM suspend fails Message-ID: References: <20230106030156.3258307-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 On Mon, Jan 16, 2023 at 03:03:17PM +0100, Jason A. Donenfeld wrote: > 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 See my response to Vlastimil: https://lore.kernel.org/linux-integrity/Y8sr7YJ8e8eSpPFv@kernel.org/ Can you try what happens if you do not call tpm_add_hwrng()? BR, Jarkko