Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: patches@lists.linux.dev, stable@vger.kernel.org
Cc: "Buday Csaba" <buday.csaba@prolan.hu>,
	"Csókás Bence" <csokas.bence@prolan.hu>,
	"Andrew Lunn" <andrew@lunn.ch>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Sasha Levin" <sashal@kernel.org>,
	hkallweit1@gmail.com, netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 6.16-5.4] net: phy: smsc: add proper reset flags for LAN8710A
Date: Sun, 10 Aug 2025 12:51:51 -0400	[thread overview]
Message-ID: <20250810165158.1888206-9-sashal@kernel.org> (raw)
In-Reply-To: <20250810165158.1888206-1-sashal@kernel.org>

From: Buday Csaba <buday.csaba@prolan.hu>

[ Upstream commit 57ec5a8735dc5dccd1ee68afdb1114956a3fce0d ]

According to the LAN8710A datasheet (Rev. B, section 3.8.5.1), a hardware
reset is required after power-on, and the reference clock (REF_CLK) must be
established before asserting reset.

Signed-off-by: Buday Csaba <buday.csaba@prolan.hu>
Cc: Csókás Bence <csokas.bence@prolan.hu>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20250728152916.46249-2-csokas.bence@prolan.hu
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

LLM Generated explanations, may be completely bogus:

**YES**

This commit should be backported to stable kernel trees for the
following reasons:

1. **Hardware Requirement Fix**: The commit addresses a documented
   hardware requirement from the LAN8710A datasheet (section 3.8.5.1)
   that specifies a hardware reset is required after power-on with the
   reference clock established before asserting reset. This is fixing
   incorrect hardware initialization that could lead to device
   malfunction.

2. **Regression Fix**: Looking at the git history, the
   `PHY_RST_AFTER_CLK_EN` flag was:
   - Originally added in commit 7f64e5b18ebb (2017) for LAN8710/20 based
     on datasheet requirements
   - Removed in commit d65af21842f8 (2020) when refclk support was
     added, with the assumption that the refclk mechanism would handle
     the reset
   - Still present for LAN8740 (added in commit 76db2d466f6a in 2019)

   The removal in 2020 appears to have been premature, as it relied on
optional clock provider support that may not be configured in all
systems. This commit re-adds the flag specifically for LAN8710A,
restoring proper hardware initialization.

3. **Minimal and Contained Change**: The fix is a single-line addition
   of the `PHY_RST_AFTER_CLK_EN` flag to the driver structure for the
   LAN8710/LAN8720 PHY entry. This flag is already used by other PHYs in
   the same driver (LAN8740) and has well-established kernel
   infrastructure to handle it properly through
   `phy_reset_after_clk_enable()`.

4. **Bug Fix Nature**: This fixes a real hardware initialization issue
   that could cause the PHY to not work properly if the reference clock
   timing requirements aren't met. Systems without proper clock provider
   configuration would experience PHY initialization failures.

5. **Low Risk**: The change only affects the specific PHY model
   (LAN8710/LAN8720) and uses an existing, well-tested mechanism
   (`PHY_RST_AFTER_CLK_EN` flag). The flag is already successfully used
   by LAN8740 in the same driver, demonstrating its safety and
   effectiveness.

6. **Clear Problem Statement**: The commit message clearly documents the
   hardware requirement from the datasheet, making it evident this is
   fixing a specification compliance issue rather than adding a new
   feature.

The commit meets stable kernel criteria as it fixes a hardware
initialization bug with minimal risk and a very contained change scope.

 drivers/net/phy/smsc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c
index b6489da5cfcd..48487149c225 100644
--- a/drivers/net/phy/smsc.c
+++ b/drivers/net/phy/smsc.c
@@ -785,6 +785,7 @@ static struct phy_driver smsc_phy_driver[] = {
 
 	/* PHY_BASIC_FEATURES */
 
+	.flags		= PHY_RST_AFTER_CLK_EN,
 	.probe		= smsc_phy_probe,
 
 	/* basic functions */
-- 
2.39.5


  parent reply	other threads:[~2025-08-10 16:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-10 16:51 [PATCH AUTOSEL 6.16-5.10] block: avoid possible overflow for chunk_sectors check in blk_stack_limits() Sasha Levin
2025-08-10 16:51 ` [PATCH AUTOSEL 6.16-6.12] tools/power turbostat: Handle non-root legacy-uncore sysfs permissions Sasha Levin
2025-08-10 16:51 ` [PATCH AUTOSEL 6.16-6.12] ALSA: hda/realtek: add LG gram 16Z90R-A to alc269 fixup table Sasha Levin
2025-08-10 16:51 ` [PATCH AUTOSEL 6.16-6.12] lib/sbitmap: convert shallow_depth from one word to the whole sbitmap Sasha Levin
2025-08-10 16:51 ` [PATCH AUTOSEL 6.16-6.1] ASoC: Intel: avs: Fix uninitialized pointer error in probe() Sasha Levin
2025-08-10 16:51 ` [PATCH AUTOSEL 6.16-6.12] smb: client: don't call init_waitqueue_head(&info->conn_wait) twice in _smbd_get_connection Sasha Levin
2025-08-10 16:51 ` [PATCH AUTOSEL 6.16-5.4] pNFS: Fix stripe mapping in block/scsi layout Sasha Levin
2025-08-10 16:51 ` [PATCH AUTOSEL 6.16-5.4] pNFS: Fix uninited ptr deref " Sasha Levin
2025-08-10 16:51 ` Sasha Levin [this message]
2025-08-10 16:51 ` [PATCH AUTOSEL 6.16-6.15] ASoC: Intel: sof_sdw: Add quirk for Alienware Area 51 (2025) 0CCC SKU Sasha Levin
2025-08-10 16:51 ` [PATCH AUTOSEL 6.16] regmap: irq: Free the regmap-irq mutex Sasha Levin
2025-08-10 16:51 ` [PATCH AUTOSEL 6.16-6.12] tools/power turbostat: Fix build with musl Sasha Levin
2025-08-10 16:51 ` [PATCH AUTOSEL 6.16] irqchip/mvebu-gicp: Clear pending interrupts on init Sasha Levin
2025-08-10 16:51 ` [PATCH AUTOSEL 6.16-5.4] pNFS: Fix disk addr range check in block/scsi layout Sasha Levin
2025-08-10 16:51 ` [PATCH AUTOSEL 6.16-6.12] tools/power turbostat: Handle cap_get_proc() ENOSYS Sasha Levin
2025-08-10 16:51 ` [PATCH AUTOSEL 6.16-5.4] pNFS: Handle RPC size limit for layoutcommits Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250810165158.1888206-9-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=buday.csaba@prolan.hu \
    --cc=csokas.bence@prolan.hu \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox