Commit b8ba1e74 authored by Jason Gunthorpe's avatar Jason Gunthorpe Committed by Jarkko Sakkinen

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: default avatarJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Reviewed-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-by: default avatarMartin Wilck <Martin.Wilck@ts.fujitsu.com>
Tested-by: default avatarScot Doyle <lkml14@scotdoyle.com>
Signed-off-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Acked-by: default avatarPeter Huewe <peterhuewe@gmx.de>
parent e3837e74
...@@ -603,12 +603,13 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id) ...@@ -603,12 +603,13 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id)
* irq is seen then leave the chip setup for IRQ operation, otherwise reverse * irq is seen then leave the chip setup for IRQ operation, otherwise reverse
* everything and leave in polling mode. Returns 0 on success. * everything and leave in polling mode. Returns 0 on success.
*/ */
static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask, int irq) static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,
int flags, int irq)
{ {
struct priv_data *priv = chip->vendor.priv; struct priv_data *priv = chip->vendor.priv;
u8 original_int_vec; u8 original_int_vec;
if (devm_request_irq(chip->pdev, irq, tis_int_handler, IRQF_SHARED, if (devm_request_irq(chip->pdev, irq, tis_int_handler, flags,
chip->devname, chip) != 0) { chip->devname, chip) != 0) {
dev_info(chip->pdev, "Unable to request irq: %d for probe\n", dev_info(chip->pdev, "Unable to request irq: %d for probe\n",
irq); irq);
...@@ -666,10 +667,13 @@ static void tpm_tis_probe_irq(struct tpm_chip *chip, u32 intmask) ...@@ -666,10 +667,13 @@ static void tpm_tis_probe_irq(struct tpm_chip *chip, u32 intmask)
TPM_INT_VECTOR(chip->vendor.locality)); TPM_INT_VECTOR(chip->vendor.locality));
if (!original_int_vec) { if (!original_int_vec) {
for (i = 3; i <= 15; i++) if (IS_ENABLED(CONFIG_X86))
if (!tpm_tis_probe_irq_single(chip, intmask, i)) for (i = 3; i <= 15; i++)
return; if (!tpm_tis_probe_irq_single(chip, intmask, 0,
} else if (!tpm_tis_probe_irq_single(chip, intmask, original_int_vec)) i))
return;
} else if (!tpm_tis_probe_irq_single(chip, intmask, 0,
original_int_vec))
return; return;
} }
...@@ -805,7 +809,8 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info, ...@@ -805,7 +809,8 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
init_waitqueue_head(&chip->vendor.int_queue); init_waitqueue_head(&chip->vendor.int_queue);
if (interrupts) { if (interrupts) {
if (tpm_info->irq) { if (tpm_info->irq) {
tpm_tis_probe_irq_single(chip, intmask, tpm_info->irq); tpm_tis_probe_irq_single(chip, intmask, IRQF_SHARED,
tpm_info->irq);
if (!chip->vendor.irq) if (!chip->vendor.irq)
dev_err(chip->pdev, FW_BUG dev_err(chip->pdev, FW_BUG
"TPM interrupt not working, polling instead\n"); "TPM interrupt not working, polling instead\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment