Commit a3f4d282 authored by Jonathan McDowell's avatar Jonathan McDowell Committed by Greg Kroah-Hartman
Browse files

tpm, tpm_tis: Fix timeout handling when waiting for TPM status



commit 7146dffa upstream.

The change to only use interrupts to handle supported status changes
introduced an issue when it is necessary to poll for the status. Rather
than checking for the status after sleeping the code now sleeps after
the check. This means a correct, but slower, status change on the part
of the TPM can be missed, resulting in a spurious timeout error,
especially on a more loaded system. Switch back to sleeping *then*
checking. An up front check of the status has been done at the start of
the function, so this does not cause an additional delay when the status
is already what we're looking for.

Cc: stable@vger.kernel.org # v6.4+
Fixes: e87fcf0d ("tpm, tpm_tis: Only handle supported interrupts")
Signed-off-by: default avatarJonathan McDowell <noodles@meta.com>
Reviewed-by: default avatarMichal Suchánek <msuchanek@suse.de>
Reviewed-by: default avatarLino Sanfilippo <l.sanfilippo@kunbus.com>
Reviewed-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9dd161f7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment