Skip to contentSkip to conversation

irqchip/gic-v5: Delete a stray tab

PATCH In review Dan Carpenter 3 participants 8 messages Jul 17, 2025 – Aug 25, 2025 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH v2 1/3 irqchip/gic-v5: Delete a stray tab

This line is indented one tab too far. Delete the tab.

---
v2: no change

 drivers/irqchip/irq-gic-v5-irs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-gic-v5-irs.c +1 -1
index f845415f9143..ad1435a858a4 100644
@@ -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)	|
Signature · 1 line
2.47.2
author Reviewed-by Lorenzo Pieralisi Tested-by Lorenzo Pieralisi on v2 1/3
#2 lore raw

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.

regards,
dan carpenter

Quoted 24 lines · Dan Carpenter

This line is indented one tab too far. Delete the tab.

---
v2: no change

 drivers/irqchip/irq-gic-v5-irs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-gic-v5-irs.c +1 -1
index f845415f9143..ad1435a858a4 100644
@@ -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)	|
Signature · 1 line
2.47.2
#3 lore raw
Quoted 5 lines · Dan Carpenter

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

Quoted 31 lines

regards,
dan carpenter

Quoted 24 lines · Dan Carpenter

This line is indented one tab too far. Delete the tab.

---
v2: no change

 drivers/irqchip/irq-gic-v5-irs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-gic-v5-irs.c +1 -1
index f845415f9143..ad1435a858a4 100644
@@ -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)	|
Signature · 1 line
2.47.2
#5 lore raw

PATCH v2 2/3 irqchip/gic-v5: Fix forever loop in gicv5_its_create_itt_two_level() error handling

In reply to a message not in the archive

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")

---
v2: no change

 drivers/irqchip/irq-gic-v5-its.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/irqchip/irq-gic-v5-its.c +2 -2
index 340640fdbdf6..55360ae9f1f6 100644
@@ -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);
Signature · 1 line
2.47.2
Reviewed-by on v2 2/3
#6 lore raw

Re: [PATCH v2 2/3] irqchip/gic-v5: Fix forever loop in gicv5_its_create_itt_two_level() error handling

Quoted 10 lines · Dan Carpenter

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")

---
v2: no change

 drivers/irqchip/irq-gic-v5-its.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
#7 lore raw

PATCH v2 3/3 irqchip/gic-v5: Fix error handling in gicv5_its_irq_domain_alloc()

In reply to a message not in the archive

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")

---
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(-)
drivers/irqchip/irq-gic-v5-its.c +14 -6
index 55360ae9f1f6..40e361d5499c 100644
@@ -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;
Signature · 1 line
2.47.2
Reviewed-by on v2 3/3
#8 lore raw

Re: [PATCH v2 3/3] irqchip/gic-v5: Fix error handling in gicv5_its_irq_domain_alloc()

Quoted 6 lines · Dan Carpenter

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.

Quoted 8 lines
Fixes 57d72196dfc8 ("irqchip/gic-v5: Add GICv5 ITS support")

---
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(-)