On 2026/09/10 01:51, Jarkko Sakkinen wrote:
On Tue, Sep 08, 2026 at 05:58:02PM +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.

Fixes: 99d464506255 ("tpm: Prevent hwrng from activating during resume")
Link: 
https://lore.kernel.org/all/[email protected]/
Signed-off-by: Richard Lyu <[email protected]>

I agree that wmb() is necessary but what is the bug here?

Agree with the change but I'm not convinced about fixes tag here.

You're right. There is no actual bug being fixed here, so a Fixes tag is not
needed. This patch only removes redundant code. I will send a v2 without the
tag.

Best Regards,
Richard Lyu

Reply via email to