Skip to content

Commit 5f5739d

Browse files
author
Marc Zyngier
committed
Merge branch irq/irq_cpu_offline into irq/irqchip-next
* irq/irq_cpu_offline: : . : Make irq_cpu_{on,off}line() deprecated kernel API, and only : enable it for some obscure Cavium platform after having : moved all the other users away from it. : : Next step, drop the platform itself. : . genirq: Hide irq_cpu_{on,off}line() behind a deprecated option irqchip/mips-gic: Get rid of the reliance on irq_cpu_online() MIPS: loongson64: Drop call to irq_cpu_offline() Signed-off-by: Marc Zyngier <[email protected]>
2 parents c6dca71 + 8d15a72 commit 5f5739d

File tree

5 files changed

+39
-13
lines changed

5 files changed

+39
-13
lines changed

arch/mips/loongson64/smp.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,6 @@ static int loongson3_cpu_disable(void)
550550
set_cpu_online(cpu, false);
551551
calculate_cpu_foreign_map();
552552
local_irq_save(flags);
553-
irq_cpu_offline();
554553
clear_c0_status(ST0_IM);
555554
local_irq_restore(flags);
556555
local_flush_tlb_all();

drivers/irqchip/irq-mips-gic.c

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -381,24 +381,35 @@ static void gic_unmask_local_irq_all_vpes(struct irq_data *d)
381381
spin_unlock_irqrestore(&gic_lock, flags);
382382
}
383383

384-
static void gic_all_vpes_irq_cpu_online(struct irq_data *d)
384+
static void gic_all_vpes_irq_cpu_online(void)
385385
{
386-
struct gic_all_vpes_chip_data *cd;
387-
unsigned int intr;
386+
static const unsigned int local_intrs[] = {
387+
GIC_LOCAL_INT_TIMER,
388+
GIC_LOCAL_INT_PERFCTR,
389+
GIC_LOCAL_INT_FDC,
390+
};
391+
unsigned long flags;
392+
int i;
388393

389-
intr = GIC_HWIRQ_TO_LOCAL(d->hwirq);
390-
cd = irq_data_get_irq_chip_data(d);
394+
spin_lock_irqsave(&gic_lock, flags);
391395

392-
write_gic_vl_map(mips_gic_vx_map_reg(intr), cd->map);
393-
if (cd->mask)
394-
write_gic_vl_smask(BIT(intr));
396+
for (i = 0; i < ARRAY_SIZE(local_intrs); i++) {
397+
unsigned int intr = local_intrs[i];
398+
struct gic_all_vpes_chip_data *cd;
399+
400+
cd = &gic_all_vpes_chip_data[intr];
401+
write_gic_vl_map(mips_gic_vx_map_reg(intr), cd->map);
402+
if (cd->mask)
403+
write_gic_vl_smask(BIT(intr));
404+
}
405+
406+
spin_unlock_irqrestore(&gic_lock, flags);
395407
}
396408

397409
static struct irq_chip gic_all_vpes_local_irq_controller = {
398410
.name = "MIPS GIC Local",
399411
.irq_mask = gic_mask_local_irq_all_vpes,
400412
.irq_unmask = gic_unmask_local_irq_all_vpes,
401-
.irq_cpu_online = gic_all_vpes_irq_cpu_online,
402413
};
403414

404415
static void __gic_irq_dispatch(void)
@@ -477,6 +488,10 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int virq,
477488
intr = GIC_HWIRQ_TO_LOCAL(hwirq);
478489
map = GIC_MAP_PIN_MAP_TO_PIN | gic_cpu_pin;
479490

491+
/*
492+
* If adding support for more per-cpu interrupts, keep the the
493+
* array in gic_all_vpes_irq_cpu_online() in sync.
494+
*/
480495
switch (intr) {
481496
case GIC_LOCAL_INT_TIMER:
482497
/* CONFIG_MIPS_CMP workaround (see __gic_init) */
@@ -663,8 +678,8 @@ static int gic_cpu_startup(unsigned int cpu)
663678
/* Clear all local IRQ masks (ie. disable all local interrupts) */
664679
write_gic_vl_rmask(~0);
665680

666-
/* Invoke irq_cpu_online callbacks to enable desired interrupts */
667-
irq_cpu_online();
681+
/* Enable desired interrupts */
682+
gic_all_vpes_irq_cpu_online();
668683

669684
return 0;
670685
}

include/linux/irq.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,9 +524,10 @@ struct irq_chip {
524524
void (*irq_bus_lock)(struct irq_data *data);
525525
void (*irq_bus_sync_unlock)(struct irq_data *data);
526526

527+
#ifdef CONFIG_DEPRECATED_IRQ_CPU_ONOFFLINE
527528
void (*irq_cpu_online)(struct irq_data *data);
528529
void (*irq_cpu_offline)(struct irq_data *data);
529-
530+
#endif
530531
void (*irq_suspend)(struct irq_data *data);
531532
void (*irq_resume)(struct irq_data *data);
532533
void (*irq_pm_shutdown)(struct irq_data *data);
@@ -606,8 +607,10 @@ struct irqaction;
606607
extern int setup_percpu_irq(unsigned int irq, struct irqaction *new);
607608
extern void remove_percpu_irq(unsigned int irq, struct irqaction *act);
608609

610+
#ifdef CONFIG_DEPRECATED_IRQ_CPU_ONOFFLINE
609611
extern void irq_cpu_online(void);
610612
extern void irq_cpu_offline(void);
613+
#endif
611614
extern int irq_set_affinity_locked(struct irq_data *data,
612615
const struct cpumask *cpumask, bool force);
613616
extern int irq_set_vcpu_affinity(unsigned int irq, void *vcpu_info);

kernel/irq/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,10 @@ config GENERIC_IRQ_MULTI_HANDLER
141141
bool
142142
help
143143
Allow to specify the low level IRQ handler at run time.
144+
145+
# Cavium Octeon is the last system to use this deprecated option
146+
# Do not even think of enabling this on any new platform
147+
config DEPRECATED_IRQ_CPU_ONOFFLINE
148+
bool
149+
depends on CAVIUM_OCTEON_SOC
150+
default CAVIUM_OCTEON_SOC

kernel/irq/chip.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,6 +1122,7 @@ void irq_modify_status(unsigned int irq, unsigned long clr, unsigned long set)
11221122
}
11231123
EXPORT_SYMBOL_GPL(irq_modify_status);
11241124

1125+
#ifdef CONFIG_DEPRECATED_IRQ_CPU_ONOFFLINE
11251126
/**
11261127
* irq_cpu_online - Invoke all irq_cpu_online functions.
11271128
*
@@ -1181,6 +1182,7 @@ void irq_cpu_offline(void)
11811182
raw_spin_unlock_irqrestore(&desc->lock, flags);
11821183
}
11831184
}
1185+
#endif
11841186

11851187
#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
11861188

0 commit comments

Comments
 (0)