Skip to contentSkip to conversation

Handle switch reset in mscc-miim

PATCH Applied Herve Codina 2 participants 4 messages Jun 20, 2024 – Jun 21, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v3 cover Handle switch reset in mscc-miim

These two patches were previously sent as part of a bigger series:
https://lore.kernel.org/lkml/[email protected]/

v1 and v2 iterations were handled during the v1 and v2 reviews of this bigger series. As theses two patches are now ready to be applied, they were extracted from the bigger series and sent alone in this current series.

This current v3 series takes into account feedback received during the bigger series v2 review.

Best regards,
Hervé

Changes v2 -> v3
- patch 1
Drop one useless sentence.
Add 'Reviewed-by: Andrew Lunn <[email protected]>'
Add 'Acked-by: Krzysztof Kozlowski <[email protected]>'

- patch 2
Add 'Reviewed-by: Andrew Lunn <[email protected]>'

Changes v1 -> v2 (as part of the bigger series iterations)
- Patch 1
Improve the reset property description

- Patch 2
Fix a wrong reverse x-mass tree declaration

Herve Codina (2):
dt-bindings: net: mscc-miim: Add resets property
net: mdio: mscc-miim: Handle the switch reset

 Documentation/devicetree/bindings/net/mscc,miim.yaml | 10 ++++++++++
 drivers/net/mdio/mdio-mscc-miim.c                    |  8 ++++++++
 2 files changed, 18 insertions(+)
Signature · 1 line
2.45.0
#1 lore raw

PATCH v3 1/2 dt-bindings: net: mscc-miim: Add resets property

Add the (optional) resets property.
The mscc-miim device is impacted by the switch reset especially when the mscc-miim device is used as part of the LAN966x PCI device.

---
 Documentation/devicetree/bindings/net/mscc,miim.yaml | 10 ++++++++++
 1 file changed, 10 insertions(+)
Documentation/devicetree/bindings/net/mscc,miim.yaml +10 -0
index 5b292e7c9e46..792f26b06b06 100644
@@ -38,6 +38,16 @@ properties:
 
   clock-frequency: true
 
+  resets:
+    items:
+      - description:
+          Reset shared with all blocks attached to the Switch Core Register
+          Bus (CSR) including VRAP slave.
+
+  reset-names:
+    items:
+      - const: switch
+
 required:
   - compatible
   - reg
Signature · 1 line
2.45.0
#2 lore raw

PATCH v3 2/2 net: mdio: mscc-miim: Handle the switch reset

In reply to Herve Codina

The mscc-miim device can be impacted by the switch reset, at least when this device is part of the LAN966x PCI device.

Handle this newly added (optional) resets property.

---
 drivers/net/mdio/mdio-mscc-miim.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/net/mdio/mdio-mscc-miim.c +8 -0
index c29377c85307..62c47e0dd142 100644
@@ -19,6 +19,7 @@
 #include <linux/platform_device.h>
 #include <linux/property.h>
 #include <linux/regmap.h>
+#include <linux/reset.h>
 
 #define MSCC_MIIM_REG_STATUS		0x0
 #define		MSCC_MIIM_STATUS_STAT_PENDING	BIT(2)
@@ -271,10 +272,17 @@ static int mscc_miim_probe(struct platform_device *pdev)
 	struct device_node *np = pdev->dev.of_node;
 	struct regmap *mii_regmap, *phy_regmap;
 	struct device *dev = &pdev->dev;
+	struct reset_control *reset;
 	struct mscc_miim_dev *miim;
 	struct mii_bus *bus;
 	int ret;
 
+	reset = devm_reset_control_get_optional_shared(dev, "switch");
+	if (IS_ERR(reset))
+		return dev_err_probe(dev, PTR_ERR(reset), "Failed to get reset\n");
+
+	reset_control_reset(reset);
+
 	mii_regmap = ocelot_regmap_from_resource(pdev, 0,
 						 &mscc_miim_regmap_config);
 	if (IS_ERR(mii_regmap))
Signature · 1 line
2.45.0
#3 lore raw
In reply to Herve Codina
This series was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:

Hello:

This series was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:

Quoted 9 lines · On Thu, 20 Jun 2024 14:01:23 +0200 you wrote:

These two patches were previously sent as part of a bigger series:
https://lore.kernel.org/lkml/[email protected]/

v1 and v2 iterations were handled during the v1 and v2 reviews of this bigger series. As theses two patches are now ready to be applied, they were extracted from the bigger series and sent alone in this current series.

[...]

Here is the summary with links:
- [net-next,v3,1/2] dt-bindings: net: mscc-miim: Add resets property

    https://git.kernel.org/netdev/net-next/c/e5efa3ff412d
  - [net-next,v3,2/2] net: mdio: mscc-miim: Handle the switch reset
    https://git.kernel.org/netdev/net-next/c/9e6d33937b42

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html