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 updates from Thomas Gleixner:
- core fix for missing round up in the generic irq chip implementation
- new irq chip for MOXA SoCs
- a few fixes and cleanups in the irqchip drivers

* 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
irqchip: Add support for MOXA ART SoCs
genirq: generic chip: Use DIV_ROUND_UP to calculate numchips
irqchip: nvic: Fix wrong num_ct argument for irq_alloc_domain_generic_chips()
irqchip: sun4i: Staticize sun4i_irq_ack()
irqchip: vt8500: Staticize local symbols

+125 -5
+1
drivers/irqchip/Makefile
··· 7 7 obj-$(CONFIG_ARCH_S3C24XX) += irq-s3c24xx.o 8 8 obj-$(CONFIG_METAG) += irq-metag-ext.o 9 9 obj-$(CONFIG_METAG_PERFCOUNTER_IRQS) += irq-metag.o 10 + obj-$(CONFIG_ARCH_MOXART) += irq-moxart.o 10 11 obj-$(CONFIG_ORION_IRQCHIP) += irq-orion.o 11 12 obj-$(CONFIG_ARCH_SUNXI) += irq-sun4i.o 12 13 obj-$(CONFIG_ARCH_SPEAR3XX) += spear-shirq.o
+117
drivers/irqchip/irq-moxart.c
··· 1 + /* 2 + * MOXA ART SoCs IRQ chip driver. 3 + * 4 + * Copyright (C) 2013 Jonas Jensen 5 + * 6 + * Jonas Jensen <jonas.jensen@gmail.com> 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/irqdomain.h> 19 + 20 + #include <asm/exception.h> 21 + 22 + #include "irqchip.h" 23 + 24 + #define IRQ_SOURCE_REG 0 25 + #define IRQ_MASK_REG 0x04 26 + #define IRQ_CLEAR_REG 0x08 27 + #define IRQ_MODE_REG 0x0c 28 + #define IRQ_LEVEL_REG 0x10 29 + #define IRQ_STATUS_REG 0x14 30 + 31 + #define FIQ_SOURCE_REG 0x20 32 + #define FIQ_MASK_REG 0x24 33 + #define FIQ_CLEAR_REG 0x28 34 + #define FIQ_MODE_REG 0x2c 35 + #define FIQ_LEVEL_REG 0x30 36 + #define FIQ_STATUS_REG 0x34 37 + 38 + 39 + struct moxart_irq_data { 40 + void __iomem *base; 41 + struct irq_domain *domain; 42 + unsigned int interrupt_mask; 43 + }; 44 + 45 + static struct moxart_irq_data intc; 46 + 47 + static asmlinkage void __exception_irq_entry handle_irq(struct pt_regs *regs) 48 + { 49 + u32 irqstat; 50 + int hwirq; 51 + 52 + irqstat = readl(intc.base + IRQ_STATUS_REG); 53 + 54 + while (irqstat) { 55 + hwirq = ffs(irqstat) - 1; 56 + handle_IRQ(irq_linear_revmap(intc.domain, hwirq), regs); 57 + irqstat &= ~(1 << hwirq); 58 + } 59 + } 60 + 61 + static int __init moxart_of_intc_init(struct device_node *node, 62 + struct device_node *parent) 63 + { 64 + unsigned int clr = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN; 65 + int ret; 66 + struct irq_chip_generic *gc; 67 + 68 + intc.base = of_iomap(node, 0); 69 + if (!intc.base) { 70 + pr_err("%s: unable to map IC registers\n", 71 + node->full_name); 72 + return -EINVAL; 73 + } 74 + 75 + intc.domain = irq_domain_add_linear(node, 32, &irq_generic_chip_ops, 76 + intc.base); 77 + if (!intc.domain) { 78 + pr_err("%s: unable to create IRQ domain\n", node->full_name); 79 + return -EINVAL; 80 + } 81 + 82 + ret = irq_alloc_domain_generic_chips(intc.domain, 32, 1, 83 + "MOXARTINTC", handle_edge_irq, 84 + clr, 0, IRQ_GC_INIT_MASK_CACHE); 85 + if (ret) { 86 + pr_err("%s: could not allocate generic chip\n", 87 + node->full_name); 88 + irq_domain_remove(intc.domain); 89 + return -EINVAL; 90 + } 91 + 92 + ret = of_property_read_u32(node, "interrupt-mask", 93 + &intc.interrupt_mask); 94 + if (ret) 95 + pr_err("%s: could not read interrupt-mask DT property\n", 96 + node->full_name); 97 + 98 + gc = irq_get_domain_generic_chip(intc.domain, 0); 99 + 100 + gc->reg_base = intc.base; 101 + gc->chip_types[0].regs.mask = IRQ_MASK_REG; 102 + gc->chip_types[0].regs.ack = IRQ_CLEAR_REG; 103 + gc->chip_types[0].chip.irq_ack = irq_gc_ack_set_bit; 104 + gc->chip_types[0].chip.irq_mask = irq_gc_mask_clr_bit; 105 + gc->chip_types[0].chip.irq_unmask = irq_gc_mask_set_bit; 106 + 107 + writel(0, intc.base + IRQ_MASK_REG); 108 + writel(0xffffffff, intc.base + IRQ_CLEAR_REG); 109 + 110 + writel(intc.interrupt_mask, intc.base + IRQ_MODE_REG); 111 + writel(intc.interrupt_mask, intc.base + IRQ_LEVEL_REG); 112 + 113 + set_handle_irq(handle_irq); 114 + 115 + return 0; 116 + } 117 + IRQCHIP_DECLARE(moxa_moxart_ic, "moxa,moxart-ic", moxart_of_intc_init);
+1 -1
drivers/irqchip/irq-nvic.c
··· 84 84 return -ENOMEM; 85 85 } 86 86 87 - ret = irq_alloc_domain_generic_chips(nvic_irq_domain, 32, numbanks, 87 + ret = irq_alloc_domain_generic_chips(nvic_irq_domain, 32, 1, 88 88 "nvic_irq", handle_fasteoi_irq, 89 89 clr, 0, IRQ_GC_INIT_MASK_CACHE); 90 90 if (ret) {
+1 -1
drivers/irqchip/irq-sun4i.c
··· 38 38 39 39 static asmlinkage void __exception_irq_entry sun4i_handle_irq(struct pt_regs *regs); 40 40 41 - void sun4i_irq_ack(struct irq_data *irqd) 41 + static void sun4i_irq_ack(struct irq_data *irqd) 42 42 { 43 43 unsigned int irq = irqd_to_hwirq(irqd); 44 44 unsigned int irq_off = irq % 32;
+4 -2
drivers/irqchip/irq-vt8500.c
··· 178 178 .xlate = irq_domain_xlate_onecell, 179 179 }; 180 180 181 - asmlinkage void __exception_irq_entry vt8500_handle_irq(struct pt_regs *regs) 181 + static asmlinkage 182 + void __exception_irq_entry vt8500_handle_irq(struct pt_regs *regs) 182 183 { 183 184 u32 stat, i; 184 185 int irqnr, virq; ··· 204 203 } 205 204 } 206 205 207 - int __init vt8500_irq_init(struct device_node *node, struct device_node *parent) 206 + static int __init vt8500_irq_init(struct device_node *node, 207 + struct device_node *parent) 208 208 { 209 209 int irq, i; 210 210 struct device_node *np = node;
+1 -1
kernel/irq/generic-chip.c
··· 275 275 if (d->gc) 276 276 return -EBUSY; 277 277 278 - numchips = d->revmap_size / irqs_per_chip; 278 + numchips = DIV_ROUND_UP(d->revmap_size, irqs_per_chip); 279 279 if (!numchips) 280 280 return -EINVAL; 281 281