Skip to content

Commit 8ab54ed

Browse files
committed
Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irqchip fixes from Thomas Gleixner: "Another set of ARM SoC related irqchip fixes: - Plug a memory leak in gicv3-its - Limit features to the root gic interrupt controller - Add a missing barrier in the gic-v3 IAR access - Another compile test fix for sun4i" * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: irqchip/gic-v3: Make sure read from ICC_IAR1_EL1 is visible on redestributor irqchip/gic: Only set the EOImodeNS bit for the root controller irqchip/gic: Only populate set_affinity for the root controller irqchip/gicv3-its: Fix memory leak in its_free_tables() irqchip/sun4i: Fix compilation outside of arch/arm
2 parents 2d23e61 + 49b245e commit 8ab54ed

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

arch/arm64/include/asm/arch_gicv3.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ static inline u64 gic_read_iar_common(void)
103103
u64 irqstat;
104104

105105
asm volatile("mrs_s %0, " __stringify(ICC_IAR1_EL1) : "=r" (irqstat));
106+
dsb(sy);
106107
return irqstat;
107108
}
108109

drivers/irqchip/irq-gic-v3-its.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ struct its_node {
6666
unsigned long phys_base;
6767
struct its_cmd_block *cmd_base;
6868
struct its_cmd_block *cmd_write;
69-
void *tables[GITS_BASER_NR_REGS];
69+
struct {
70+
void *base;
71+
u32 order;
72+
} tables[GITS_BASER_NR_REGS];
7073
struct its_collection *collections;
7174
struct list_head its_device_list;
7275
u64 flags;
@@ -807,9 +810,10 @@ static void its_free_tables(struct its_node *its)
807810
int i;
808811

809812
for (i = 0; i < GITS_BASER_NR_REGS; i++) {
810-
if (its->tables[i]) {
811-
free_page((unsigned long)its->tables[i]);
812-
its->tables[i] = NULL;
813+
if (its->tables[i].base) {
814+
free_pages((unsigned long)its->tables[i].base,
815+
its->tables[i].order);
816+
its->tables[i].base = NULL;
813817
}
814818
}
815819
}
@@ -890,7 +894,8 @@ static int its_alloc_tables(const char *node_name, struct its_node *its)
890894
goto out_free;
891895
}
892896

893-
its->tables[i] = base;
897+
its->tables[i].base = base;
898+
its->tables[i].order = order;
894899

895900
retry_baser:
896901
val = (virt_to_phys(base) |
@@ -940,7 +945,7 @@ static int its_alloc_tables(const char *node_name, struct its_node *its)
940945
* something is horribly wrong...
941946
*/
942947
free_pages((unsigned long)base, order);
943-
its->tables[i] = NULL;
948+
its->tables[i].base = NULL;
944949

945950
switch (psz) {
946951
case SZ_16K:

drivers/irqchip/irq-gic.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,6 @@ static struct irq_chip gic_chip = {
384384
.irq_unmask = gic_unmask_irq,
385385
.irq_eoi = gic_eoi_irq,
386386
.irq_set_type = gic_set_type,
387-
#ifdef CONFIG_SMP
388-
.irq_set_affinity = gic_set_affinity,
389-
#endif
390387
.irq_get_irqchip_state = gic_irq_get_irqchip_state,
391388
.irq_set_irqchip_state = gic_irq_set_irqchip_state,
392389
.flags = IRQCHIP_SET_TYPE_MASKED |
@@ -400,9 +397,6 @@ static struct irq_chip gic_eoimode1_chip = {
400397
.irq_unmask = gic_unmask_irq,
401398
.irq_eoi = gic_eoimode1_eoi_irq,
402399
.irq_set_type = gic_set_type,
403-
#ifdef CONFIG_SMP
404-
.irq_set_affinity = gic_set_affinity,
405-
#endif
406400
.irq_get_irqchip_state = gic_irq_get_irqchip_state,
407401
.irq_set_irqchip_state = gic_irq_set_irqchip_state,
408402
.irq_set_vcpu_affinity = gic_irq_set_vcpu_affinity,
@@ -443,7 +437,7 @@ static void gic_cpu_if_up(struct gic_chip_data *gic)
443437
u32 bypass = 0;
444438
u32 mode = 0;
445439

446-
if (static_key_true(&supports_deactivate))
440+
if (gic == &gic_data[0] && static_key_true(&supports_deactivate))
447441
mode = GIC_CPU_CTRL_EOImodeNS;
448442

449443
/*
@@ -1039,6 +1033,11 @@ static void __init __gic_init_bases(unsigned int gic_nr, int irq_start,
10391033
gic->chip.name = kasprintf(GFP_KERNEL, "GIC-%d", gic_nr);
10401034
}
10411035

1036+
#ifdef CONFIG_SMP
1037+
if (gic_nr == 0)
1038+
gic->chip.irq_set_affinity = gic_set_affinity;
1039+
#endif
1040+
10421041
#ifdef CONFIG_GIC_NON_BANKED
10431042
if (percpu_offset) { /* Frankein-GIC without banked registers... */
10441043
unsigned int cpu;

drivers/irqchip/irq-sun4i.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include <linux/of_irq.h>
2323

2424
#include <asm/exception.h>
25-
#include <asm/mach/irq.h>
2625

2726
#define SUN4I_IRQ_VECTOR_REG 0x00
2827
#define SUN4I_IRQ_PROTECTION_REG 0x08

0 commit comments

Comments
 (0)