* [PATCH net-next v3 1/2] dt-bindings: net: mscc-miim: Add resets property
2024-06-20 12:01 [PATCH net-next v3 0/2] Handle switch reset in mscc-miim Herve Codina
@ 2024-06-20 12:01 ` Herve Codina
2024-06-20 12:01 ` [PATCH net-next v3 2/2] net: mdio: mscc-miim: Handle the switch reset Herve Codina
2024-06-21 11:20 ` [PATCH net-next v3 0/2] Handle switch reset in mscc-miim patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Herve Codina @ 2024-06-20 12:01 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Andrew Lunn,
Heiner Kallweit, Russell King, Philipp Zabel, Alexandre Belloni
Cc: netdev, devicetree, linux-kernel, Allan Nielsen, Horatiu Vultur,
Steen Hegelund, Thomas Petazzoni, Herve Codina,
Krzysztof Kozlowski
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.
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
Documentation/devicetree/bindings/net/mscc,miim.yaml | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/Documentation/devicetree/bindings/net/mscc,miim.yaml b/Documentation/devicetree/bindings/net/mscc,miim.yaml
index 5b292e7c9e46..792f26b06b06 100644
--- a/Documentation/devicetree/bindings/net/mscc,miim.yaml
+++ b/Documentation/devicetree/bindings/net/mscc,miim.yaml
@@ -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
--
2.45.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH net-next v3 2/2] net: mdio: mscc-miim: Handle the switch reset
2024-06-20 12:01 [PATCH net-next v3 0/2] Handle switch reset in mscc-miim Herve Codina
2024-06-20 12:01 ` [PATCH net-next v3 1/2] dt-bindings: net: mscc-miim: Add resets property Herve Codina
@ 2024-06-20 12:01 ` Herve Codina
2024-06-21 11:20 ` [PATCH net-next v3 0/2] Handle switch reset in mscc-miim patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Herve Codina @ 2024-06-20 12:01 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Andrew Lunn,
Heiner Kallweit, Russell King, Philipp Zabel, Alexandre Belloni
Cc: netdev, devicetree, linux-kernel, Allan Nielsen, Horatiu Vultur,
Steen Hegelund, Thomas Petazzoni, 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.
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
drivers/net/mdio/mdio-mscc-miim.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/mdio/mdio-mscc-miim.c b/drivers/net/mdio/mdio-mscc-miim.c
index c29377c85307..62c47e0dd142 100644
--- a/drivers/net/mdio/mdio-mscc-miim.c
+++ b/drivers/net/mdio/mdio-mscc-miim.c
@@ -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))
--
2.45.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next v3 0/2] Handle switch reset in mscc-miim
2024-06-20 12:01 [PATCH net-next v3 0/2] Handle switch reset in mscc-miim Herve Codina
2024-06-20 12:01 ` [PATCH net-next v3 1/2] dt-bindings: net: mscc-miim: Add resets property Herve Codina
2024-06-20 12:01 ` [PATCH net-next v3 2/2] net: mdio: mscc-miim: Handle the switch reset Herve Codina
@ 2024-06-21 11:20 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-06-21 11:20 UTC (permalink / raw)
To: Herve Codina
Cc: davem, edumazet, kuba, pabeni, robh, krzk+dt, conor+dt, andrew,
hkallweit1, linux, p.zabel, alexandre.belloni, netdev, devicetree,
linux-kernel, allan.nielsen, horatiu.vultur, steen.hegelund,
thomas.petazzoni
Hello:
This series was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:
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/20240527161450.326615-1-herve.codina@bootlin.com/
>
> 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!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread