Skip to content

Commit 9dae41a

Browse files
committed
Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irq fixes from Thomas Gleixner: "A pile of smallish changes all over the place: - Add a missing ISB in the GIC V1 driver - Remove an ACPI version check in the GIC V3 ITS driver - Add the missing irq_pm_shutdown function for BRCMSTB-L2 to avoid spurious wakeups - Remove the artifical limitation of ITS instances to the number of NUMA nodes which prevents utilizing the ITS hardware correctly - Prevent a infinite parsing loop in the GIC-V3 ITS/MSI code - Honour the force affinity argument in the GIC-V3 driver which is required to make perf work correctly - Correctly report allocation failures in GIC-V2/V3 to avoid using half allocated and initialized interrupts. - Fixup checks against nr_cpu_ids in the generic IPI code" * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: genirq/ipi: Fixup checks against nr_cpu_ids genirq: Restore trigger settings in irq_modify_status() MAINTAINERS: Remove Jason Cooper's irqchip git tree irqchip/gic-v3-its-platform-msi: Fix msi-parent parsing loop irqchip/gic-v3-its: Allow GIC ITS number more than MAX_NUMNODES irqchip: brcmstb-l2: Define an irq_pm_shutdown function irqchip/gic: Ensure we have an ISB between ack and ->handle_irq irqchip/gic-v3-its: Remove ACPICA version check for ACPI NUMA irqchip/gic-v3: Honor forced affinity setting irqchip/gic-v3: Report failures in gic_irq_domain_alloc irqchip/gic-v2: Report failures in gic_irq_domain_alloc irqchip/atmel-aic: Remove root argument from ->fixup() prototype irqchip/atmel-aic: Fix unbalanced refcount in aic_common_rtc_irq_fixup() irqchip/atmel-aic: Fix unbalanced of_node_put() in aic_common_irq_fixup()
2 parents e18a5eb + 8fbbe2d commit 9dae41a

12 files changed

+84
-38
lines changed

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7110,7 +7110,6 @@ M: Marc Zyngier <marc.zyngier@arm.com>
71107110
L: linux-kernel@vger.kernel.org
71117111
S: Maintained
71127112
T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core
7113-
T: git git://git.infradead.org/users/jcooper/linux.git irqchip/core
71147113
F: Documentation/devicetree/bindings/interrupt-controller/
71157114
F: drivers/irqchip/
71167115

drivers/irqchip/irq-atmel-aic-common.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,14 @@ static void __init aic_common_ext_irq_of_init(struct irq_domain *domain)
137137
#define AT91_RTC_IMR 0x28
138138
#define AT91_RTC_IRQ_MASK 0x1f
139139

140-
void __init aic_common_rtc_irq_fixup(struct device_node *root)
140+
void __init aic_common_rtc_irq_fixup(void)
141141
{
142142
struct device_node *np;
143143
void __iomem *regs;
144144

145-
np = of_find_compatible_node(root, NULL, "atmel,at91rm9200-rtc");
145+
np = of_find_compatible_node(NULL, NULL, "atmel,at91rm9200-rtc");
146146
if (!np)
147-
np = of_find_compatible_node(root, NULL,
147+
np = of_find_compatible_node(NULL, NULL,
148148
"atmel,at91sam9x5-rtc");
149149

150150
if (!np)
@@ -165,7 +165,7 @@ void __init aic_common_rtc_irq_fixup(struct device_node *root)
165165
#define AT91_RTT_ALMIEN (1 << 16) /* Alarm Interrupt Enable */
166166
#define AT91_RTT_RTTINCIEN (1 << 17) /* Real Time Timer Increment Interrupt Enable */
167167

168-
void __init aic_common_rtt_irq_fixup(struct device_node *root)
168+
void __init aic_common_rtt_irq_fixup(void)
169169
{
170170
struct device_node *np;
171171
void __iomem *regs;
@@ -196,11 +196,10 @@ static void __init aic_common_irq_fixup(const struct of_device_id *matches)
196196
return;
197197

198198
match = of_match_node(matches, root);
199-
of_node_put(root);
200199

201200
if (match) {
202-
void (*fixup)(struct device_node *) = match->data;
203-
fixup(root);
201+
void (*fixup)(void) = match->data;
202+
fixup();
204203
}
205204

206205
of_node_put(root);

drivers/irqchip/irq-atmel-aic-common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ struct irq_domain *__init aic_common_of_init(struct device_node *node,
3333
const char *name, int nirqs,
3434
const struct of_device_id *matches);
3535

36-
void __init aic_common_rtc_irq_fixup(struct device_node *root);
36+
void __init aic_common_rtc_irq_fixup(void);
3737

38-
void __init aic_common_rtt_irq_fixup(struct device_node *root);
38+
void __init aic_common_rtt_irq_fixup(void);
3939

4040
#endif /* __IRQ_ATMEL_AIC_COMMON_H */

drivers/irqchip/irq-atmel-aic.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -209,20 +209,20 @@ static const struct irq_domain_ops aic_irq_ops = {
209209
.xlate = aic_irq_domain_xlate,
210210
};
211211

212-
static void __init at91rm9200_aic_irq_fixup(struct device_node *root)
212+
static void __init at91rm9200_aic_irq_fixup(void)
213213
{
214-
aic_common_rtc_irq_fixup(root);
214+
aic_common_rtc_irq_fixup();
215215
}
216216

217-
static void __init at91sam9260_aic_irq_fixup(struct device_node *root)
217+
static void __init at91sam9260_aic_irq_fixup(void)
218218
{
219-
aic_common_rtt_irq_fixup(root);
219+
aic_common_rtt_irq_fixup();
220220
}
221221

222-
static void __init at91sam9g45_aic_irq_fixup(struct device_node *root)
222+
static void __init at91sam9g45_aic_irq_fixup(void)
223223
{
224-
aic_common_rtc_irq_fixup(root);
225-
aic_common_rtt_irq_fixup(root);
224+
aic_common_rtc_irq_fixup();
225+
aic_common_rtt_irq_fixup();
226226
}
227227

228228
static const struct of_device_id aic_irq_fixups[] __initconst = {

drivers/irqchip/irq-atmel-aic5.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,9 @@ static const struct irq_domain_ops aic5_irq_ops = {
305305
.xlate = aic5_irq_domain_xlate,
306306
};
307307

308-
static void __init sama5d3_aic_irq_fixup(struct device_node *root)
308+
static void __init sama5d3_aic_irq_fixup(void)
309309
{
310-
aic_common_rtc_irq_fixup(root);
310+
aic_common_rtc_irq_fixup();
311311
}
312312

313313
static const struct of_device_id aic5_irq_fixups[] __initconst = {

drivers/irqchip/irq-brcmstb-l2.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ static int __init brcmstb_l2_intc_of_init(struct device_node *np,
189189

190190
ct->chip.irq_suspend = brcmstb_l2_intc_suspend;
191191
ct->chip.irq_resume = brcmstb_l2_intc_resume;
192+
ct->chip.irq_pm_shutdown = brcmstb_l2_intc_suspend;
192193

193194
if (data->can_wake) {
194195
/* This IRQ chip can wake the system, set all child interrupts

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ static int of_pmsi_get_dev_id(struct irq_domain *domain, struct device *dev,
4343
*dev_id = args.args[0];
4444
break;
4545
}
46+
index++;
4647
} while (!ret);
4748

4849
return ret;

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

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,15 +1835,15 @@ static int __init its_of_probe(struct device_node *node)
18351835

18361836
#define ACPI_GICV3_ITS_MEM_SIZE (SZ_128K)
18371837

1838-
#if defined(CONFIG_ACPI_NUMA) && (ACPI_CA_VERSION >= 0x20170531)
1838+
#ifdef CONFIG_ACPI_NUMA
18391839
struct its_srat_map {
18401840
/* numa node id */
18411841
u32 numa_node;
18421842
/* GIC ITS ID */
18431843
u32 its_id;
18441844
};
18451845

1846-
static struct its_srat_map its_srat_maps[MAX_NUMNODES] __initdata;
1846+
static struct its_srat_map *its_srat_maps __initdata;
18471847
static int its_in_srat __initdata;
18481848

18491849
static int __init acpi_get_its_numa_node(u32 its_id)
@@ -1857,6 +1857,12 @@ static int __init acpi_get_its_numa_node(u32 its_id)
18571857
return NUMA_NO_NODE;
18581858
}
18591859

1860+
static int __init gic_acpi_match_srat_its(struct acpi_subtable_header *header,
1861+
const unsigned long end)
1862+
{
1863+
return 0;
1864+
}
1865+
18601866
static int __init gic_acpi_parse_srat_its(struct acpi_subtable_header *header,
18611867
const unsigned long end)
18621868
{
@@ -1873,12 +1879,6 @@ static int __init gic_acpi_parse_srat_its(struct acpi_subtable_header *header,
18731879
return -EINVAL;
18741880
}
18751881

1876-
if (its_in_srat >= MAX_NUMNODES) {
1877-
pr_err("SRAT: ITS affinity exceeding max count[%d]\n",
1878-
MAX_NUMNODES);
1879-
return -EINVAL;
1880-
}
1881-
18821882
node = acpi_map_pxm_to_node(its_affinity->proximity_domain);
18831883

18841884
if (node == NUMA_NO_NODE || node >= MAX_NUMNODES) {
@@ -1897,14 +1897,37 @@ static int __init gic_acpi_parse_srat_its(struct acpi_subtable_header *header,
18971897

18981898
static void __init acpi_table_parse_srat_its(void)
18991899
{
1900+
int count;
1901+
1902+
count = acpi_table_parse_entries(ACPI_SIG_SRAT,
1903+
sizeof(struct acpi_table_srat),
1904+
ACPI_SRAT_TYPE_GIC_ITS_AFFINITY,
1905+
gic_acpi_match_srat_its, 0);
1906+
if (count <= 0)
1907+
return;
1908+
1909+
its_srat_maps = kmalloc(count * sizeof(struct its_srat_map),
1910+
GFP_KERNEL);
1911+
if (!its_srat_maps) {
1912+
pr_warn("SRAT: Failed to allocate memory for its_srat_maps!\n");
1913+
return;
1914+
}
1915+
19001916
acpi_table_parse_entries(ACPI_SIG_SRAT,
19011917
sizeof(struct acpi_table_srat),
19021918
ACPI_SRAT_TYPE_GIC_ITS_AFFINITY,
19031919
gic_acpi_parse_srat_its, 0);
19041920
}
1921+
1922+
/* free the its_srat_maps after ITS probing */
1923+
static void __init acpi_its_srat_maps_free(void)
1924+
{
1925+
kfree(its_srat_maps);
1926+
}
19051927
#else
19061928
static void __init acpi_table_parse_srat_its(void) { }
19071929
static int __init acpi_get_its_numa_node(u32 its_id) { return NUMA_NO_NODE; }
1930+
static void __init acpi_its_srat_maps_free(void) { }
19081931
#endif
19091932

19101933
static int __init gic_acpi_parse_madt_its(struct acpi_subtable_header *header,
@@ -1951,6 +1974,7 @@ static void __init its_acpi_probe(void)
19511974
acpi_table_parse_srat_its();
19521975
acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_TRANSLATOR,
19531976
gic_acpi_parse_madt_its, 0);
1977+
acpi_its_srat_maps_free();
19541978
}
19551979
#else
19561980
static void __init its_acpi_probe(void) { }

drivers/irqchip/irq-gic-v3.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,8 @@ static asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs
353353

354354
if (static_key_true(&supports_deactivate))
355355
gic_write_eoir(irqnr);
356+
else
357+
isb();
356358

357359
err = handle_domain_irq(gic_data.domain, irqnr, regs);
358360
if (err) {
@@ -640,11 +642,16 @@ static void gic_smp_init(void)
640642
static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
641643
bool force)
642644
{
643-
unsigned int cpu = cpumask_any_and(mask_val, cpu_online_mask);
645+
unsigned int cpu;
644646
void __iomem *reg;
645647
int enabled;
646648
u64 val;
647649

650+
if (force)
651+
cpu = cpumask_first(mask_val);
652+
else
653+
cpu = cpumask_any_and(mask_val, cpu_online_mask);
654+
648655
if (cpu >= nr_cpu_ids)
649656
return -EINVAL;
650657

@@ -831,8 +838,11 @@ static int gic_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,
831838
if (ret)
832839
return ret;
833840

834-
for (i = 0; i < nr_irqs; i++)
835-
gic_irq_domain_map(domain, virq + i, hwirq + i);
841+
for (i = 0; i < nr_irqs; i++) {
842+
ret = gic_irq_domain_map(domain, virq + i, hwirq + i);
843+
if (ret)
844+
return ret;
845+
}
836846

837847
return 0;
838848
}

drivers/irqchip/irq-gic.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ static void __exception_irq_entry gic_handle_irq(struct pt_regs *regs)
361361
if (likely(irqnr > 15 && irqnr < 1020)) {
362362
if (static_key_true(&supports_deactivate))
363363
writel_relaxed(irqstat, cpu_base + GIC_CPU_EOI);
364+
isb();
364365
handle_domain_irq(gic->domain, irqnr, regs);
365366
continue;
366367
}
@@ -401,10 +402,12 @@ static void gic_handle_cascade_irq(struct irq_desc *desc)
401402
goto out;
402403

403404
cascade_irq = irq_find_mapping(chip_data->domain, gic_irq);
404-
if (unlikely(gic_irq < 32 || gic_irq > 1020))
405+
if (unlikely(gic_irq < 32 || gic_irq > 1020)) {
405406
handle_bad_irq(desc);
406-
else
407+
} else {
408+
isb();
407409
generic_handle_irq(cascade_irq);
410+
}
408411

409412
out:
410413
chained_irq_exit(chip, desc);
@@ -1027,8 +1030,11 @@ static int gic_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,
10271030
if (ret)
10281031
return ret;
10291032

1030-
for (i = 0; i < nr_irqs; i++)
1031-
gic_irq_domain_map(domain, virq + i, hwirq + i);
1033+
for (i = 0; i < nr_irqs; i++) {
1034+
ret = gic_irq_domain_map(domain, virq + i, hwirq + i);
1035+
if (ret)
1036+
return ret;
1037+
}
10321038

10331039
return 0;
10341040
}

kernel/irq/chip.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ EXPORT_SYMBOL_GPL(irq_set_chip_and_handler_name);
10001000

10011001
void irq_modify_status(unsigned int irq, unsigned long clr, unsigned long set)
10021002
{
1003-
unsigned long flags;
1003+
unsigned long flags, trigger, tmp;
10041004
struct irq_desc *desc = irq_get_desc_lock(irq, &flags, 0);
10051005

10061006
if (!desc)
@@ -1014,6 +1014,8 @@ void irq_modify_status(unsigned int irq, unsigned long clr, unsigned long set)
10141014

10151015
irq_settings_clr_and_set(desc, clr, set);
10161016

1017+
trigger = irqd_get_trigger_type(&desc->irq_data);
1018+
10171019
irqd_clear(&desc->irq_data, IRQD_NO_BALANCING | IRQD_PER_CPU |
10181020
IRQD_TRIGGER_MASK | IRQD_LEVEL | IRQD_MOVE_PCNTXT);
10191021
if (irq_settings_has_no_balance_set(desc))
@@ -1025,7 +1027,11 @@ void irq_modify_status(unsigned int irq, unsigned long clr, unsigned long set)
10251027
if (irq_settings_is_level(desc))
10261028
irqd_set(&desc->irq_data, IRQD_LEVEL);
10271029

1028-
irqd_set(&desc->irq_data, irq_settings_get_trigger_mask(desc));
1030+
tmp = irq_settings_get_trigger_mask(desc);
1031+
if (tmp != IRQ_TYPE_NONE)
1032+
trigger = tmp;
1033+
1034+
irqd_set(&desc->irq_data, trigger);
10291035

10301036
irq_put_desc_unlock(desc, flags);
10311037
}

kernel/irq/ipi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ irq_hw_number_t ipi_get_hwirq(unsigned int irq, unsigned int cpu)
165165
struct irq_data *data = irq_get_irq_data(irq);
166166
struct cpumask *ipimask = data ? irq_data_get_affinity_mask(data) : NULL;
167167

168-
if (!data || !ipimask || cpu > nr_cpu_ids)
168+
if (!data || !ipimask || cpu >= nr_cpu_ids)
169169
return INVALID_HWIRQ;
170170

171171
if (!cpumask_test_cpu(cpu, ipimask))
@@ -195,7 +195,7 @@ static int ipi_send_verify(struct irq_chip *chip, struct irq_data *data,
195195
if (!chip->ipi_send_single && !chip->ipi_send_mask)
196196
return -EINVAL;
197197

198-
if (cpu > nr_cpu_ids)
198+
if (cpu >= nr_cpu_ids)
199199
return -EINVAL;
200200

201201
if (dest) {

0 commit comments

Comments
 (0)