From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] irqchip/gic-v3: Support v2m frame backwards compatibility mode
Date: Tue, 10 Apr 2018 18:30:45 +0100 [thread overview]
Message-ID: <41edab13-83db-4d57-583a-782144463857@arm.com> (raw)
In-Reply-To: <a4451252-35e4-e63f-8cca-a072f90fa9ad@arm.com>
On 10/04/18 16:23, Marc Zyngier wrote:
> I have a vague idea how to support this. Given that level-triggered MSIs
> have to be platform MSIs (because it is just madness otherwise), we can
> probably store an extra message in the struct platform_msi_desc for the
> "lower the line" write. On activation, you'd get two callbacks, probably
> with a flag of some sort to indicate whether this is for the rising or
> falling edge.
Actually, we can get away with a single call and no extra storage if we do
something like below, and check the trigger in the backends:
diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
index 2a8571f72b17..85408be6d752 100644
--- a/kernel/irq/msi.c
+++ b/kernel/irq/msi.c
@@ -89,13 +89,13 @@ int msi_domain_set_affinity(struct irq_data *irq_data,
const struct cpumask *mask, bool force)
{
struct irq_data *parent = irq_data->parent_data;
- struct msi_msg msg;
+ struct msi_msg msg[2];
int ret;
ret = parent->chip->irq_set_affinity(parent, mask, force);
if (ret >= 0 && ret != IRQ_SET_MASK_OK_DONE) {
- BUG_ON(irq_chip_compose_msi_msg(irq_data, &msg));
- irq_chip_write_msi_msg(irq_data, &msg);
+ BUG_ON(irq_chip_compose_msi_msg(irq_data, msg));
+ irq_chip_write_msi_msg(irq_data, msg);
}
return ret;
@@ -104,20 +104,20 @@ int msi_domain_set_affinity(struct irq_data *irq_data,
static int msi_domain_activate(struct irq_domain *domain,
struct irq_data *irq_data, bool early)
{
- struct msi_msg msg;
+ struct msi_msg msg[2];
- BUG_ON(irq_chip_compose_msi_msg(irq_data, &msg));
- irq_chip_write_msi_msg(irq_data, &msg);
+ BUG_ON(irq_chip_compose_msi_msg(irq_data, msg));
+ irq_chip_write_msi_msg(irq_data, msg);
return 0;
}
static void msi_domain_deactivate(struct irq_domain *domain,
struct irq_data *irq_data)
{
- struct msi_msg msg;
+ struct msi_msg msg[2];
- memset(&msg, 0, sizeof(msg));
- irq_chip_write_msi_msg(irq_data, &msg);
+ memset(msg, 0, sizeof(msg));
+ irq_chip_write_msi_msg(irq_data, msg);
}
static int msi_domain_alloc(struct irq_domain *domain, unsigned int virq,
Is it disgusting? You bet. Does it work? Probably.
M.
--
Jazz is not dead. It just smells funny...
next prev parent reply other threads:[~2018-04-10 17:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-20 22:36 [PATCH] irqchip/gic-v3: Support v2m frame backwards compatibility mode Stephen Boyd
2017-03-21 9:43 ` Marc Zyngier
2018-04-10 15:01 ` Thomas Petazzoni
2018-04-10 15:23 ` Marc Zyngier
2018-04-10 15:41 ` Thomas Petazzoni
2018-04-10 16:18 ` Marc Zyngier
2018-04-10 17:30 ` Marc Zyngier [this message]
2018-04-10 18:17 ` Stephen Boyd
2018-04-10 18:34 ` Marc Zyngier
2018-04-11 10:32 ` Srinivas Kandagatla
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=41edab13-83db-4d57-583a-782144463857@arm.com \
--to=marc.zyngier@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).