1 From 4efb592d8a931669df5df04bedcae8cbc85c3700 Mon Sep 17 00:00:00 2001
2 From: Razvan Stefanescu <razvan.stefanescu@freescale.com>
3 Date: Wed, 17 Feb 2016 16:31:01 +0200
4 Subject: [PATCH 216/226] dpaa2-evb: Fix interrupt handling
6 Mask only the events handled by the driver - DPDMUX_IRQ_EVENT_LINK_CHANGED.
8 Use clear-on-read mechanism for the interrupt status and avoid calling
9 dpdmux_clear_irq_status(). Status contains the events handled (only link
10 state change for the moment) and masks the first 16-bits, as they are used
11 to store the interface ID that generated the event.
13 Signed-off-by: Razvan Stefanescu <razvan.stefanescu@freescale.com>
15 drivers/staging/fsl-dpaa2/evb/evb.c | 20 ++++++++++----------
16 1 file changed, 10 insertions(+), 10 deletions(-)
18 --- a/drivers/staging/fsl-dpaa2/evb/evb.c
19 +++ b/drivers/staging/fsl-dpaa2/evb/evb.c
20 @@ -151,7 +151,9 @@ static irqreturn_t _evb_irq0_handler_thr
21 struct fsl_mc_io *io = priv->mc_io;
22 uint16_t token = priv->mux_handle;
23 int irq_index = DPDMUX_IRQ_INDEX_IF;
24 - uint32_t status = 0, clear = 0;
26 + /* Mask the events and the if_id reserved bits to be cleared on read */
27 + uint32_t status = DPDMUX_IRQ_EVENT_LINK_CHANGED | 0xFFFF0000;
31 @@ -163,23 +165,21 @@ static irqreturn_t _evb_irq0_handler_thr
32 err = dpdmux_get_irq_status(io, 0, token, irq_index, &status);
34 netdev_err(netdev, "Can't get irq status (err %d)", err);
36 + err = dpdmux_clear_irq_status(io, 0, token, irq_index,
39 + netdev_err(netdev, "Can't clear irq status (err %d)",
44 - /* FIXME clear irq status */
46 if (status & DPDMUX_IRQ_EVENT_LINK_CHANGED) {
47 - clear |= DPDMUX_IRQ_EVENT_LINK_CHANGED;
49 err = evb_links_state_update(priv);
55 - err = dpdmux_clear_irq_status(io, 0, token, irq_index, clear);
57 - netdev_err(netdev, "Can't clear irq status (err %d)", err);
61 @@ -191,7 +191,7 @@ static int evb_setup_irqs(struct fsl_mc_
63 struct fsl_mc_device_irq *irq;
64 const int irq_index = DPDMUX_IRQ_INDEX_IF;
65 - uint32_t mask = ~0x0u; /* FIXME: unmask handled irqs */
66 + uint32_t mask = DPDMUX_IRQ_EVENT_LINK_CHANGED;
68 err = fsl_mc_allocate_irqs(evb_dev);