diff mbox series

[net,v1,1/1] lan78xx: enable auto speed configuration for LAN7850 if no EEPROM is detected

Message ID 20240222123839.2816561-1-o.rempel@pengutronix.de (mailing list archive)
State Accepted
Commit 0e67899abfbfdea0c3c0ed3fd263ffc601c5c157
Delegated to: Netdev Maintainers
Headers show
Series [net,v1,1/1] lan78xx: enable auto speed configuration for LAN7850 if no EEPROM is detected | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 958 this patch: 958
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 1 maintainers not CCed: linux-usb@vger.kernel.org
netdev/build_clang success Errors and warnings before: 973 this patch: 973
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 Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 975 this patch: 975
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 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-02-23--03-00 (tests: 1457)

Commit Message

Oleksij Rempel Feb. 22, 2024, 12:38 p.m. UTC
Same as LAN7800, LAN7850 can be used without EEPROM. If EEPROM is not
present or not flashed, LAN7850 will fail to sync the speed detected by the PHY
with the MAC. In case link speed is 100Mbit, it will accidentally work,
otherwise no data can be transferred.

Better way would be to implement link_up callback, or set auto speed
configuration unconditionally. But this changes would be more intrusive.
So, for now, set it only if no EEPROM is found.

Fixes: e69647a19c87 ("lan78xx: Set ASD in MAC_CR when EEE is enabled.")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 drivers/net/usb/lan78xx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

patchwork-bot+netdevbpf@kernel.org Feb. 27, 2024, 3:10 a.m. UTC | #1
Hello:

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

On Thu, 22 Feb 2024 13:38:38 +0100 you wrote:
> Same as LAN7800, LAN7850 can be used without EEPROM. If EEPROM is not
> present or not flashed, LAN7850 will fail to sync the speed detected by the PHY
> with the MAC. In case link speed is 100Mbit, it will accidentally work,
> otherwise no data can be transferred.
> 
> Better way would be to implement link_up callback, or set auto speed
> configuration unconditionally. But this changes would be more intrusive.
> So, for now, set it only if no EEPROM is found.
> 
> [...]

Here is the summary with links:
  - [net,v1,1/1] lan78xx: enable auto speed configuration for LAN7850 if no EEPROM is detected
    https://git.kernel.org/netdev/net/c/0e67899abfbf

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
index 106282612bc2..7d7e185d7fae 100644
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -3033,7 +3033,8 @@  static int lan78xx_reset(struct lan78xx_net *dev)
 	if (dev->chipid == ID_REV_CHIP_ID_7801_)
 		buf &= ~MAC_CR_GMII_EN_;
 
-	if (dev->chipid == ID_REV_CHIP_ID_7800_) {
+	if (dev->chipid == ID_REV_CHIP_ID_7800_ ||
+	    dev->chipid == ID_REV_CHIP_ID_7850_) {
 		ret = lan78xx_read_raw_eeprom(dev, 0, 1, &sig);
 		if (!ret && sig != EEPROM_INDICATOR) {
 			/* Implies there is no external eeprom. Set mac speed */