Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2149724rwr; Fri, 28 Apr 2023 06:52:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4PaR4lngpdVgSBMFOlMYc1g1ILiKw5Vp0RbkNQZgvDkXBwFkn1jwF0gYxF9Mpay5ZNt8Jx X-Received: by 2002:a17:902:f790:b0:1a6:d15f:3ce1 with SMTP id q16-20020a170902f79000b001a6d15f3ce1mr5497555pln.34.1682689920932; Fri, 28 Apr 2023 06:52:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682689920; cv=none; d=google.com; s=arc-20160816; b=BUvbjoRIB9JaMx7U7BU41JfVdSzlrV7HvEqhBsxFNwQTkgPLbifzkkORvBfaejHVzu OXJIKQM5D9bFID5D5je5QzQ8KE91OYMcM6hwSnWqxk1yVwSV61lI/PCarI/IrgA6DKSw j81LLOoFJ4/ye0Px1bq1vqjzM4YnyIT1Fw/6382zMagbHKoPntUHwXgzovlC+K38tfiK 5T6stmPXQS44jIRqwv/a7AiRY2HMnZbEhiF3M7R/Ke3uCmq1plvlR3mnER7BOuBxJu0D buJNJ0Nw8gJDwUtFyopDyYAq9TDfKR6jFc+TIpaeImITPxc1s0iHFZeSBi6hedQhHXzB tNSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:references:to:from:subject:cc :message-id:date:content-transfer-encoding:mime-version :dkim-signature; bh=lZrzjuU571vLyc9/UjAKgebSxuWsIZ/ivbq2LRelGTU=; b=QMh01xFAbUkB9bRTIfa3vA6mbH58nBdCKoZ52AQiWhWD2T+aQFHOBSxJ4N0PVdE0cG z+X4t/yVjXmNDxfNTL86YacRcR9tVObF7XBef0V6LiXVPQ0EXTel9qT6uHPCOB5uLbT6 cL26BVRPColxignqtIBB6eRyoJdPYesnS9TkeMNIHDVEdbGNW7uf+hGEsIY78aTPazkg lUY8g231+OUIBCQRo9hdffjGaxwo+KK/5GTqgHBpzZpqnsDIcs9AMBpCFfhXM4wpZ54o 6D4j/whFIFHs4aXido3vg3L8rwC5HprcgP+05UbP1218J78kxiMhj6emYNrbwify6dKb YiJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pzN0c0yk; 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 o6-20020a1709026b0600b001a24efe1f14si21384667plk.78.2023.04.28.06.51.46; Fri, 28 Apr 2023 06:52:00 -0700 (PDT) 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=pzN0c0yk; 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 S1346307AbjD1NlQ (ORCPT + 99 others); Fri, 28 Apr 2023 09:41:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346185AbjD1NlP (ORCPT ); Fri, 28 Apr 2023 09:41:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5218F1BFA; Fri, 28 Apr 2023 06:41:14 -0700 (PDT) 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 E8939643D4; Fri, 28 Apr 2023 13:41:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7739C433EF; Fri, 28 Apr 2023 13:41:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682689273; bh=lZrzjuU571vLyc9/UjAKgebSxuWsIZ/ivbq2LRelGTU=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=pzN0c0ykfHzqcSKtUI6U7TW7FhVklucewaOXW5CtlF+Jx+AeRxE3gA3IQ7BHwYoeI 9lxQbJczQDIKTmaQh0gYHXzmx7AI4HDb9BfjMJEn9KmpxZeqD4ts6R7qXBTeqjC+hC g9cuZ+kTkgsT6qfbR4LyC6LnqQATfyi3dP2SMDkpN+UZqgB4XmuOJ3kU0tjTHOG88x 4+z6afRtJu36k8jQ1+QERRyr1gYzW+U8ORli/W5tG6vrxyvtH+kYXPwbkUuklMx0ps RCriX1ZVAOBG++uTKadV2ZpnuRqeDcThysQ+/HdTN7Yasml5XpeD7MArHFnUm7YD37 hCN6cxqGJIeaw== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 28 Apr 2023 16:41:04 +0300 Message-Id: Cc: , , "Peter Huewe" , "Jason Gunthorpe" , Subject: Re: [PATCH 2/2] tpm: Prevent hwrng from activating during resume From: "Jarkko Sakkinen" To: "Jerry Snitselaar" X-Mailer: aerc 0.14.0 References: <20230426172928.3963287-1-jarkko@kernel.org> <20230426172928.3963287-3-jarkko@kernel.org> <3r4dorqzh7nrcsqmsedmt47iimqrh52dfzgrmkjduqglhwufkt@3svji6cfdsug> In-Reply-To: <3r4dorqzh7nrcsqmsedmt47iimqrh52dfzgrmkjduqglhwufkt@3svji6cfdsug> X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Thu Apr 27, 2023 at 9:27 PM EEST, Jerry Snitselaar wrote: > On Wed, Apr 26, 2023 at 08:29:28PM +0300, Jarkko Sakkinen wrote: > > Set TPM_CHIP_FLAG_SUSPENDED in tpm_pm_suspend() and reset in > > tpm_pm_resume(). While the flag is set, tpm_hwrng() gives back zero byt= es. > > This prevents hwrng from racing during resume. > >=20 > > Cc: stable@vger.kernel.org > > Fixes: 6e592a065d51 ("tpm: Move Linux RNG connection to hwrng") > > Signed-off-by: Jarkko Sakkinen > > > Reviewed-by: Jerry Snitselaar