Skip to content

Commit b8ba1e7

Browse files
jgunthorpeJarkko Sakkinen
authored andcommitted
tpm_tis: Tighten IRQ auto-probing
auto-probing doesn't work with shared interrupts, and the auto detection interrupt range is for x86 only. Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Tested-by: Martin Wilck <Martin.Wilck@ts.fujitsu.com> Tested-by: Scot Doyle <lkml14@scotdoyle.com> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Acked-by: Peter Huewe <peterhuewe@gmx.de>
1 parent e3837e7 commit b8ba1e7

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

drivers/char/tpm/tpm_tis.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -603,12 +603,13 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id)
603603
* irq is seen then leave the chip setup for IRQ operation, otherwise reverse
604604
* everything and leave in polling mode. Returns 0 on success.
605605
*/
606-
static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask, int irq)
606+
static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,
607+
int flags, int irq)
607608
{
608609
struct priv_data *priv = chip->vendor.priv;
609610
u8 original_int_vec;
610611

611-
if (devm_request_irq(chip->pdev, irq, tis_int_handler, IRQF_SHARED,
612+
if (devm_request_irq(chip->pdev, irq, tis_int_handler, flags,
612613
chip->devname, chip) != 0) {
613614
dev_info(chip->pdev, "Unable to request irq: %d for probe\n",
614615
irq);
@@ -666,10 +667,13 @@ static void tpm_tis_probe_irq(struct tpm_chip *chip, u32 intmask)
666667
TPM_INT_VECTOR(chip->vendor.locality));
667668

668669
if (!original_int_vec) {
669-
for (i = 3; i <= 15; i++)
670-
if (!tpm_tis_probe_irq_single(chip, intmask, i))
671-
return;
672-
} else if (!tpm_tis_probe_irq_single(chip, intmask, original_int_vec))
670+
if (IS_ENABLED(CONFIG_X86))
671+
for (i = 3; i <= 15; i++)
672+
if (!tpm_tis_probe_irq_single(chip, intmask, 0,
673+
i))
674+
return;
675+
} else if (!tpm_tis_probe_irq_single(chip, intmask, 0,
676+
original_int_vec))
673677
return;
674678
}
675679

@@ -805,7 +809,8 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
805809
init_waitqueue_head(&chip->vendor.int_queue);
806810
if (interrupts) {
807811
if (tpm_info->irq) {
808-
tpm_tis_probe_irq_single(chip, intmask, tpm_info->irq);
812+
tpm_tis_probe_irq_single(chip, intmask, IRQF_SHARED,
813+
tpm_info->irq);
809814
if (!chip->vendor.irq)
810815
dev_err(chip->pdev, FW_BUG
811816
"TPM interrupt not working, polling instead\n");

0 commit comments

Comments
 (0)