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 irqchip updates from Ingo Molnar:
"Various irqchip driver updates, plus a genirq core update that allows
the initial spreading of irqs amonst CPUs without having to do it from
user-space"

* 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
genirq: Fix null pointer reference in irq_set_affinity_hint()
irqchip: gic: Allow interrupt level to be set for PPIs
irqchip: mips-gic: Handle pending interrupts once in __gic_irq_dispatch()
irqchip: Conexant CX92755 interrupts controller driver
irqchip: Devicetree: document Conexant Digicolor irq binding
irqchip: omap-intc: Remove unused legacy interface for omap2
irqchip: omap-intc: Fix support for dm814 and dm816
irqchip: mtk-sysirq: Get irq number from register resource size
irqchip: renesas-intc-irqpin: r8a7779 IRLM setup support
genirq: Set initial affinity in irq_set_affinity_hint()

+296 -72
+6 -2
Documentation/devicetree/bindings/arm/gic.txt
··· 32 32 The 3rd cell is the flags, encoded as follows: 33 33 bits[3:0] trigger type and level flags. 34 34 1 = low-to-high edge triggered 35 - 2 = high-to-low edge triggered 35 + 2 = high-to-low edge triggered (invalid for SPIs) 36 36 4 = active high level-sensitive 37 - 8 = active low level-sensitive 37 + 8 = active low level-sensitive (invalid for SPIs). 38 38 bits[15:8] PPI interrupt cpu mask. Each bit corresponds to each of 39 39 the 8 possible cpus attached to the GIC. A bit set to '1' indicated 40 40 the interrupt is wired to that CPU. Only valid for PPI interrupts. 41 + Also note that the configurability of PPI interrupts is IMPLEMENTATION 42 + DEFINED and as such not guaranteed to be present (most SoC available 43 + in 2014 seem to ignore the setting of this flag and use the hardware 44 + default value). 41 45 42 46 - reg : Specifies base physical address(s) and size of the GIC registers. The 43 47 first region is the GIC distributor register base and size. The 2nd region is
+21
Documentation/devicetree/bindings/interrupt-controller/digicolor-ic.txt
··· 1 + Conexant Digicolor Interrupt Controller 2 + 3 + Required properties: 4 + 5 + - compatible : should be "cnxt,cx92755-ic" 6 + - reg : Specifies base physical address and size of the interrupt controller 7 + registers (IC) area 8 + - interrupt-controller : Identifies the node as an interrupt controller 9 + - #interrupt-cells : Specifies the number of cells needed to encode an 10 + interrupt source. The value shall be 1. 11 + - syscon: A phandle to the syscon node describing UC registers 12 + 13 + Example: 14 + 15 + intc: interrupt-controller@f0000040 { 16 + compatible = "cnxt,cx92755-ic"; 17 + interrupt-controller; 18 + #interrupt-cells = <1>; 19 + reg = <0xf0000040 0x40>; 20 + syscon = <&uc_regs>; 21 + };
+5
Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.txt
··· 9 9 - "renesas,intc-irqpin-r8a7778" (R-Car M1A) 10 10 - "renesas,intc-irqpin-r8a7779" (R-Car H1) 11 11 - "renesas,intc-irqpin-sh73a0" (SH-Mobile AG5) 12 + 13 + - reg: Base address and length of each register bank used by the external 14 + IRQ pins driven by the interrupt controller hardware module. The base 15 + addresses, length and number of required register banks varies with soctype. 16 + 12 17 - #interrupt-cells: has to be <2>: an interrupt index and flags, as defined in 13 18 interrupts.txt in this directory 14 19
+28
Documentation/devicetree/bindings/interrupt-controller/ti,omap-intc-irq.txt
··· 1 + Omap2/3 intc controller 2 + 3 + On TI omap2 and 3 the intc interrupt controller can provide 4 + 96 or 128 IRQ signals to the ARM host depending on the SoC. 5 + 6 + Required Properties: 7 + - compatible: should be one of 8 + "ti,omap2-intc" 9 + "ti,omap3-intc" 10 + "ti,dm814-intc" 11 + "ti,dm816-intc" 12 + "ti,am33xx-intc" 13 + 14 + - interrupt-controller : Identifies the node as an interrupt controller 15 + - #interrupt-cells : Specifies the number of cells needed to encode interrupt 16 + source, should be 1 for intc 17 + - interrupts: interrupt reference to primary interrupt controller 18 + 19 + Please refer to interrupts.txt in this directory for details of the common 20 + Interrupt Controllers bindings used by client devices. 21 + 22 + Example: 23 + intc: interrupt-controller@48200000 { 24 + compatible = "ti,omap3-intc"; 25 + interrupt-controller; 26 + #interrupt-cells = <1>; 27 + reg = <0x48200000 0x1000>; 28 + };
+1
drivers/irqchip/Makefile
··· 42 42 obj-$(CONFIG_KEYSTONE_IRQ) += irq-keystone.o 43 43 obj-$(CONFIG_MIPS_GIC) += irq-mips-gic.o 44 44 obj-$(CONFIG_ARCH_MEDIATEK) += irq-mtk-sysirq.o 45 + obj-$(CONFIG_ARCH_DIGICOLOR) += irq-digicolor.o
+120
drivers/irqchip/irq-digicolor.c
··· 1 + /* 2 + * Conexant Digicolor SoCs IRQ chip driver 3 + * 4 + * Author: Baruch Siach <baruch@tkos.co.il> 5 + * 6 + * Copyright (C) 2014 Paradox Innovation Ltd. 7 + * 8 + * This file is licensed under the terms of the GNU General Public 9 + * License version 2. This program is licensed "as is" without any 10 + * warranty of any kind, whether express or implied. 11 + */ 12 + 13 + #include <linux/io.h> 14 + #include <linux/irq.h> 15 + #include <linux/of.h> 16 + #include <linux/of_address.h> 17 + #include <linux/of_irq.h> 18 + #include <linux/mfd/syscon.h> 19 + #include <linux/regmap.h> 20 + 21 + #include <asm/exception.h> 22 + 23 + #include "irqchip.h" 24 + 25 + #define UC_IRQ_CONTROL 0x04 26 + 27 + #define IC_FLAG_CLEAR_LO 0x00 28 + #define IC_FLAG_CLEAR_XLO 0x04 29 + #define IC_INT0ENABLE_LO 0x10 30 + #define IC_INT0ENABLE_XLO 0x14 31 + #define IC_INT0STATUS_LO 0x18 32 + #define IC_INT0STATUS_XLO 0x1c 33 + 34 + static struct irq_domain *digicolor_irq_domain; 35 + 36 + static void __exception_irq_entry digicolor_handle_irq(struct pt_regs *regs) 37 + { 38 + struct irq_domain_chip_generic *dgc = digicolor_irq_domain->gc; 39 + struct irq_chip_generic *gc = dgc->gc[0]; 40 + u32 status, hwirq; 41 + 42 + do { 43 + status = irq_reg_readl(gc, IC_INT0STATUS_LO); 44 + if (status) { 45 + hwirq = ffs(status) - 1; 46 + } else { 47 + status = irq_reg_readl(gc, IC_INT0STATUS_XLO); 48 + if (status) 49 + hwirq = ffs(status) - 1 + 32; 50 + else 51 + return; 52 + } 53 + 54 + handle_domain_irq(digicolor_irq_domain, hwirq, regs); 55 + } while (1); 56 + } 57 + 58 + static void digicolor_set_gc(void __iomem *reg_base, unsigned irq_base, 59 + unsigned en_reg, unsigned ack_reg) 60 + { 61 + struct irq_chip_generic *gc; 62 + 63 + gc = irq_get_domain_generic_chip(digicolor_irq_domain, irq_base); 64 + gc->reg_base = reg_base; 65 + gc->chip_types[0].regs.ack = ack_reg; 66 + gc->chip_types[0].regs.mask = en_reg; 67 + gc->chip_types[0].chip.irq_ack = irq_gc_ack_set_bit; 68 + gc->chip_types[0].chip.irq_mask = irq_gc_mask_clr_bit; 69 + gc->chip_types[0].chip.irq_unmask = irq_gc_mask_set_bit; 70 + } 71 + 72 + static int __init digicolor_of_init(struct device_node *node, 73 + struct device_node *parent) 74 + { 75 + static void __iomem *reg_base; 76 + unsigned int clr = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN; 77 + struct regmap *ucregs; 78 + int ret; 79 + 80 + reg_base = of_iomap(node, 0); 81 + if (!reg_base) { 82 + pr_err("%s: unable to map IC registers\n", node->full_name); 83 + return -ENXIO; 84 + } 85 + 86 + /* disable all interrupts */ 87 + writel(0, reg_base + IC_INT0ENABLE_LO); 88 + writel(0, reg_base + IC_INT0ENABLE_XLO); 89 + 90 + ucregs = syscon_regmap_lookup_by_phandle(node, "syscon"); 91 + if (IS_ERR(ucregs)) { 92 + pr_err("%s: unable to map UC registers\n", node->full_name); 93 + return PTR_ERR(ucregs); 94 + } 95 + /* channel 1, regular IRQs */ 96 + regmap_write(ucregs, UC_IRQ_CONTROL, 1); 97 + 98 + digicolor_irq_domain = 99 + irq_domain_add_linear(node, 64, &irq_generic_chip_ops, NULL); 100 + if (!digicolor_irq_domain) { 101 + pr_err("%s: unable to create IRQ domain\n", node->full_name); 102 + return -ENOMEM; 103 + } 104 + 105 + ret = irq_alloc_domain_generic_chips(digicolor_irq_domain, 32, 1, 106 + "digicolor_irq", handle_level_irq, 107 + clr, 0, 0); 108 + if (ret) { 109 + pr_err("%s: unable to allocate IRQ gc\n", node->full_name); 110 + return ret; 111 + } 112 + 113 + digicolor_set_gc(reg_base, 0, IC_INT0ENABLE_LO, IC_FLAG_CLEAR_LO); 114 + digicolor_set_gc(reg_base, 32, IC_INT0ENABLE_XLO, IC_FLAG_CLEAR_XLO); 115 + 116 + set_handle_irq(digicolor_handle_irq); 117 + 118 + return 0; 119 + } 120 + IRQCHIP_DECLARE(conexant_digicolor_ic, "cnxt,cx92755-ic", digicolor_of_init);
+12 -6
drivers/irqchip/irq-gic-common.c
··· 21 21 22 22 #include "irq-gic-common.h" 23 23 24 - void gic_configure_irq(unsigned int irq, unsigned int type, 24 + int gic_configure_irq(unsigned int irq, unsigned int type, 25 25 void __iomem *base, void (*sync_access)(void)) 26 26 { 27 27 u32 enablemask = 1 << (irq % 32); ··· 29 29 u32 confmask = 0x2 << ((irq % 16) * 2); 30 30 u32 confoff = (irq / 16) * 4; 31 31 bool enabled = false; 32 - u32 val; 32 + u32 val, oldval; 33 + int ret = 0; 33 34 34 35 /* 35 36 * Read current configuration register, and insert the config 36 37 * for "irq", depending on "type". 37 38 */ 38 - val = readl_relaxed(base + GIC_DIST_CONFIG + confoff); 39 - if (type == IRQ_TYPE_LEVEL_HIGH) 39 + val = oldval = readl_relaxed(base + GIC_DIST_CONFIG + confoff); 40 + if (type & IRQ_TYPE_LEVEL_MASK) 40 41 val &= ~confmask; 41 - else if (type == IRQ_TYPE_EDGE_RISING) 42 + else if (type & IRQ_TYPE_EDGE_BOTH) 42 43 val |= confmask; 43 44 44 45 /* ··· 55 54 56 55 /* 57 56 * Write back the new configuration, and possibly re-enable 58 - * the interrupt. 57 + * the interrupt. If we tried to write a new configuration and failed, 58 + * return an error. 59 59 */ 60 60 writel_relaxed(val, base + GIC_DIST_CONFIG + confoff); 61 + if (readl_relaxed(base + GIC_DIST_CONFIG + confoff) != val && val != oldval) 62 + ret = -EINVAL; 61 63 62 64 if (enabled) 63 65 writel_relaxed(enablemask, base + GIC_DIST_ENABLE_SET + enableoff); 64 66 65 67 if (sync_access) 66 68 sync_access(); 69 + 70 + return ret; 67 71 } 68 72 69 73 void __init gic_dist_config(void __iomem *base, int gic_irqs,
+1 -1
drivers/irqchip/irq-gic-common.h
··· 20 20 #include <linux/of.h> 21 21 #include <linux/irqdomain.h> 22 22 23 - void gic_configure_irq(unsigned int irq, unsigned int type, 23 + int gic_configure_irq(unsigned int irq, unsigned int type, 24 24 void __iomem *base, void (*sync_access)(void)); 25 25 void gic_dist_config(void __iomem *base, int gic_irqs, 26 26 void (*sync_access)(void));
+4 -4
drivers/irqchip/irq-gic-v3.c
··· 238 238 if (irq < 16) 239 239 return -EINVAL; 240 240 241 - if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING) 241 + /* SPIs have restrictions on the supported types */ 242 + if (irq >= 32 && type != IRQ_TYPE_LEVEL_HIGH && 243 + type != IRQ_TYPE_EDGE_RISING) 242 244 return -EINVAL; 243 245 244 246 if (gic_irq_in_rdist(d)) { ··· 251 249 rwp_wait = gic_dist_wait_for_rwp; 252 250 } 253 251 254 - gic_configure_irq(irq, type, base, rwp_wait); 255 - 256 - return 0; 252 + return gic_configure_irq(irq, type, base, rwp_wait); 257 253 } 258 254 259 255 static u64 gic_mpidr_to_affinity(u64 mpidr)
+6 -3
drivers/irqchip/irq-gic.c
··· 188 188 { 189 189 void __iomem *base = gic_dist_base(d); 190 190 unsigned int gicirq = gic_irq(d); 191 + int ret; 191 192 192 193 /* Interrupt configuration for SGIs can't be changed */ 193 194 if (gicirq < 16) 194 195 return -EINVAL; 195 196 196 - if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING) 197 + /* SPIs have restrictions on the supported types */ 198 + if (gicirq >= 32 && type != IRQ_TYPE_LEVEL_HIGH && 199 + type != IRQ_TYPE_EDGE_RISING) 197 200 return -EINVAL; 198 201 199 202 raw_spin_lock(&irq_controller_lock); ··· 204 201 if (gic_arch_extn.irq_set_type) 205 202 gic_arch_extn.irq_set_type(d, type); 206 203 207 - gic_configure_irq(gicirq, type, base, NULL); 204 + ret = gic_configure_irq(gicirq, type, base, NULL); 208 205 209 206 raw_spin_unlock(&irq_controller_lock); 210 207 211 - return 0; 208 + return ret; 212 209 } 213 210 214 211 static int gic_retrigger(struct irq_data *d)
+6 -3
drivers/irqchip/irq-hip04.c
··· 120 120 { 121 121 void __iomem *base = hip04_dist_base(d); 122 122 unsigned int irq = hip04_irq(d); 123 + int ret; 123 124 124 125 /* Interrupt configuration for SGIs can't be changed */ 125 126 if (irq < 16) 126 127 return -EINVAL; 127 128 128 - if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING) 129 + /* SPIs have restrictions on the supported types */ 130 + if (irq >= 32 && type != IRQ_TYPE_LEVEL_HIGH && 131 + type != IRQ_TYPE_EDGE_RISING) 129 132 return -EINVAL; 130 133 131 134 raw_spin_lock(&irq_controller_lock); 132 135 133 - gic_configure_irq(irq, type, base, NULL); 136 + ret = gic_configure_irq(irq, type, base, NULL); 134 137 135 138 raw_spin_unlock(&irq_controller_lock); 136 139 137 - return 0; 140 + return ret; 138 141 } 139 142 140 143 #ifdef CONFIG_SMP
+26 -18
drivers/irqchip/irq-mips-gic.c
··· 235 235 GIC_LOCAL_TO_HWIRQ(GIC_LOCAL_INT_PERFCTR)); 236 236 } 237 237 238 - static unsigned int gic_get_int(void) 238 + static void gic_handle_shared_int(void) 239 239 { 240 - unsigned int i; 240 + unsigned int i, intr, virq; 241 241 unsigned long *pcpu_mask; 242 242 unsigned long pending_reg, intrmask_reg; 243 243 DECLARE_BITMAP(pending, GIC_MAX_INTRS); ··· 259 259 bitmap_and(pending, pending, intrmask, gic_shared_intrs); 260 260 bitmap_and(pending, pending, pcpu_mask, gic_shared_intrs); 261 261 262 - return find_first_bit(pending, gic_shared_intrs); 262 + intr = find_first_bit(pending, gic_shared_intrs); 263 + while (intr != gic_shared_intrs) { 264 + virq = irq_linear_revmap(gic_irq_domain, 265 + GIC_SHARED_TO_HWIRQ(intr)); 266 + do_IRQ(virq); 267 + 268 + /* go to next pending bit */ 269 + bitmap_clear(pending, intr, 1); 270 + intr = find_first_bit(pending, gic_shared_intrs); 271 + } 263 272 } 264 273 265 274 static void gic_mask_irq(struct irq_data *d) ··· 395 386 #endif 396 387 }; 397 388 398 - static unsigned int gic_get_local_int(void) 389 + static void gic_handle_local_int(void) 399 390 { 400 391 unsigned long pending, masked; 392 + unsigned int intr, virq; 401 393 402 394 pending = gic_read(GIC_REG(VPE_LOCAL, GIC_VPE_PEND)); 403 395 masked = gic_read(GIC_REG(VPE_LOCAL, GIC_VPE_MASK)); 404 396 405 397 bitmap_and(&pending, &pending, &masked, GIC_NUM_LOCAL_INTRS); 406 398 407 - return find_first_bit(&pending, GIC_NUM_LOCAL_INTRS); 399 + intr = find_first_bit(&pending, GIC_NUM_LOCAL_INTRS); 400 + while (intr != GIC_NUM_LOCAL_INTRS) { 401 + virq = irq_linear_revmap(gic_irq_domain, 402 + GIC_LOCAL_TO_HWIRQ(intr)); 403 + do_IRQ(virq); 404 + 405 + /* go to next pending bit */ 406 + bitmap_clear(&pending, intr, 1); 407 + intr = find_first_bit(&pending, GIC_NUM_LOCAL_INTRS); 408 + } 408 409 } 409 410 410 411 static void gic_mask_local_irq(struct irq_data *d) ··· 473 454 474 455 static void __gic_irq_dispatch(void) 475 456 { 476 - unsigned int intr, virq; 477 - 478 - while ((intr = gic_get_local_int()) != GIC_NUM_LOCAL_INTRS) { 479 - virq = irq_linear_revmap(gic_irq_domain, 480 - GIC_LOCAL_TO_HWIRQ(intr)); 481 - do_IRQ(virq); 482 - } 483 - 484 - while ((intr = gic_get_int()) != gic_shared_intrs) { 485 - virq = irq_linear_revmap(gic_irq_domain, 486 - GIC_SHARED_TO_HWIRQ(intr)); 487 - do_IRQ(virq); 488 - } 457 + gic_handle_local_int(); 458 + gic_handle_shared_int(); 489 459 } 490 460 491 461 static void gic_irq_dispatch(unsigned int irq, struct irq_desc *desc)
+11 -7
drivers/irqchip/irq-mtk-sysirq.c
··· 23 23 24 24 #include "irqchip.h" 25 25 26 - #define MT6577_SYS_INTPOL_NUM (224) 27 - 28 26 struct mtk_sysirq_chip_data { 29 27 spinlock_t lock; 30 28 void __iomem *intpol_base; ··· 122 124 { 123 125 struct irq_domain *domain, *domain_parent; 124 126 struct mtk_sysirq_chip_data *chip_data; 125 - int ret = 0; 127 + int ret, size, intpol_num; 128 + struct resource res; 126 129 127 130 domain_parent = irq_find_host(parent); 128 131 if (!domain_parent) { ··· 131 132 return -EINVAL; 132 133 } 133 134 135 + ret = of_address_to_resource(node, 0, &res); 136 + if (ret) 137 + return ret; 138 + 134 139 chip_data = kzalloc(sizeof(*chip_data), GFP_KERNEL); 135 140 if (!chip_data) 136 141 return -ENOMEM; 137 142 138 - chip_data->intpol_base = of_io_request_and_map(node, 0, "intpol"); 139 - if (IS_ERR(chip_data->intpol_base)) { 143 + size = resource_size(&res); 144 + intpol_num = size * 8; 145 + chip_data->intpol_base = ioremap(res.start, size); 146 + if (!chip_data->intpol_base) { 140 147 pr_err("mtk_sysirq: unable to map sysirq register\n"); 141 148 ret = PTR_ERR(chip_data->intpol_base); 142 149 goto out_free; 143 150 } 144 151 145 - domain = irq_domain_add_hierarchy(domain_parent, 0, 146 - MT6577_SYS_INTPOL_NUM, node, 152 + domain = irq_domain_add_hierarchy(domain_parent, 0, intpol_num, node, 147 153 &sysirq_domain_ops, chip_data); 148 154 if (!domain) { 149 155 ret = -ENOMEM;
+5 -17
drivers/irqchip/irq-omap-intc.c
··· 364 364 omap_ack_irq(NULL); 365 365 } 366 366 367 - void __init omap2_init_irq(void) 368 - { 369 - omap_nr_irqs = 96; 370 - omap_nr_pending = 3; 371 - omap_init_irq(OMAP24XX_IC_BASE, NULL); 372 - set_handle_irq(omap_intc_handle_irq); 373 - } 374 - 375 367 void __init omap3_init_irq(void) 376 368 { 377 369 omap_nr_irqs = 96; 378 370 omap_nr_pending = 3; 379 - omap_init_irq(OMAP34XX_IC_BASE, NULL); 380 - set_handle_irq(omap_intc_handle_irq); 381 - } 382 - 383 - void __init ti81xx_init_irq(void) 384 - { 385 - omap_nr_irqs = 96; 386 - omap_nr_pending = 4; 387 371 omap_init_irq(OMAP34XX_IC_BASE, NULL); 388 372 set_handle_irq(omap_intc_handle_irq); 389 373 } ··· 383 399 if (WARN_ON(!node)) 384 400 return -ENODEV; 385 401 386 - if (of_device_is_compatible(node, "ti,am33xx-intc")) { 402 + if (of_device_is_compatible(node, "ti,dm814-intc") || 403 + of_device_is_compatible(node, "ti,dm816-intc") || 404 + of_device_is_compatible(node, "ti,am33xx-intc")) { 387 405 omap_nr_irqs = 128; 388 406 omap_nr_pending = 4; 389 407 } ··· 401 415 402 416 IRQCHIP_DECLARE(omap2_intc, "ti,omap2-intc", intc_of_init); 403 417 IRQCHIP_DECLARE(omap3_intc, "ti,omap3-intc", intc_of_init); 418 + IRQCHIP_DECLARE(dm814x_intc, "ti,dm814-intc", intc_of_init); 419 + IRQCHIP_DECLARE(dm816x_intc, "ti,dm816-intc", intc_of_init); 404 420 IRQCHIP_DECLARE(am33xx_intc, "ti,am33xx-intc", intc_of_init);
+41 -9
drivers/irqchip/irq-renesas-intc-irqpin.c
··· 30 30 #include <linux/err.h> 31 31 #include <linux/slab.h> 32 32 #include <linux/module.h> 33 + #include <linux/of_device.h> 33 34 #include <linux/platform_data/irq-renesas-intc-irqpin.h> 34 35 #include <linux/pm_runtime.h> 35 36 ··· 41 40 #define INTC_IRQPIN_REG_SOURCE 2 /* INTREQnn */ 42 41 #define INTC_IRQPIN_REG_MASK 3 /* INTMSKnn */ 43 42 #define INTC_IRQPIN_REG_CLEAR 4 /* INTMSKCLRnn */ 44 - #define INTC_IRQPIN_REG_NR 5 43 + #define INTC_IRQPIN_REG_NR_MANDATORY 5 44 + #define INTC_IRQPIN_REG_IRLM 5 /* ICR0 with IRLM bit (optional) */ 45 + #define INTC_IRQPIN_REG_NR 6 45 46 46 47 /* INTC external IRQ PIN hardware register access: 47 48 * ··· 83 80 struct clk *clk; 84 81 bool shared_irqs; 85 82 u8 shared_irq_mask; 83 + }; 84 + 85 + struct intc_irqpin_irlm_config { 86 + unsigned int irlm_bit; 86 87 }; 87 88 88 89 static unsigned long intc_irqpin_read32(void __iomem *iomem) ··· 352 345 .xlate = irq_domain_xlate_twocell, 353 346 }; 354 347 348 + static const struct intc_irqpin_irlm_config intc_irqpin_irlm_r8a7779 = { 349 + .irlm_bit = 23, /* ICR0.IRLM0 */ 350 + }; 351 + 352 + static const struct of_device_id intc_irqpin_dt_ids[] = { 353 + { .compatible = "renesas,intc-irqpin", }, 354 + { .compatible = "renesas,intc-irqpin-r8a7779", 355 + .data = &intc_irqpin_irlm_r8a7779 }, 356 + {}, 357 + }; 358 + MODULE_DEVICE_TABLE(of, intc_irqpin_dt_ids); 359 + 355 360 static int intc_irqpin_probe(struct platform_device *pdev) 356 361 { 357 362 struct device *dev = &pdev->dev; 358 363 struct renesas_intc_irqpin_config *pdata = dev->platform_data; 364 + const struct of_device_id *of_id; 359 365 struct intc_irqpin_priv *p; 360 366 struct intc_irqpin_iomem *i; 361 367 struct resource *io[INTC_IRQPIN_REG_NR]; ··· 411 391 pm_runtime_enable(dev); 412 392 pm_runtime_get_sync(dev); 413 393 414 - /* get hold of manadatory IOMEM */ 394 + /* get hold of register banks */ 395 + memset(io, 0, sizeof(io)); 415 396 for (k = 0; k < INTC_IRQPIN_REG_NR; k++) { 416 397 io[k] = platform_get_resource(pdev, IORESOURCE_MEM, k); 417 - if (!io[k]) { 398 + if (!io[k] && k < INTC_IRQPIN_REG_NR_MANDATORY) { 418 399 dev_err(dev, "not enough IOMEM resources\n"); 419 400 ret = -EINVAL; 420 401 goto err0; ··· 443 422 for (k = 0; k < INTC_IRQPIN_REG_NR; k++) { 444 423 i = &p->iomem[k]; 445 424 425 + /* handle optional registers */ 426 + if (!io[k]) 427 + continue; 428 + 446 429 switch (resource_size(io[k])) { 447 430 case 1: 448 431 i->width = 8; ··· 471 446 ret = -ENXIO; 472 447 goto err0; 473 448 } 449 + } 450 + 451 + /* configure "individual IRQ mode" where needed */ 452 + of_id = of_match_device(intc_irqpin_dt_ids, dev); 453 + if (of_id && of_id->data) { 454 + const struct intc_irqpin_irlm_config *irlm_config = of_id->data; 455 + 456 + if (io[INTC_IRQPIN_REG_IRLM]) 457 + intc_irqpin_read_modify_write(p, INTC_IRQPIN_REG_IRLM, 458 + irlm_config->irlm_bit, 459 + 1, 1); 460 + else 461 + dev_warn(dev, "unable to select IRLM mode\n"); 474 462 } 475 463 476 464 /* mask all interrupts using priority */ ··· 587 549 pm_runtime_disable(&pdev->dev); 588 550 return 0; 589 551 } 590 - 591 - static const struct of_device_id intc_irqpin_dt_ids[] = { 592 - { .compatible = "renesas,intc-irqpin", }, 593 - {}, 594 - }; 595 - MODULE_DEVICE_TABLE(of, intc_irqpin_dt_ids); 596 552 597 553 static struct platform_driver intc_irqpin_device_driver = { 598 554 .probe = intc_irqpin_probe,
-2
include/linux/irqchip/irq-omap-intc.h
··· 18 18 #ifndef __INCLUDE_LINUX_IRQCHIP_IRQ_OMAP_INTC_H 19 19 #define __INCLUDE_LINUX_IRQCHIP_IRQ_OMAP_INTC_H 20 20 21 - void omap2_init_irq(void); 22 21 void omap3_init_irq(void); 23 - void ti81xx_init_irq(void); 24 22 25 23 int omap_irq_pending(void); 26 24 void omap_intc_save_context(void);
+3
kernel/irq/manage.c
··· 243 243 return -EINVAL; 244 244 desc->affinity_hint = m; 245 245 irq_put_desc_unlock(desc, flags); 246 + /* set the initial affinity to prevent every interrupt being on CPU0 */ 247 + if (m) 248 + __irq_set_affinity(irq, m, false); 246 249 return 0; 247 250 } 248 251 EXPORT_SYMBOL_GPL(irq_set_affinity_hint);