Skip to content

Commit 0c90547

Browse files
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 <[email protected]>
1 parent 781a5e9 commit 0c90547

File tree

3 files changed

+10
-20
lines changed

3 files changed

+10
-20
lines changed

arch/tile/include/asm/irq.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,6 @@ enum {
7474
*/
7575
void tile_irq_activate(unsigned int irq, int tile_irq_type);
7676

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-
8777
void setup_irq_regs(void);
8878

8979
#endif /* _ASM_TILE_IRQ_H */

arch/tile/kernel/irq.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -152,28 +152,26 @@ void tile_dev_intr(struct pt_regs *regs, int intnum)
152152
* Remove an irq from the disabled mask. If we're in an interrupt
153153
* context, defer enabling the HW interrupt until we leave.
154154
*/
155-
void enable_percpu_irq(unsigned int irq)
155+
static void tile_irq_chip_enable(struct irq_data *d)
156156
{
157-
get_cpu_var(irq_disable_mask) &= ~(1UL << irq);
157+
get_cpu_var(irq_disable_mask) &= ~(1UL << d->irq);
158158
if (__get_cpu_var(irq_depth) == 0)
159-
unmask_irqs(1UL << irq);
159+
unmask_irqs(1UL << d->irq);
160160
put_cpu_var(irq_disable_mask);
161161
}
162-
EXPORT_SYMBOL(enable_percpu_irq);
163162

164163
/*
165164
* Add an irq to the disabled mask. We disable the HW interrupt
166165
* immediately so that there's no possibility of it firing. If we're
167166
* in an interrupt context, the return path is careful to avoid
168167
* unmasking a newly disabled interrupt.
169168
*/
170-
void disable_percpu_irq(unsigned int irq)
169+
static void tile_irq_chip_disable(struct irq_data *d)
171170
{
172-
get_cpu_var(irq_disable_mask) |= (1UL << irq);
173-
mask_irqs(1UL << irq);
171+
get_cpu_var(irq_disable_mask) |= (1UL << d->irq);
172+
mask_irqs(1UL << d->irq);
174173
put_cpu_var(irq_disable_mask);
175174
}
176-
EXPORT_SYMBOL(disable_percpu_irq);
177175

178176
/* Mask an interrupt. */
179177
static void tile_irq_chip_mask(struct irq_data *d)
@@ -209,6 +207,8 @@ static void tile_irq_chip_eoi(struct irq_data *d)
209207

210208
static struct irq_chip tile_irq_chip = {
211209
.name = "tile_irq_chip",
210+
.irq_enable = tile_irq_chip_enable,
211+
.irq_disable = tile_irq_chip_disable,
212212
.irq_ack = tile_irq_chip_ack,
213213
.irq_eoi = tile_irq_chip_eoi,
214214
.irq_mask = tile_irq_chip_mask,

drivers/net/ethernet/tile/tilepro.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ static int tile_net_poll(struct napi_struct *napi, int budget)
926926
goto done;
927927

928928
/* Re-enable the ingress interrupt. */
929-
enable_percpu_irq(priv->intr_id);
929+
enable_percpu_irq(priv->intr_id, 0);
930930

931931
/* HACK: Avoid the "rotting packet" problem (see above). */
932932
if (qup->__packet_receive_read !=
@@ -1296,7 +1296,7 @@ static void tile_net_open_enable(void *dev_ptr)
12961296
info->napi_enabled = true;
12971297

12981298
/* Enable the ingress interrupt. */
1299-
enable_percpu_irq(priv->intr_id);
1299+
enable_percpu_irq(priv->intr_id, 0);
13001300
}
13011301

13021302

0 commit comments

Comments
 (0)