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

Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull irq updates from Thomas Gleixner:
"The irq departement delivers:

- plug a potential race related to chained interrupt handlers

- core updates which address the needs of the x86 irqdomain conversion

- new irqchip callback to support affinity settings for VCPUs

- the usual pile of updates to interrupt chip drivers

- a few helper functions to allow further cleanups and
simplifications

I have a largish pile of coccinelle scripted/verified cleanups and
simplifications pending on top of that, but I prefer to send that
towards the end of the merge window when the arch/driver changes have
hit your tree to avoid API change wreckage as far as possible"

* 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (34 commits)
genirq: Remove bogus restriction in irq_move_mask_irq()
irqchip: atmel-aic5: Add sama5d2 support
irq: spear-shirq: Fix race in installing chained IRQ handler
irq: irq-keystone: Fix race in installing chained IRQ handler
gpio: gpio-tegra: Fix race in installing chained IRQ handler
gpio: gpio-mxs: Fix race in installing chained IRQ handler
gpio: gpio-mxc: Fix race in installing chained IRQ handler
ARM: gemini: Fix race in installing GPIO chained IRQ handler
GPU: ipu: Fix race in installing IPU chained IRQ handler
ARM: sa1100: convert SA11x0 related code to use new chained handler helper
irq: Add irq_set_chained_handler_and_data()
irqchip: exynos-combiner: Save IRQ enable set on suspend
genirq: Introduce helper function irq_data_get_affinity_mask()
genirq: Introduce helper function irq_data_get_node()
genirq: Introduce struct irq_common_data to host shared irq data
genirq: Prevent crash in irq_move_irq()
genirq: Enhance irq_data_to_desc() to support hierarchy irqdomain
irqchip: gic: Simplify gic_configure_irq by using IRQCHIP_SET_TYPE_MASKED
irqchip: renesas: intc-irqpin: Improve binding documentation
genirq: Set IRQCHIP_SKIP_SET_WAKE for no_irq_chip
...

+378 -191
+1 -1
Documentation/devicetree/bindings/interrupt-controller/atmel,aic.txt
··· 2 2 3 3 Required properties: 4 4 - compatible: Should be "atmel,<chip>-aic" 5 - <chip> can be "at91rm9200", "sama5d3" or "sama5d4" 5 + <chip> can be "at91rm9200", "sama5d2", "sama5d3" or "sama5d4" 6 6 - interrupt-controller: Identifies the node as an interrupt controller. 7 7 - interrupt-parent: For single AIC system, it is an empty property. 8 8 - #interrupt-cells: The number of cells to define the interrupts. It should be 3.
+37 -2
Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.txt
··· 13 13 - reg: Base address and length of each register bank used by the external 14 14 IRQ pins driven by the interrupt controller hardware module. The base 15 15 addresses, length and number of required register banks varies with soctype. 16 - 16 + - interrupt-controller: Identifies the node as an interrupt controller. 17 17 - #interrupt-cells: has to be <2>: an interrupt index and flags, as defined in 18 - interrupts.txt in this directory 18 + interrupts.txt in this directory. 19 + - interrupts: Must contain a list of interrupt specifiers. For each interrupt 20 + provided by this irqpin controller instance, there must be one entry, 21 + referring to the corresponding parent interrupt. 19 22 20 23 Optional properties: 21 24 ··· 28 25 if different from the default 4 bits 29 26 - control-parent: disable and enable interrupts on the parent interrupt 30 27 controller, needed for some broken implementations 28 + - clocks: Must contain a reference to the functional clock. This property is 29 + mandatory if the hardware implements a controllable functional clock for 30 + the irqpin controller instance. 31 + - power-domains: Must contain a reference to the power domain. This property is 32 + mandatory if the irqpin controller instance is part of a controllable power 33 + domain. 34 + 35 + 36 + Example 37 + ------- 38 + 39 + irqpin1: interrupt-controller@e6900004 { 40 + compatible = "renesas,intc-irqpin-r8a7740", 41 + "renesas,intc-irqpin"; 42 + #interrupt-cells = <2>; 43 + interrupt-controller; 44 + reg = <0xe6900004 4>, 45 + <0xe6900014 4>, 46 + <0xe6900024 1>, 47 + <0xe6900044 1>, 48 + <0xe6900064 1>; 49 + interrupts = <0 149 IRQ_TYPE_LEVEL_HIGH 50 + 0 149 IRQ_TYPE_LEVEL_HIGH 51 + 0 149 IRQ_TYPE_LEVEL_HIGH 52 + 0 149 IRQ_TYPE_LEVEL_HIGH 53 + 0 149 IRQ_TYPE_LEVEL_HIGH 54 + 0 149 IRQ_TYPE_LEVEL_HIGH 55 + 0 149 IRQ_TYPE_LEVEL_HIGH 56 + 0 149 IRQ_TYPE_LEVEL_HIGH>; 57 + clocks = <&mstp2_clks R8A7740_CLK_INTCA>; 58 + power-domains = <&pd_a4s>; 59 + };
+3 -4
arch/arm/common/sa1111.c
··· 501 501 * Register SA1111 interrupt 502 502 */ 503 503 irq_set_irq_type(sachip->irq, IRQ_TYPE_EDGE_RISING); 504 - irq_set_handler_data(sachip->irq, sachip); 505 - irq_set_chained_handler(sachip->irq, sa1111_irq_handler); 504 + irq_set_chained_handler_and_data(sachip->irq, sa1111_irq_handler, 505 + sachip); 506 506 507 507 dev_info(sachip->dev, "Providing IRQ%u-%u\n", 508 508 sachip->irq_base, sachip->irq_base + SA1111_IRQ_NR - 1); ··· 836 836 clk_unprepare(sachip->clk); 837 837 838 838 if (sachip->irq != NO_IRQ) { 839 - irq_set_chained_handler(sachip->irq, NULL); 840 - irq_set_handler_data(sachip->irq, NULL); 839 + irq_set_chained_handler_and_data(sachip->irq, NULL, NULL); 841 840 irq_free_descs(sachip->irq_base, SA1111_IRQ_NR); 842 841 843 842 release_mem_region(sachip->phys + SA1111_INTC, 512);
+2 -2
arch/arm/mach-gemini/gpio.c
··· 223 223 set_irq_flags(j, IRQF_VALID); 224 224 } 225 225 226 - irq_set_chained_handler(IRQ_GPIO(i), gpio_irq_handler); 227 - irq_set_handler_data(IRQ_GPIO(i), (void *)i); 226 + irq_set_chained_handler_and_data(IRQ_GPIO(i), gpio_irq_handler, 227 + (void *)i); 228 228 } 229 229 230 230 BUG_ON(gpiochip_add(&gemini_gpio_chip));
+1 -2
arch/arm/mach-sa1100/neponset.c
··· 327 327 irq_set_chip(d->irq_base + NEP_IRQ_SA1111, &nochip); 328 328 329 329 irq_set_irq_type(irq, IRQ_TYPE_EDGE_RISING); 330 - irq_set_handler_data(irq, d); 331 - irq_set_chained_handler(irq, neponset_irq_handler); 330 + irq_set_chained_handler_and_data(irq, neponset_irq_handler, d); 332 331 333 332 /* 334 333 * We would set IRQ_GPIO25 to be a wake-up IRQ, but unfortunately
+6 -7
drivers/gpio/gpio-mxc.c
··· 437 437 irq_set_chained_handler(port->irq, mx2_gpio_irq_handler); 438 438 } else { 439 439 /* setup one handler for each entry */ 440 - irq_set_chained_handler(port->irq, mx3_gpio_irq_handler); 441 - irq_set_handler_data(port->irq, port); 442 - if (port->irq_high > 0) { 440 + irq_set_chained_handler_and_data(port->irq, 441 + mx3_gpio_irq_handler, port); 442 + if (port->irq_high > 0) 443 443 /* setup handler for GPIO 16 to 31 */ 444 - irq_set_chained_handler(port->irq_high, 445 - mx3_gpio_irq_handler); 446 - irq_set_handler_data(port->irq_high, port); 447 - } 444 + irq_set_chained_handler_and_data(port->irq_high, 445 + mx3_gpio_irq_handler, 446 + port); 448 447 } 449 448 450 449 err = bgpio_init(&port->bgc, &pdev->dev, 4,
+2 -2
drivers/gpio/gpio-mxs.c
··· 320 320 mxs_gpio_init_gc(port, irq_base); 321 321 322 322 /* setup one handler for each entry */ 323 - irq_set_chained_handler(port->irq, mxs_gpio_irq_handler); 324 - irq_set_handler_data(port->irq, port); 323 + irq_set_chained_handler_and_data(port->irq, mxs_gpio_irq_handler, 324 + port); 325 325 326 326 err = bgpio_init(&port->bgc, &pdev->dev, 4, 327 327 port->base + PINCTRL_DIN(port),
+2 -2
drivers/gpio/gpio-tegra.c
··· 515 515 for (i = 0; i < tegra_gpio_bank_count; i++) { 516 516 bank = &tegra_gpio_banks[i]; 517 517 518 - irq_set_chained_handler(bank->irq, tegra_gpio_irq_handler); 519 - irq_set_handler_data(bank->irq, bank); 518 + irq_set_chained_handler_and_data(bank->irq, 519 + tegra_gpio_irq_handler, bank); 520 520 521 521 for (j = 0; j < 4; j++) 522 522 spin_lock_init(&bank->lvl_lock[j]);
+5 -8
drivers/gpu/ipu-v3/ipu-common.c
··· 1119 1119 ct->regs.mask = IPU_INT_CTRL(i / 32); 1120 1120 } 1121 1121 1122 - irq_set_chained_handler(ipu->irq_sync, ipu_irq_handler); 1123 - irq_set_handler_data(ipu->irq_sync, ipu); 1124 - irq_set_chained_handler(ipu->irq_err, ipu_err_irq_handler); 1125 - irq_set_handler_data(ipu->irq_err, ipu); 1122 + irq_set_chained_handler_and_data(ipu->irq_sync, ipu_irq_handler, ipu); 1123 + irq_set_chained_handler_and_data(ipu->irq_err, ipu_err_irq_handler, 1124 + ipu); 1126 1125 1127 1126 return 0; 1128 1127 } ··· 1130 1131 { 1131 1132 int i, irq; 1132 1133 1133 - irq_set_chained_handler(ipu->irq_err, NULL); 1134 - irq_set_handler_data(ipu->irq_err, NULL); 1135 - irq_set_chained_handler(ipu->irq_sync, NULL); 1136 - irq_set_handler_data(ipu->irq_sync, NULL); 1134 + irq_set_chained_handler_and_data(ipu->irq_err, NULL, NULL); 1135 + irq_set_chained_handler_and_data(ipu->irq_sync, NULL, NULL); 1137 1136 1138 1137 /* TODO: remove irq_domain_generic_chips */ 1139 1138
+1
drivers/irqchip/Kconfig
··· 30 30 config ARM_NVIC 31 31 bool 32 32 select IRQ_DOMAIN 33 + select IRQ_DOMAIN_HIERARCHY 33 34 select GENERIC_IRQ_CHIP 34 35 35 36 config ARM_VIC
+60 -6
drivers/irqchip/exynos-combiner.c
··· 13 13 #include <linux/init.h> 14 14 #include <linux/io.h> 15 15 #include <linux/slab.h> 16 + #include <linux/syscore_ops.h> 16 17 #include <linux/irqdomain.h> 17 18 #include <linux/irqchip/chained_irq.h> 18 19 #include <linux/interrupt.h> ··· 35 34 unsigned int irq_mask; 36 35 void __iomem *base; 37 36 unsigned int parent_irq; 37 + #ifdef CONFIG_PM 38 + u32 pm_save; 39 + #endif 38 40 }; 39 41 42 + static struct combiner_chip_data *combiner_data; 40 43 static struct irq_domain *combiner_irq_domain; 44 + static unsigned int max_nr = 20; 41 45 42 46 static inline void __iomem *combiner_base(struct irq_data *data) 43 47 { ··· 170 164 return 0; 171 165 } 172 166 173 - static struct irq_domain_ops combiner_irq_domain_ops = { 167 + static const struct irq_domain_ops combiner_irq_domain_ops = { 174 168 .xlate = combiner_irq_domain_xlate, 175 169 .map = combiner_irq_domain_map, 176 170 }; 177 171 178 172 static void __init combiner_init(void __iomem *combiner_base, 179 - struct device_node *np, 180 - unsigned int max_nr) 173 + struct device_node *np) 181 174 { 182 175 int i, irq; 183 176 unsigned int nr_irq; 184 - struct combiner_chip_data *combiner_data; 185 177 186 178 nr_irq = max_nr * IRQ_IN_COMBINER; 187 179 ··· 205 201 } 206 202 } 207 203 204 + #ifdef CONFIG_PM 205 + 206 + /** 207 + * combiner_suspend - save interrupt combiner state before suspend 208 + * 209 + * Save the interrupt enable set register for all combiner groups since 210 + * the state is lost when the system enters into a sleep state. 211 + * 212 + */ 213 + static int combiner_suspend(void) 214 + { 215 + int i; 216 + 217 + for (i = 0; i < max_nr; i++) 218 + combiner_data[i].pm_save = 219 + __raw_readl(combiner_data[i].base + COMBINER_ENABLE_SET); 220 + 221 + return 0; 222 + } 223 + 224 + /** 225 + * combiner_resume - restore interrupt combiner state after resume 226 + * 227 + * Restore the interrupt enable set register for all combiner groups since 228 + * the state is lost when the system enters into a sleep state on suspend. 229 + * 230 + */ 231 + static void combiner_resume(void) 232 + { 233 + int i; 234 + 235 + for (i = 0; i < max_nr; i++) { 236 + __raw_writel(combiner_data[i].irq_mask, 237 + combiner_data[i].base + COMBINER_ENABLE_CLEAR); 238 + __raw_writel(combiner_data[i].pm_save, 239 + combiner_data[i].base + COMBINER_ENABLE_SET); 240 + } 241 + } 242 + 243 + #else 244 + #define combiner_suspend NULL 245 + #define combiner_resume NULL 246 + #endif 247 + 248 + static struct syscore_ops combiner_syscore_ops = { 249 + .suspend = combiner_suspend, 250 + .resume = combiner_resume, 251 + }; 252 + 208 253 static int __init combiner_of_init(struct device_node *np, 209 254 struct device_node *parent) 210 255 { 211 256 void __iomem *combiner_base; 212 - unsigned int max_nr = 20; 213 257 214 258 combiner_base = of_iomap(np, 0); 215 259 if (!combiner_base) { ··· 271 219 __func__, max_nr); 272 220 } 273 221 274 - combiner_init(combiner_base, np, max_nr); 222 + combiner_init(combiner_base, np); 223 + 224 + register_syscore_ops(&combiner_syscore_ops); 275 225 276 226 return 0; 277 227 }
+1 -1
drivers/irqchip/irq-armada-370-xp.c
··· 409 409 }; 410 410 #endif /* CONFIG_SMP */ 411 411 412 - static struct irq_domain_ops armada_370_xp_mpic_irq_ops = { 412 + static const struct irq_domain_ops armada_370_xp_mpic_irq_ops = { 413 413 .map = armada_370_xp_mpic_irq_map, 414 414 .xlate = irq_domain_xlate_onecell, 415 415 };
+9
drivers/irqchip/irq-atmel-aic5.c
··· 339 339 return 0; 340 340 } 341 341 342 + #define NR_SAMA5D2_IRQS 77 343 + 344 + static int __init sama5d2_aic5_of_init(struct device_node *node, 345 + struct device_node *parent) 346 + { 347 + return aic5_of_init(node, parent, NR_SAMA5D2_IRQS); 348 + } 349 + IRQCHIP_DECLARE(sama5d2_aic5, "atmel,sama5d2-aic", sama5d2_aic5_of_init); 350 + 342 351 #define NR_SAMA5D3_IRQS 48 343 352 344 353 static int __init sama5d3_aic5_of_init(struct device_node *node,
+1 -1
drivers/irqchip/irq-bcm2835.c
··· 135 135 return 0; 136 136 } 137 137 138 - static struct irq_domain_ops armctrl_ops = { 138 + static const struct irq_domain_ops armctrl_ops = { 139 139 .xlate = armctrl_xlate 140 140 }; 141 141
-17
drivers/irqchip/irq-gic-common.c
··· 24 24 int gic_configure_irq(unsigned int irq, unsigned int type, 25 25 void __iomem *base, void (*sync_access)(void)) 26 26 { 27 - u32 enablemask = 1 << (irq % 32); 28 - u32 enableoff = (irq / 32) * 4; 29 27 u32 confmask = 0x2 << ((irq % 16) * 2); 30 28 u32 confoff = (irq / 16) * 4; 31 - bool enabled = false; 32 29 u32 val, oldval; 33 30 int ret = 0; 34 31 ··· 40 43 val |= confmask; 41 44 42 45 /* 43 - * As recommended by the spec, disable the interrupt before changing 44 - * the configuration 45 - */ 46 - if (readl_relaxed(base + GIC_DIST_ENABLE_SET + enableoff) & enablemask) { 47 - writel_relaxed(enablemask, base + GIC_DIST_ENABLE_CLEAR + enableoff); 48 - if (sync_access) 49 - sync_access(); 50 - enabled = true; 51 - } 52 - 53 - /* 54 46 * Write back the new configuration, and possibly re-enable 55 47 * the interrupt. If we tried to write a new configuration and failed, 56 48 * return an error. ··· 47 61 writel_relaxed(val, base + GIC_DIST_CONFIG + confoff); 48 62 if (readl_relaxed(base + GIC_DIST_CONFIG + confoff) != val && val != oldval) 49 63 ret = -EINVAL; 50 - 51 - if (enabled) 52 - writel_relaxed(enablemask, base + GIC_DIST_ENABLE_SET + enableoff); 53 64 54 65 if (sync_access) 55 66 sync_access();
+1
drivers/irqchip/irq-gic-v3.c
··· 658 658 .irq_set_affinity = gic_set_affinity, 659 659 .irq_get_irqchip_state = gic_irq_get_irqchip_state, 660 660 .irq_set_irqchip_state = gic_irq_set_irqchip_state, 661 + .flags = IRQCHIP_SET_TYPE_MASKED, 661 662 }; 662 663 663 664 #define GIC_ID_NR (1U << gic_data.rdists.id_bits)
+1
drivers/irqchip/irq-gic.c
··· 324 324 #endif 325 325 .irq_get_irqchip_state = gic_irq_get_irqchip_state, 326 326 .irq_set_irqchip_state = gic_irq_set_irqchip_state, 327 + .flags = IRQCHIP_SET_TYPE_MASKED, 327 328 }; 328 329 329 330 void __init gic_cascade_irq(unsigned int gic_nr, unsigned int irq)
+1
drivers/irqchip/irq-hip04.c
··· 202 202 #ifdef CONFIG_SMP 203 203 .irq_set_affinity = hip04_irq_set_affinity, 204 204 #endif 205 + .flags = IRQCHIP_SET_TYPE_MASKED, 205 206 }; 206 207 207 208 static u16 hip04_get_cpumask(struct hip04_irq_data *intc)
+2 -3
drivers/irqchip/irq-keystone.c
··· 131 131 return 0; 132 132 } 133 133 134 - static struct irq_domain_ops keystone_irq_ops = { 134 + static const struct irq_domain_ops keystone_irq_ops = { 135 135 .map = keystone_irq_map, 136 136 .xlate = irq_domain_xlate_onecell, 137 137 }; ··· 184 184 185 185 platform_set_drvdata(pdev, kirq); 186 186 187 - irq_set_chained_handler(kirq->irq, keystone_irq_handler); 188 - irq_set_handler_data(kirq->irq, kirq); 187 + irq_set_chained_handler_and_data(kirq->irq, keystone_irq_handler, kirq); 189 188 190 189 /* clear all source bits */ 191 190 keystone_irq_writel(kirq, ~0x0);
+1 -1
drivers/irqchip/irq-mips-gic.c
··· 746 746 return 0; 747 747 } 748 748 749 - static struct irq_domain_ops gic_irq_domain_ops = { 749 + static const struct irq_domain_ops gic_irq_domain_ops = { 750 750 .map = gic_irq_domain_map, 751 751 .xlate = gic_irq_domain_xlate, 752 752 };
+2 -2
drivers/irqchip/irq-mtk-sysirq.c
··· 111 111 return irq_domain_alloc_irqs_parent(domain, virq, nr_irqs, &gic_data); 112 112 } 113 113 114 - static struct irq_domain_ops sysirq_domain_ops = { 114 + static const struct irq_domain_ops sysirq_domain_ops = { 115 115 .xlate = mtk_sysirq_domain_xlate, 116 116 .alloc = mtk_sysirq_domain_alloc, 117 117 .free = irq_domain_free_irqs_common, ··· 144 144 chip_data->intpol_base = ioremap(res.start, size); 145 145 if (!chip_data->intpol_base) { 146 146 pr_err("mtk_sysirq: unable to map sysirq register\n"); 147 - ret = PTR_ERR(chip_data->intpol_base); 147 + ret = -ENXIO; 148 148 goto out_free; 149 149 } 150 150
+1 -1
drivers/irqchip/irq-mxs.c
··· 90 90 return 0; 91 91 } 92 92 93 - static struct irq_domain_ops icoll_irq_domain_ops = { 93 + static const struct irq_domain_ops icoll_irq_domain_ops = { 94 94 .map = icoll_irq_domain_map, 95 95 .xlate = irq_domain_xlate_onecell, 96 96 };
+27 -1
drivers/irqchip/irq-nvic.c
··· 49 49 handle_IRQ(irq, regs); 50 50 } 51 51 52 + static int nvic_irq_domain_alloc(struct irq_domain *domain, unsigned int virq, 53 + unsigned int nr_irqs, void *arg) 54 + { 55 + int i, ret; 56 + irq_hw_number_t hwirq; 57 + unsigned int type = IRQ_TYPE_NONE; 58 + struct of_phandle_args *irq_data = arg; 59 + 60 + ret = irq_domain_xlate_onecell(domain, irq_data->np, irq_data->args, 61 + irq_data->args_count, &hwirq, &type); 62 + if (ret) 63 + return ret; 64 + 65 + for (i = 0; i < nr_irqs; i++) 66 + irq_map_generic_chip(domain, virq + i, hwirq + i); 67 + 68 + return 0; 69 + } 70 + 71 + static const struct irq_domain_ops nvic_irq_domain_ops = { 72 + .xlate = irq_domain_xlate_onecell, 73 + .alloc = nvic_irq_domain_alloc, 74 + .free = irq_domain_free_irqs_top, 75 + }; 76 + 52 77 static int __init nvic_of_init(struct device_node *node, 53 78 struct device_node *parent) 54 79 { ··· 95 70 irqs = NVIC_MAX_IRQ; 96 71 97 72 nvic_irq_domain = 98 - irq_domain_add_linear(node, irqs, &irq_generic_chip_ops, NULL); 73 + irq_domain_add_linear(node, irqs, &nvic_irq_domain_ops, NULL); 74 + 99 75 if (!nvic_irq_domain) { 100 76 pr_warn("Failed to allocate irq domain\n"); 101 77 return -ENOMEM;
+1 -1
drivers/irqchip/irq-renesas-intc-irqpin.c
··· 347 347 return 0; 348 348 } 349 349 350 - static struct irq_domain_ops intc_irqpin_irq_domain_ops = { 350 + static const struct irq_domain_ops intc_irqpin_irq_domain_ops = { 351 351 .map = intc_irqpin_irq_domain_map, 352 352 .xlate = irq_domain_xlate_twocell, 353 353 };
+2 -17
drivers/irqchip/irq-renesas-irqc.c
··· 29 29 #include <linux/err.h> 30 30 #include <linux/slab.h> 31 31 #include <linux/module.h> 32 - #include <linux/platform_data/irq-renesas-irqc.h> 33 32 #include <linux/pm_runtime.h> 34 33 35 34 #define IRQC_IRQ_MAX 32 /* maximum 32 interrupts per driver instance */ ··· 61 62 void __iomem *iomem; 62 63 void __iomem *cpu_int_base; 63 64 struct irqc_irq irq[IRQC_IRQ_MAX]; 64 - struct renesas_irqc_config config; 65 65 unsigned int number_of_irqs; 66 66 struct platform_device *pdev; 67 67 struct irq_chip irq_chip; ··· 166 168 return 0; 167 169 } 168 170 169 - static struct irq_domain_ops irqc_irq_domain_ops = { 171 + static const struct irq_domain_ops irqc_irq_domain_ops = { 170 172 .map = irqc_irq_domain_map, 171 173 .xlate = irq_domain_xlate_twocell, 172 174 }; 173 175 174 176 static int irqc_probe(struct platform_device *pdev) 175 177 { 176 - struct renesas_irqc_config *pdata = pdev->dev.platform_data; 177 178 struct irqc_priv *p; 178 179 struct resource *io; 179 180 struct resource *irq; ··· 187 190 ret = -ENOMEM; 188 191 goto err0; 189 192 } 190 - 191 - /* deal with driver instance configuration */ 192 - if (pdata) 193 - memcpy(&p->config, pdata, sizeof(*pdata)); 194 193 195 194 p->pdev = pdev; 196 195 platform_set_drvdata(pdev, p); ··· 244 251 irq_chip->flags = IRQCHIP_MASK_ON_SUSPEND; 245 252 246 253 p->irq_domain = irq_domain_add_simple(pdev->dev.of_node, 247 - p->number_of_irqs, 248 - p->config.irq_base, 254 + p->number_of_irqs, 0, 249 255 &irqc_irq_domain_ops, p); 250 256 if (!p->irq_domain) { 251 257 ret = -ENXIO; ··· 263 271 } 264 272 265 273 dev_info(&pdev->dev, "driving %d irqs\n", p->number_of_irqs); 266 - 267 - /* warn in case of mismatch if irq base is specified */ 268 - if (p->config.irq_base) { 269 - if (p->config.irq_base != p->irq[0].domain_irq) 270 - dev_warn(&pdev->dev, "irq base mismatch (%d/%d)\n", 271 - p->config.irq_base, p->irq[0].domain_irq); 272 - } 273 274 274 275 return 0; 275 276 err3:
+2 -2
drivers/irqchip/irq-s3c24xx.c
··· 502 502 return -EINVAL; 503 503 } 504 504 505 - static struct irq_domain_ops s3c24xx_irq_ops = { 505 + static const struct irq_domain_ops s3c24xx_irq_ops = { 506 506 .map = s3c24xx_irq_map, 507 507 .xlate = irq_domain_xlate_twocell, 508 508 }; ··· 1228 1228 return 0; 1229 1229 } 1230 1230 1231 - static struct irq_domain_ops s3c24xx_irq_ops_of = { 1231 + static const struct irq_domain_ops s3c24xx_irq_ops_of = { 1232 1232 .map = s3c24xx_irq_map_of, 1233 1233 .xlate = s3c24xx_irq_xlate_of, 1234 1234 };
+1 -1
drivers/irqchip/irq-sun4i.c
··· 89 89 return 0; 90 90 } 91 91 92 - static struct irq_domain_ops sun4i_irq_ops = { 92 + static const struct irq_domain_ops sun4i_irq_ops = { 93 93 .map = sun4i_irq_map, 94 94 .xlate = irq_domain_xlate_onecell, 95 95 };
+1 -1
drivers/irqchip/irq-versatile-fpga.c
··· 132 132 return 0; 133 133 } 134 134 135 - static struct irq_domain_ops fpga_irqdomain_ops = { 135 + static const struct irq_domain_ops fpga_irqdomain_ops = { 136 136 .map = fpga_irqdomain_map, 137 137 .xlate = irq_domain_xlate_onetwocell, 138 138 };
+19 -9
drivers/irqchip/irq-vf610-mscm-ir.c
··· 47 47 void __iomem *mscm_ir_base; 48 48 u16 cpu_mask; 49 49 u16 saved_irsprc[MSCM_IRSPRC_NUM]; 50 + bool is_nvic; 50 51 }; 51 52 52 53 static struct vf610_mscm_ir_chip_data *mscm_ir_data; ··· 102 101 writew_relaxed(chip_data->cpu_mask, 103 102 chip_data->mscm_ir_base + MSCM_IRSPRC(hwirq)); 104 103 105 - irq_chip_unmask_parent(data); 104 + irq_chip_enable_parent(data); 106 105 } 107 106 108 107 static void vf610_mscm_ir_disable(struct irq_data *data) ··· 112 111 113 112 writew_relaxed(0x0, chip_data->mscm_ir_base + MSCM_IRSPRC(hwirq)); 114 113 115 - irq_chip_mask_parent(data); 114 + irq_chip_disable_parent(data); 116 115 } 117 116 118 117 static struct irq_chip vf610_mscm_ir_irq_chip = { ··· 144 143 domain->host_data); 145 144 146 145 gic_data.np = domain->parent->of_node; 147 - gic_data.args_count = 3; 148 - gic_data.args[0] = GIC_SPI; 149 - gic_data.args[1] = irq_data->args[0]; 150 - gic_data.args[2] = irq_data->args[1]; 146 + 147 + if (mscm_ir_data->is_nvic) { 148 + gic_data.args_count = 1; 149 + gic_data.args[0] = irq_data->args[0]; 150 + } else { 151 + gic_data.args_count = 3; 152 + gic_data.args[0] = GIC_SPI; 153 + gic_data.args[1] = irq_data->args[0]; 154 + gic_data.args[2] = irq_data->args[1]; 155 + } 156 + 151 157 return irq_domain_alloc_irqs_parent(domain, virq, nr_irqs, &gic_data); 152 158 } 153 159 ··· 182 174 return -ENOMEM; 183 175 184 176 mscm_ir_data->mscm_ir_base = of_io_request_and_map(node, 0, "mscm-ir"); 185 - 186 - if (!mscm_ir_data->mscm_ir_base) { 177 + if (IS_ERR(mscm_ir_data->mscm_ir_base)) { 187 178 pr_err("vf610_mscm_ir: unable to map mscm register\n"); 188 - ret = -ENOMEM; 179 + ret = PTR_ERR(mscm_ir_data->mscm_ir_base); 189 180 goto out_free; 190 181 } 191 182 ··· 205 198 ret = -ENOMEM; 206 199 goto out_unmap; 207 200 } 201 + 202 + if (of_device_is_compatible(domain->parent->of_node, "arm,armv7m-nvic")) 203 + mscm_ir_data->is_nvic = true; 208 204 209 205 cpu_pm_register_notifier(&mscm_ir_notifier_block); 210 206
+1 -1
drivers/irqchip/irq-vic.c
··· 256 256 } while (handled); 257 257 } 258 258 259 - static struct irq_domain_ops vic_irqdomain_ops = { 259 + static const struct irq_domain_ops vic_irqdomain_ops = { 260 260 .map = vic_irqdomain_map, 261 261 .xlate = irq_domain_xlate_onetwocell, 262 262 };
+1 -1
drivers/irqchip/irq-vt8500.c
··· 173 173 return 0; 174 174 } 175 175 176 - static struct irq_domain_ops vt8500_irq_domain_ops = { 176 + static const struct irq_domain_ops vt8500_irq_domain_ops = { 177 177 .map = vt8500_irq_map, 178 178 .xlate = irq_domain_xlate_onecell, 179 179 };
+1 -2
drivers/irqchip/spear-shirq.c
··· 207 207 if (!shirq->irq_chip) 208 208 return; 209 209 210 - irq_set_chained_handler(parent_irq, shirq_handler); 211 - irq_set_handler_data(parent_irq, shirq); 210 + irq_set_chained_handler_and_data(parent_irq, shirq_handler, shirq); 212 211 213 212 for (i = 0; i < shirq->nr_irqs; i++) { 214 213 irq_set_chip_and_handler(shirq->virq_base + i,
+1 -2
drivers/mfd/ucb1x00-core.c
··· 566 566 } 567 567 568 568 irq_set_irq_type(ucb->irq, IRQ_TYPE_EDGE_RISING); 569 - irq_set_handler_data(ucb->irq, ucb); 570 - irq_set_chained_handler(ucb->irq, ucb1x00_irq); 569 + irq_set_chained_handler_and_data(ucb->irq, ucb1x00_irq, ucb); 571 570 572 571 if (pdata && pdata->gpio_base) { 573 572 ucb->gpio.label = dev_name(&ucb->dev);
+60 -22
include/linux/irq.h
··· 126 126 struct irq_domain; 127 127 128 128 /** 129 - * struct irq_data - per irq and irq chip data passed down to chip functions 129 + * struct irq_common_data - per irq data shared by all irqchips 130 + * @state_use_accessors: status information for irq chip functions. 131 + * Use accessor functions to deal with it 132 + */ 133 + struct irq_common_data { 134 + unsigned int state_use_accessors; 135 + }; 136 + 137 + /** 138 + * struct irq_data - per irq chip data passed down to chip functions 130 139 * @mask: precomputed bitmask for accessing the chip registers 131 140 * @irq: interrupt number 132 141 * @hwirq: hardware interrupt number, local to the interrupt domain 133 142 * @node: node index useful for balancing 134 - * @state_use_accessors: status information for irq chip functions. 135 - * Use accessor functions to deal with it 143 + * @common: point to data shared by all irqchips 136 144 * @chip: low level interrupt hardware access 137 145 * @domain: Interrupt translation domain; responsible for mapping 138 146 * between hwirq number and linux irq number. ··· 161 153 unsigned int irq; 162 154 unsigned long hwirq; 163 155 unsigned int node; 164 - unsigned int state_use_accessors; 156 + struct irq_common_data *common; 165 157 struct irq_chip *chip; 166 158 struct irq_domain *domain; 167 159 #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY ··· 174 166 }; 175 167 176 168 /* 177 - * Bit masks for irq_data.state 169 + * Bit masks for irq_common_data.state_use_accessors 178 170 * 179 171 * IRQD_TRIGGER_MASK - Mask for the trigger type bits 180 172 * IRQD_SETAFFINITY_PENDING - Affinity setting is pending ··· 206 198 IRQD_WAKEUP_ARMED = (1 << 19), 207 199 }; 208 200 201 + #define __irqd_to_state(d) ((d)->common->state_use_accessors) 202 + 209 203 static inline bool irqd_is_setaffinity_pending(struct irq_data *d) 210 204 { 211 - return d->state_use_accessors & IRQD_SETAFFINITY_PENDING; 205 + return __irqd_to_state(d) & IRQD_SETAFFINITY_PENDING; 212 206 } 213 207 214 208 static inline bool irqd_is_per_cpu(struct irq_data *d) 215 209 { 216 - return d->state_use_accessors & IRQD_PER_CPU; 210 + return __irqd_to_state(d) & IRQD_PER_CPU; 217 211 } 218 212 219 213 static inline bool irqd_can_balance(struct irq_data *d) 220 214 { 221 - return !(d->state_use_accessors & (IRQD_PER_CPU | IRQD_NO_BALANCING)); 215 + return !(__irqd_to_state(d) & (IRQD_PER_CPU | IRQD_NO_BALANCING)); 222 216 } 223 217 224 218 static inline bool irqd_affinity_was_set(struct irq_data *d) 225 219 { 226 - return d->state_use_accessors & IRQD_AFFINITY_SET; 220 + return __irqd_to_state(d) & IRQD_AFFINITY_SET; 227 221 } 228 222 229 223 static inline void irqd_mark_affinity_was_set(struct irq_data *d) 230 224 { 231 - d->state_use_accessors |= IRQD_AFFINITY_SET; 225 + __irqd_to_state(d) |= IRQD_AFFINITY_SET; 232 226 } 233 227 234 228 static inline u32 irqd_get_trigger_type(struct irq_data *d) 235 229 { 236 - return d->state_use_accessors & IRQD_TRIGGER_MASK; 230 + return __irqd_to_state(d) & IRQD_TRIGGER_MASK; 237 231 } 238 232 239 233 /* ··· 243 233 */ 244 234 static inline void irqd_set_trigger_type(struct irq_data *d, u32 type) 245 235 { 246 - d->state_use_accessors &= ~IRQD_TRIGGER_MASK; 247 - d->state_use_accessors |= type & IRQD_TRIGGER_MASK; 236 + __irqd_to_state(d) &= ~IRQD_TRIGGER_MASK; 237 + __irqd_to_state(d) |= type & IRQD_TRIGGER_MASK; 248 238 } 249 239 250 240 static inline bool irqd_is_level_type(struct irq_data *d) 251 241 { 252 - return d->state_use_accessors & IRQD_LEVEL; 242 + return __irqd_to_state(d) & IRQD_LEVEL; 253 243 } 254 244 255 245 static inline bool irqd_is_wakeup_set(struct irq_data *d) 256 246 { 257 - return d->state_use_accessors & IRQD_WAKEUP_STATE; 247 + return __irqd_to_state(d) & IRQD_WAKEUP_STATE; 258 248 } 259 249 260 250 static inline bool irqd_can_move_in_process_context(struct irq_data *d) 261 251 { 262 - return d->state_use_accessors & IRQD_MOVE_PCNTXT; 252 + return __irqd_to_state(d) & IRQD_MOVE_PCNTXT; 263 253 } 264 254 265 255 static inline bool irqd_irq_disabled(struct irq_data *d) 266 256 { 267 - return d->state_use_accessors & IRQD_IRQ_DISABLED; 257 + return __irqd_to_state(d) & IRQD_IRQ_DISABLED; 268 258 } 269 259 270 260 static inline bool irqd_irq_masked(struct irq_data *d) 271 261 { 272 - return d->state_use_accessors & IRQD_IRQ_MASKED; 262 + return __irqd_to_state(d) & IRQD_IRQ_MASKED; 273 263 } 274 264 275 265 static inline bool irqd_irq_inprogress(struct irq_data *d) 276 266 { 277 - return d->state_use_accessors & IRQD_IRQ_INPROGRESS; 267 + return __irqd_to_state(d) & IRQD_IRQ_INPROGRESS; 278 268 } 279 269 280 270 static inline bool irqd_is_wakeup_armed(struct irq_data *d) 281 271 { 282 - return d->state_use_accessors & IRQD_WAKEUP_ARMED; 272 + return __irqd_to_state(d) & IRQD_WAKEUP_ARMED; 283 273 } 284 274 285 275 ··· 290 280 */ 291 281 static inline void irqd_set_chained_irq_inprogress(struct irq_data *d) 292 282 { 293 - d->state_use_accessors |= IRQD_IRQ_INPROGRESS; 283 + __irqd_to_state(d) |= IRQD_IRQ_INPROGRESS; 294 284 } 295 285 296 286 static inline void irqd_clr_chained_irq_inprogress(struct irq_data *d) 297 287 { 298 - d->state_use_accessors &= ~IRQD_IRQ_INPROGRESS; 288 + __irqd_to_state(d) &= ~IRQD_IRQ_INPROGRESS; 299 289 } 300 290 301 291 static inline irq_hw_number_t irqd_to_hwirq(struct irq_data *d) ··· 472 462 473 463 extern int irq_chip_compose_msi_msg(struct irq_data *data, struct msi_msg *msg); 474 464 #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY 465 + extern void irq_chip_enable_parent(struct irq_data *data); 466 + extern void irq_chip_disable_parent(struct irq_data *data); 475 467 extern void irq_chip_ack_parent(struct irq_data *data); 476 468 extern int irq_chip_retrigger_hierarchy(struct irq_data *data); 477 469 extern void irq_chip_mask_parent(struct irq_data *data); ··· 534 522 { 535 523 __irq_set_handler(irq, handle, 1, NULL); 536 524 } 525 + 526 + /* 527 + * Set a highlevel chained flow handler and its data for a given IRQ. 528 + * (a chained handler is automatically enabled and set to 529 + * IRQ_NOREQUEST, IRQ_NOPROBE, and IRQ_NOTHREAD) 530 + */ 531 + void 532 + irq_set_chained_handler_and_data(unsigned int irq, irq_flow_handler_t handle, 533 + void *data); 537 534 538 535 void irq_modify_status(unsigned int irq, unsigned long clr, unsigned long set); 539 536 ··· 649 628 { 650 629 struct irq_data *d = irq_get_irq_data(irq); 651 630 return d ? irqd_get_trigger_type(d) : 0; 631 + } 632 + 633 + static inline int irq_data_get_node(struct irq_data *d) 634 + { 635 + return d->node; 636 + } 637 + 638 + static inline struct cpumask *irq_get_affinity_mask(int irq) 639 + { 640 + struct irq_data *d = irq_get_irq_data(irq); 641 + 642 + return d ? d->affinity : NULL; 643 + } 644 + 645 + static inline struct cpumask *irq_data_get_affinity_mask(struct irq_data *d) 646 + { 647 + return d->affinity; 652 648 } 653 649 654 650 unsigned int arch_dynirq_lower_bound(unsigned int from);
+2 -1
include/linux/irqdesc.h
··· 17 17 18 18 /** 19 19 * struct irq_desc - interrupt descriptor 20 - * @irq_data: per irq and chip data passed down to chip functions 20 + * @irq_common_data: per irq and chip data passed down to chip functions 21 21 * @kstat_irqs: irq stats per cpu 22 22 * @handle_irq: highlevel irq-events handler 23 23 * @preflow_handler: handler called before the flow handler (currently used by sparc) ··· 47 47 * @name: flow handler name for /proc/interrupts output 48 48 */ 49 49 struct irq_desc { 50 + struct irq_common_data irq_common_data; 50 51 struct irq_data irq_data; 51 52 unsigned int __percpu *kstat_irqs; 52 53 irq_flow_handler_t handle_irq;
+4 -4
include/linux/irqdomain.h
··· 258 258 /* V2 interfaces to support hierarchy IRQ domains. */ 259 259 extern struct irq_data *irq_domain_get_irq_data(struct irq_domain *domain, 260 260 unsigned int virq); 261 + extern void irq_domain_set_info(struct irq_domain *domain, unsigned int virq, 262 + irq_hw_number_t hwirq, struct irq_chip *chip, 263 + void *chip_data, irq_flow_handler_t handler, 264 + void *handler_data, const char *handler_name); 261 265 #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY 262 266 extern struct irq_domain *irq_domain_add_hierarchy(struct irq_domain *parent, 263 267 unsigned int flags, unsigned int size, ··· 285 281 irq_hw_number_t hwirq, 286 282 struct irq_chip *chip, 287 283 void *chip_data); 288 - extern void irq_domain_set_info(struct irq_domain *domain, unsigned int virq, 289 - irq_hw_number_t hwirq, struct irq_chip *chip, 290 - void *chip_data, irq_flow_handler_t handler, 291 - void *handler_data, const char *handler_name); 292 284 extern void irq_domain_reset_irq_data(struct irq_data *irq_data); 293 285 extern void irq_domain_free_irqs_common(struct irq_domain *domain, 294 286 unsigned int virq,
-27
include/linux/platform_data/irq-renesas-irqc.h
··· 1 - /* 2 - * Renesas IRQC Driver 3 - * 4 - * Copyright (C) 2013 Magnus Damm 5 - * 6 - * This program is free software; you can redistribute it and/or modify 7 - * it under the terms of the GNU General Public License as published by 8 - * the Free Software Foundation; either version 2 of the License 9 - * 10 - * This program is distributed in the hope that it will be useful, 11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 - * GNU General Public License for more details. 14 - * 15 - * You should have received a copy of the GNU General Public License 16 - * along with this program; if not, write to the Free Software 17 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 - */ 19 - 20 - #ifndef __IRQ_RENESAS_IRQC_H__ 21 - #define __IRQ_RENESAS_IRQC_H__ 22 - 23 - struct renesas_irqc_config { 24 - unsigned int irq_base; 25 - }; 26 - 27 - #endif /* __IRQ_RENESAS_IRQC_H__ */
+62 -11
kernel/irq/chip.c
··· 719 719 } 720 720 721 721 void 722 - __irq_set_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained, 723 - const char *name) 722 + __irq_do_set_handler(struct irq_desc *desc, irq_flow_handler_t handle, 723 + int is_chained, const char *name) 724 724 { 725 - unsigned long flags; 726 - struct irq_desc *desc = irq_get_desc_buslock(irq, &flags, 0); 727 - 728 - if (!desc) 729 - return; 730 - 731 725 if (!handle) { 732 726 handle = handle_bad_irq; 733 727 } else { ··· 743 749 * right away. 744 750 */ 745 751 if (WARN_ON(is_chained)) 746 - goto out; 752 + return; 747 753 /* Try the parent */ 748 754 irq_data = irq_data->parent_data; 749 755 } 750 756 #endif 751 757 if (WARN_ON(!irq_data || irq_data->chip == &no_irq_chip)) 752 - goto out; 758 + return; 753 759 } 754 760 755 761 /* Uninstall? */ ··· 768 774 irq_settings_set_nothread(desc); 769 775 irq_startup(desc, true); 770 776 } 771 - out: 777 + } 778 + 779 + void 780 + __irq_set_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained, 781 + const char *name) 782 + { 783 + unsigned long flags; 784 + struct irq_desc *desc = irq_get_desc_buslock(irq, &flags, 0); 785 + 786 + if (!desc) 787 + return; 788 + 789 + __irq_do_set_handler(desc, handle, is_chained, name); 772 790 irq_put_desc_busunlock(desc, flags); 773 791 } 774 792 EXPORT_SYMBOL_GPL(__irq_set_handler); 793 + 794 + void 795 + irq_set_chained_handler_and_data(unsigned int irq, irq_flow_handler_t handle, 796 + void *data) 797 + { 798 + unsigned long flags; 799 + struct irq_desc *desc = irq_get_desc_buslock(irq, &flags, 0); 800 + 801 + if (!desc) 802 + return; 803 + 804 + __irq_do_set_handler(desc, handle, 1, NULL); 805 + desc->irq_data.handler_data = data; 806 + 807 + irq_put_desc_busunlock(desc, flags); 808 + } 809 + EXPORT_SYMBOL_GPL(irq_set_chained_handler_and_data); 775 810 776 811 void 777 812 irq_set_chip_and_handler_name(unsigned int irq, struct irq_chip *chip, ··· 898 875 } 899 876 900 877 #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY 878 + /** 879 + * irq_chip_enable_parent - Enable the parent interrupt (defaults to unmask if 880 + * NULL) 881 + * @data: Pointer to interrupt specific data 882 + */ 883 + void irq_chip_enable_parent(struct irq_data *data) 884 + { 885 + data = data->parent_data; 886 + if (data->chip->irq_enable) 887 + data->chip->irq_enable(data); 888 + else 889 + data->chip->irq_unmask(data); 890 + } 891 + 892 + /** 893 + * irq_chip_disable_parent - Disable the parent interrupt (defaults to mask if 894 + * NULL) 895 + * @data: Pointer to interrupt specific data 896 + */ 897 + void irq_chip_disable_parent(struct irq_data *data) 898 + { 899 + data = data->parent_data; 900 + if (data->chip->irq_disable) 901 + data->chip->irq_disable(data); 902 + else 903 + data->chip->irq_mask(data); 904 + } 905 + 901 906 /** 902 907 * irq_chip_ack_parent - Acknowledge the parent interrupt 903 908 * @data: Pointer to interrupt specific data
+2 -2
kernel/irq/devres.c
··· 104 104 return -ENOMEM; 105 105 106 106 rc = request_any_context_irq(irq, handler, irqflags, devname, dev_id); 107 - if (rc) { 107 + if (rc < 0) { 108 108 devres_free(dr); 109 109 return rc; 110 110 } ··· 113 113 dr->dev_id = dev_id; 114 114 devres_add(dev, dr); 115 115 116 - return 0; 116 + return rc; 117 117 } 118 118 EXPORT_SYMBOL(devm_request_any_context_irq); 119 119
+1
kernel/irq/dummychip.c
··· 42 42 .irq_enable = noop, 43 43 .irq_disable = noop, 44 44 .irq_ack = ack_bad, 45 + .flags = IRQCHIP_SKIP_SET_WAKE, 45 46 }; 46 47 47 48 /*
+2 -3
kernel/irq/generic-chip.c
··· 360 360 int irq_map_generic_chip(struct irq_domain *d, unsigned int virq, 361 361 irq_hw_number_t hw_irq) 362 362 { 363 - struct irq_data *data = irq_get_irq_data(virq); 363 + struct irq_data *data = irq_domain_get_irq_data(d, virq); 364 364 struct irq_domain_chip_generic *dgc = d->gc; 365 365 struct irq_chip_generic *gc; 366 366 struct irq_chip_type *ct; ··· 405 405 else 406 406 data->mask = 1 << idx; 407 407 408 - irq_set_chip_and_handler(virq, chip, ct->handler); 409 - irq_set_chip_data(virq, gc); 408 + irq_domain_set_info(d, virq, hw_irq, chip, gc, ct->handler, NULL, NULL); 410 409 irq_modify_status(virq, dgc->irq_flags_to_clear, dgc->irq_flags_to_set); 411 410 return 0; 412 411 }
+10 -5
kernel/irq/internals.h
··· 168 168 */ 169 169 static inline void irqd_set_move_pending(struct irq_data *d) 170 170 { 171 - d->state_use_accessors |= IRQD_SETAFFINITY_PENDING; 171 + __irqd_to_state(d) |= IRQD_SETAFFINITY_PENDING; 172 172 } 173 173 174 174 static inline void irqd_clr_move_pending(struct irq_data *d) 175 175 { 176 - d->state_use_accessors &= ~IRQD_SETAFFINITY_PENDING; 176 + __irqd_to_state(d) &= ~IRQD_SETAFFINITY_PENDING; 177 177 } 178 178 179 179 static inline void irqd_clear(struct irq_data *d, unsigned int mask) 180 180 { 181 - d->state_use_accessors &= ~mask; 181 + __irqd_to_state(d) &= ~mask; 182 182 } 183 183 184 184 static inline void irqd_set(struct irq_data *d, unsigned int mask) 185 185 { 186 - d->state_use_accessors |= mask; 186 + __irqd_to_state(d) |= mask; 187 187 } 188 188 189 189 static inline bool irqd_has_set(struct irq_data *d, unsigned int mask) 190 190 { 191 - return d->state_use_accessors & mask; 191 + return __irqd_to_state(d) & mask; 192 192 } 193 193 194 194 static inline void kstat_incr_irqs_this_cpu(unsigned int irq, struct irq_desc *desc) 195 195 { 196 196 __this_cpu_inc(*desc->kstat_irqs); 197 197 __this_cpu_inc(kstat.irqs_sum); 198 + } 199 + 200 + static inline int irq_desc_get_node(struct irq_desc *desc) 201 + { 202 + return irq_data_get_node(&desc->irq_data); 198 203 } 199 204 200 205 #ifdef CONFIG_PM_SLEEP
+4 -9
kernel/irq/irqdesc.c
··· 59 59 #endif 60 60 } 61 61 62 - static inline int desc_node(struct irq_desc *desc) 63 - { 64 - return desc->irq_data.node; 65 - } 66 - 67 62 #else 68 63 static inline int 69 64 alloc_masks(struct irq_desc *desc, gfp_t gfp, int node) { return 0; } 70 65 static inline void desc_smp_init(struct irq_desc *desc, int node) { } 71 - static inline int desc_node(struct irq_desc *desc) { return 0; } 72 66 #endif 73 67 74 68 static void desc_set_defaults(unsigned int irq, struct irq_desc *desc, int node, ··· 70 76 { 71 77 int cpu; 72 78 79 + desc->irq_data.common = &desc->irq_common_data; 73 80 desc->irq_data.irq = irq; 74 81 desc->irq_data.chip = &no_irq_chip; 75 82 desc->irq_data.chip_data = NULL; ··· 294 299 unsigned long flags; 295 300 296 301 raw_spin_lock_irqsave(&desc->lock, flags); 297 - desc_set_defaults(irq, desc, desc_node(desc), NULL); 302 + desc_set_defaults(irq, desc, irq_desc_get_node(desc), NULL); 298 303 raw_spin_unlock_irqrestore(&desc->lock, flags); 299 304 } 300 305 ··· 614 619 { 615 620 struct irq_desc *desc = irq_to_desc(irq); 616 621 int cpu; 617 - int sum = 0; 622 + unsigned int sum = 0; 618 623 619 624 if (!desc || !desc->kstat_irqs) 620 625 return 0; ··· 634 639 */ 635 640 unsigned int kstat_irqs_usr(unsigned int irq) 636 641 { 637 - int sum; 642 + unsigned int sum; 638 643 639 644 irq_lock_sparse(); 640 645 sum = kstat_irqs(irq);
+24 -1
kernel/irq/irqdomain.c
··· 830 830 { 831 831 struct irq_data *irq_data; 832 832 833 - irq_data = kzalloc_node(sizeof(*irq_data), GFP_KERNEL, child->node); 833 + irq_data = kzalloc_node(sizeof(*irq_data), GFP_KERNEL, 834 + irq_data_get_node(child)); 834 835 if (irq_data) { 835 836 child->parent_data = irq_data; 836 837 irq_data->irq = child->irq; 838 + irq_data->common = child->common; 837 839 irq_data->node = child->node; 838 840 irq_data->domain = domain; 839 841 } ··· 1232 1230 struct irq_data *irq_data = irq_get_irq_data(virq); 1233 1231 1234 1232 return (irq_data && irq_data->domain == domain) ? irq_data : NULL; 1233 + } 1234 + 1235 + /** 1236 + * irq_domain_set_info - Set the complete data for a @virq in @domain 1237 + * @domain: Interrupt domain to match 1238 + * @virq: IRQ number 1239 + * @hwirq: The hardware interrupt number 1240 + * @chip: The associated interrupt chip 1241 + * @chip_data: The associated interrupt chip data 1242 + * @handler: The interrupt flow handler 1243 + * @handler_data: The interrupt flow handler data 1244 + * @handler_name: The interrupt handler name 1245 + */ 1246 + void irq_domain_set_info(struct irq_domain *domain, unsigned int virq, 1247 + irq_hw_number_t hwirq, struct irq_chip *chip, 1248 + void *chip_data, irq_flow_handler_t handler, 1249 + void *handler_data, const char *handler_name) 1250 + { 1251 + irq_set_chip_and_handler_name(virq, chip, handler, handler_name); 1252 + irq_set_chip_data(virq, chip_data); 1253 + irq_set_handler_data(virq, handler_data); 1235 1254 } 1236 1255 1237 1256 static void irq_domain_check_hierarchy(struct irq_domain *domain)
+1 -1
kernel/irq/manage.c
··· 363 363 setup_affinity(unsigned int irq, struct irq_desc *desc, struct cpumask *mask) 364 364 { 365 365 struct cpumask *set = irq_default_affinity; 366 - int node = desc->irq_data.node; 366 + int node = irq_desc_get_node(desc); 367 367 368 368 /* Excludes PER_CPU and NO_BALANCE interrupts */ 369 369 if (!irq_can_set_affinity(irq))
+3 -3
kernel/irq/migration.c
··· 12 12 if (likely(!irqd_is_setaffinity_pending(&desc->irq_data))) 13 13 return; 14 14 15 + irqd_clr_move_pending(&desc->irq_data); 16 + 15 17 /* 16 18 * Paranoia: cpu-local interrupts shouldn't be calling in here anyway. 17 19 */ 18 - if (!irqd_can_balance(&desc->irq_data)) { 20 + if (irqd_is_per_cpu(&desc->irq_data)) { 19 21 WARN_ON(1); 20 22 return; 21 23 } 22 - 23 - irqd_clr_move_pending(&desc->irq_data); 24 24 25 25 if (unlikely(cpumask_empty(desc->pending_mask))) 26 26 return;
+1 -1
kernel/irq/msi.c
··· 124 124 irq_domain_free_irqs_top(domain, virq, nr_irqs); 125 125 } 126 126 127 - static struct irq_domain_ops msi_domain_ops = { 127 + static const struct irq_domain_ops msi_domain_ops = { 128 128 .alloc = msi_domain_alloc, 129 129 .free = msi_domain_free, 130 130 .activate = msi_domain_activate,
+4
kernel/irq/pm.c
··· 123 123 unsigned long flags; 124 124 bool sync; 125 125 126 + if (irq_settings_is_nested_thread(desc)) 127 + continue; 126 128 raw_spin_lock_irqsave(&desc->lock, flags); 127 129 sync = suspend_device_irq(desc, irq); 128 130 raw_spin_unlock_irqrestore(&desc->lock, flags); ··· 164 162 desc->action->flags & IRQF_EARLY_RESUME; 165 163 166 164 if (!is_early && want_early) 165 + continue; 166 + if (irq_settings_is_nested_thread(desc)) 167 167 continue; 168 168 169 169 raw_spin_lock_irqsave(&desc->lock, flags);
+1 -1
kernel/irq/proc.c
··· 241 241 { 242 242 struct irq_desc *desc = irq_to_desc((long) m->private); 243 243 244 - seq_printf(m, "%d\n", desc->irq_data.node); 244 + seq_printf(m, "%d\n", irq_desc_get_node(desc)); 245 245 return 0; 246 246 } 247 247