]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
tpm: Convert warn to dbg in tpm2_start_auth_session()
authorJonathan McDowell <noodles@meta.com>
Fri, 7 Mar 2025 10:56:44 +0000 (10:56 +0000)
committerJarkko Sakkinen <jarkko@kernel.org>
Thu, 27 Mar 2025 13:34:05 +0000 (15:34 +0200)
TPM2 sessions have been flushed lazily since commit df745e25098dc ("tpm:
Lazily flush the auth session").  If /dev/tpm{rm}0 is not accessed
in-between two in-kernel calls, it is possible that a TPM2 session is
re-started before the previous one has been completed.

This causes a spurios warning in a legit run-time condition, which is also
correctly addressed with a fast return path:

[    2.944047] tpm tpm0: auth session is active

Address the issue by changing dev_warn_once() call to a dev_dbg_once()
call.

[jarkko: Rewrote the commit message, and instead of dropping converted
 to a debug message.]
Signed-off-by: Jonathan McDowell <noodles@meta.com>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
drivers/char/tpm/tpm2-sessions.c

index b70165b588eccd9ec2f72bc2429cb97d6a691c83..3f89635ba5e8553b4aa7ad491f2bac285200dd27 100644 (file)
@@ -982,7 +982,7 @@ int tpm2_start_auth_session(struct tpm_chip *chip)
        int rc;
 
        if (chip->auth) {
-               dev_warn_once(&chip->dev, "auth session is active\n");
+               dev_dbg_once(&chip->dev, "auth session is active\n");
                return 0;
        }