Patch "tpm, tpm_tis: Disable interrupts if tpm_tis_probe_irq() failed" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    tpm, tpm_tis: Disable interrupts if tpm_tis_probe_irq() failed

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     tpm-tpm_tis-disable-interrupts-if-tpm_tis_probe_irq-.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 0578fca0afff154a7083e0b0be4bd2e17a531f2a
Author: Lino Sanfilippo <l.sanfilippo@xxxxxxxxxx>
Date:   Thu Nov 24 14:55:27 2022 +0100

    tpm, tpm_tis: Disable interrupts if tpm_tis_probe_irq() failed
    
    [ Upstream commit 6d789ad726950e612a7f31044260337237c5b490 ]
    
    Both functions tpm_tis_probe_irq_single() and tpm_tis_probe_irq() may setup
    the interrupts and then return with an error. This case is indicated by a
    missing TPM_CHIP_FLAG_IRQ flag in chip->flags.
    Currently the interrupt setup is only undone if tpm_tis_probe_irq_single()
    fails. Undo the setup also if tpm_tis_probe_irq() fails.
    
    Signed-off-by: Lino Sanfilippo <l.sanfilippo@xxxxxxxxxx>
    Tested-by: Michael Niewöhner <linux@xxxxxxxxxxxxxx>
    Tested-by: Jarkko Sakkinen <jarkko@xxxxxxxxxx>
    Reviewed-by: Jarkko Sakkinen <jarkko@xxxxxxxxxx>
    Signed-off-by: Jarkko Sakkinen <jarkko@xxxxxxxxxx>
    Stable-dep-of: 955df4f87760 ("tpm, tpm_tis: Claim locality when interrupts are reenabled on resume")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c
index 274096fece3fa..99cbf6fb062ce 100644
--- a/drivers/char/tpm/tpm_tis_core.c
+++ b/drivers/char/tpm/tpm_tis_core.c
@@ -1069,21 +1069,21 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
 			goto out_err;
 		}
 
-		if (irq) {
+		if (irq)
 			tpm_tis_probe_irq_single(chip, intmask, IRQF_SHARED,
 						 irq);
-			if (!(chip->flags & TPM_CHIP_FLAG_IRQ)) {
-				dev_err(&chip->dev, FW_BUG
+		else
+			tpm_tis_probe_irq(chip, intmask);
+
+		if (!(chip->flags & TPM_CHIP_FLAG_IRQ)) {
+			dev_err(&chip->dev, FW_BUG
 					"TPM interrupt not working, polling instead\n");
 
-				rc = request_locality(chip, 0);
-				if (rc < 0)
-					goto out_err;
-				disable_interrupts(chip);
-				release_locality(chip, 0);
-			}
-		} else {
-			tpm_tis_probe_irq(chip, intmask);
+			rc = request_locality(chip, 0);
+			if (rc < 0)
+				goto out_err;
+			disable_interrupts(chip);
+			release_locality(chip, 0);
 		}
 	}
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux