From: Jarkko Sakkinen <jarkko@kernel.org>
To: Richard Lyu <richard.lyu@suse.com>
Cc: fourier.thomas@gmail.com, jgg@ziepe.ca,
linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org,
peterhuewe@gmx.de
Subject: Re: [PATCH v2] tpm: Remove ineffective wmb() from tpm_pm_resume()
Date: Fri, 18 Sep 2026 03:55:15 +0300 [thread overview]
Message-ID: <aqyL87YNcLrAZ0fV@kernel.org> (raw)
In-Reply-To: <20260910024430.40418-1-richard.lyu@suse.com>
On Thu, Sep 10, 2026 at 10:44:31AM +0800, Richard Lyu wrote:
> The comment above the wmb() in tpm_pm_resume() states that the barrier
> guarantees TPM_CHIP_FLAG_SUSPENDED is written last, so that hwrng does
> not activate before the chip has been fully resumed. It cannot do so:
> it is placed after the store that clears the flag, and therefore does
> not order the preceding resume work before that store. It also has
> nothing to pair with, as tpm_try_get_ops() contains no matching read
> barrier.
>
> Drop the barrier along with the comment rather than leave a no-op
> behind. Should such ordering turn out to be needed, it would require
> paired barriers or locking.
>
> Link: https://lore.kernel.org/all/a62fc816-259a-4d28-a265-e425bc17ed50@gmail.com/
> Signed-off-by: Richard Lyu <richard.lyu@suse.com>
>
> ---
> v2:
> - Drop the Fixes tag: this is a cleanup, not a bug fix.
> - Link to v1: https://lore.kernel.org/all/aqIVn0cDBvIYKggE@r1chard/
> ---
> drivers/char/tpm/tpm-interface.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
> index b4e749e70b02..0bab78c8767c 100644
> --- a/drivers/char/tpm/tpm-interface.c
> +++ b/drivers/char/tpm/tpm-interface.c
> @@ -497,12 +497,6 @@ int tpm_pm_resume(struct device *dev)
>
> chip->flags &= ~TPM_CHIP_FLAG_SUSPENDED;
>
> - /*
> - * Guarantee that SUSPENDED is written last, so that hwrng does not
> - * activate before the chip has been fully resumed.
> - */
> - wmb();
> -
> return 0;
> }
> EXPORT_SYMBOL_GPL(tpm_pm_resume);
> --
> 2.51.0
>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
BR, Jarkko
next prev parent reply other threads:[~2026-09-18 0:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-08 9:58 [PATCH] " Richard Lyu
2026-09-09 22:51 ` Jarkko Sakkinen
2026-09-10 2:27 ` Richard Lyu
2026-09-10 2:44 ` [PATCH v2] " Richard Lyu
2026-09-18 0:55 ` Jarkko Sakkinen [this message]
2026-09-10 2:46 Richard Lyu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aqyL87YNcLrAZ0fV@kernel.org \
--to=jarkko@kernel.org \
--cc=fourier.thomas@gmail.com \
--cc=jgg@ziepe.ca \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterhuewe@gmx.de \
--cc=richard.lyu@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®