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

arch/tile: use new generic {enable,disable}_percpu_irq() routines

We provided very similar routines internally, but now we can hook
into the generic framework by supplying our routines as function
pointers in the irq_chip structure instead.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

+10 -20
-10
arch/tile/include/asm/irq.h
··· 74 74 */ 75 75 void tile_irq_activate(unsigned int irq, int tile_irq_type); 76 76 77 - /* 78 - * For onboard, non-PCI (e.g. TILE_IRQ_PERCPU) devices, drivers know 79 - * how to use enable/disable_percpu_irq() to manage interrupts on each 80 - * core. We can't use the generic enable/disable_irq() because they 81 - * use a single reference count per irq, rather than per cpu per irq. 82 - */ 83 - void enable_percpu_irq(unsigned int irq); 84 - void disable_percpu_irq(unsigned int irq); 85 - 86 - 87 77 void setup_irq_regs(void); 88 78 89 79 #endif /* _ASM_TILE_IRQ_H */
+8 -8
arch/tile/kernel/irq.c
··· 152 152 * Remove an irq from the disabled mask. If we're in an interrupt 153 153 * context, defer enabling the HW interrupt until we leave. 154 154 */ 155 - void enable_percpu_irq(unsigned int irq) 155 + static void tile_irq_chip_enable(struct irq_data *d) 156 156 { 157 - get_cpu_var(irq_disable_mask) &= ~(1UL << irq); 157 + get_cpu_var(irq_disable_mask) &= ~(1UL << d->irq); 158 158 if (__get_cpu_var(irq_depth) == 0) 159 - unmask_irqs(1UL << irq); 159 + unmask_irqs(1UL << d->irq); 160 160 put_cpu_var(irq_disable_mask); 161 161 } 162 - EXPORT_SYMBOL(enable_percpu_irq); 163 162 164 163 /* 165 164 * Add an irq to the disabled mask. We disable the HW interrupt ··· 166 167 * in an interrupt context, the return path is careful to avoid 167 168 * unmasking a newly disabled interrupt. 168 169 */ 169 - void disable_percpu_irq(unsigned int irq) 170 + static void tile_irq_chip_disable(struct irq_data *d) 170 171 { 171 - get_cpu_var(irq_disable_mask) |= (1UL << irq); 172 - mask_irqs(1UL << irq); 172 + get_cpu_var(irq_disable_mask) |= (1UL << d->irq); 173 + mask_irqs(1UL << d->irq); 173 174 put_cpu_var(irq_disable_mask); 174 175 } 175 - EXPORT_SYMBOL(disable_percpu_irq); 176 176 177 177 /* Mask an interrupt. */ 178 178 static void tile_irq_chip_mask(struct irq_data *d) ··· 207 209 208 210 static struct irq_chip tile_irq_chip = { 209 211 .name = "tile_irq_chip", 212 + .irq_enable = tile_irq_chip_enable, 213 + .irq_disable = tile_irq_chip_disable, 210 214 .irq_ack = tile_irq_chip_ack, 211 215 .irq_eoi = tile_irq_chip_eoi, 212 216 .irq_mask = tile_irq_chip_mask,
+2 -2
drivers/net/ethernet/tile/tilepro.c
··· 926 926 goto done; 927 927 928 928 /* Re-enable the ingress interrupt. */ 929 - enable_percpu_irq(priv->intr_id); 929 + enable_percpu_irq(priv->intr_id, 0); 930 930 931 931 /* HACK: Avoid the "rotting packet" problem (see above). */ 932 932 if (qup->__packet_receive_read != ··· 1296 1296 info->napi_enabled = true; 1297 1297 1298 1298 /* Enable the ingress interrupt. */ 1299 - enable_percpu_irq(priv->intr_id); 1299 + enable_percpu_irq(priv->intr_id, 0); 1300 1300 } 1301 1301 1302 1302