netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] net: mdio: mux-meson-gxl: set reversed bit when using internal phy
@ 2025-04-25 19:20 Da Xue
  2025-04-28 18:12 ` Simon Horman
  2025-04-29 19:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 5+ messages in thread
From: Da Xue @ 2025-04-25 19:20 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl
  Cc: netdev, linux-arm-kernel, linux-amlogic, linux-kernel,
	Christian Hewitt, stable, Da Xue

This bit is necessary to receive packets from the internal PHY.
Without this bit set, no activity occurs on the interface.

Normally u-boot sets this bit, but if u-boot is compiled without
net support, the interface will be up but without any activity.

The vendor SDK sets this bit along with the PHY_ID bits.

Fixes: 9a24e1ff4326 ("net: mdio: add amlogic gxl mdio mux support");
Signed-off-by: Da Xue <da@libre.computer>
---
Changes since v2:
* Rename REG2_RESERVED_28 to REG2_REVERSED

Link to v2:
https://patchwork.kernel.org/project/linux-amlogic/patch/20250331074420.3443748-1-christianshewitt@gmail.com/
---
 drivers/net/mdio/mdio-mux-meson-gxl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mdio/mdio-mux-meson-gxl.c b/drivers/net/mdio/mdio-mux-meson-gxl.c
index 00c66240136b..3dd12a8c8b03 100644
--- a/drivers/net/mdio/mdio-mux-meson-gxl.c
+++ b/drivers/net/mdio/mdio-mux-meson-gxl.c
@@ -17,6 +17,7 @@
 #define  REG2_LEDACT		GENMASK(23, 22)
 #define  REG2_LEDLINK		GENMASK(25, 24)
 #define  REG2_DIV4SEL		BIT(27)
+#define  REG2_REVERSED		BIT(28)
 #define  REG2_ADCBYPASS		BIT(30)
 #define  REG2_CLKINSEL		BIT(31)
 #define ETH_REG3		0x4
@@ -65,7 +66,7 @@ static void gxl_enable_internal_mdio(struct gxl_mdio_mux *priv)
 	 * The only constraint is that it must match the one in
 	 * drivers/net/phy/meson-gxl.c to properly match the PHY.
 	 */
-	writel(FIELD_PREP(REG2_PHYID, EPHY_GXL_ID),
+	writel(REG2_REVERSED | FIELD_PREP(REG2_PHYID, EPHY_GXL_ID),
 	       priv->regs + ETH_REG2);
 
 	/* Enable the internal phy */
-- 
2.39.5


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

* Re: [PATCH v3] net: mdio: mux-meson-gxl: set reversed bit when using internal phy
  2025-04-25 19:20 [PATCH v3] net: mdio: mux-meson-gxl: set reversed bit when using internal phy Da Xue
@ 2025-04-28 18:12 ` Simon Horman
  2025-04-29  0:44   ` Da Xue
  2025-04-29 19:10 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 5+ messages in thread
From: Simon Horman @ 2025-04-28 18:12 UTC (permalink / raw)
  To: Da Xue
  Cc: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, netdev,
	linux-arm-kernel, linux-amlogic, linux-kernel, Christian Hewitt,
	stable

On Fri, Apr 25, 2025 at 03:20:09PM -0400, Da Xue wrote:
> This bit is necessary to receive packets from the internal PHY.
> Without this bit set, no activity occurs on the interface.
> 
> Normally u-boot sets this bit, but if u-boot is compiled without
> net support, the interface will be up but without any activity.
> 
> The vendor SDK sets this bit along with the PHY_ID bits.

I'd like to clarify that:
Without this patch the writel the patch is modifying will clear the PHY_ID bit.
But despite that the system works if at some point (uboot) set the PHY_ID bit?

> 
> Fixes: 9a24e1ff4326 ("net: mdio: add amlogic gxl mdio mux support");

I don't think you need to resend because of this,
but the correct syntax is as follows. (No trailing ';'.)

Fixes: 9a24e1ff4326 ("net: mdio: add amlogic gxl mdio mux support")

> Signed-off-by: Da Xue <da@libre.computer>
> ---
> Changes since v2:
> * Rename REG2_RESERVED_28 to REG2_REVERSED
> 
> Link to v2:
> https://patchwork.kernel.org/project/linux-amlogic/patch/20250331074420.3443748-1-christianshewitt@gmail.com/

...

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

* Re: [PATCH v3] net: mdio: mux-meson-gxl: set reversed bit when using internal phy
  2025-04-28 18:12 ` Simon Horman
@ 2025-04-29  0:44   ` Da Xue
  2025-04-29 19:02     ` Jakub Kicinski
  0 siblings, 1 reply; 5+ messages in thread
From: Da Xue @ 2025-04-29  0:44 UTC (permalink / raw)
  To: Simon Horman
  Cc: Da Xue, Andrew Lunn, Neil Armstrong, Martin Blumenstingl,
	Kevin Hilman, Russell King, stable, linux-kernel, Eric Dumazet,
	netdev, Jerome Brunet, Jakub Kicinski, linux-amlogic, Paolo Abeni,
	David S. Miller, linux-arm-kernel, Heiner Kallweit

On Mon, Apr 28, 2025 at 2:13 PM Simon Horman <horms@kernel.org> wrote:
>
> On Fri, Apr 25, 2025 at 03:20:09PM -0400, Da Xue wrote:
> > This bit is necessary to receive packets from the internal PHY.
> > Without this bit set, no activity occurs on the interface.
> >
> > Normally u-boot sets this bit, but if u-boot is compiled without
> > net support, the interface will be up but without any activity.
> >
> > The vendor SDK sets this bit along with the PHY_ID bits.
>
> I'd like to clarify that:
> Without this patch the writel the patch is modifying will clear the PHY_ID bit.
> But despite that the system works if at some point (uboot) set the PHY_ID bit?

Correct. If this is set once, it will work until the IP is powered
down or reset.
If u-boot does not set it, Linux will not set it and the IP will not work.
If u-boot does set it, the IP will not work after suspend-resume since
the IP is reset.
Thus, we need to set it on the Linux side when bringing up the interface.

>
> >
> > Fixes: 9a24e1ff4326 ("net: mdio: add amlogic gxl mdio mux support");
>
> I don't think you need to resend because of this,
> but the correct syntax is as follows. (No trailing ';'.)

Great and thanks! I just set up git send-email so I'm a little rough
around the edges.

>
> Fixes: 9a24e1ff4326 ("net: mdio: add amlogic gxl mdio mux support")
>
> > Signed-off-by: Da Xue <da@libre.computer>
> > ---
> > Changes since v2:
> > * Rename REG2_RESERVED_28 to REG2_REVERSED
> >
> > Link to v2:
> > https://patchwork.kernel.org/project/linux-amlogic/patch/20250331074420.3443748-1-christianshewitt@gmail.com/
>
> ...
>
> _______________________________________________
> linux-amlogic mailing list
> linux-amlogic@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH v3] net: mdio: mux-meson-gxl: set reversed bit when using internal phy
  2025-04-29  0:44   ` Da Xue
@ 2025-04-29 19:02     ` Jakub Kicinski
  0 siblings, 0 replies; 5+ messages in thread
From: Jakub Kicinski @ 2025-04-29 19:02 UTC (permalink / raw)
  To: Da Xue
  Cc: Simon Horman, Da Xue, Andrew Lunn, Neil Armstrong,
	Martin Blumenstingl, Kevin Hilman, Russell King, stable,
	linux-kernel, Eric Dumazet, netdev, Jerome Brunet, linux-amlogic,
	Paolo Abeni, David S. Miller, linux-arm-kernel, Heiner Kallweit

On Mon, 28 Apr 2025 20:44:14 -0400 Da Xue wrote:
> > On Fri, Apr 25, 2025 at 03:20:09PM -0400, Da Xue wrote:  
> > > This bit is necessary to receive packets from the internal PHY.
> > > Without this bit set, no activity occurs on the interface.
> > >
> > > Normally u-boot sets this bit, but if u-boot is compiled without
> > > net support, the interface will be up but without any activity.
> > >
> > > The vendor SDK sets this bit along with the PHY_ID bits.  
> >
> > I'd like to clarify that:
> > Without this patch the writel the patch is modifying will clear the PHY_ID bit.
> > But despite that the system works if at some point (uboot) set the PHY_ID bit?  
> 
> Correct. If this is set once, it will work until the IP is powered
> down or reset.
> If u-boot does not set it, Linux will not set it and the IP will not work.
> If u-boot does set it, the IP will not work after suspend-resume since
> the IP is reset.
> Thus, we need to set it on the Linux side when bringing up the interface.

Added to the commit message when applying, thank you both!

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

* Re: [PATCH v3] net: mdio: mux-meson-gxl: set reversed bit when using internal phy
  2025-04-25 19:20 [PATCH v3] net: mdio: mux-meson-gxl: set reversed bit when using internal phy Da Xue
  2025-04-28 18:12 ` Simon Horman
@ 2025-04-29 19:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-04-29 19:10 UTC (permalink / raw)
  To: Da Xue
  Cc: andrew, hkallweit1, linux, davem, edumazet, kuba, pabeni,
	neil.armstrong, khilman, jbrunet, martin.blumenstingl, netdev,
	linux-arm-kernel, linux-amlogic, linux-kernel, christianshewitt,
	stable

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 25 Apr 2025 15:20:09 -0400 you wrote:
> This bit is necessary to receive packets from the internal PHY.
> Without this bit set, no activity occurs on the interface.
> 
> Normally u-boot sets this bit, but if u-boot is compiled without
> net support, the interface will be up but without any activity.
> 
> The vendor SDK sets this bit along with the PHY_ID bits.
> 
> [...]

Here is the summary with links:
  - [v3] net: mdio: mux-meson-gxl: set reversed bit when using internal phy
    https://git.kernel.org/netdev/net/c/b23285e93bef

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] 5+ messages in thread

end of thread, other threads:[~2025-04-29 19:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-25 19:20 [PATCH v3] net: mdio: mux-meson-gxl: set reversed bit when using internal phy Da Xue
2025-04-28 18:12 ` Simon Horman
2025-04-29  0:44   ` Da Xue
2025-04-29 19:02     ` Jakub Kicinski
2025-04-29 19:10 ` 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).