>From 03080b4e459b103b97b658789658f118053de522 Mon Sep 17 00:00:00 2001 From: Gregory CLEMENT Date: Sat, 9 Feb 2013 22:07:54 +0100 Subject: [PATCH] net: mvneta: convert to percpu interrupt Signed-off-by: Gregory CLEMENT --- drivers/net/ethernet/marvell/mvneta.c | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index b6025c3..7f63dd4 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -1800,7 +1800,7 @@ static void mvneta_set_rx_mode(struct net_device *dev) /* Interrupt handling - the callback for request_irq() */ static irqreturn_t mvneta_isr(int irq, void *dev_id) { - struct mvneta_port *pp = (struct mvneta_port *)dev_id; + struct mvneta_port *pp = *(struct mvneta_port **)dev_id; /* Mask all interrupts */ mvreg_write(pp, MVNETA_INTR_NEW_MASK, 0); @@ -2368,6 +2368,7 @@ static void mvneta_mdio_remove(struct mvneta_port *pp) phy_disconnect(pp->phy_dev); pp->phy_dev = NULL; } +static struct mvneta_port __percpu **percpu_pp; static int mvneta_open(struct net_device *dev) { @@ -2386,9 +2387,14 @@ static int mvneta_open(struct net_device *dev) if (ret) goto err_cleanup_rxqs; + percpu_pp = alloc_percpu(struct mvneta_port *); + *__this_cpu_ptr(percpu_pp) = pp; + /* Connect to port interrupt line */ - ret = request_irq(pp->dev->irq, mvneta_isr, 0, - MVNETA_DRIVER_NAME, pp); + ret = request_percpu_irq(pp->dev->irq, mvneta_isr, + MVNETA_DRIVER_NAME, percpu_pp); + enable_percpu_irq(pp->dev->irq, 0); + if (ret) { netdev_err(pp->dev, "cannot request irq %d\n", pp->dev->irq); goto err_cleanup_txqs; -- 1.7.8.6