diff options
author | Jason Gunthorpe <jgunthorpe@obsidianresearch.com> | 2015-11-25 16:05:36 -0500 |
---|---|---|
committer | Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> | 2015-12-20 08:26:28 -0500 |
commit | b8ba1e744445d65dad7dd61db909e7f2b89df35e (patch) | |
tree | 141ae24e4829cbfe8004991bd7e56b4f16b25b49 /drivers/char | |
parent | e3837e74a06dc38ab79529758a3667fbff2fdc17 (diff) |
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>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/tpm/tpm_tis.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index c29ae69f1df6..8a3509cb10da 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c | |||
@@ -603,12 +603,13 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id) | |||
603 | * irq is seen then leave the chip setup for IRQ operation, otherwise reverse | 603 | * irq is seen then leave the chip setup for IRQ operation, otherwise reverse |
604 | * everything and leave in polling mode. Returns 0 on success. | 604 | * everything and leave in polling mode. Returns 0 on success. |
605 | */ | 605 | */ |
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) | ||
607 | { | 608 | { |
608 | struct priv_data *priv = chip->vendor.priv; | 609 | struct priv_data *priv = chip->vendor.priv; |
609 | u8 original_int_vec; | 610 | u8 original_int_vec; |
610 | 611 | ||
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, |
612 | chip->devname, chip) != 0) { | 613 | chip->devname, chip) != 0) { |
613 | dev_info(chip->pdev, "Unable to request irq: %d for probe\n", | 614 | dev_info(chip->pdev, "Unable to request irq: %d for probe\n", |
614 | irq); | 615 | irq); |
@@ -666,10 +667,13 @@ static void tpm_tis_probe_irq(struct tpm_chip *chip, u32 intmask) | |||
666 | TPM_INT_VECTOR(chip->vendor.locality)); | 667 | TPM_INT_VECTOR(chip->vendor.locality)); |
667 | 668 | ||
668 | if (!original_int_vec) { | 669 | if (!original_int_vec) { |
669 | for (i = 3; i <= 15; i++) | 670 | if (IS_ENABLED(CONFIG_X86)) |
670 | if (!tpm_tis_probe_irq_single(chip, intmask, i)) | 671 | for (i = 3; i <= 15; i++) |
671 | return; | 672 | if (!tpm_tis_probe_irq_single(chip, intmask, 0, |
672 | } else if (!tpm_tis_probe_irq_single(chip, intmask, original_int_vec)) | 673 | i)) |
674 | return; | ||
675 | } else if (!tpm_tis_probe_irq_single(chip, intmask, 0, | ||
676 | original_int_vec)) | ||
673 | return; | 677 | return; |
674 | } | 678 | } |
675 | 679 | ||
@@ -805,7 +809,8 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info, | |||
805 | init_waitqueue_head(&chip->vendor.int_queue); | 809 | init_waitqueue_head(&chip->vendor.int_queue); |
806 | if (interrupts) { | 810 | if (interrupts) { |
807 | if (tpm_info->irq) { | 811 | 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); | ||
809 | if (!chip->vendor.irq) | 814 | if (!chip->vendor.irq) |
810 | dev_err(chip->pdev, FW_BUG | 815 | dev_err(chip->pdev, FW_BUG |
811 | "TPM interrupt not working, polling instead\n"); | 816 | "TPM interrupt not working, polling instead\n"); |