| 412e1775 | 20-Jun-2024 |
Matthias Schiffer <[email protected]> |
net: dsa: qca8k: factor out bridge join/leave logic
Most of the logic in qca8k_port_bridge_join() and qca8k_port_bridge_leave() is the same. Refactor to reduce duplication and prepare for reusing th
net: dsa: qca8k: factor out bridge join/leave logic
Most of the logic in qca8k_port_bridge_join() and qca8k_port_bridge_leave() is the same. Refactor to reduce duplication and prepare for reusing the code for implementing bridge port isolation.
dsa_port_offloads_bridge_dev() is used instead of dsa_port_offloads_bridge(), passing the bridge in as a struct netdevice *, as we won't have a struct dsa_bridge in qca8k_port_bridge_flags().
The error handling is changed slightly in the bridge leave case, returning early and emitting an error message when a regmap access fails. This shouldn't matter in practice, as there isn't much we can do if communication with the switch breaks down in the middle of reconfiguration.
Signed-off-by: Matthias Schiffer <[email protected]> Reviewed-by: Wojciech Drewek <[email protected]> Signed-off-by: David S. Miller <[email protected]>
show more ...
|
| 636d022c | 12-Apr-2024 |
Russell King (Oracle) <[email protected]> |
net: dsa: qca8k: provide own phylink MAC operations
Convert qca8k to provide its own phylink MAC operations, thus avoiding the shim layer in DSA's port.c.
Signed-off-by: Russell King (Oracle) <rmk+
net: dsa: qca8k: provide own phylink MAC operations
Convert qca8k to provide its own phylink MAC operations, thus avoiding the shim layer in DSA's port.c.
Signed-off-by: Russell King (Oracle) <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
show more ...
|
| 709776ea | 02-Feb-2024 |
Vladimir Oltean <[email protected]> |
net: dsa: qca8k: consistently use "ret" rather than "err" for error codes
It was pointed out during the review [1] of commit 68e1010cda79 ("net: dsa: qca8k: put MDIO bus OF node on qca8k_mdio_regist
net: dsa: qca8k: consistently use "ret" rather than "err" for error codes
It was pointed out during the review [1] of commit 68e1010cda79 ("net: dsa: qca8k: put MDIO bus OF node on qca8k_mdio_register() failure") that the rest of the qca8k driver uses "int ret" rather than "int err".
Make everything consistent in that regard, not only qca8k_mdio_register(), but also qca8k_setup_mdio_bus().
[1] https://lore.kernel.org/netdev/qyl2w3ownx5q7363kqxib52j5htar4y6pkn7gen27rj45xr4on@pvy5agi6o2te/
Suggested-by: Alvin Šipraga <[email protected]> Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Reviewed-by: Christian Marangi <[email protected]> Signed-off-by: David S. Miller <[email protected]>
show more ...
|
| c4a1cefd | 04-Jan-2024 |
Vladimir Oltean <[email protected]> |
net: dsa: qca8k: use "dev" consistently within qca8k_mdio_register()
Accessed either through priv->dev or ds->dev, it is the same device structure. Keep a single variable which holds a reference to
net: dsa: qca8k: use "dev" consistently within qca8k_mdio_register()
Accessed either through priv->dev or ds->dev, it is the same device structure. Keep a single variable which holds a reference to it, and use it consistently.
Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Alvin Šipraga <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Reviewed-by: Christian Marangi <[email protected]> Reviewed-by: Luiz Angelo Daros de Luca <[email protected]> Signed-off-by: David S. Miller <[email protected]>
show more ...
|
| 5c5d6b34 | 04-Jan-2024 |
Vladimir Oltean <[email protected]> |
net: dsa: qca8k: consolidate calls to a single devm_of_mdiobus_register()
__of_mdiobus_register() already calls __mdiobus_register() if the OF node provided as argument is NULL. We can take advantag
net: dsa: qca8k: consolidate calls to a single devm_of_mdiobus_register()
__of_mdiobus_register() already calls __mdiobus_register() if the OF node provided as argument is NULL. We can take advantage of that and simplify the 2 code path, calling devm_of_mdiobus_register() only once for both cases.
Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Alvin Šipraga <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Reviewed-by: Christian Marangi <[email protected]> Reviewed-by: Luiz Angelo Daros de Luca <[email protected]> Signed-off-by: David S. Miller <[email protected]>
show more ...
|
| 525366b8 | 04-Jan-2024 |
Vladimir Oltean <[email protected]> |
net: dsa: qca8k: assign ds->user_mii_bus only for the non-OF case
To simplify reasoning about why the DSA framework provides the ds->user_mii_bus functionality, drivers should only use it if they ne
net: dsa: qca8k: assign ds->user_mii_bus only for the non-OF case
To simplify reasoning about why the DSA framework provides the ds->user_mii_bus functionality, drivers should only use it if they need to. The qca8k driver appears to also use it simply as storage for a pointer, which is not a good enough reason to make the core much more difficult to follow.
ds->user_mii_bus is useful for only 2 cases:
1. The driver probes on platform_data (no OF) 2. The driver probes on OF, but there is no OF node for the MDIO bus.
It is unclear if case (1) is supported with qca8k. It might not be: the driver might crash when of_device_get_match_data() returns NULL and then it dereferences priv->info without NULL checking.
Anyway, let us limit the ds->user_mii_bus usage only to the above cases, and not assign it when an OF node is present.
The bus->phy_mask assignment follows along with the movement, because __of_mdiobus_register() overwrites this bus field anyway. The value set by the driver only matters for the non-OF code path.
Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Alvin Šipraga <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Reviewed-by: Luiz Angelo Daros de Luca <[email protected]> Signed-off-by: David S. Miller <[email protected]>
show more ...
|
| e66bf63a | 04-Jan-2024 |
Vladimir Oltean <[email protected]> |
net: dsa: qca8k: skip MDIO bus creation if its OF node has status = "disabled"
Currently the driver calls the non-OF devm_mdiobus_register() rather than devm_of_mdiobus_register() for this case, but
net: dsa: qca8k: skip MDIO bus creation if its OF node has status = "disabled"
Currently the driver calls the non-OF devm_mdiobus_register() rather than devm_of_mdiobus_register() for this case, but it seems to rather be a confusing coincidence, and not a real use case that needs to be supported.
If the device tree says status = "disabled" for the MDIO bus, we shouldn't need an MDIO bus at all. Instead, just exit as early as possible and do not call any MDIO API.
Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Alvin Šipraga <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
show more ...
|