diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-08-20 12:07:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-08-20 12:07:56 -0400 |
commit | 9dae41a238a952eb65c8aa8a59d8aa39058a7bcf (patch) | |
tree | 19a6382bdef8db85c7dac475ed524f7e78803b2a | |
parent | e18a5ebc2d507f42ca724581a1039ba058fa12da (diff) | |
parent | 8fbbe2d7cc478d1544f41f2271787c993c23a4f6 (diff) |
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()
-rw-r--r-- | MAINTAINERS | 1 | ||||
-rw-r--r-- | drivers/irqchip/irq-atmel-aic-common.c | 13 | ||||
-rw-r--r-- | drivers/irqchip/irq-atmel-aic-common.h | 4 | ||||
-rw-r--r-- | drivers/irqchip/irq-atmel-aic.c | 14 | ||||
-rw-r--r-- | drivers/irqchip/irq-atmel-aic5.c | 4 | ||||
-rw-r--r-- | drivers/irqchip/irq-brcmstb-l2.c | 1 | ||||
-rw-r--r-- | drivers/irqchip/irq-gic-v3-its-platform-msi.c | 1 | ||||
-rw-r--r-- | drivers/irqchip/irq-gic-v3-its.c | 40 | ||||
-rw-r--r-- | drivers/irqchip/irq-gic-v3.c | 16 | ||||
-rw-r--r-- | drivers/irqchip/irq-gic.c | 14 | ||||
-rw-r--r-- | kernel/irq/chip.c | 10 | ||||
-rw-r--r-- | kernel/irq/ipi.c | 4 |
12 files changed, 84 insertions, 38 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 6f7721d1634c..1c3feffb1c1c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -7110,7 +7110,6 @@ M: Marc Zyngier <marc.zyngier@arm.com> | |||
7110 | L: linux-kernel@vger.kernel.org | 7110 | L: linux-kernel@vger.kernel.org |
7111 | S: Maintained | 7111 | S: Maintained |
7112 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core | 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 | F: Documentation/devicetree/bindings/interrupt-controller/ | 7113 | F: Documentation/devicetree/bindings/interrupt-controller/ |
7115 | F: drivers/irqchip/ | 7114 | F: drivers/irqchip/ |
7116 | 7115 | ||
diff --git a/drivers/irqchip/irq-atmel-aic-common.c b/drivers/irqchip/irq-atmel-aic-common.c index 28b26c80f4cf..072bd227b6c6 100644 --- a/drivers/irqchip/irq-atmel-aic-common.c +++ b/drivers/irqchip/irq-atmel-aic-common.c | |||
@@ -137,14 +137,14 @@ static void __init aic_common_ext_irq_of_init(struct irq_domain *domain) | |||
137 | #define AT91_RTC_IMR 0x28 | 137 | #define AT91_RTC_IMR 0x28 |
138 | #define AT91_RTC_IRQ_MASK 0x1f | 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 | struct device_node *np; | 142 | struct device_node *np; |
143 | void __iomem *regs; | 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 | if (!np) | 146 | if (!np) |
147 | np = of_find_compatible_node(root, NULL, | 147 | np = of_find_compatible_node(NULL, NULL, |
148 | "atmel,at91sam9x5-rtc"); | 148 | "atmel,at91sam9x5-rtc"); |
149 | 149 | ||
150 | if (!np) | 150 | if (!np) |
@@ -165,7 +165,7 @@ void __init aic_common_rtc_irq_fixup(struct device_node *root) | |||
165 | #define AT91_RTT_ALMIEN (1 << 16) /* Alarm Interrupt Enable */ | 165 | #define AT91_RTT_ALMIEN (1 << 16) /* Alarm Interrupt Enable */ |
166 | #define AT91_RTT_RTTINCIEN (1 << 17) /* Real Time Timer Increment Interrupt Enable */ | 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 | struct device_node *np; | 170 | struct device_node *np; |
171 | void __iomem *regs; | 171 | void __iomem *regs; |
@@ -196,11 +196,10 @@ static void __init aic_common_irq_fixup(const struct of_device_id *matches) | |||
196 | return; | 196 | return; |
197 | 197 | ||
198 | match = of_match_node(matches, root); | 198 | match = of_match_node(matches, root); |
199 | of_node_put(root); | ||
200 | 199 | ||
201 | if (match) { | 200 | if (match) { |
202 | void (*fixup)(struct device_node *) = match->data; | 201 | void (*fixup)(void) = match->data; |
203 | fixup(root); | 202 | fixup(); |
204 | } | 203 | } |
205 | 204 | ||
206 | of_node_put(root); | 205 | of_node_put(root); |
diff --git a/drivers/irqchip/irq-atmel-aic-common.h b/drivers/irqchip/irq-atmel-aic-common.h index af60376d50de..242e62c1851e 100644 --- a/drivers/irqchip/irq-atmel-aic-common.h +++ b/drivers/irqchip/irq-atmel-aic-common.h | |||
@@ -33,8 +33,8 @@ struct irq_domain *__init aic_common_of_init(struct device_node *node, | |||
33 | const char *name, int nirqs, | 33 | const char *name, int nirqs, |
34 | const struct of_device_id *matches); | 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 | #endif /* __IRQ_ATMEL_AIC_COMMON_H */ | 40 | #endif /* __IRQ_ATMEL_AIC_COMMON_H */ |
diff --git a/drivers/irqchip/irq-atmel-aic.c b/drivers/irqchip/irq-atmel-aic.c index 37f952dd9fc9..bb1ad451392f 100644 --- a/drivers/irqchip/irq-atmel-aic.c +++ b/drivers/irqchip/irq-atmel-aic.c | |||
@@ -209,20 +209,20 @@ static const struct irq_domain_ops aic_irq_ops = { | |||
209 | .xlate = aic_irq_domain_xlate, | 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); | 224 | aic_common_rtc_irq_fixup(); |
225 | aic_common_rtt_irq_fixup(root); | 225 | aic_common_rtt_irq_fixup(); |
226 | } | 226 | } |
227 | 227 | ||
228 | static const struct of_device_id aic_irq_fixups[] __initconst = { | 228 | static const struct of_device_id aic_irq_fixups[] __initconst = { |
diff --git a/drivers/irqchip/irq-atmel-aic5.c b/drivers/irqchip/irq-atmel-aic5.c index c04ee9a23d09..6acad2ea0fb3 100644 --- a/drivers/irqchip/irq-atmel-aic5.c +++ b/drivers/irqchip/irq-atmel-aic5.c | |||
@@ -305,9 +305,9 @@ static const struct irq_domain_ops aic5_irq_ops = { | |||
305 | .xlate = aic5_irq_domain_xlate, | 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 | static const struct of_device_id aic5_irq_fixups[] __initconst = { | 313 | static const struct of_device_id aic5_irq_fixups[] __initconst = { |
diff --git a/drivers/irqchip/irq-brcmstb-l2.c b/drivers/irqchip/irq-brcmstb-l2.c index bddf169c4b37..b009b916a292 100644 --- a/drivers/irqchip/irq-brcmstb-l2.c +++ b/drivers/irqchip/irq-brcmstb-l2.c | |||
@@ -189,6 +189,7 @@ static int __init brcmstb_l2_intc_of_init(struct device_node *np, | |||
189 | 189 | ||
190 | ct->chip.irq_suspend = brcmstb_l2_intc_suspend; | 190 | ct->chip.irq_suspend = brcmstb_l2_intc_suspend; |
191 | ct->chip.irq_resume = brcmstb_l2_intc_resume; | 191 | ct->chip.irq_resume = brcmstb_l2_intc_resume; |
192 | ct->chip.irq_pm_shutdown = brcmstb_l2_intc_suspend; | ||
192 | 193 | ||
193 | if (data->can_wake) { | 194 | if (data->can_wake) { |
194 | /* This IRQ chip can wake the system, set all child interrupts | 195 | /* This IRQ chip can wake the system, set all child interrupts |
diff --git a/drivers/irqchip/irq-gic-v3-its-platform-msi.c b/drivers/irqchip/irq-gic-v3-its-platform-msi.c index 249240d9a425..833a90fe33ae 100644 --- a/drivers/irqchip/irq-gic-v3-its-platform-msi.c +++ b/drivers/irqchip/irq-gic-v3-its-platform-msi.c | |||
@@ -43,6 +43,7 @@ static int of_pmsi_get_dev_id(struct irq_domain *domain, struct device *dev, | |||
43 | *dev_id = args.args[0]; | 43 | *dev_id = args.args[0]; |
44 | break; | 44 | break; |
45 | } | 45 | } |
46 | index++; | ||
46 | } while (!ret); | 47 | } while (!ret); |
47 | 48 | ||
48 | return ret; | 49 | return ret; |
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 68932873eebc..284738add89b 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c | |||
@@ -1835,7 +1835,7 @@ static int __init its_of_probe(struct device_node *node) | |||
1835 | 1835 | ||
1836 | #define ACPI_GICV3_ITS_MEM_SIZE (SZ_128K) | 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 | struct its_srat_map { | 1839 | struct its_srat_map { |
1840 | /* numa node id */ | 1840 | /* numa node id */ |
1841 | u32 numa_node; | 1841 | u32 numa_node; |
@@ -1843,7 +1843,7 @@ struct its_srat_map { | |||
1843 | u32 its_id; | 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 | static int its_in_srat __initdata; | 1847 | static int its_in_srat __initdata; |
1848 | 1848 | ||
1849 | static int __init acpi_get_its_numa_node(u32 its_id) | 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) | |||
1857 | return NUMA_NO_NODE; | 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 | static int __init gic_acpi_parse_srat_its(struct acpi_subtable_header *header, | 1866 | static int __init gic_acpi_parse_srat_its(struct acpi_subtable_header *header, |
1861 | const unsigned long end) | 1867 | const unsigned long end) |
1862 | { | 1868 | { |
@@ -1873,12 +1879,6 @@ static int __init gic_acpi_parse_srat_its(struct acpi_subtable_header *header, | |||
1873 | return -EINVAL; | 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 | node = acpi_map_pxm_to_node(its_affinity->proximity_domain); | 1882 | node = acpi_map_pxm_to_node(its_affinity->proximity_domain); |
1883 | 1883 | ||
1884 | if (node == NUMA_NO_NODE || node >= MAX_NUMNODES) { | 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, | |||
1897 | 1897 | ||
1898 | static void __init acpi_table_parse_srat_its(void) | 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 | acpi_table_parse_entries(ACPI_SIG_SRAT, | 1916 | acpi_table_parse_entries(ACPI_SIG_SRAT, |
1901 | sizeof(struct acpi_table_srat), | 1917 | sizeof(struct acpi_table_srat), |
1902 | ACPI_SRAT_TYPE_GIC_ITS_AFFINITY, | 1918 | ACPI_SRAT_TYPE_GIC_ITS_AFFINITY, |
1903 | gic_acpi_parse_srat_its, 0); | 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 | #else | 1927 | #else |
1906 | static void __init acpi_table_parse_srat_its(void) { } | 1928 | static void __init acpi_table_parse_srat_its(void) { } |
1907 | static int __init acpi_get_its_numa_node(u32 its_id) { return NUMA_NO_NODE; } | 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 | #endif | 1931 | #endif |
1909 | 1932 | ||
1910 | static int __init gic_acpi_parse_madt_its(struct acpi_subtable_header *header, | 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) | |||
1951 | acpi_table_parse_srat_its(); | 1974 | acpi_table_parse_srat_its(); |
1952 | acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_TRANSLATOR, | 1975 | acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_TRANSLATOR, |
1953 | gic_acpi_parse_madt_its, 0); | 1976 | gic_acpi_parse_madt_its, 0); |
1977 | acpi_its_srat_maps_free(); | ||
1954 | } | 1978 | } |
1955 | #else | 1979 | #else |
1956 | static void __init its_acpi_probe(void) { } | 1980 | static void __init its_acpi_probe(void) { } |
diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index dbffb7ab6203..984c3ecfd22c 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c | |||
@@ -353,6 +353,8 @@ static asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs | |||
353 | 353 | ||
354 | if (static_key_true(&supports_deactivate)) | 354 | if (static_key_true(&supports_deactivate)) |
355 | gic_write_eoir(irqnr); | 355 | gic_write_eoir(irqnr); |
356 | else | ||
357 | isb(); | ||
356 | 358 | ||
357 | err = handle_domain_irq(gic_data.domain, irqnr, regs); | 359 | err = handle_domain_irq(gic_data.domain, irqnr, regs); |
358 | if (err) { | 360 | if (err) { |
@@ -640,11 +642,16 @@ static void gic_smp_init(void) | |||
640 | static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val, | 642 | static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val, |
641 | bool force) | 643 | bool force) |
642 | { | 644 | { |
643 | unsigned int cpu = cpumask_any_and(mask_val, cpu_online_mask); | 645 | unsigned int cpu; |
644 | void __iomem *reg; | 646 | void __iomem *reg; |
645 | int enabled; | 647 | int enabled; |
646 | u64 val; | 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 | if (cpu >= nr_cpu_ids) | 655 | if (cpu >= nr_cpu_ids) |
649 | return -EINVAL; | 656 | return -EINVAL; |
650 | 657 | ||
@@ -831,8 +838,11 @@ static int gic_irq_domain_alloc(struct irq_domain *domain, unsigned int virq, | |||
831 | if (ret) | 838 | if (ret) |
832 | return ret; | 839 | return ret; |
833 | 840 | ||
834 | for (i = 0; i < nr_irqs; i++) | 841 | for (i = 0; i < nr_irqs; i++) { |
835 | gic_irq_domain_map(domain, virq + i, hwirq + i); | 842 | ret = gic_irq_domain_map(domain, virq + i, hwirq + i); |
843 | if (ret) | ||
844 | return ret; | ||
845 | } | ||
836 | 846 | ||
837 | return 0; | 847 | return 0; |
838 | } | 848 | } |
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index 1b1df4f770bd..d3e7c43718b8 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c | |||
@@ -361,6 +361,7 @@ static void __exception_irq_entry gic_handle_irq(struct pt_regs *regs) | |||
361 | if (likely(irqnr > 15 && irqnr < 1020)) { | 361 | if (likely(irqnr > 15 && irqnr < 1020)) { |
362 | if (static_key_true(&supports_deactivate)) | 362 | if (static_key_true(&supports_deactivate)) |
363 | writel_relaxed(irqstat, cpu_base + GIC_CPU_EOI); | 363 | writel_relaxed(irqstat, cpu_base + GIC_CPU_EOI); |
364 | isb(); | ||
364 | handle_domain_irq(gic->domain, irqnr, regs); | 365 | handle_domain_irq(gic->domain, irqnr, regs); |
365 | continue; | 366 | continue; |
366 | } | 367 | } |
@@ -401,10 +402,12 @@ static void gic_handle_cascade_irq(struct irq_desc *desc) | |||
401 | goto out; | 402 | goto out; |
402 | 403 | ||
403 | cascade_irq = irq_find_mapping(chip_data->domain, gic_irq); | 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 | handle_bad_irq(desc); | 406 | handle_bad_irq(desc); |
406 | else | 407 | } else { |
408 | isb(); | ||
407 | generic_handle_irq(cascade_irq); | 409 | generic_handle_irq(cascade_irq); |
410 | } | ||
408 | 411 | ||
409 | out: | 412 | out: |
410 | chained_irq_exit(chip, desc); | 413 | chained_irq_exit(chip, desc); |
@@ -1027,8 +1030,11 @@ static int gic_irq_domain_alloc(struct irq_domain *domain, unsigned int virq, | |||
1027 | if (ret) | 1030 | if (ret) |
1028 | return ret; | 1031 | return ret; |
1029 | 1032 | ||
1030 | for (i = 0; i < nr_irqs; i++) | 1033 | for (i = 0; i < nr_irqs; i++) { |
1031 | gic_irq_domain_map(domain, virq + i, hwirq + i); | 1034 | ret = gic_irq_domain_map(domain, virq + i, hwirq + i); |
1035 | if (ret) | ||
1036 | return ret; | ||
1037 | } | ||
1032 | 1038 | ||
1033 | return 0; | 1039 | return 0; |
1034 | } | 1040 | } |
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index a3cc37c0c85e..3675c6004f2a 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c | |||
@@ -1000,7 +1000,7 @@ EXPORT_SYMBOL_GPL(irq_set_chip_and_handler_name); | |||
1000 | 1000 | ||
1001 | void irq_modify_status(unsigned int irq, unsigned long clr, unsigned long set) | 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 | struct irq_desc *desc = irq_get_desc_lock(irq, &flags, 0); | 1004 | struct irq_desc *desc = irq_get_desc_lock(irq, &flags, 0); |
1005 | 1005 | ||
1006 | if (!desc) | 1006 | if (!desc) |
@@ -1014,6 +1014,8 @@ void irq_modify_status(unsigned int irq, unsigned long clr, unsigned long set) | |||
1014 | 1014 | ||
1015 | irq_settings_clr_and_set(desc, clr, set); | 1015 | irq_settings_clr_and_set(desc, clr, set); |
1016 | 1016 | ||
1017 | trigger = irqd_get_trigger_type(&desc->irq_data); | ||
1018 | |||
1017 | irqd_clear(&desc->irq_data, IRQD_NO_BALANCING | IRQD_PER_CPU | | 1019 | irqd_clear(&desc->irq_data, IRQD_NO_BALANCING | IRQD_PER_CPU | |
1018 | IRQD_TRIGGER_MASK | IRQD_LEVEL | IRQD_MOVE_PCNTXT); | 1020 | IRQD_TRIGGER_MASK | IRQD_LEVEL | IRQD_MOVE_PCNTXT); |
1019 | if (irq_settings_has_no_balance_set(desc)) | 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) | |||
1025 | if (irq_settings_is_level(desc)) | 1027 | if (irq_settings_is_level(desc)) |
1026 | irqd_set(&desc->irq_data, IRQD_LEVEL); | 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 | irq_put_desc_unlock(desc, flags); | 1036 | irq_put_desc_unlock(desc, flags); |
1031 | } | 1037 | } |
diff --git a/kernel/irq/ipi.c b/kernel/irq/ipi.c index 1a9abc1c8ea0..259a22aa9934 100644 --- a/kernel/irq/ipi.c +++ b/kernel/irq/ipi.c | |||
@@ -165,7 +165,7 @@ irq_hw_number_t ipi_get_hwirq(unsigned int irq, unsigned int cpu) | |||
165 | struct irq_data *data = irq_get_irq_data(irq); | 165 | struct irq_data *data = irq_get_irq_data(irq); |
166 | struct cpumask *ipimask = data ? irq_data_get_affinity_mask(data) : NULL; | 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 | return INVALID_HWIRQ; | 169 | return INVALID_HWIRQ; |
170 | 170 | ||
171 | if (!cpumask_test_cpu(cpu, ipimask)) | 171 | if (!cpumask_test_cpu(cpu, ipimask)) |
@@ -195,7 +195,7 @@ static int ipi_send_verify(struct irq_chip *chip, struct irq_data *data, | |||
195 | if (!chip->ipi_send_single && !chip->ipi_send_mask) | 195 | if (!chip->ipi_send_single && !chip->ipi_send_mask) |
196 | return -EINVAL; | 196 | return -EINVAL; |
197 | 197 | ||
198 | if (cpu > nr_cpu_ids) | 198 | if (cpu >= nr_cpu_ids) |
199 | return -EINVAL; | 199 | return -EINVAL; |
200 | 200 | ||
201 | if (dest) { | 201 | if (dest) { |