From: tip-bot for Marc Zyngier <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: marc.zyngier@arm.com, Suravee.Suthikulpanit@amd.com,
tglx@linutronix.de, dhdang@apm.com,
linux-arm-kernel@lists.infradead.org, jason@lakedaemon.net,
hpa@zytor.com, mingo@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip:irq/core] irqchip/gic-v3: Fix translation of LPIs after conversion to irq_fwspec
Date: Thu, 15 Oct 2015 01:21:37 -0700 [thread overview]
Message-ID: <tip-db8c70ec1f9d45e530383204c57f2971df4bd334@git.kernel.org> (raw)
In-Reply-To: <1444822037-16983-2-git-send-email-marc.zyngier@arm.com>
Commit-ID: db8c70ec1f9d45e530383204c57f2971df4bd334
Gitweb: http://git.kernel.org/tip/db8c70ec1f9d45e530383204c57f2971df4bd334
Author: Marc Zyngier <marc.zyngier@arm.com>
AuthorDate: Wed, 14 Oct 2015 12:27:16 +0100
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 15 Oct 2015 10:18:48 +0200
irqchip/gic-v3: Fix translation of LPIs after conversion to irq_fwspec
Commit f833f57ff254 ("irqchip: Convert all alloc/xlate users from
of_node to fwnode") converted the GICv3 driver to using irq_fwspec
as part of its 'translate' method.
Too bad it ended up with a copy of the GICv2 'translate' method,
which screws up LPI translation (by not translating them at all).
Restore the code in its original shape, and just change what is
really required...
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Cc: <linux-arm-kernel@lists.infradead.org>
Cc: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Cc: Duc Dang <dhdang@apm.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Link: http://lkml.kernel.org/r/1444822037-16983-2-git-send-email-marc.zyngier@arm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
drivers/irqchip/irq-gic-v3.c | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index 05d010b..d7be6dd 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -746,15 +746,19 @@ static int gic_irq_domain_translate(struct irq_domain *d,
if (fwspec->param_count < 3)
return -EINVAL;
- /* Get the interrupt number and add 16 to skip over SGIs */
- *hwirq = fwspec->param[1] + 16;
-
- /*
- * For SPIs, we need to add 16 more to get the GIC irq
- * ID number
- */
- if (!fwspec->param[0])
- *hwirq += 16;
+ switch (fwspec->param[0]) {
+ case 0: /* SPI */
+ *hwirq = fwspec->param[1] + 32;
+ break;
+ case 1: /* PPI */
+ *hwirq = fwspec->param[1] + 16;
+ break;
+ case GIC_IRQ_TYPE_LPI: /* LPI */
+ *hwirq = fwspec->param[1];
+ break;
+ default:
+ return -EINVAL;
+ }
*type = fwspec->param[2] & IRQ_TYPE_SENSE_MASK;
return 0;
next prev parent reply other threads:[~2015-10-15 8:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-14 11:27 [PATCH v2 0/2] More GIC updates for Linux 4.4 Marc Zyngier
2015-10-14 11:27 ` [PATCH v2 1/2] irqchip/gic-v3: Fix translation of LPIs after conversion to irq_fwspec Marc Zyngier
2015-10-15 8:21 ` tip-bot for Marc Zyngier [this message]
2015-10-14 11:27 ` [PATCH v2 2/2] irqchip/gic-v2m: Add support for multiple MSI frames Marc Zyngier
2015-10-14 14:13 ` Suravee Suthikulanit
2015-10-14 15:28 ` Marc Zyngier
2015-10-14 15:30 ` Suravee Suthikulanit
2015-10-15 8:21 ` [tip:irq/core] " tip-bot for Marc Zyngier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-db8c70ec1f9d45e530383204c57f2971df4bd334@git.kernel.org \
--to=tipbot@zytor.com \
--cc=Suravee.Suthikulpanit@amd.com \
--cc=dhdang@apm.com \
--cc=hpa@zytor.com \
--cc=jason@lakedaemon.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox