Commit 112197de authored by Ioana Radulescu's avatar Ioana Radulescu Committed by Greg Kroah-Hartman

staging: fsl-dpaa2/eth: Use implicit clear of link interrupt

dpni_get_irq_status() also looks at the input value of its
status parameter, and if not null it automatically clears
from pending state the bits that are set there.

Use this feature to avoid a separate MC command for clearing
the interrupt event bits after reading the status.
Signed-off-by: default avatarIoana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 729d79b8
...@@ -2332,7 +2332,7 @@ static irqreturn_t dpni_irq0_handler(int irq_num, void *arg) ...@@ -2332,7 +2332,7 @@ static irqreturn_t dpni_irq0_handler(int irq_num, void *arg)
static irqreturn_t dpni_irq0_handler_thread(int irq_num, void *arg) static irqreturn_t dpni_irq0_handler_thread(int irq_num, void *arg)
{ {
u32 status = 0, clear = 0; u32 status = ~0;
struct device *dev = (struct device *)arg; struct device *dev = (struct device *)arg;
struct fsl_mc_device *dpni_dev = to_fsl_mc_device(dev); struct fsl_mc_device *dpni_dev = to_fsl_mc_device(dev);
struct net_device *net_dev = dev_get_drvdata(dev); struct net_device *net_dev = dev_get_drvdata(dev);
...@@ -2342,18 +2342,12 @@ static irqreturn_t dpni_irq0_handler_thread(int irq_num, void *arg) ...@@ -2342,18 +2342,12 @@ static irqreturn_t dpni_irq0_handler_thread(int irq_num, void *arg)
DPNI_IRQ_INDEX, &status); DPNI_IRQ_INDEX, &status);
if (unlikely(err)) { if (unlikely(err)) {
netdev_err(net_dev, "Can't get irq status (err %d)\n", err); netdev_err(net_dev, "Can't get irq status (err %d)\n", err);
clear = 0xffffffff; return IRQ_HANDLED;
goto out;
} }
if (status & DPNI_IRQ_EVENT_LINK_CHANGED) { if (status & DPNI_IRQ_EVENT_LINK_CHANGED)
clear |= DPNI_IRQ_EVENT_LINK_CHANGED;
link_state_update(netdev_priv(net_dev)); link_state_update(netdev_priv(net_dev));
}
out:
dpni_clear_irq_status(dpni_dev->mc_io, 0, dpni_dev->mc_handle,
DPNI_IRQ_INDEX, clear);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment