netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: dsa: mv88e6xxx: accept phy-mode = "internal" for internal PHY ports
@ 2022-12-05 19:48 Vladimir Oltean
  2022-12-05 19:51 ` Florian Fainelli
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Vladimir Oltean @ 2022-12-05 19:48 UTC (permalink / raw)
  To: netdev
  Cc: Andrew Lunn, Florian Fainelli, Marek Behún, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Russell King,
	Tim Harvey

The ethernet-controller dt-schema, mostly pushed forward by Linux, has
the "internal" PHY mode for denoting MAC connections to an internal PHY.

U-Boot may provide device tree blobs where this phy-mode is specified,
so make the Linux driver accept them.

It appears that the current behavior with phy-mode = "internal" was
introduced when mv88e6xxx started reporting supported_interfaces to
phylink. Prior to that, I don't think it would have any issues accepting
this phy-mode.

Fixes: d4ebf12bcec4 ("net: dsa: mv88e6xxx: populate supported_interfaces and mac_capabilities")
Link: https://lore.kernel.org/linux-arm-kernel/20221205172709.kglithpbhdbsakvd@skbuf/T/
Reported-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 drivers/net/dsa/mv88e6xxx/chip.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index ccfa4751d3b7..ba4fff8690aa 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -833,10 +833,13 @@ static void mv88e6xxx_get_caps(struct dsa_switch *ds, int port,
 
 	chip->info->ops->phylink_get_caps(chip, port, config);
 
-	/* Internal ports need GMII for PHYLIB */
-	if (mv88e6xxx_phy_is_internal(ds, port))
+	if (mv88e6xxx_phy_is_internal(ds, port)) {
+		__set_bit(PHY_INTERFACE_MODE_INTERNAL,
+			  config->supported_interfaces);
+		/* Internal ports with no phy-mode need GMII for PHYLIB */
 		__set_bit(PHY_INTERFACE_MODE_GMII,
 			  config->supported_interfaces);
+	}
 }
 
 static void mv88e6xxx_mac_config(struct dsa_switch *ds, int port,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net: dsa: mv88e6xxx: accept phy-mode = "internal" for internal PHY ports
  2022-12-05 19:48 [PATCH net] net: dsa: mv88e6xxx: accept phy-mode = "internal" for internal PHY ports Vladimir Oltean
@ 2022-12-05 19:51 ` Florian Fainelli
  2022-12-06 17:54 ` Tim Harvey
  2022-12-07 15:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2022-12-05 19:51 UTC (permalink / raw)
  To: Vladimir Oltean, netdev
  Cc: Andrew Lunn, Marek Behún, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Russell King, Tim Harvey

On 12/5/22 11:48, Vladimir Oltean wrote:
> The ethernet-controller dt-schema, mostly pushed forward by Linux, has
> the "internal" PHY mode for denoting MAC connections to an internal PHY.
> 
> U-Boot may provide device tree blobs where this phy-mode is specified,
> so make the Linux driver accept them.
> 
> It appears that the current behavior with phy-mode = "internal" was
> introduced when mv88e6xxx started reporting supported_interfaces to
> phylink. Prior to that, I don't think it would have any issues accepting
> this phy-mode.
> 
> Fixes: d4ebf12bcec4 ("net: dsa: mv88e6xxx: populate supported_interfaces and mac_capabilities")
> Link: https://lore.kernel.org/linux-arm-kernel/20221205172709.kglithpbhdbsakvd@skbuf/T/
> Reported-by: Tim Harvey <tharvey@gateworks.com>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net: dsa: mv88e6xxx: accept phy-mode = "internal" for internal PHY ports
  2022-12-05 19:48 [PATCH net] net: dsa: mv88e6xxx: accept phy-mode = "internal" for internal PHY ports Vladimir Oltean
  2022-12-05 19:51 ` Florian Fainelli
@ 2022-12-06 17:54 ` Tim Harvey
  2022-12-07 15:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Tim Harvey @ 2022-12-06 17:54 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: netdev, Andrew Lunn, Florian Fainelli, Marek Behún,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Russell King

On Mon, Dec 5, 2022 at 11:49 AM Vladimir Oltean <vladimir.oltean@nxp.com> wrote:
>
> The ethernet-controller dt-schema, mostly pushed forward by Linux, has
> the "internal" PHY mode for denoting MAC connections to an internal PHY.
>
> U-Boot may provide device tree blobs where this phy-mode is specified,
> so make the Linux driver accept them.
>
> It appears that the current behavior with phy-mode = "internal" was
> introduced when mv88e6xxx started reporting supported_interfaces to
> phylink. Prior to that, I don't think it would have any issues accepting
> this phy-mode.
>
> Fixes: d4ebf12bcec4 ("net: dsa: mv88e6xxx: populate supported_interfaces and mac_capabilities")
> Link: https://lore.kernel.org/linux-arm-kernel/20221205172709.kglithpbhdbsakvd@skbuf/T/
> Reported-by: Tim Harvey <tharvey@gateworks.com>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> ---
>  drivers/net/dsa/mv88e6xxx/chip.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
> index ccfa4751d3b7..ba4fff8690aa 100644
> --- a/drivers/net/dsa/mv88e6xxx/chip.c
> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
> @@ -833,10 +833,13 @@ static void mv88e6xxx_get_caps(struct dsa_switch *ds, int port,
>
>         chip->info->ops->phylink_get_caps(chip, port, config);
>
> -       /* Internal ports need GMII for PHYLIB */
> -       if (mv88e6xxx_phy_is_internal(ds, port))
> +       if (mv88e6xxx_phy_is_internal(ds, port)) {
> +               __set_bit(PHY_INTERFACE_MODE_INTERNAL,
> +                         config->supported_interfaces);
> +               /* Internal ports with no phy-mode need GMII for PHYLIB */
>                 __set_bit(PHY_INTERFACE_MODE_GMII,
>                           config->supported_interfaces);
> +       }
>  }
>
>  static void mv88e6xxx_mac_config(struct dsa_switch *ds, int port,
> --
> 2.34.1
>

Thanks,

This allows me to update the dt of the imx6q-gw5904 to make the
internal mdio phy's less ambiguous.

Tested-By: Tim Harvey <tharvey@gateworks.com> # imx6q-gw904.dts

Best Regards,

Tim

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net: dsa: mv88e6xxx: accept phy-mode = "internal" for internal PHY ports
  2022-12-05 19:48 [PATCH net] net: dsa: mv88e6xxx: accept phy-mode = "internal" for internal PHY ports Vladimir Oltean
  2022-12-05 19:51 ` Florian Fainelli
  2022-12-06 17:54 ` Tim Harvey
@ 2022-12-07 15:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-12-07 15:20 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: netdev, andrew, f.fainelli, kabel, davem, edumazet, kuba, pabeni,
	linux, tharvey

Hello:

This patch was applied to netdev/net.git (master)
by Paolo Abeni <pabeni@redhat.com>:

On Mon,  5 Dec 2022 21:48:45 +0200 you wrote:
> The ethernet-controller dt-schema, mostly pushed forward by Linux, has
> the "internal" PHY mode for denoting MAC connections to an internal PHY.
> 
> U-Boot may provide device tree blobs where this phy-mode is specified,
> so make the Linux driver accept them.
> 
> It appears that the current behavior with phy-mode = "internal" was
> introduced when mv88e6xxx started reporting supported_interfaces to
> phylink. Prior to that, I don't think it would have any issues accepting
> this phy-mode.
> 
> [...]

Here is the summary with links:
  - [net] net: dsa: mv88e6xxx: accept phy-mode = "internal" for internal PHY ports
    https://git.kernel.org/netdev/net/c/87a39882b5ab

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

end of thread, other threads:[~2022-12-07 15:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-05 19:48 [PATCH net] net: dsa: mv88e6xxx: accept phy-mode = "internal" for internal PHY ports Vladimir Oltean
2022-12-05 19:51 ` Florian Fainelli
2022-12-06 17:54 ` Tim Harvey
2022-12-07 15:20 ` 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).