Skip to content

Commit

Permalink
arch/tile: use new generic {enable,disable}_percpu_irq() routines
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chris Metcalf committed Dec 3, 2011
1 parent 781a5e9 commit 0c90547
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 20 deletions.
10 changes: 0 additions & 10 deletions arch/tile/include/asm/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,6 @@ enum {
*/
void tile_irq_activate(unsigned int irq, int tile_irq_type);

/*
* For onboard, non-PCI (e.g. TILE_IRQ_PERCPU) devices, drivers know
* how to use enable/disable_percpu_irq() to manage interrupts on each
* core. We can't use the generic enable/disable_irq() because they
* use a single reference count per irq, rather than per cpu per irq.
*/
void enable_percpu_irq(unsigned int irq);
void disable_percpu_irq(unsigned int irq);


void setup_irq_regs(void);

#endif /* _ASM_TILE_IRQ_H */
16 changes: 8 additions & 8 deletions arch/tile/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,28 +152,26 @@ void tile_dev_intr(struct pt_regs *regs, int intnum)
* Remove an irq from the disabled mask. If we're in an interrupt
* context, defer enabling the HW interrupt until we leave.
*/
void enable_percpu_irq(unsigned int irq)
static void tile_irq_chip_enable(struct irq_data *d)
{
get_cpu_var(irq_disable_mask) &= ~(1UL << irq);
get_cpu_var(irq_disable_mask) &= ~(1UL << d->irq);
if (__get_cpu_var(irq_depth) == 0)
unmask_irqs(1UL << irq);
unmask_irqs(1UL << d->irq);
put_cpu_var(irq_disable_mask);
}
EXPORT_SYMBOL(enable_percpu_irq);

/*
* Add an irq to the disabled mask. We disable the HW interrupt
* immediately so that there's no possibility of it firing. If we're
* in an interrupt context, the return path is careful to avoid
* unmasking a newly disabled interrupt.
*/
void disable_percpu_irq(unsigned int irq)
static void tile_irq_chip_disable(struct irq_data *d)
{
get_cpu_var(irq_disable_mask) |= (1UL << irq);
mask_irqs(1UL << irq);
get_cpu_var(irq_disable_mask) |= (1UL << d->irq);
mask_irqs(1UL << d->irq);
put_cpu_var(irq_disable_mask);
}
EXPORT_SYMBOL(disable_percpu_irq);

/* Mask an interrupt. */
static void tile_irq_chip_mask(struct irq_data *d)
Expand Down Expand Up @@ -209,6 +207,8 @@ static void tile_irq_chip_eoi(struct irq_data *d)

static struct irq_chip tile_irq_chip = {
.name = "tile_irq_chip",
.irq_enable = tile_irq_chip_enable,
.irq_disable = tile_irq_chip_disable,
.irq_ack = tile_irq_chip_ack,
.irq_eoi = tile_irq_chip_eoi,
.irq_mask = tile_irq_chip_mask,
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ethernet/tile/tilepro.c
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ static int tile_net_poll(struct napi_struct *napi, int budget)
goto done;

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

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

/* Enable the ingress interrupt. */
enable_percpu_irq(priv->intr_id);
enable_percpu_irq(priv->intr_id, 0);
}


Expand Down

0 comments on commit 0c90547

Please sign in to comment.