* [PATCH 0/3] irqchip/gic-v5: Tidy up LPI allocation
@ 2026-04-30 15:33 Sascha Bischoff
2026-04-30 15:34 ` [PATCH 1/3] irqchip/gic-v5: Move LPI alloc/free into LPI domain Sascha Bischoff
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Sascha Bischoff @ 2026-04-30 15:33 UTC (permalink / raw)
To: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Cc: nd, Lorenzo Pieralisi, Marc Zyngier, Thomas Gleixner
LPIs are owned by the LPI domain, so allocating and freeing them from
the ITS MSI and IPI domains was always a bit backwards. Those domains
should only ask their parent for interrupts, and never need to
know how the parent picks or releases the underlying LPIs (or do it on
behalf of said parent, as was the case).
This series moves LPI allocation into the LPI domain itself and
removes the exported wrappers that allowed LPI allocation from elsewhere.
With that done, the LPI domain can also be slightly reworked to
support allocating and freeing more than one LPI at a time. This
rework is extended to the IPI allocation, too. The last patch makes
the ITS MSI domain request its parent interrupts as a single range,
matching the IPI cleanup from the previous patch.
As a side effect of these changes, the IPI path now unwinds earlier
parent allocations correctly if a later allocation fails.
Thanks,
Sascha
Sascha Bischoff (3):
irqchip/gic-v5: Move LPI alloc/free into LPI domain
irqchip/gic-v5: Allow for nr_irqs > 1 for LPI alloc and teardown
irqchip/gic-v5: Allocate ITS parent LPIs as a range
drivers/irqchip/irq-gic-v5-its.c | 34 +++--------
drivers/irqchip/irq-gic-v5.c | 90 ++++++++++++++++--------------
include/linux/irqchip/arm-gic-v5.h | 3 -
3 files changed, 56 insertions(+), 71 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/3] irqchip/gic-v5: Move LPI alloc/free into LPI domain
2026-04-30 15:33 [PATCH 0/3] irqchip/gic-v5: Tidy up LPI allocation Sascha Bischoff
@ 2026-04-30 15:34 ` Sascha Bischoff
2026-04-30 15:34 ` [PATCH 2/3] irqchip/gic-v5: Allow for nr_irqs > 1 for LPI alloc and teardown Sascha Bischoff
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Sascha Bischoff @ 2026-04-30 15:34 UTC (permalink / raw)
To: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Cc: nd, Lorenzo Pieralisi, Marc Zyngier, Thomas Gleixner
Rather than relying on the domains built on top of GICv5's LPI domain
to manage LPI allocations and frees, move that into the LPI domain
itself. This, rightly, ensures that domains other than the LPI itself
have no knowledge of LPI allocations themselves. This not only cleans
up the LPI domain itself, but also the IPI and ITS MSI domains which
build upon it.
While we're at it, drop the helpers wrapping the helpers -
gicv5_alloc_lpi() and gicv5_free_lpi() - and directly use alloc_lpi()
and release_lpi() instead.
Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com>
---
drivers/irqchip/irq-gic-v5-its.c | 14 ++------
drivers/irqchip/irq-gic-v5.c | 54 +++++++++++++++---------------
include/linux/irqchip/arm-gic-v5.h | 3 --
3 files changed, 29 insertions(+), 42 deletions(-)
diff --git a/drivers/irqchip/irq-gic-v5-its.c b/drivers/irqchip/irq-gic-v5-its.c
index 36a8d1368f0e4..36d03f82ef684 100644
--- a/drivers/irqchip/irq-gic-v5-its.c
+++ b/drivers/irqchip/irq-gic-v5-its.c
@@ -929,8 +929,8 @@ static void gicv5_its_free_eventid(struct gicv5_its_dev *its_dev, u32 event_id_b
static int gicv5_its_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,
unsigned int nr_irqs, void *arg)
{
- u32 device_id, event_id_base, lpi;
struct gicv5_its_dev *its_dev;
+ u32 device_id, event_id_base;
msi_alloc_info_t *info = arg;
irq_hw_number_t hwirq;
struct irq_data *irqd;
@@ -949,16 +949,8 @@ static int gicv5_its_irq_domain_alloc(struct irq_domain *domain, unsigned int vi
device_id = its_dev->device_id;
for (i = 0; i < nr_irqs; i++) {
- ret = gicv5_alloc_lpi();
- if (ret < 0) {
- pr_debug("Failed to find free LPI!\n");
- goto out_free_irqs;
- }
- lpi = ret;
-
- ret = irq_domain_alloc_irqs_parent(domain, virq + i, 1, &lpi);
+ ret = irq_domain_alloc_irqs_parent(domain, virq + i, 1, NULL);
if (ret) {
- gicv5_free_lpi(lpi);
goto out_free_irqs;
}
@@ -983,7 +975,6 @@ static int gicv5_its_irq_domain_alloc(struct irq_domain *domain, unsigned int vi
out_free_irqs:
while (--i >= 0) {
irqd = irq_domain_get_irq_data(domain, virq + i);
- gicv5_free_lpi(irqd->parent_data->hwirq);
irq_domain_reset_irq_data(irqd);
irq_domain_free_irqs_parent(domain, virq + i, 1);
}
@@ -1013,7 +1004,6 @@ static void gicv5_its_irq_domain_free(struct irq_domain *domain, unsigned int vi
for (i = 0; i < nr_irqs; i++) {
d = irq_domain_get_irq_data(domain, virq + i);
- gicv5_free_lpi(d->parent_data->hwirq);
irq_domain_reset_irq_data(d);
irq_domain_free_irqs_parent(domain, virq + i, 1);
}
diff --git a/drivers/irqchip/irq-gic-v5.c b/drivers/irqchip/irq-gic-v5.c
index 6b0903be8ebfd..a3c9eaa8ff486 100644
--- a/drivers/irqchip/irq-gic-v5.c
+++ b/drivers/irqchip/irq-gic-v5.c
@@ -59,16 +59,6 @@ static void release_lpi(u32 lpi)
ida_free(&lpi_ida, lpi);
}
-int gicv5_alloc_lpi(void)
-{
- return alloc_lpi();
-}
-
-void gicv5_free_lpi(u32 lpi)
-{
- release_lpi(lpi);
-}
-
static void gicv5_ppi_priority_init(void)
{
write_sysreg_s(REPEAT_BYTE(GICV5_IRQ_PRI_MI), SYS_ICC_PPI_PRIORITYR0_EL1);
@@ -806,18 +796,37 @@ static void gicv5_lpi_config_reset(struct irq_data *d)
gicv5_lpi_irq_write_pending_state(d, false);
}
+static void gicv5_irq_lpi_domain_free(struct irq_domain *domain, unsigned int virq,
+ unsigned int nr_irqs)
+{
+ struct irq_data *d;
+
+ if (WARN_ON_ONCE(nr_irqs != 1))
+ return;
+
+ d = irq_domain_get_irq_data(domain, virq);
+
+
+ release_lpi(d->hwirq);
+
+ irq_set_handler(virq, NULL);
+ irq_domain_reset_irq_data(d);
+}
+
static int gicv5_irq_lpi_domain_alloc(struct irq_domain *domain, unsigned int virq,
unsigned int nr_irqs, void *arg)
{
irq_hw_number_t hwirq;
struct irq_data *irqd;
- u32 *lpi = arg;
int ret;
if (WARN_ON_ONCE(nr_irqs != 1))
return -EINVAL;
- hwirq = *lpi;
+ ret = alloc_lpi();
+ if (ret < 0)
+ return ret;
+ hwirq = ret;
irqd = irq_domain_get_irq_data(domain, virq);
@@ -826,8 +835,10 @@ static int gicv5_irq_lpi_domain_alloc(struct irq_domain *domain, unsigned int vi
irqd_set_single_target(irqd);
ret = gicv5_irs_iste_alloc(hwirq);
- if (ret < 0)
+ if (ret < 0) {
+ release_lpi(hwirq);
return ret;
+ }
gicv5_hwirq_init(hwirq, GICV5_IRQ_PRI_MI, GICV5_HWIRQ_TYPE_LPI);
gicv5_lpi_config_reset(irqd);
@@ -837,7 +848,7 @@ static int gicv5_irq_lpi_domain_alloc(struct irq_domain *domain, unsigned int vi
static const struct irq_domain_ops gicv5_irq_lpi_domain_ops = {
.alloc = gicv5_irq_lpi_domain_alloc,
- .free = gicv5_irq_domain_free,
+ .free = gicv5_irq_lpi_domain_free,
};
void __init gicv5_init_lpi_domain(void)
@@ -859,21 +870,12 @@ static int gicv5_irq_ipi_domain_alloc(struct irq_domain *domain, unsigned int vi
{
struct irq_data *irqd;
int ret, i;
- u32 lpi;
for (i = 0; i < nr_irqs; i++) {
- ret = gicv5_alloc_lpi();
- if (ret < 0)
+ ret = irq_domain_alloc_irqs_parent(domain, virq + i, 1, NULL);
+ if (ret)
return ret;
- lpi = ret;
-
- ret = irq_domain_alloc_irqs_parent(domain, virq + i, 1, &lpi);
- if (ret) {
- gicv5_free_lpi(lpi);
- return ret;
- }
-
irqd = irq_domain_get_irq_data(domain, virq + i);
irq_domain_set_hwirq_and_chip(domain, virq + i, i,
@@ -899,8 +901,6 @@ static void gicv5_irq_ipi_domain_free(struct irq_domain *domain, unsigned int vi
if (!d)
return;
- gicv5_free_lpi(d->parent_data->hwirq);
-
irq_set_handler(virq + i, NULL);
irq_domain_reset_irq_data(d);
irq_domain_free_irqs_parent(domain, virq + i, 1);
diff --git a/include/linux/irqchip/arm-gic-v5.h b/include/linux/irqchip/arm-gic-v5.h
index 40d2fce682940..f78787e654f4c 100644
--- a/include/linux/irqchip/arm-gic-v5.h
+++ b/include/linux/irqchip/arm-gic-v5.h
@@ -425,9 +425,6 @@ struct gicv5_its_itt_cfg {
void gicv5_init_lpis(u32 max);
void gicv5_deinit_lpis(void);
-int gicv5_alloc_lpi(void);
-void gicv5_free_lpi(u32 lpi);
-
void __init gicv5_its_of_probe(struct device_node *parent);
void __init gicv5_its_acpi_probe(void);
#endif
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] irqchip/gic-v5: Allow for nr_irqs > 1 for LPI alloc and teardown
2026-04-30 15:33 [PATCH 0/3] irqchip/gic-v5: Tidy up LPI allocation Sascha Bischoff
2026-04-30 15:34 ` [PATCH 1/3] irqchip/gic-v5: Move LPI alloc/free into LPI domain Sascha Bischoff
@ 2026-04-30 15:34 ` Sascha Bischoff
2026-04-30 15:34 ` [PATCH 3/3] irqchip/gic-v5: Allocate ITS parent LPIs as a range Sascha Bischoff
2026-05-02 10:40 ` [PATCH 0/3] irqchip/gic-v5: Tidy up LPI allocation Marc Zyngier
3 siblings, 0 replies; 6+ messages in thread
From: Sascha Bischoff @ 2026-04-30 15:34 UTC (permalink / raw)
To: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Cc: nd, Lorenzo Pieralisi, Marc Zyngier, Thomas Gleixner
Formerly the LPI allocaion and freeing was handled by the domains
built on top of the LPI domain, and hence the LPI to use was passed in
from the child domain. This mandadated that LPI allocation and freeing
was done one at a time, rather than for a range of interrupts in one
go.
Now that the underlying restriction has been removed and all LPI
tracking happens within the LPI domain itself, drop the requirement to
allocate and free LPIs one-by-one. While we're at it, clean up the
IPI allocation to request all LPIs in one go, rather than requesting
them one at a time.
Incidentally, this fixes a unwind bug for IPIs where previously
allocated entries were not unwound on a failed parent allocation.
Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com>
---
drivers/irqchip/irq-gic-v5.c | 70 +++++++++++++++++++-----------------
1 file changed, 38 insertions(+), 32 deletions(-)
diff --git a/drivers/irqchip/irq-gic-v5.c b/drivers/irqchip/irq-gic-v5.c
index a3c9eaa8ff486..61a70fe48bc32 100644
--- a/drivers/irqchip/irq-gic-v5.c
+++ b/drivers/irqchip/irq-gic-v5.c
@@ -800,17 +800,16 @@ static void gicv5_irq_lpi_domain_free(struct irq_domain *domain, unsigned int vi
unsigned int nr_irqs)
{
struct irq_data *d;
+ int i;
- if (WARN_ON_ONCE(nr_irqs != 1))
- return;
-
- d = irq_domain_get_irq_data(domain, virq);
-
+ for (i = 0; i < nr_irqs; i++) {
+ d = irq_domain_get_irq_data(domain, virq + i);
- release_lpi(d->hwirq);
+ release_lpi(d->hwirq);
- irq_set_handler(virq, NULL);
- irq_domain_reset_irq_data(d);
+ irq_set_handler(virq + i, NULL);
+ irq_domain_reset_irq_data(d);
+ }
}
static int gicv5_irq_lpi_domain_alloc(struct irq_domain *domain, unsigned int virq,
@@ -818,32 +817,38 @@ static int gicv5_irq_lpi_domain_alloc(struct irq_domain *domain, unsigned int vi
{
irq_hw_number_t hwirq;
struct irq_data *irqd;
- int ret;
-
- if (WARN_ON_ONCE(nr_irqs != 1))
- return -EINVAL;
+ int ret, i;
- ret = alloc_lpi();
- if (ret < 0)
- return ret;
- hwirq = ret;
+ for (i = 0; i < nr_irqs; i++) {
+ ret = alloc_lpi();
+ if (ret < 0)
+ goto out_free_lpis;
+ hwirq = ret;
+
+ ret = gicv5_irs_iste_alloc(hwirq);
+ if (ret < 0) {
+ /* Undo partial state first, then clean up the rest */
+ release_lpi(hwirq);
+ goto out_free_lpis;
+ }
- irqd = irq_domain_get_irq_data(domain, virq);
+ irqd = irq_domain_get_irq_data(domain, virq + i);
- irq_domain_set_info(domain, virq, hwirq, &gicv5_lpi_irq_chip, NULL,
- handle_fasteoi_irq, NULL, NULL);
- irqd_set_single_target(irqd);
+ irq_domain_set_info(domain, virq + i, hwirq, &gicv5_lpi_irq_chip,
+ NULL, handle_fasteoi_irq, NULL, NULL);
+ irqd_set_single_target(irqd);
- ret = gicv5_irs_iste_alloc(hwirq);
- if (ret < 0) {
- release_lpi(hwirq);
- return ret;
+ gicv5_hwirq_init(hwirq, GICV5_IRQ_PRI_MI, GICV5_HWIRQ_TYPE_LPI);
+ gicv5_lpi_config_reset(irqd);
}
- gicv5_hwirq_init(hwirq, GICV5_IRQ_PRI_MI, GICV5_HWIRQ_TYPE_LPI);
- gicv5_lpi_config_reset(irqd);
-
return 0;
+
+out_free_lpis:
+ if (i)
+ gicv5_irq_lpi_domain_free(domain, virq, i);
+
+ return ret;
}
static const struct irq_domain_ops gicv5_irq_lpi_domain_ops = {
@@ -871,11 +876,11 @@ static int gicv5_irq_ipi_domain_alloc(struct irq_domain *domain, unsigned int vi
struct irq_data *irqd;
int ret, i;
- for (i = 0; i < nr_irqs; i++) {
- ret = irq_domain_alloc_irqs_parent(domain, virq + i, 1, NULL);
- if (ret)
- return ret;
+ ret = irq_domain_alloc_irqs_parent(domain, virq, nr_irqs, arg);
+ if (ret)
+ return ret;
+ for (i = 0; i < nr_irqs; i++) {
irqd = irq_domain_get_irq_data(domain, virq + i);
irq_domain_set_hwirq_and_chip(domain, virq + i, i,
@@ -903,8 +908,9 @@ static void gicv5_irq_ipi_domain_free(struct irq_domain *domain, unsigned int vi
irq_set_handler(virq + i, NULL);
irq_domain_reset_irq_data(d);
- irq_domain_free_irqs_parent(domain, virq + i, 1);
}
+
+ irq_domain_free_irqs_parent(domain, virq, nr_irqs);
}
static const struct irq_domain_ops gicv5_irq_ipi_domain_ops = {
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] irqchip/gic-v5: Allocate ITS parent LPIs as a range
2026-04-30 15:33 [PATCH 0/3] irqchip/gic-v5: Tidy up LPI allocation Sascha Bischoff
2026-04-30 15:34 ` [PATCH 1/3] irqchip/gic-v5: Move LPI alloc/free into LPI domain Sascha Bischoff
2026-04-30 15:34 ` [PATCH 2/3] irqchip/gic-v5: Allow for nr_irqs > 1 for LPI alloc and teardown Sascha Bischoff
@ 2026-04-30 15:34 ` Sascha Bischoff
2026-05-02 10:40 ` [PATCH 0/3] irqchip/gic-v5: Tidy up LPI allocation Marc Zyngier
3 siblings, 0 replies; 6+ messages in thread
From: Sascha Bischoff @ 2026-04-30 15:34 UTC (permalink / raw)
To: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Cc: nd, Lorenzo Pieralisi, Marc Zyngier, Thomas Gleixner
The ITS MSI domain no longer manages LPI allocation directly. LPIs are
allocated and freed by the parent LPI domain, which can now handle a
full range of interrupts and unwind partial allocations internally.
Make the ITS domain request and release the parent IRQs as a single
range instead of iterating over each interrupt. The ITS allocation
path then only needs to reserve EventIDs, allocate the parent range,
and fill in the ITS irq_data for each MSI. Since no operation in the
per-MSI loop can fail, the partial parent-free unwind becomes
unnecessary.
On teardown, reset the ITS irq_data for the range and then release the
parent range in one call, leaving LPI teardown to the LPI domain.
Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com>
---
drivers/irqchip/irq-gic-v5-its.c | 22 +++++++---------------
1 file changed, 7 insertions(+), 15 deletions(-)
diff --git a/drivers/irqchip/irq-gic-v5-its.c b/drivers/irqchip/irq-gic-v5-its.c
index 36d03f82ef684..28e39b065de0e 100644
--- a/drivers/irqchip/irq-gic-v5-its.c
+++ b/drivers/irqchip/irq-gic-v5-its.c
@@ -937,6 +937,7 @@ static int gicv5_its_irq_domain_alloc(struct irq_domain *domain, unsigned int vi
int ret, i;
its_dev = info->scratchpad[0].ptr;
+ device_id = its_dev->device_id;
ret = gicv5_its_alloc_eventid(its_dev, info, nr_irqs, &event_id_base);
if (ret)
@@ -946,14 +947,11 @@ static int gicv5_its_irq_domain_alloc(struct irq_domain *domain, unsigned int vi
if (ret)
goto out_eventid;
- device_id = its_dev->device_id;
+ ret = irq_domain_alloc_irqs_parent(domain, virq, nr_irqs, NULL);
+ if (ret)
+ goto out_eventid;
for (i = 0; i < nr_irqs; i++) {
- ret = irq_domain_alloc_irqs_parent(domain, virq + i, 1, NULL);
- if (ret) {
- goto out_free_irqs;
- }
-
/*
* Store eventid and deviceid into the hwirq for later use.
*
@@ -972,12 +970,6 @@ static int gicv5_its_irq_domain_alloc(struct irq_domain *domain, unsigned int vi
return 0;
-out_free_irqs:
- while (--i >= 0) {
- irqd = irq_domain_get_irq_data(domain, virq + i);
- irq_domain_reset_irq_data(irqd);
- irq_domain_free_irqs_parent(domain, virq + i, 1);
- }
out_eventid:
gicv5_its_free_eventid(its_dev, event_id_base, nr_irqs);
return ret;
@@ -1000,14 +992,14 @@ static void gicv5_its_irq_domain_free(struct irq_domain *domain, unsigned int vi
bitmap_release_region(its_dev->event_map, event_id_base,
get_count_order(nr_irqs));
- /* Hierarchically free irq data */
for (i = 0; i < nr_irqs; i++) {
d = irq_domain_get_irq_data(domain, virq + i);
-
irq_domain_reset_irq_data(d);
- irq_domain_free_irqs_parent(domain, virq + i, 1);
}
+ /* Hierarchically free irq data */
+ irq_domain_free_irqs_parent(domain, virq, nr_irqs);
+
gicv5_its_syncr(its, its_dev);
gicv5_irs_syncr();
}
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3] irqchip/gic-v5: Tidy up LPI allocation
2026-04-30 15:33 [PATCH 0/3] irqchip/gic-v5: Tidy up LPI allocation Sascha Bischoff
` (2 preceding siblings ...)
2026-04-30 15:34 ` [PATCH 3/3] irqchip/gic-v5: Allocate ITS parent LPIs as a range Sascha Bischoff
@ 2026-05-02 10:40 ` Marc Zyngier
2026-05-04 8:45 ` Lorenzo Pieralisi
3 siblings, 1 reply; 6+ messages in thread
From: Marc Zyngier @ 2026-05-02 10:40 UTC (permalink / raw)
To: Sascha Bischoff, Thomas Gleixner
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, nd, Lorenzo Pieralisi
Hi Sascha,
On Thu, 30 Apr 2026 16:33:58 +0100,
Sascha Bischoff <Sascha.Bischoff@arm.com> wrote:
>
> LPIs are owned by the LPI domain, so allocating and freeing them from
> the ITS MSI and IPI domains was always a bit backwards. Those domains
> should only ask their parent for interrupts, and never need to
> know how the parent picks or releases the underlying LPIs (or do it on
> behalf of said parent, as was the case).
>
> This series moves LPI allocation into the LPI domain itself and
> removes the exported wrappers that allowed LPI allocation from elsewhere.
>
> With that done, the LPI domain can also be slightly reworked to
> support allocating and freeing more than one LPI at a time. This
> rework is extended to the IPI allocation, too. The last patch makes
> the ITS MSI domain request its parent interrupts as a single range,
> matching the IPI cleanup from the previous patch.
>
> As a side effect of these changes, the IPI path now unwinds earlier
> parent allocations correctly if a later allocation fails.
Thanks for cleaning up this mess. It aligns the GICv5 host code with
the expectations we have for hierarchical domains (don't mess with
your parent's allocations), and will make the KVM management of
doorbell LPIs less awkward. It also removes global helpers that always
irked me, so:
Reviewed-by: Marc Zyngier <maz@kernel.org>
Thomas, could you please take th in at the earliest opportunity?
Thanks,
M.
--
Jazz isn't dead. It just smells funny.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3] irqchip/gic-v5: Tidy up LPI allocation
2026-05-02 10:40 ` [PATCH 0/3] irqchip/gic-v5: Tidy up LPI allocation Marc Zyngier
@ 2026-05-04 8:45 ` Lorenzo Pieralisi
0 siblings, 0 replies; 6+ messages in thread
From: Lorenzo Pieralisi @ 2026-05-04 8:45 UTC (permalink / raw)
To: Marc Zyngier
Cc: Sascha Bischoff, Thomas Gleixner,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, nd
On Sat, May 02, 2026 at 11:40:10AM +0100, Marc Zyngier wrote:
> Hi Sascha,
>
> On Thu, 30 Apr 2026 16:33:58 +0100,
> Sascha Bischoff <Sascha.Bischoff@arm.com> wrote:
> >
> > LPIs are owned by the LPI domain, so allocating and freeing them from
> > the ITS MSI and IPI domains was always a bit backwards. Those domains
> > should only ask their parent for interrupts, and never need to
> > know how the parent picks or releases the underlying LPIs (or do it on
> > behalf of said parent, as was the case).
> >
> > This series moves LPI allocation into the LPI domain itself and
> > removes the exported wrappers that allowed LPI allocation from elsewhere.
> >
> > With that done, the LPI domain can also be slightly reworked to
> > support allocating and freeing more than one LPI at a time. This
> > rework is extended to the IPI allocation, too. The last patch makes
> > the ITS MSI domain request its parent interrupts as a single range,
> > matching the IPI cleanup from the previous patch.
> >
> > As a side effect of these changes, the IPI path now unwinds earlier
> > parent allocations correctly if a later allocation fails.
>
> Thanks for cleaning up this mess. It aligns the GICv5 host code with
> the expectations we have for hierarchical domains (don't mess with
> your parent's allocations), and will make the KVM management of
> doorbell LPIs less awkward. It also removes global helpers that always
> irked me, so:
Bah, sorry, it not only breaks the IRQ domains expectations but
the current allocation is really braindead - I was too fixated on
the IDA 1 by 1 allocation (that should really disappear asap) that
I could not see the wood for the trees.
Thank you Sascha for cleaning it up.
Reviewed-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
> Reviewed-by: Marc Zyngier <maz@kernel.org>
>
> Thomas, could you please take th in at the earliest opportunity?
>
> Thanks,
>
> M.
>
> --
> Jazz isn't dead. It just smells funny.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-05-04 8:46 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-30 15:33 [PATCH 0/3] irqchip/gic-v5: Tidy up LPI allocation Sascha Bischoff
2026-04-30 15:34 ` [PATCH 1/3] irqchip/gic-v5: Move LPI alloc/free into LPI domain Sascha Bischoff
2026-04-30 15:34 ` [PATCH 2/3] irqchip/gic-v5: Allow for nr_irqs > 1 for LPI alloc and teardown Sascha Bischoff
2026-04-30 15:34 ` [PATCH 3/3] irqchip/gic-v5: Allocate ITS parent LPIs as a range Sascha Bischoff
2026-05-02 10:40 ` [PATCH 0/3] irqchip/gic-v5: Tidy up LPI allocation Marc Zyngier
2026-05-04 8:45 ` Lorenzo Pieralisi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox