Message ID | 20231219115933.1480290-6-ioana.ciornei@nxp.com (mailing list archive) |
---|---|
State | Accepted |
Commit | f6da276479c63ca29774bc331a537b92f0550c45 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | dpaa2-switch: small improvements | expand |
On Tue, Dec 19, 2023 at 01:59:30PM +0200, Ioana Ciornei wrote: > The DPSW object has multiple event sources multiplexed over the same > IRQ. The driver has the capability to configure only some of these > events to trigger the IRQ. > > The dpsw_get_irq_status() can clear events 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 events than we actually handled. > > Just resort to manually clearing the events that we handled. Also, since > status is not used on the out path we remove its initialization to zero. > > This change does not have a user-visible effect because the dpaa2-switch > driver enables and handles all the DPSW events which exist at the > moment. > > Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> > --- > Changes in v3: > - mention that the change does not have a user visible impact > Changes in v2: > - add a bit more info in the commit message Thanks for these updates too. Reviewed-by: Simon Horman <horms@kernel.org>
On Wed, Dec 20, 2023 at 03:48:22PM +0100, Simon Horman wrote: > On Tue, Dec 19, 2023 at 01:59:30PM +0200, Ioana Ciornei wrote: > > The DPSW object has multiple event sources multiplexed over the same > > IRQ. The driver has the capability to configure only some of these > > events to trigger the IRQ. > > > > The dpsw_get_irq_status() can clear events 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 events than we actually handled. > > > > Just resort to manually clearing the events that we handled. Also, since > > status is not used on the out path we remove its initialization to zero. > > > > This change does not have a user-visible effect because the dpaa2-switch > > driver enables and handles all the DPSW events which exist at the > > moment. > > > > Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> > > --- > > Changes in v3: > > - mention that the change does not have a user visible impact > > Changes in v2: > > - add a bit more info in the commit message > > Thanks for these updates too. > No problem!
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c index a355295468bd..1b8d233e0802 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c @@ -1509,9 +1509,9 @@ 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; int err, if_id; bool had_mac; + u32 status; err = dpsw_get_irq_status(ethsw->mc_io, 0, ethsw->dpsw_handle, DPSW_IRQ_INDEX_IF, &status); @@ -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 object has multiple event sources multiplexed over the same IRQ. The driver has the capability to configure only some of these events to trigger the IRQ. The dpsw_get_irq_status() can clear events 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 events than we actually handled. Just resort to manually clearing the events that we handled. Also, since status is not used on the out path we remove its initialization to zero. This change does not have a user-visible effect because the dpaa2-switch driver enables and handles all the DPSW events which exist at the moment. Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> --- Changes in v3: - mention that the change does not have a user visible impact Changes in v2: - add a bit more info in the commit message drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)