From: "tip-bot2 for Matti Vaittinen" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>,
Thomas Gleixner <tglx@linutronix.de>,
x86@kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org
Subject: [tip: irq/core] irqdomain: Always associate interrupts for legacy domains
Date: Tue, 20 Aug 2024 15:21:08 -0000 [thread overview]
Message-ID: <172416726820.2215.8921397905891328952.tip-bot2@tip-bot2> (raw)
In-Reply-To: <c3379142-10bc-4f14-b8ac-a46927aeac38@gmail.com>
The following commit has been merged into the irq/core branch of tip:
Commit-ID: 24d02c4e53e2f02da16b2ae8a1bc92553110ca25
Gitweb: https://git.kernel.org/tip/24d02c4e53e2f02da16b2ae8a1bc92553110ca25
Author: Matti Vaittinen <mazziesaccount@gmail.com>
AuthorDate: Tue, 13 Aug 2024 14:34:27 +03:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Tue, 20 Aug 2024 17:12:43 +02:00
irqdomain: Always associate interrupts for legacy domains
The unification of irq_domain_create_legacy() missed the fact that
interrupts must be associated even when the Linux interrupt number provided
in the first_irq argument is 0.
This breaks all call sites of irq_domain_create_legacy() which supply 0 as
the first_irq argument.
Enforce the association for legacy domains in __irq_domain_instantiate() to
cure this.
[ tglx: Massaged it slightly. ]
Fixes: 70114e7f7585 ("irqdomain: Simplify simple and legacy domain creation")
Reported-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by Matti Vaittinen <mazziesaccount@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Link: https://lore.kernel.org/all/c3379142-10bc-4f14-b8ac-a46927aeac38@gmail.com
---
kernel/irq/irqdomain.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 1acc530..5df8780 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -306,7 +306,7 @@ static void irq_domain_instantiate_descs(const struct irq_domain_info *info)
}
static struct irq_domain *__irq_domain_instantiate(const struct irq_domain_info *info,
- bool cond_alloc_descs)
+ bool cond_alloc_descs, bool force_associate)
{
struct irq_domain *domain;
int err;
@@ -342,8 +342,12 @@ static struct irq_domain *__irq_domain_instantiate(const struct irq_domain_info
if (cond_alloc_descs && info->virq_base > 0)
irq_domain_instantiate_descs(info);
- /* Legacy interrupt domains have a fixed Linux interrupt number */
- if (info->virq_base > 0) {
+ /*
+ * Legacy interrupt domains have a fixed Linux interrupt number
+ * associated. Other interrupt domains can request association by
+ * providing a Linux interrupt number > 0.
+ */
+ if (force_associate || info->virq_base > 0) {
irq_domain_associate_many(domain, info->virq_base, info->hwirq_base,
info->size - info->hwirq_base);
}
@@ -366,7 +370,7 @@ err_domain_free:
*/
struct irq_domain *irq_domain_instantiate(const struct irq_domain_info *info)
{
- return __irq_domain_instantiate(info, false);
+ return __irq_domain_instantiate(info, false, false);
}
EXPORT_SYMBOL_GPL(irq_domain_instantiate);
@@ -470,7 +474,7 @@ struct irq_domain *irq_domain_create_simple(struct fwnode_handle *fwnode,
.ops = ops,
.host_data = host_data,
};
- struct irq_domain *domain = __irq_domain_instantiate(&info, true);
+ struct irq_domain *domain = __irq_domain_instantiate(&info, true, false);
return IS_ERR(domain) ? NULL : domain;
}
@@ -519,7 +523,7 @@ struct irq_domain *irq_domain_create_legacy(struct fwnode_handle *fwnode,
.ops = ops,
.host_data = host_data,
};
- struct irq_domain *domain = irq_domain_instantiate(&info);
+ struct irq_domain *domain = __irq_domain_instantiate(&info, false, true);
return IS_ERR(domain) ? NULL : domain;
}
next prev parent reply other threads:[~2024-08-20 15:21 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-08 12:32 [PATCH v2 0/3] regmap IRQ support for devices with multiple IRQs Matti Vaittinen
2024-08-08 12:34 ` [PATCH v2 1/3] irqdomain: simplify simple and legacy domain creation Matti Vaittinen
2024-08-13 10:19 ` Jiaxun Yang
2024-08-13 10:54 ` Matti Vaittinen
2024-08-13 12:02 ` Matti Vaittinen
2024-08-13 12:14 ` Jiaxun Yang
2024-08-13 14:20 ` [tip: irq/core] irqdomain: Always associate interrupts for legacy domains tip-bot2 for Matti Vaittinen
2024-08-20 15:21 ` tip-bot2 for Matti Vaittinen [this message]
2024-08-13 12:03 ` [PATCH v2 1/3] irqdomain: simplify simple and legacy domain creation Jiaxun Yang
2024-08-08 12:35 ` [PATCH v2 2/3] irqdomain: Allow giving name suffix for domain Matti Vaittinen
2024-08-08 20:17 ` Thomas Gleixner
2024-08-08 20:19 ` [PATCH] irqdomain: Cleanup domain name allocation Thomas Gleixner
2024-08-08 20:23 ` [PATCH v2a 2/3] irqdomain: Allow giving name suffix for domain Thomas Gleixner
2024-08-09 5:03 ` Matti Vaittinen
2024-08-09 21:14 ` [tip: irq/core] " tip-bot2 for Matti Vaittinen
2024-08-09 5:19 ` [PATCH] irqdomain: Cleanup domain name allocation Matti Vaittinen
2024-08-09 21:14 ` [tip: irq/core] " tip-bot2 for Thomas Gleixner
2024-08-08 12:36 ` [PATCH v2 3/3] regmap: Allow setting IRQ domain name suffix Matti Vaittinen
2024-08-09 21:09 ` Thomas Gleixner
2024-08-12 19:05 ` Andy Shevchenko
2024-08-13 9:11 ` Matti Vaittinen
2024-08-14 12:05 ` (subset) [PATCH v2 0/3] regmap IRQ support for devices with multiple IRQs Mark Brown
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=172416726820.2215.8921397905891328952.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=jiaxun.yang@flygoat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=maz@kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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
all inboxes | Powered by JetHome®