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()
Unified · Split
| @@ -7110,7 +7110,6 @@ M: Marc Zyngier <marc.zyngier@arm.com> · 7109 unmodified lines | ||
| 7110 | 7110 | L: linux-kernel@vger.kernel.org |
| 7111 | 7111 | S: Maintained |
| 7112 | 7112 | 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 | |
| 7114 | 7113 | F: Documentation/devicetree/bindings/interrupt-controller/ |
| 7115 | 7114 | F: drivers/irqchip/ |
| 7116 | 7115 | |
| @@ -137,14 +137,14 @@ static void __init aic_common_ext_irq_of_init(struct irq_domain *domain) · 136 unmodified lines | ||
| 137 | 137 | #define AT91_RTC_IMR 0x28 |
| 138 | 138 | #define AT91_RTC_IRQ_MASK 0x1f |
| 139 | 139 | |
| 140 | −void __init aic_common_rtc_irq_fixup(struct device_node *root) | |
| 140 | +void __init aic_common_rtc_irq_fixup(void) | |
| 141 | 141 | { |
| 142 | 142 | struct device_node *np; |
| 143 | 143 | void __iomem *regs; |
| 144 | 144 | |
| 145 | − np = of_find_compatible_node(root, NULL, "atmel,at91rm9200-rtc"); | |
| 145 | + np = of_find_compatible_node(NULL, NULL, "atmel,at91rm9200-rtc"); | |
| 146 | 146 | if (!np) |
| 147 | − np = of_find_compatible_node(root, NULL, | |
| 147 | + np = of_find_compatible_node(NULL, NULL, | |
| 148 | 148 | "atmel,at91sam9x5-rtc"); |
| 149 | 149 | |
| 150 | 150 | if (!np) |
| @@ -165,7 +165,7 @@ void __init aic_common_rtc_irq_fixup(struct device_node *root) · 14 unmodified lines | ||
| 165 | 165 | #define AT91_RTT_ALMIEN (1 << 16) /* Alarm Interrupt Enable */ |
| 166 | 166 | #define AT91_RTT_RTTINCIEN (1 << 17) /* Real Time Timer Increment Interrupt Enable */ |
| 167 | 167 | |
| 168 | −void __init aic_common_rtt_irq_fixup(struct device_node *root) | |
| 168 | +void __init aic_common_rtt_irq_fixup(void) | |
| 169 | 169 | { |
| 170 | 170 | struct device_node *np; |
| 171 | 171 | void __iomem *regs; |
| @@ -196,11 +196,10 @@ static void __init aic_common_irq_fixup(const struct of_device_id *matches) · 24 unmodified lines | ||
| 196 | 196 | return; |
| 197 | 197 | |
| 198 | 198 | match = of_match_node(matches, root); |
| 199 | − of_node_put(root); | |
| 200 | 199 | |
| 201 | 200 | if (match) { |
| 202 | − void (*fixup)(struct device_node *) = match->data; | |
| 203 | − fixup(root); | |
| 201 | + void (*fixup)(void) = match->data; | |
| 202 | + fixup(); | |
| 204 | 203 | } |
| 205 | 204 | |
| 206 | 205 | of_node_put(root); |
| @@ -33,8 +33,8 @@ struct irq_domain *__init aic_common_of_init(struct device_node *node, · 32 unmodified lines | ||
| 33 | 33 | const char *name, int nirqs, |
| 34 | 34 | const struct of_device_id *matches); |
| 35 | 35 | |
| 36 | −void __init aic_common_rtc_irq_fixup(struct device_node *root); | |
| 36 | +void __init aic_common_rtc_irq_fixup(void); | |
| 37 | 37 | |
| 38 | −void __init aic_common_rtt_irq_fixup(struct device_node *root); | |
| 38 | +void __init aic_common_rtt_irq_fixup(void); | |
| 39 | 39 | |
| 40 | 40 | #endif /* __IRQ_ATMEL_AIC_COMMON_H */ |
| @@ -209,20 +209,20 @@ static const struct irq_domain_ops aic_irq_ops = { · 208 unmodified lines | ||
| 209 | 209 | .xlate = aic_irq_domain_xlate, |
| 210 | 210 | }; |
| 211 | 211 | |
| 212 | −static void __init at91rm9200_aic_irq_fixup(struct device_node *root) | |
| 212 | +static void __init at91rm9200_aic_irq_fixup(void) | |
| 213 | 213 | { |
| 214 | − aic_common_rtc_irq_fixup(root); | |
| 214 | + aic_common_rtc_irq_fixup(); | |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | −static void __init at91sam9260_aic_irq_fixup(struct device_node *root) | |
| 217 | +static void __init at91sam9260_aic_irq_fixup(void) | |
| 218 | 218 | { |
| 219 | − aic_common_rtt_irq_fixup(root); | |
| 219 | + aic_common_rtt_irq_fixup(); | |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | −static void __init at91sam9g45_aic_irq_fixup(struct device_node *root) | |
| 222 | +static void __init at91sam9g45_aic_irq_fixup(void) | |
| 223 | 223 | { |
| 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(); | |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | static const struct of_device_id aic_irq_fixups[] __initconst = { |
| @@ -305,9 +305,9 @@ static const struct irq_domain_ops aic5_irq_ops = { · 304 unmodified lines | ||
| 305 | 305 | .xlate = aic5_irq_domain_xlate, |
| 306 | 306 | }; |
| 307 | 307 | |
| 308 | −static void __init sama5d3_aic_irq_fixup(struct device_node *root) | |
| 308 | +static void __init sama5d3_aic_irq_fixup(void) | |
| 309 | 309 | { |
| 310 | − aic_common_rtc_irq_fixup(root); | |
| 310 | + aic_common_rtc_irq_fixup(); | |
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | static const struct of_device_id aic5_irq_fixups[] __initconst = { |
| @@ -189,6 +189,7 @@ static int __init brcmstb_l2_intc_of_init(struct device_node *np, · 188 unmodified lines | ||
| 189 | 189 | |
| 190 | 190 | ct->chip.irq_suspend = brcmstb_l2_intc_suspend; |
| 191 | 191 | ct->chip.irq_resume = brcmstb_l2_intc_resume; |
| 192 | + ct->chip.irq_pm_shutdown = brcmstb_l2_intc_suspend; | |
| 192 | 193 | |
| 193 | 194 | if (data->can_wake) { |
| 194 | 195 | /* This IRQ chip can wake the system, set all child interrupts |
| @@ -43,6 +43,7 @@ static int of_pmsi_get_dev_id(struct irq_domain *domain, struct device *dev, · 42 unmodified lines | ||
| 43 | 43 | *dev_id = args.args[0]; |
| 44 | 44 | break; |
| 45 | 45 | } |
| 46 | + index++; | |
| 46 | 47 | } while (!ret); |
| 47 | 48 | |
| 48 | 49 | return ret; |
| @@ -1835,7 +1835,7 @@ static int __init its_of_probe(struct device_node *node) · 1834 unmodified lines | ||
| 1835 | 1835 | |
| 1836 | 1836 | #define ACPI_GICV3_ITS_MEM_SIZE (SZ_128K) |
| 1837 | 1837 | |
| 1838 | −#if defined(CONFIG_ACPI_NUMA) && (ACPI_CA_VERSION >= 0x20170531) | |
| 1838 | +#ifdef CONFIG_ACPI_NUMA | |
| 1839 | 1839 | struct its_srat_map { |
| 1840 | 1840 | /* numa node id */ |
| 1841 | 1841 | u32 numa_node; |
| @@ -1843,7 +1843,7 @@ struct its_srat_map { · 1 unmodified line | ||
| 1843 | 1843 | u32 its_id; |
| 1844 | 1844 | }; |
| 1845 | 1845 | |
| 1846 | −static struct its_srat_map its_srat_maps[MAX_NUMNODES] __initdata; | |
| 1846 | +static struct its_srat_map *its_srat_maps __initdata; | |
| 1847 | 1847 | static int its_in_srat __initdata; |
| 1848 | 1848 | |
| 1849 | 1849 | 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) · 7 unmodified lines | ||
| 1857 | 1857 | return NUMA_NO_NODE; |
| 1858 | 1858 | } |
| 1859 | 1859 | |
| 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 | + | |
| 1860 | 1866 | static int __init gic_acpi_parse_srat_its(struct acpi_subtable_header *header, |
| 1861 | 1867 | const unsigned long end) |
| 1862 | 1868 | { |
| @@ -1873,12 +1879,6 @@ static int __init gic_acpi_parse_srat_its(struct acpi_subtable_header *header, · 10 unmodified lines | ||
| 1873 | 1879 | return -EINVAL; |
| 1874 | 1880 | } |
| 1875 | 1881 | |
| 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 | − | |
| 1882 | 1882 | node = acpi_map_pxm_to_node(its_affinity->proximity_domain); |
| 1883 | 1883 | |
| 1884 | 1884 | 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, · 12 unmodified lines | ||
| 1897 | 1897 | |
| 1898 | 1898 | static void __init acpi_table_parse_srat_its(void) |
| 1899 | 1899 | { |
| 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 | + | |
| 1900 | 1916 | acpi_table_parse_entries(ACPI_SIG_SRAT, |
| 1901 | 1917 | sizeof(struct acpi_table_srat), |
| 1902 | 1918 | ACPI_SRAT_TYPE_GIC_ITS_AFFINITY, |
| 1903 | 1919 | gic_acpi_parse_srat_its, 0); |
| 1904 | 1920 | } |
| 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 | +} | |
| 1905 | 1927 | #else |
| 1906 | 1928 | static void __init acpi_table_parse_srat_its(void) { } |
| 1907 | 1929 | 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) { } | |
| 1908 | 1931 | #endif |
| 1909 | 1932 | |
| 1910 | 1933 | static int __init gic_acpi_parse_madt_its(struct acpi_subtable_header *header, |
| @@ -1951,6 +1974,7 @@ static void __init its_acpi_probe(void) · 40 unmodified lines | ||
| 1951 | 1974 | acpi_table_parse_srat_its(); |
| 1952 | 1975 | acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_TRANSLATOR, |
| 1953 | 1976 | gic_acpi_parse_madt_its, 0); |
| 1977 | + acpi_its_srat_maps_free(); | |
| 1954 | 1978 | } |
| 1955 | 1979 | #else |
| 1956 | 1980 | static void __init its_acpi_probe(void) { } |
| @@ -353,6 +353,8 @@ static asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs · 352 unmodified lines | ||
| 353 | 353 | |
| 354 | 354 | if (static_key_true(&supports_deactivate)) |
| 355 | 355 | gic_write_eoir(irqnr); |
| 356 | + else | |
| 357 | + isb(); | |
| 356 | 358 | |
| 357 | 359 | err = handle_domain_irq(gic_data.domain, irqnr, regs); |
| 358 | 360 | if (err) { |
| @@ -640,11 +642,16 @@ static void gic_smp_init(void) · 281 unmodified lines | ||
| 640 | 642 | static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val, |
| 641 | 643 | bool force) |
| 642 | 644 | { |
| 643 | − unsigned int cpu = cpumask_any_and(mask_val, cpu_online_mask); | |
| 645 | + unsigned int cpu; | |
| 644 | 646 | void __iomem *reg; |
| 645 | 647 | int enabled; |
| 646 | 648 | u64 val; |
| 647 | 649 | |
| 650 | + if (force) | |
| 651 | + cpu = cpumask_first(mask_val); | |
| 652 | + else | |
| 653 | + cpu = cpumask_any_and(mask_val, cpu_online_mask); | |
| 654 | + | |
| 648 | 655 | if (cpu >= nr_cpu_ids) |
| 649 | 656 | return -EINVAL; |
| 650 | 657 | |
| @@ -831,8 +838,11 @@ static int gic_irq_domain_alloc(struct irq_domain *domain, unsigned int virq, · 180 unmodified lines | ||
| 831 | 838 | if (ret) |
| 832 | 839 | return ret; |
| 833 | 840 | |
| 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 | + } | |
| 836 | 846 | |
| 837 | 847 | return 0; |
| 838 | 848 | } |
| @@ -361,6 +361,7 @@ static void __exception_irq_entry gic_handle_irq(struct pt_regs *regs) · 360 unmodified lines | ||
| 361 | 361 | if (likely(irqnr > 15 && irqnr < 1020)) { |
| 362 | 362 | if (static_key_true(&supports_deactivate)) |
| 363 | 363 | writel_relaxed(irqstat, cpu_base + GIC_CPU_EOI); |
| 364 | + isb(); | |
| 364 | 365 | handle_domain_irq(gic->domain, irqnr, regs); |
| 365 | 366 | continue; |
| 366 | 367 | } |
| @@ -401,10 +402,12 @@ static void gic_handle_cascade_irq(struct irq_desc *desc) · 34 unmodified lines | ||
| 401 | 402 | goto out; |
| 402 | 403 | |
| 403 | 404 | 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)) { | |
| 405 | 406 | handle_bad_irq(desc); |
| 406 | − else | |
| 407 | + } else { | |
| 408 | + isb(); | |
| 407 | 409 | generic_handle_irq(cascade_irq); |
| 410 | + } | |
| 408 | 411 | |
| 409 | 412 | out: |
| 410 | 413 | chained_irq_exit(chip, desc); |
| @@ -1027,8 +1030,11 @@ static int gic_irq_domain_alloc(struct irq_domain *domain, unsigned int virq, · 616 unmodified lines | ||
| 1027 | 1030 | if (ret) |
| 1028 | 1031 | return ret; |
| 1029 | 1032 | |
| 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 | + } | |
| 1032 | 1038 | |
| 1033 | 1039 | return 0; |
| 1034 | 1040 | } |
| @@ -1000,7 +1000,7 @@ EXPORT_SYMBOL_GPL(irq_set_chip_and_handler_name); · 999 unmodified lines | ||
| 1000 | 1000 | |
| 1001 | 1001 | void irq_modify_status(unsigned int irq, unsigned long clr, unsigned long set) |
| 1002 | 1002 | { |
| 1003 | − unsigned long flags; | |
| 1003 | + unsigned long flags, trigger, tmp; | |
| 1004 | 1004 | struct irq_desc *desc = irq_get_desc_lock(irq, &flags, 0); |
| 1005 | 1005 | |
| 1006 | 1006 | if (!desc) |
| @@ -1014,6 +1014,8 @@ void irq_modify_status(unsigned int irq, unsigned long clr, unsigned long set) · 7 unmodified lines | ||
| 1014 | 1014 | |
| 1015 | 1015 | irq_settings_clr_and_set(desc, clr, set); |
| 1016 | 1016 | |
| 1017 | + trigger = irqd_get_trigger_type(&desc->irq_data); | |
| 1018 | + | |
| 1017 | 1019 | irqd_clear(&desc->irq_data, IRQD_NO_BALANCING | IRQD_PER_CPU | |
| 1018 | 1020 | IRQD_TRIGGER_MASK | IRQD_LEVEL | IRQD_MOVE_PCNTXT); |
| 1019 | 1021 | 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) · 5 unmodified lines | ||
| 1025 | 1027 | if (irq_settings_is_level(desc)) |
| 1026 | 1028 | irqd_set(&desc->irq_data, IRQD_LEVEL); |
| 1027 | 1029 | |
| 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); | |
| 1029 | 1035 | |
| 1030 | 1036 | irq_put_desc_unlock(desc, flags); |
| 1031 | 1037 | } |
| @@ -165,7 +165,7 @@ irq_hw_number_t ipi_get_hwirq(unsigned int irq, unsigned int cpu) · 164 unmodified lines | ||
| 165 | 165 | struct irq_data *data = irq_get_irq_data(irq); |
| 166 | 166 | struct cpumask *ipimask = data ? irq_data_get_affinity_mask(data) : NULL; |
| 167 | 167 | |
| 168 | − if (!data || !ipimask || cpu > nr_cpu_ids) | |
| 168 | + if (!data || !ipimask || cpu >= nr_cpu_ids) | |
| 169 | 169 | return INVALID_HWIRQ; |
| 170 | 170 | |
| 171 | 171 | if (!cpumask_test_cpu(cpu, ipimask)) |
| @@ -195,7 +195,7 @@ static int ipi_send_verify(struct irq_chip *chip, struct irq_data *data, · 23 unmodified lines | ||
| 195 | 195 | if (!chip->ipi_send_single && !chip->ipi_send_mask) |
| 196 | 196 | return -EINVAL; |
| 197 | 197 | |
| 198 | − if (cpu > nr_cpu_ids) | |
| 198 | + if (cpu >= nr_cpu_ids) | |
| 199 | 199 | return -EINVAL; |
| 200 | 200 | |
| 201 | 201 | if (dest) { |