Skip to content

Commit e95c64a

Browse files
mrutland-armctmarinas
authored andcommitted
irqchip/gic-common: Remove sync_access callback
The gic_configure_irq(), gic_dist_config(), and gic_cpu_config() functions each take an optional "sync_access" callback, but in almost all cases this is not used. The only user is the GICv3 driver's gic_cpu_init() function, which uses gic_redist_wait_for_rwp() as the "sync_access" callback for gic_cpu_config(). It would be simpler and clearer to remove the callback and have the GICv3 driver call gic_redist_wait_for_rwp() explicitly after gic_cpu_config(). Remove the "sync_access" callback, and call gic_redist_wait_for_rwp() explicitly in the GICv3 driver. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland <[email protected]> Cc: Alexandru Elisei <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Will Deacon <[email protected]> Reviewed-by: Marc Zyngier <[email protected]> Tested-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]> Acked-by: Thomas Gleixner <[email protected]>
1 parent 118d777 commit e95c64a

File tree

5 files changed

+16
-26
lines changed

5 files changed

+16
-26
lines changed

drivers/irqchip/irq-gic-common.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void gic_enable_quirks(u32 iidr, const struct gic_quirk *quirks,
4545
}
4646

4747
int gic_configure_irq(unsigned int irq, unsigned int type,
48-
void __iomem *base, void (*sync_access)(void))
48+
void __iomem *base)
4949
{
5050
u32 confmask = 0x2 << ((irq % 16) * 2);
5151
u32 confoff = (irq / 16) * 4;
@@ -84,14 +84,10 @@ int gic_configure_irq(unsigned int irq, unsigned int type,
8484

8585
raw_spin_unlock_irqrestore(&irq_controller_lock, flags);
8686

87-
if (sync_access)
88-
sync_access();
89-
9087
return ret;
9188
}
9289

93-
void gic_dist_config(void __iomem *base, int gic_irqs,
94-
void (*sync_access)(void))
90+
void gic_dist_config(void __iomem *base, int gic_irqs)
9591
{
9692
unsigned int i;
9793

@@ -118,12 +114,9 @@ void gic_dist_config(void __iomem *base, int gic_irqs,
118114
writel_relaxed(GICD_INT_EN_CLR_X32,
119115
base + GIC_DIST_ENABLE_CLEAR + i / 8);
120116
}
121-
122-
if (sync_access)
123-
sync_access();
124117
}
125118

126-
void gic_cpu_config(void __iomem *base, int nr, void (*sync_access)(void))
119+
void gic_cpu_config(void __iomem *base, int nr)
127120
{
128121
int i;
129122

@@ -144,7 +137,4 @@ void gic_cpu_config(void __iomem *base, int nr, void (*sync_access)(void))
144137
for (i = 0; i < nr; i += 4)
145138
writel_relaxed(GICD_INT_DEF_PRI_X4,
146139
base + GIC_DIST_PRI + i * 4 / 4);
147-
148-
if (sync_access)
149-
sync_access();
150140
}

drivers/irqchip/irq-gic-common.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ struct gic_quirk {
2020
};
2121

2222
int gic_configure_irq(unsigned int irq, unsigned int type,
23-
void __iomem *base, void (*sync_access)(void));
24-
void gic_dist_config(void __iomem *base, int gic_irqs,
25-
void (*sync_access)(void));
26-
void gic_cpu_config(void __iomem *base, int nr, void (*sync_access)(void));
23+
void __iomem *base);
24+
void gic_dist_config(void __iomem *base, int gic_irqs);
25+
void gic_cpu_config(void __iomem *base, int nr);
2726
void gic_enable_quirks(u32 iidr, const struct gic_quirk *quirks,
2827
void *data);
2928
void gic_enable_of_quirks(const struct device_node *np,

drivers/irqchip/irq-gic-v3.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ static int gic_set_type(struct irq_data *d, unsigned int type)
670670

671671
offset = convert_offset_index(d, GICD_ICFGR, &index);
672672

673-
ret = gic_configure_irq(index, type, base + offset, NULL);
673+
ret = gic_configure_irq(index, type, base + offset);
674674
if (ret && (range == PPI_RANGE || range == EPPI_RANGE)) {
675675
/* Misconfigured PPIs are usually not fatal */
676676
pr_warn("GIC: PPI INTID%ld is secure or misconfigured\n", irq);
@@ -940,7 +940,7 @@ static void __init gic_dist_init(void)
940940
writel_relaxed(GICD_INT_DEF_PRI_X4, base + GICD_IPRIORITYRnE + i);
941941

942942
/* Now do the common stuff */
943-
gic_dist_config(base, GIC_LINE_NR, NULL);
943+
gic_dist_config(base, GIC_LINE_NR);
944944

945945
val = GICD_CTLR_ARE_NS | GICD_CTLR_ENABLE_G1A | GICD_CTLR_ENABLE_G1;
946946
if (gic_data.rdists.gicd_typer2 & GICD_TYPER2_nASSGIcap) {
@@ -1282,7 +1282,8 @@ static void gic_cpu_init(void)
12821282
for (i = 0; i < gic_data.ppi_nr + SGI_NR; i += 32)
12831283
writel_relaxed(~0, rbase + GICR_IGROUPR0 + i / 8);
12841284

1285-
gic_cpu_config(rbase, gic_data.ppi_nr + SGI_NR, gic_redist_wait_for_rwp);
1285+
gic_cpu_config(rbase, gic_data.ppi_nr + SGI_NR);
1286+
gic_redist_wait_for_rwp();
12861287

12871288
/* initialise system registers */
12881289
gic_cpu_sys_reg_init();

drivers/irqchip/irq-gic.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ static int gic_set_type(struct irq_data *d, unsigned int type)
303303
type != IRQ_TYPE_EDGE_RISING)
304304
return -EINVAL;
305305

306-
ret = gic_configure_irq(gicirq, type, base + GIC_DIST_CONFIG, NULL);
306+
ret = gic_configure_irq(gicirq, type, base + GIC_DIST_CONFIG);
307307
if (ret && gicirq < 32) {
308308
/* Misconfigured PPIs are usually not fatal */
309309
pr_warn("GIC: PPI%ld is secure or misconfigured\n", gicirq - 16);
@@ -479,7 +479,7 @@ static void gic_dist_init(struct gic_chip_data *gic)
479479
for (i = 32; i < gic_irqs; i += 4)
480480
writel_relaxed(cpumask, base + GIC_DIST_TARGET + i * 4 / 4);
481481

482-
gic_dist_config(base, gic_irqs, NULL);
482+
gic_dist_config(base, gic_irqs);
483483

484484
writel_relaxed(GICD_ENABLE, base + GIC_DIST_CTRL);
485485
}
@@ -516,7 +516,7 @@ static int gic_cpu_init(struct gic_chip_data *gic)
516516
gic_cpu_map[i] &= ~cpu_mask;
517517
}
518518

519-
gic_cpu_config(dist_base, 32, NULL);
519+
gic_cpu_config(dist_base, 32);
520520

521521
writel_relaxed(GICC_INT_PRI_THRESHOLD, base + GIC_CPU_PRIMASK);
522522
gic_cpu_if_up(gic);

drivers/irqchip/irq-hip04.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static int hip04_irq_set_type(struct irq_data *d, unsigned int type)
130130

131131
raw_spin_lock(&irq_controller_lock);
132132

133-
ret = gic_configure_irq(irq, type, base + GIC_DIST_CONFIG, NULL);
133+
ret = gic_configure_irq(irq, type, base + GIC_DIST_CONFIG);
134134
if (ret && irq < 32) {
135135
/* Misconfigured PPIs are usually not fatal */
136136
pr_warn("GIC: PPI%d is secure or misconfigured\n", irq - 16);
@@ -260,7 +260,7 @@ static void __init hip04_irq_dist_init(struct hip04_irq_data *intc)
260260
for (i = 32; i < nr_irqs; i += 2)
261261
writel_relaxed(cpumask, base + GIC_DIST_TARGET + ((i * 2) & ~3));
262262

263-
gic_dist_config(base, nr_irqs, NULL);
263+
gic_dist_config(base, nr_irqs);
264264

265265
writel_relaxed(1, base + GIC_DIST_CTRL);
266266
}
@@ -287,7 +287,7 @@ static void hip04_irq_cpu_init(struct hip04_irq_data *intc)
287287
if (i != cpu)
288288
hip04_cpu_map[i] &= ~cpu_mask;
289289

290-
gic_cpu_config(dist_base, 32, NULL);
290+
gic_cpu_config(dist_base, 32);
291291

292292
writel_relaxed(0xf0, base + GIC_CPU_PRIMASK);
293293
writel_relaxed(1, base + GIC_CPU_CTRL);

0 commit comments

Comments
 (0)