diff mbox series

net: phy: ti: add PHY_RST_AFTER_CLK_EN flag

Message ID 20241102151504.811306-1-paissilva@ld-100007.ds1.internal (mailing list archive)
State Accepted
Commit 256748d5480bb3c4b731236c6d6fc86a8e2815d8
Delegated to: Netdev Maintainers
Headers show
Series net: phy: ti: add PHY_RST_AFTER_CLK_EN flag | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 3 this patch: 3
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 3 this patch: 3
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 4 this patch: 4
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-11-03--21-00 (tests: 781)

Commit Message

Diogo Silva Nov. 2, 2024, 3:15 p.m. UTC
From: Diogo Silva <diogompaissilva@gmail.com>

DP83848	datasheet (section 4.7.2) indicates that the reset pin should be
toggled after the clocks are running. Add the PHY_RST_AFTER_CLK_EN to
make sure that this indication is respected.

In my experience not having this flag enabled would lead to, on some
boots, the wrong MII mode being selected if the PHY was initialized on
the bootloader and was receiving data during Linux boot.

Signed-off-by: Diogo Silva <diogompaissilva@gmail.com>
---
 drivers/net/phy/dp83848.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Andrew Lunn Nov. 2, 2024, 5:03 p.m. UTC | #1
On Sat, Nov 02, 2024 at 04:15:05PM +0100, Diogo Silva wrote:
> From: Diogo Silva <diogompaissilva@gmail.com>
> 
> DP83848	datasheet (section 4.7.2) indicates that the reset pin should be
> toggled after the clocks are running. Add the PHY_RST_AFTER_CLK_EN to
> make sure that this indication is respected.

Do you have the datasheets for the other three devices this driver
supports? Do they all require this flag?

	Andrew
Diogo Silva Nov. 3, 2024, 10:24 a.m. UTC | #2
Hi Andrew,

I assume "TI DP83848C" and "NS DP83848C" are the same device, just
rebranded after Texas Instruments acquired National Semiconductors.
For both TLK10X and DP83620, both their datasheets have the same power
up timing sequence as the DP83848C (as far as clock and reset goes)
[1][2].

Best regards,
Diogo Silva

[1] https://www.ti.com/lit/ds/symlink/tlk105.pdf (section 9.10.1 -
Power Up Timing)
[2] https://www.ti.com/lit/ds/symlink/dp83620.pdf (section 4.5 - Power
Up Timing)

On Sat, 2 Nov 2024 at 18:03, Andrew Lunn <andrew@lunn.ch> wrote:
>
> On Sat, Nov 02, 2024 at 04:15:05PM +0100, Diogo Silva wrote:
> > From: Diogo Silva <diogompaissilva@gmail.com>
> >
> > DP83848       datasheet (section 4.7.2) indicates that the reset pin should be
> > toggled after the clocks are running. Add the PHY_RST_AFTER_CLK_EN to
> > make sure that this indication is respected.
>
> Do you have the datasheets for the other three devices this driver
> supports? Do they all require this flag?
>
>         Andrew
Andrew Lunn Nov. 3, 2024, 3:20 p.m. UTC | #3
On Sat, Nov 02, 2024 at 04:15:05PM +0100, Diogo Silva wrote:
> From: Diogo Silva <diogompaissilva@gmail.com>
> 
> DP83848	datasheet (section 4.7.2) indicates that the reset pin should be
> toggled after the clocks are running. Add the PHY_RST_AFTER_CLK_EN to
> make sure that this indication is respected.
> 
> In my experience not having this flag enabled would lead to, on some
> boots, the wrong MII mode being selected if the PHY was initialized on
> the bootloader and was receiving data during Linux boot.
> 
> Signed-off-by: Diogo Silva <diogompaissilva@gmail.com>

This should be merged to net.

Fixes: 34e45ad9378c ("net: phy: dp83848: Add TI DP83848 Ethernet PHY")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
patchwork-bot+netdevbpf@kernel.org Nov. 6, 2024, 1:50 a.m. UTC | #4
Hello:

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

On Sat,  2 Nov 2024 16:15:05 +0100 you wrote:
> From: Diogo Silva <diogompaissilva@gmail.com>
> 
> DP83848	datasheet (section 4.7.2) indicates that the reset pin should be
> toggled after the clocks are running. Add the PHY_RST_AFTER_CLK_EN to
> make sure that this indication is respected.
> 
> In my experience not having this flag enabled would lead to, on some
> boots, the wrong MII mode being selected if the PHY was initialized on
> the bootloader and was receiving data during Linux boot.
> 
> [...]

Here is the summary with links:
  - net: phy: ti: add PHY_RST_AFTER_CLK_EN flag
    https://git.kernel.org/netdev/net/c/256748d5480b

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/phy/dp83848.c b/drivers/net/phy/dp83848.c
index 937061acfc61..351411f0aa6f 100644
--- a/drivers/net/phy/dp83848.c
+++ b/drivers/net/phy/dp83848.c
@@ -147,6 +147,8 @@  MODULE_DEVICE_TABLE(mdio, dp83848_tbl);
 		/* IRQ related */				\
 		.config_intr	= dp83848_config_intr,		\
 		.handle_interrupt = dp83848_handle_interrupt,	\
+								\
+		.flags		= PHY_RST_AFTER_CLK_EN,		\
 	}
 
 static struct phy_driver dp83848_driver[] = {