* [PATCH v2 1/3] irqchip/gic-v5: Delete a stray tab
[not found] <cover.1752777667.git.dan.carpenter@linaro.org>
@ 2025-07-17 18:45 ` Dan Carpenter
2025-08-07 14:55 ` Dan Carpenter
2025-08-22 1:00 ` Zenghui Yu
2025-07-17 18:45 ` [PATCH v2 2/3] irqchip/gic-v5: Fix forever loop in gicv5_its_create_itt_two_level() error handling Dan Carpenter
2025-07-17 18:45 ` [PATCH v2 3/3] irqchip/gic-v5: Fix error handling in gicv5_its_irq_domain_alloc() Dan Carpenter
2 siblings, 2 replies; 8+ messages in thread
From: Dan Carpenter @ 2025-07-17 18:45 UTC (permalink / raw)
To: Marc Zyngier
Cc: Lorenzo Pieralisi, Thomas Gleixner, linux-arm-kernel,
linux-kernel
This line is indented one tab too far. Delete the tab.
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
v2: no change
drivers/irqchip/irq-gic-v5-irs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/irqchip/irq-gic-v5-irs.c b/drivers/irqchip/irq-gic-v5-irs.c
index f845415f9143..ad1435a858a4 100644
--- a/drivers/irqchip/irq-gic-v5-irs.c
+++ b/drivers/irqchip/irq-gic-v5-irs.c
@@ -568,7 +568,7 @@ static void __init gicv5_irs_init_bases(struct gicv5_irs_chip_data *irs_data,
FIELD_PREP(GICV5_IRS_CR1_IST_RA, GICV5_NO_READ_ALLOC) |
FIELD_PREP(GICV5_IRS_CR1_IC, GICV5_NON_CACHE) |
FIELD_PREP(GICV5_IRS_CR1_OC, GICV5_NON_CACHE);
- irs_data->flags |= IRS_FLAGS_NON_COHERENT;
+ irs_data->flags |= IRS_FLAGS_NON_COHERENT;
} else {
cr1 = FIELD_PREP(GICV5_IRS_CR1_VPED_WA, GICV5_WRITE_ALLOC) |
FIELD_PREP(GICV5_IRS_CR1_VPED_RA, GICV5_READ_ALLOC) |
--
2.47.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 2/3] irqchip/gic-v5: Fix forever loop in gicv5_its_create_itt_two_level() error handling
[not found] <cover.1752777667.git.dan.carpenter@linaro.org>
2025-07-17 18:45 ` [PATCH v2 1/3] irqchip/gic-v5: Delete a stray tab Dan Carpenter
@ 2025-07-17 18:45 ` Dan Carpenter
2025-08-25 3:54 ` Zenghui Yu
2025-07-17 18:45 ` [PATCH v2 3/3] irqchip/gic-v5: Fix error handling in gicv5_its_irq_domain_alloc() Dan Carpenter
2 siblings, 1 reply; 8+ messages in thread
From: Dan Carpenter @ 2025-07-17 18:45 UTC (permalink / raw)
To: Lorenzo Pieralisi
Cc: Marc Zyngier, Thomas Gleixner, Timothy Hayes, Sascha Bischoff,
linux-arm-kernel, linux-kernel
The "i" variable needs to be signed otherwise there is a forever loop
in the cleanup code.
Fixes: 57d72196dfc8 ("irqchip/gic-v5: Add GICv5 ITS support")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
v2: no change
drivers/irqchip/irq-gic-v5-its.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/irqchip/irq-gic-v5-its.c b/drivers/irqchip/irq-gic-v5-its.c
index 340640fdbdf6..55360ae9f1f6 100644
--- a/drivers/irqchip/irq-gic-v5-its.c
+++ b/drivers/irqchip/irq-gic-v5-its.c
@@ -191,9 +191,9 @@ static int gicv5_its_create_itt_two_level(struct gicv5_its_chip_data *its,
unsigned int num_events)
{
unsigned int l1_bits, l2_bits, span, events_per_l2_table;
- unsigned int i, complete_tables, final_span, num_ents;
+ unsigned int complete_tables, final_span, num_ents;
__le64 *itt_l1, *itt_l2, **l2ptrs;
- int ret;
+ int i, ret;
u64 val;
ret = gicv5_its_l2sz_to_l2_bits(itt_l2sz);
--
2.47.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 3/3] irqchip/gic-v5: Fix error handling in gicv5_its_irq_domain_alloc()
[not found] <cover.1752777667.git.dan.carpenter@linaro.org>
2025-07-17 18:45 ` [PATCH v2 1/3] irqchip/gic-v5: Delete a stray tab Dan Carpenter
2025-07-17 18:45 ` [PATCH v2 2/3] irqchip/gic-v5: Fix forever loop in gicv5_its_create_itt_two_level() error handling Dan Carpenter
@ 2025-07-17 18:45 ` Dan Carpenter
2025-08-25 3:54 ` Zenghui Yu
2 siblings, 1 reply; 8+ messages in thread
From: Dan Carpenter @ 2025-07-17 18:45 UTC (permalink / raw)
To: Lorenzo Pieralisi
Cc: Marc Zyngier, Thomas Gleixner, Sascha Bischoff, Timothy Hayes,
linux-arm-kernel, linux-kernel
There are two issues to fix in this code:
1) If gicv5_alloc_lpi() fails the original code was checking the wrong
variable. Fix the mixup between "ret" and "lpi".
2) Clean up from all the previous iterations and not just the current
iteration.
Fixes: 57d72196dfc8 ("irqchip/gic-v5: Add GICv5 ITS support")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
v2: In v1 I had the wrong goto if gicv5_alloc_lpi() failed. Also change
the label name from out_free_lpi to out_free_irqs.
drivers/irqchip/irq-gic-v5-its.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/drivers/irqchip/irq-gic-v5-its.c b/drivers/irqchip/irq-gic-v5-its.c
index 55360ae9f1f6..40e361d5499c 100644
--- a/drivers/irqchip/irq-gic-v5-its.c
+++ b/drivers/irqchip/irq-gic-v5-its.c
@@ -949,15 +949,18 @@ 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++) {
- lpi = gicv5_alloc_lpi();
+ ret = gicv5_alloc_lpi();
if (ret < 0) {
pr_debug("Failed to find free LPI!\n");
- goto out_eventid;
+ goto out_free_irqs;
}
+ lpi = ret;
ret = irq_domain_alloc_irqs_parent(domain, virq + i, 1, &lpi);
- if (ret)
- goto out_free_lpi;
+ if (ret) {
+ gicv5_free_lpi(lpi);
+ goto out_free_irqs;
+ }
/*
* Store eventid and deviceid into the hwirq for later use.
@@ -978,8 +981,13 @@ static int gicv5_its_irq_domain_alloc(struct irq_domain *domain, unsigned int vi
return 0;
-out_free_lpi:
- gicv5_free_lpi(lpi);
+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);
+ }
out_eventid:
gicv5_its_free_eventid(its_dev, event_id_base, nr_irqs);
return ret;
--
2.47.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 1/3] irqchip/gic-v5: Delete a stray tab
2025-07-17 18:45 ` [PATCH v2 1/3] irqchip/gic-v5: Delete a stray tab Dan Carpenter
@ 2025-08-07 14:55 ` Dan Carpenter
2025-08-20 8:51 ` Lorenzo Pieralisi
2025-08-22 1:00 ` Zenghui Yu
1 sibling, 1 reply; 8+ messages in thread
From: Dan Carpenter @ 2025-08-07 14:55 UTC (permalink / raw)
To: Thomas Gleixner, Marc Zyngier
Cc: Lorenzo Pieralisi, linux-arm-kernel, linux-kernel
Hi Thomas,
Sorry, I screwed up the over letter so it was sent as a different
thread. These three patches are still required. Lorenzo reviewed
and tested them.
Reviewed-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
Tested-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
regards,
dan carpenter
On Thu, Jul 17, 2025 at 01:45:24PM -0500, Dan Carpenter wrote:
> This line is indented one tab too far. Delete the tab.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> v2: no change
>
> drivers/irqchip/irq-gic-v5-irs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/irqchip/irq-gic-v5-irs.c b/drivers/irqchip/irq-gic-v5-irs.c
> index f845415f9143..ad1435a858a4 100644
> --- a/drivers/irqchip/irq-gic-v5-irs.c
> +++ b/drivers/irqchip/irq-gic-v5-irs.c
> @@ -568,7 +568,7 @@ static void __init gicv5_irs_init_bases(struct gicv5_irs_chip_data *irs_data,
> FIELD_PREP(GICV5_IRS_CR1_IST_RA, GICV5_NO_READ_ALLOC) |
> FIELD_PREP(GICV5_IRS_CR1_IC, GICV5_NON_CACHE) |
> FIELD_PREP(GICV5_IRS_CR1_OC, GICV5_NON_CACHE);
> - irs_data->flags |= IRS_FLAGS_NON_COHERENT;
> + irs_data->flags |= IRS_FLAGS_NON_COHERENT;
> } else {
> cr1 = FIELD_PREP(GICV5_IRS_CR1_VPED_WA, GICV5_WRITE_ALLOC) |
> FIELD_PREP(GICV5_IRS_CR1_VPED_RA, GICV5_READ_ALLOC) |
> --
> 2.47.2
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 1/3] irqchip/gic-v5: Delete a stray tab
2025-08-07 14:55 ` Dan Carpenter
@ 2025-08-20 8:51 ` Lorenzo Pieralisi
0 siblings, 0 replies; 8+ messages in thread
From: Lorenzo Pieralisi @ 2025-08-20 8:51 UTC (permalink / raw)
To: Dan Carpenter, Thomas Gleixner
Cc: Marc Zyngier, linux-arm-kernel, linux-kernel
On Thu, Aug 07, 2025 at 05:55:50PM +0300, Dan Carpenter wrote:
> Hi Thomas,
>
> Sorry, I screwed up the over letter so it was sent as a different
> thread. These three patches are still required. Lorenzo reviewed
> and tested them.
Hi Thomas,
forgive me the bother, just wanted to ask please if patches (2-3) in
this series are on your radar (patch 1 technically isn't a fix) or
should we resend them ?
I am going to be away for 2-weeks and wanted to make sure they did not
get lost (Dan sent them before the GICv5 driver code was queued in -next
for v6.17).
Thanks,
Lorenzo
> Reviewed-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
> Tested-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
>
> regards,
> dan carpenter
>
> On Thu, Jul 17, 2025 at 01:45:24PM -0500, Dan Carpenter wrote:
> > This line is indented one tab too far. Delete the tab.
> >
> > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> > ---
> > v2: no change
> >
> > drivers/irqchip/irq-gic-v5-irs.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/irqchip/irq-gic-v5-irs.c b/drivers/irqchip/irq-gic-v5-irs.c
> > index f845415f9143..ad1435a858a4 100644
> > --- a/drivers/irqchip/irq-gic-v5-irs.c
> > +++ b/drivers/irqchip/irq-gic-v5-irs.c
> > @@ -568,7 +568,7 @@ static void __init gicv5_irs_init_bases(struct gicv5_irs_chip_data *irs_data,
> > FIELD_PREP(GICV5_IRS_CR1_IST_RA, GICV5_NO_READ_ALLOC) |
> > FIELD_PREP(GICV5_IRS_CR1_IC, GICV5_NON_CACHE) |
> > FIELD_PREP(GICV5_IRS_CR1_OC, GICV5_NON_CACHE);
> > - irs_data->flags |= IRS_FLAGS_NON_COHERENT;
> > + irs_data->flags |= IRS_FLAGS_NON_COHERENT;
> > } else {
> > cr1 = FIELD_PREP(GICV5_IRS_CR1_VPED_WA, GICV5_WRITE_ALLOC) |
> > FIELD_PREP(GICV5_IRS_CR1_VPED_RA, GICV5_READ_ALLOC) |
> > --
> > 2.47.2
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 1/3] irqchip/gic-v5: Delete a stray tab
2025-07-17 18:45 ` [PATCH v2 1/3] irqchip/gic-v5: Delete a stray tab Dan Carpenter
2025-08-07 14:55 ` Dan Carpenter
@ 2025-08-22 1:00 ` Zenghui Yu
1 sibling, 0 replies; 8+ messages in thread
From: Zenghui Yu @ 2025-08-22 1:00 UTC (permalink / raw)
To: Dan Carpenter
Cc: Marc Zyngier, Lorenzo Pieralisi, Thomas Gleixner,
linux-arm-kernel, linux-kernel
On 2025/7/18 2:45, Dan Carpenter wrote:
> This line is indented one tab too far. Delete the tab.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Zenghui Yu <yuzenghui@huawei.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 2/3] irqchip/gic-v5: Fix forever loop in gicv5_its_create_itt_two_level() error handling
2025-07-17 18:45 ` [PATCH v2 2/3] irqchip/gic-v5: Fix forever loop in gicv5_its_create_itt_two_level() error handling Dan Carpenter
@ 2025-08-25 3:54 ` Zenghui Yu
0 siblings, 0 replies; 8+ messages in thread
From: Zenghui Yu @ 2025-08-25 3:54 UTC (permalink / raw)
To: Dan Carpenter
Cc: Lorenzo Pieralisi, Marc Zyngier, Thomas Gleixner, Timothy Hayes,
Sascha Bischoff, linux-arm-kernel, linux-kernel
On 2025/7/18 2:45, Dan Carpenter wrote:
> The "i" variable needs to be signed otherwise there is a forever loop
> in the cleanup code.
>
> Fixes: 57d72196dfc8 ("irqchip/gic-v5: Add GICv5 ITS support")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> v2: no change
>
> drivers/irqchip/irq-gic-v5-its.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Zenghui Yu <yuzenghui@huawei.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 3/3] irqchip/gic-v5: Fix error handling in gicv5_its_irq_domain_alloc()
2025-07-17 18:45 ` [PATCH v2 3/3] irqchip/gic-v5: Fix error handling in gicv5_its_irq_domain_alloc() Dan Carpenter
@ 2025-08-25 3:54 ` Zenghui Yu
0 siblings, 0 replies; 8+ messages in thread
From: Zenghui Yu @ 2025-08-25 3:54 UTC (permalink / raw)
To: Dan Carpenter
Cc: Lorenzo Pieralisi, Marc Zyngier, Thomas Gleixner, Sascha Bischoff,
Timothy Hayes, linux-arm-kernel, linux-kernel
On 2025/7/18 2:45, Dan Carpenter wrote:
> There are two issues to fix in this code:
> 1) If gicv5_alloc_lpi() fails the original code was checking the wrong
> variable. Fix the mixup between "ret" and "lpi".
> 2) Clean up from all the previous iterations and not just the current
> iteration.
>
> Fixes: 57d72196dfc8 ("irqchip/gic-v5: Add GICv5 ITS support")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> v2: In v1 I had the wrong goto if gicv5_alloc_lpi() failed. Also change
> the label name from out_free_lpi to out_free_irqs.
>
> drivers/irqchip/irq-gic-v5-its.c | 20 ++++++++++++++------
> 1 file changed, 14 insertions(+), 6 deletions(-)
Reviewed-by: Zenghui Yu <yuzenghui@huawei.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-08-25 4:02 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <cover.1752777667.git.dan.carpenter@linaro.org>
2025-07-17 18:45 ` [PATCH v2 1/3] irqchip/gic-v5: Delete a stray tab Dan Carpenter
2025-08-07 14:55 ` Dan Carpenter
2025-08-20 8:51 ` Lorenzo Pieralisi
2025-08-22 1:00 ` Zenghui Yu
2025-07-17 18:45 ` [PATCH v2 2/3] irqchip/gic-v5: Fix forever loop in gicv5_its_create_itt_two_level() error handling Dan Carpenter
2025-08-25 3:54 ` Zenghui Yu
2025-07-17 18:45 ` [PATCH v2 3/3] irqchip/gic-v5: Fix error handling in gicv5_its_irq_domain_alloc() Dan Carpenter
2025-08-25 3:54 ` Zenghui Yu
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).