Message ID | 20231204163528.1797565-6-ioana.ciornei@nxp.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | dpaa2-switch: small improvements | expand |
On Mon, 4 Dec 2023 18:35:25 +0200 Ioana Ciornei wrote: > The dpsw_get_irq_status() can clear interrupts automatically based on > the value stored in the 'status' variable passed to it. We don't want > that to happen because we could get into a situation when we are > clearing more interrupts that we actually handled. > > Just resort to manually clearing interrupts after we received them using > the dpsw_clear_irq_status(). Currently it can't cause any issues? We won't get into an IRQ storm if some unexpected IRQ fires?
On Tue, Dec 05, 2023 at 08:02:32PM -0800, Jakub Kicinski wrote: > On Mon, 4 Dec 2023 18:35:25 +0200 Ioana Ciornei wrote: > > The dpsw_get_irq_status() can clear interrupts automatically based on > > the value stored in the 'status' variable passed to it. We don't want > > that to happen because we could get into a situation when we are > > clearing more interrupts that we actually handled. > > > > Just resort to manually clearing interrupts after we received them using > > the dpsw_clear_irq_status(). > > Currently it can't cause any issues? > We won't get into an IRQ storm if some unexpected IRQ fires? We don't get into an IRQ storm because we can configure which event sources can raise the IRQ. This means that the driver can ask only for the events which are handled.
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c index e91ade7c7c93..d9906573f71f 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c @@ -1509,7 +1509,7 @@ static irqreturn_t dpaa2_switch_irq0_handler_thread(int irq_num, void *arg) struct device *dev = (struct device *)arg; struct ethsw_core *ethsw = dev_get_drvdata(dev); struct ethsw_port_priv *port_priv; - u32 status = ~0; + u32 status = 0; int err, if_id; bool had_mac; @@ -1539,12 +1539,12 @@ static irqreturn_t dpaa2_switch_irq0_handler_thread(int irq_num, void *arg) dpaa2_switch_port_connect_mac(port_priv); } -out: err = dpsw_clear_irq_status(ethsw->mc_io, 0, ethsw->dpsw_handle, DPSW_IRQ_INDEX_IF, status); if (err) dev_err(dev, "Can't clear irq status (err %d)\n", err); +out: return IRQ_HANDLED; }
The dpsw_get_irq_status() can clear interrupts automatically based on the value stored in the 'status' variable passed to it. We don't want that to happen because we could get into a situation when we are clearing more interrupts that we actually handled. Just resort to manually clearing interrupts after we received them using the dpsw_clear_irq_status(). Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> --- drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)