mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
tpm: Remove ineffective wmb() from tpm_pm_resume()
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> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org> Link: https://lore.kernel.org/r/20260910024430.40418-1-richard.lyu@suse.com Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
This commit is contained in:
parent
313acd594a
commit
a32b7973d6
|
|
@ -498,12 +498,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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user