Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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()

+84 -38
-1
MAINTAINERS
··· 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
+6 -7
drivers/irqchip/irq-atmel-aic-common.c
··· 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 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 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);
+2 -2
drivers/irqchip/irq-atmel-aic-common.h
··· 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 */
+7 -7
drivers/irqchip/irq-atmel-aic.c
··· 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 = {
+2 -2
drivers/irqchip/irq-atmel-aic5.c
··· 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 = {
+1
drivers/irqchip/irq-brcmstb-l2.c
··· 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
+1
drivers/irqchip/irq-gic-v3-its-platform-msi.c
··· 43 43 *dev_id = args.args[0]; 44 44 break; 45 45 } 46 + index++; 46 47 } while (!ret); 47 48 48 49 return ret;
+32 -8
drivers/irqchip/irq-gic-v3-its.c
··· 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 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) ··· 1855 1855 return its_srat_maps[i].numa_node; 1856 1856 } 1857 1857 return NUMA_NO_NODE; 1858 + } 1859 + 1860 + static int __init gic_acpi_match_srat_its(struct acpi_subtable_header *header, 1861 + const unsigned long end) 1862 + { 1863 + return 0; 1858 1864 } 1859 1865 1860 1866 static int __init gic_acpi_parse_srat_its(struct acpi_subtable_header *header, ··· 1876 1870 if (its_affinity->header.length < sizeof(*its_affinity)) { 1877 1871 pr_err("SRAT: Invalid header length %d in ITS affinity\n", 1878 1872 its_affinity->header.length); 1879 - return -EINVAL; 1880 - } 1881 - 1882 - if (its_in_srat >= MAX_NUMNODES) { 1883 - pr_err("SRAT: ITS affinity exceeding max count[%d]\n", 1884 - MAX_NUMNODES); 1885 1873 return -EINVAL; 1886 1874 } 1887 1875 ··· 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, ··· 1974 1951 acpi_table_parse_srat_its(); 1975 1952 acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_TRANSLATOR, 1976 1953 gic_acpi_parse_madt_its, 0); 1954 + acpi_its_srat_maps_free(); 1977 1955 } 1978 1956 #else 1979 1957 static void __init its_acpi_probe(void) { }
+13 -3
drivers/irqchip/irq-gic-v3.c
··· 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) { ··· 642 640 static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val, 643 641 bool force) 644 642 { 645 - unsigned int cpu = cpumask_any_and(mask_val, cpu_online_mask); 643 + unsigned int cpu; 646 644 void __iomem *reg; 647 645 int enabled; 648 646 u64 val; 647 + 648 + if (force) 649 + cpu = cpumask_first(mask_val); 650 + else 651 + cpu = cpumask_any_and(mask_val, cpu_online_mask); 649 652 650 653 if (cpu >= nr_cpu_ids) 651 654 return -EINVAL; ··· 838 831 if (ret) 839 832 return ret; 840 833 841 - for (i = 0; i < nr_irqs; i++) 842 - gic_irq_domain_map(domain, virq + i, hwirq + i); 834 + for (i = 0; i < nr_irqs; i++) { 835 + ret = gic_irq_domain_map(domain, virq + i, hwirq + i); 836 + if (ret) 837 + return ret; 838 + } 843 839 844 840 return 0; 845 841 }
+10 -4
drivers/irqchip/irq-gic.c
··· 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 } ··· 402 401 goto out; 403 402 404 403 cascade_irq = irq_find_mapping(chip_data->domain, gic_irq); 405 - if (unlikely(gic_irq < 32 || gic_irq > 1020)) 404 + if (unlikely(gic_irq < 32 || gic_irq > 1020)) { 406 405 handle_bad_irq(desc); 407 - else 406 + } else { 407 + isb(); 408 408 generic_handle_irq(cascade_irq); 409 + } 409 410 410 411 out: 411 412 chained_irq_exit(chip, desc); ··· 1030 1027 if (ret) 1031 1028 return ret; 1032 1029 1033 - for (i = 0; i < nr_irqs; i++) 1034 - gic_irq_domain_map(domain, virq + i, hwirq + i); 1030 + for (i = 0; i < nr_irqs; i++) { 1031 + ret = gic_irq_domain_map(domain, virq + i, hwirq + i); 1032 + if (ret) 1033 + return ret; 1034 + } 1035 1035 1036 1036 return 0; 1037 1037 }
+8 -2
kernel/irq/chip.c
··· 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 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)) ··· 1027 1025 if (irq_settings_is_level(desc)) 1028 1026 irqd_set(&desc->irq_data, IRQD_LEVEL); 1029 1027 1030 - irqd_set(&desc->irq_data, irq_settings_get_trigger_mask(desc)); 1028 + tmp = irq_settings_get_trigger_mask(desc); 1029 + if (tmp != IRQ_TYPE_NONE) 1030 + trigger = tmp; 1031 + 1032 + irqd_set(&desc->irq_data, trigger); 1031 1033 1032 1034 irq_put_desc_unlock(desc, flags); 1033 1035 }
+2 -2
kernel/irq/ipi.c
··· 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 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) {