diff mbox series

[net-next,v3,4/8] dpaa2-switch: add ENDPOINT_CHANGED to the irq_mask

Message ID 20231219115933.1480290-5-ioana.ciornei@nxp.com (mailing list archive)
State Accepted
Commit 77c42a3b0a3a68408976492d9e435a5adfeca5aa
Delegated to: Netdev Maintainers
Headers show
Series dpaa2-switch: small improvements | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1115 this patch: 1115
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang fail Errors and warnings before: 12 this patch: 12
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1142 this patch: 1142
netdev/checkpatch warning WARNING: line length of 81 exceeds 80 columns
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Ioana Ciornei Dec. 19, 2023, 11:59 a.m. UTC
Commit 84cba72956fd ("dpaa2-switch: integrate the MAC endpoint support")
added support for MAC endpoints in the dpaa2-switch driver but omitted
to add the ENDPOINT_CHANGED irq to the list of interrupt sources. Fix
this by extending the list of events which can raise an interrupt by
extending the mask passed to the dpsw_set_irq_mask() firmware API.

There is no user visible impact even without this patch since whenever a
switch interface is connected/disconnected from an endpoint both events
are set (LINK_CHANGED and ENDPOINT_CHANGED) and, luckily, the
LINK_CHANGED event could actually raise the interrupt and thus get the
MAC/PHY SW configuration started.

Even with this, it's better to just not rely on undocumented firmware
behavior which can change.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
---
Changes in v3:
- removed the fixes tag
Changes in v2:
- add a bit more info in the commit message

 drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Horman Dec. 20, 2023, 2:47 p.m. UTC | #1
On Tue, Dec 19, 2023 at 01:59:29PM +0200, Ioana Ciornei wrote:
> Commit 84cba72956fd ("dpaa2-switch: integrate the MAC endpoint support")
> added support for MAC endpoints in the dpaa2-switch driver but omitted
> to add the ENDPOINT_CHANGED irq to the list of interrupt sources. Fix
> this by extending the list of events which can raise an interrupt by
> extending the mask passed to the dpsw_set_irq_mask() firmware API.
> 
> There is no user visible impact even without this patch since whenever a
> switch interface is connected/disconnected from an endpoint both events
> are set (LINK_CHANGED and ENDPOINT_CHANGED) and, luckily, the
> LINK_CHANGED event could actually raise the interrupt and thus get the
> MAC/PHY SW configuration started.
> 
> Even with this, it's better to just not rely on undocumented firmware
> behavior which can change.
> 
> Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
> ---
> Changes in v3:
> - removed the fixes tag
> Changes in v2:
> - add a bit more info in the commit message

Thanks for the updates.

Reviewed-by: Simon Horman <horms@kernel.org>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
index 0f9103b13438..a355295468bd 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
@@ -1550,9 +1550,9 @@  static irqreturn_t dpaa2_switch_irq0_handler_thread(int irq_num, void *arg)
 
 static int dpaa2_switch_setup_irqs(struct fsl_mc_device *sw_dev)
 {
+	u32 mask = DPSW_IRQ_EVENT_LINK_CHANGED | DPSW_IRQ_EVENT_ENDPOINT_CHANGED;
 	struct device *dev = &sw_dev->dev;
 	struct ethsw_core *ethsw = dev_get_drvdata(dev);
-	u32 mask = DPSW_IRQ_EVENT_LINK_CHANGED;
 	struct fsl_mc_device_irq *irq;
 	int err;