* [net-next,v4 0/2] ravb: Support describing the MDIO bus
@ 2024-03-25 15:34 Niklas Söderlund
2024-03-25 15:34 ` [net-next,v4 1/2] dt-bindings: net: renesas,etheravb: Add optional MDIO bus node Niklas Söderlund
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Niklas Söderlund @ 2024-03-25 15:34 UTC (permalink / raw)
To: Sergey Shtylyov, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Claudiu Beznea, Yoshihiro Shimoda, Biju Das,
netdev, devicetree
Cc: linux-renesas-soc, Niklas Söderlund
Hello,
This series adds support to the binding and driver of the Renesas
Ethernet AVB to described the MDIO bus. Currently the driver uses the OF
node of the device itself when registering the MDIO bus. This forces any
MDIO bus properties the MDIO core should react on to be set on the
device OF node. This is confusing and non of the MDIO bus properties are
described in the Ethernet AVB bindings.
Patch 1/2 extends the bindings with an optional mdio child-node to the
device that can be used to contain the MDIO bus settings. While patch
2/2 changes the driver to use this node (if present) when registering
the MDIO bus.
If the new optional mdio child-node is not present the driver fallback
to the old behavior and uses the device OF node like before. This change
is fully backward compatible with existing usage of the bindings.
For changelog see individual patches.
Niklas Söderlund (2):
dt-bindings: net: renesas,etheravb: Add optional MDIO bus node
ravb: Add support for an optional MDIO mode
.../devicetree/bindings/net/renesas,etheravb.yaml | 12 ++++++++++--
drivers/net/ethernet/renesas/ravb_main.c | 9 ++++++++-
2 files changed, 18 insertions(+), 3 deletions(-)
--
2.44.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [net-next,v4 1/2] dt-bindings: net: renesas,etheravb: Add optional MDIO bus node
2024-03-25 15:34 [net-next,v4 0/2] ravb: Support describing the MDIO bus Niklas Söderlund
@ 2024-03-25 15:34 ` Niklas Söderlund
2024-03-25 15:34 ` [net-next,v4 2/2] ravb: Add support for an optional MDIO mode Niklas Söderlund
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Niklas Söderlund @ 2024-03-25 15:34 UTC (permalink / raw)
To: Sergey Shtylyov, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Claudiu Beznea, Yoshihiro Shimoda, Biju Das,
netdev, devicetree
Cc: linux-renesas-soc, Niklas Söderlund, Rob Herring
The Renesas Ethernet AVB bindings do not allow the MDIO bus to be
described. This has not been needed as only a single PHY is
supported and no MDIO bus properties have been needed.
Add an optional mdio node to the binding which allows the MDIO bus to be
described and allow bus properties to be set.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Reviewed-by: Rob Herring <robh@kernel.org>
---
* Changes since v3
- Marked the '#address-cells' and '#size-cells' properties as depricated
as well as making them optional.
* Changes since v2
- Mark the PHY pattern as deprecated and add a comment that new bindings
should describe the PHY inside the MDIO node.
---
.../devicetree/bindings/net/renesas,etheravb.yaml | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/renesas,etheravb.yaml b/Documentation/devicetree/bindings/net/renesas,etheravb.yaml
index de7ba7f345a9..21a92f179093 100644
--- a/Documentation/devicetree/bindings/net/renesas,etheravb.yaml
+++ b/Documentation/devicetree/bindings/net/renesas,etheravb.yaml
@@ -88,10 +88,16 @@ properties:
'#address-cells':
description: Number of address cells for the MDIO bus.
const: 1
+ deprecated: true
'#size-cells':
description: Number of size cells on the MDIO bus.
const: 0
+ deprecated: true
+
+ mdio:
+ $ref: /schemas/net/mdio.yaml#
+ unevaluatedProperties: false
renesas,no-ether-link:
type: boolean
@@ -110,9 +116,13 @@ properties:
tx-internal-delay-ps:
enum: [0, 2000]
+# In older bindings there where no mdio child-node to describe the MDIO bus
+# and the PHY. To not fail older bindings accept any node with an address. New
+# users should describe the PHY inside the mdio child-node.
patternProperties:
"@[0-9a-f]$":
type: object
+ deprecated: true
required:
- compatible
@@ -123,8 +133,6 @@ required:
- resets
- phy-mode
- phy-handle
- - '#address-cells'
- - '#size-cells'
allOf:
- $ref: ethernet-controller.yaml#
--
2.44.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [net-next,v4 2/2] ravb: Add support for an optional MDIO mode
2024-03-25 15:34 [net-next,v4 0/2] ravb: Support describing the MDIO bus Niklas Söderlund
2024-03-25 15:34 ` [net-next,v4 1/2] dt-bindings: net: renesas,etheravb: Add optional MDIO bus node Niklas Söderlund
@ 2024-03-25 15:34 ` Niklas Söderlund
2024-03-28 9:45 ` [net-next,v4 0/2] ravb: Support describing the MDIO bus Niklas Söderlund
2024-03-29 1:30 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 6+ messages in thread
From: Niklas Söderlund @ 2024-03-25 15:34 UTC (permalink / raw)
To: Sergey Shtylyov, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Claudiu Beznea, Yoshihiro Shimoda, Biju Das,
netdev, devicetree
Cc: linux-renesas-soc, Niklas Söderlund, Andrew Lunn
The driver used the DT node of the device itself when registering the
MDIO bus. While this works, it creates a problem: it forces any MDIO bus
properties to also be set on the devices DT node. This mixes the
properties of two distinctly different things and is confusing.
This change adds support for an optional mdio node to be defined as a
child to the device DT node. The child node can then be used to describe
MDIO bus properties that the MDIO core can act on when registering the
bus.
If no mdio child node is found the driver fallback to the old behavior
and register the MDIO bus using the device DT node. This change is
backward compatible with old bindings in use.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
* Changes since v3
- None
* Changes since v2
- Use DT node instead of OF ode in commit message.
- Update punctuation in commit message.
- Simplify the node selection in the driver.
---
drivers/net/ethernet/renesas/ravb_main.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index d1be030c8848..9a397f9b4c0c 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -2564,6 +2564,7 @@ static int ravb_mdio_init(struct ravb_private *priv)
{
struct platform_device *pdev = priv->pdev;
struct device *dev = &pdev->dev;
+ struct device_node *mdio_node;
struct phy_device *phydev;
struct device_node *pn;
int error;
@@ -2583,7 +2584,13 @@ static int ravb_mdio_init(struct ravb_private *priv)
pdev->name, pdev->id);
/* Register MDIO bus */
- error = of_mdiobus_register(priv->mii_bus, dev->of_node);
+ mdio_node = of_get_child_by_name(dev->of_node, "mdio");
+ if (!mdio_node) {
+ /* backwards compatibility for DT lacking mdio subnode */
+ mdio_node = of_node_get(dev->of_node);
+ }
+ error = of_mdiobus_register(priv->mii_bus, mdio_node);
+ of_node_put(mdio_node);
if (error)
goto out_free_bus;
--
2.44.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [net-next,v4 0/2] ravb: Support describing the MDIO bus
2024-03-25 15:34 [net-next,v4 0/2] ravb: Support describing the MDIO bus Niklas Söderlund
2024-03-25 15:34 ` [net-next,v4 1/2] dt-bindings: net: renesas,etheravb: Add optional MDIO bus node Niklas Söderlund
2024-03-25 15:34 ` [net-next,v4 2/2] ravb: Add support for an optional MDIO mode Niklas Söderlund
@ 2024-03-28 9:45 ` Niklas Söderlund
2024-03-28 15:28 ` Jakub Kicinski
2024-03-29 1:30 ` patchwork-bot+netdevbpf
3 siblings, 1 reply; 6+ messages in thread
From: Niklas Söderlund @ 2024-03-28 9:45 UTC (permalink / raw)
To: Sergey Shtylyov, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Claudiu Beznea, Yoshihiro Shimoda, Biju Das,
netdev, devicetree
Cc: linux-renesas-soc
Hi netdev,
This series was marked as Deferred in patchwork. I just wonder why that
is? Patch 1/2 touches bindings so it could go thru the Renesas tree but
patch 2/2 touches the driver and depends on 1/2. Should not this whole
series go thru net-next?
I fear it might have been flagged as Deferred as v3 was posted on the
same day net-next closed and was therefore closed as Deferred.
On 2024-03-25 16:34:49 +0100, Niklas Söderlund wrote:
> Hello,
>
> This series adds support to the binding and driver of the Renesas
> Ethernet AVB to described the MDIO bus. Currently the driver uses the OF
> node of the device itself when registering the MDIO bus. This forces any
> MDIO bus properties the MDIO core should react on to be set on the
> device OF node. This is confusing and non of the MDIO bus properties are
> described in the Ethernet AVB bindings.
>
> Patch 1/2 extends the bindings with an optional mdio child-node to the
> device that can be used to contain the MDIO bus settings. While patch
> 2/2 changes the driver to use this node (if present) when registering
> the MDIO bus.
>
> If the new optional mdio child-node is not present the driver fallback
> to the old behavior and uses the device OF node like before. This change
> is fully backward compatible with existing usage of the bindings.
>
> For changelog see individual patches.
>
> Niklas Söderlund (2):
> dt-bindings: net: renesas,etheravb: Add optional MDIO bus node
> ravb: Add support for an optional MDIO mode
>
> .../devicetree/bindings/net/renesas,etheravb.yaml | 12 ++++++++++--
> drivers/net/ethernet/renesas/ravb_main.c | 9 ++++++++-
> 2 files changed, 18 insertions(+), 3 deletions(-)
>
> --
> 2.44.0
>
--
Kind Regards,
Niklas Söderlund
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [net-next,v4 0/2] ravb: Support describing the MDIO bus
2024-03-28 9:45 ` [net-next,v4 0/2] ravb: Support describing the MDIO bus Niklas Söderlund
@ 2024-03-28 15:28 ` Jakub Kicinski
0 siblings, 0 replies; 6+ messages in thread
From: Jakub Kicinski @ 2024-03-28 15:28 UTC (permalink / raw)
To: Niklas Söderlund
Cc: Sergey Shtylyov, David S. Miller, Eric Dumazet, Paolo Abeni,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Claudiu Beznea, Yoshihiro Shimoda, Biju Das,
netdev, devicetree, linux-renesas-soc
On Thu, 28 Mar 2024 10:45:46 +0100 Niklas Söderlund wrote:
> This series was marked as Deferred in patchwork. I just wonder why that
> is? Patch 1/2 touches bindings so it could go thru the Renesas tree but
> patch 2/2 touches the driver and depends on 1/2. Should not this whole
> series go thru net-next?
I don't see why either. Looks ready to apply, TBH.
pw-bot: under-review
I'll get to applying later today, hopefully.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [net-next,v4 0/2] ravb: Support describing the MDIO bus
2024-03-25 15:34 [net-next,v4 0/2] ravb: Support describing the MDIO bus Niklas Söderlund
` (2 preceding siblings ...)
2024-03-28 9:45 ` [net-next,v4 0/2] ravb: Support describing the MDIO bus Niklas Söderlund
@ 2024-03-29 1:30 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-03-29 1:30 UTC (permalink / raw)
To: =?utf-8?q?Niklas_S=C3=B6derlund_=3Cniklas=2Esoderlund+renesas=40ragnatech=2E?=,
=?utf-8?q?se=3E?=
Cc: s.shtylyov, davem, edumazet, kuba, pabeni, robh+dt,
krzysztof.kozlowski+dt, conor+dt, geert+renesas,
claudiu.beznea.uj, yoshihiro.shimoda.uh, biju.das.jz, netdev,
devicetree, linux-renesas-soc
Hello:
This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 25 Mar 2024 16:34:49 +0100 you wrote:
> Hello,
>
> This series adds support to the binding and driver of the Renesas
> Ethernet AVB to described the MDIO bus. Currently the driver uses the OF
> node of the device itself when registering the MDIO bus. This forces any
> MDIO bus properties the MDIO core should react on to be set on the
> device OF node. This is confusing and non of the MDIO bus properties are
> described in the Ethernet AVB bindings.
>
> [...]
Here is the summary with links:
- [net-next,v4,1/2] dt-bindings: net: renesas,etheravb: Add optional MDIO bus node
https://git.kernel.org/netdev/net-next/c/a87590c45c87
- [net-next,v4,2/2] ravb: Add support for an optional MDIO mode
https://git.kernel.org/netdev/net-next/c/2c60c4c008d4
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] 6+ messages in thread
end of thread, other threads:[~2024-03-29 1:30 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-25 15:34 [net-next,v4 0/2] ravb: Support describing the MDIO bus Niklas Söderlund
2024-03-25 15:34 ` [net-next,v4 1/2] dt-bindings: net: renesas,etheravb: Add optional MDIO bus node Niklas Söderlund
2024-03-25 15:34 ` [net-next,v4 2/2] ravb: Add support for an optional MDIO mode Niklas Söderlund
2024-03-28 9:45 ` [net-next,v4 0/2] ravb: Support describing the MDIO bus Niklas Söderlund
2024-03-28 15:28 ` Jakub Kicinski
2024-03-29 1:30 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).