Commit 5d070a12 authored by Martin Jeřábek's avatar Martin Jeřábek

driver: mask RBNEI instead of just disabling it

Eliminates the need for CTUCAN_FLAG_RX_SCHED.
parent 16164b9f
......@@ -90,7 +90,7 @@ struct ctucan_priv {
struct list_head peers_on_pdev;
};
#define CTUCAN_FLAG_RX_SCHED 1
// #define CTUCAN_FLAG_RX_SCHED 1
#define CTUCAN_FLAG_RX_FFW_BUFFERED 2
static int ctucan_reset(struct net_device *ndev)
......@@ -223,7 +223,7 @@ static int ctucan_chip_start(struct net_device *ndev)
int_msk.u32 = ~int_ena.u32; /* mask all disabled interrupts */
clear_bit(CTUCAN_FLAG_RX_SCHED, &priv->drv_flags);
// clear_bit(CTUCAN_FLAG_RX_SCHED, &priv->drv_flags);
/* It's after reset, so there is no need to clear anything */
ctu_can_fd_int_mask_set(&priv->p, int_msk);
......@@ -536,9 +536,9 @@ static int ctucan_rx_poll(struct napi_struct *napi, int quota)
*/
iec.u32 = 0;
iec.s.rbnei = 1;
clear_bit(CTUCAN_FLAG_RX_SCHED, &priv->drv_flags);
// clear_bit(CTUCAN_FLAG_RX_SCHED, &priv->drv_flags);
ctu_can_fd_int_clr(&priv->p, iec);
ctu_can_fd_int_ena_set(&priv->p, iec);
ctu_can_fd_int_mask_clr(&priv->p, iec);
}
}
......@@ -678,8 +678,8 @@ static irqreturn_t ctucan_interrupt(int irq, void *dev_id)
/* Get the interrupt status */
isr = ctu_can_fd_int_sts(&priv->p);
if (test_bit(CTUCAN_FLAG_RX_SCHED, &priv->drv_flags))
isr.s.rbnei = 0;
//if (test_bit(CTUCAN_FLAG_RX_SCHED, &priv->drv_flags))
// isr.s.rbnei = 0;
if (!isr.u32)
return irq_loops ? IRQ_HANDLED : IRQ_NONE;
......@@ -689,10 +689,12 @@ static irqreturn_t ctucan_interrupt(int irq, void *dev_id)
netdev_dbg(ndev, "RXBNEI");
icr.u32 = 0;
icr.s.rbnei = 1;
/* Clear and disable RXBNEI, schedule NAPI */
/* Clear and mask RXBNEI, schedule NAPI.
* Even if another IRQ fires, isr.s.rbnei will always
* be 0 (masked). */
ctu_can_fd_int_clr(&priv->p, icr);
ctu_can_fd_int_ena_clr(&priv->p, icr);
set_bit(CTUCAN_FLAG_RX_SCHED, &priv->drv_flags);
ctu_can_fd_int_mask_set(&priv->p, icr);
// set_bit(CTUCAN_FLAG_RX_SCHED, &priv->drv_flags);
napi_schedule(&priv->napi);
}
......
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