Skip to content

ramips: mt7620: build Realtek PHY driver into kernel - #22496

Open
DragonBluep wants to merge 2 commits into
openwrt:mainfrom
DragonBluep:mt7620-rtk-phy
Open

DragonBluep wants to merge 2 commits into
openwrt:mainfrom
DragonBluep:mt7620-rtk-phy

Conversation

@DragonBluep

Copy link
Copy Markdown
Contributor

No description provided.

The MT7620 ethernet driver attempts to connect the PHY before kmods
are loaded. Hence the kmod PHY driver package can not work on this
sub-target. Build the PHY driver into the kernel to fix the Realtek
PHY probe issue.

Signed-off-by: Shiji Yang <[email protected]>
The Realtek driver has been built into the kernel.

Signed-off-by: Shiji Yang <[email protected]>
@github-actions github-actions Bot added kernel pull request/issue with Linux kernel related changes target/ramips pull request/issue for ramips target labels Mar 19, 2026
@namiltd

namiltd commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

What about the fact that not all MT7620 routers needed kmod-phy-realtek? After this change, all will include it. Isn't this an unnecessary use of flash memory?

@DragonBluep

Copy link
Copy Markdown
Contributor Author

What about the fact that not all MT7620 routers needed kmod-phy-realtek? After this change, all will include it. Isn't this an unnecessary use of flash memory?

But without this change, the realtek phy doesn't work correctly.

@namiltd

namiltd commented Mar 19, 2026 •

Copy link
Copy Markdown
Contributor

Maybe -kmod-phy-realtek for those routers that don't need it?

@DragonBluep

Copy link
Copy Markdown
Contributor Author

Maybe -kmod-phy-realtek for those routers that don't need it?

The dilemma here is that Ethernet driver expect to attach phy earlier.

The MT7620 ethernet driver attempts to connect the PHY before kmods
are loaded. Hence the kmod PHY driver package can not work on this
sub-target. Build the PHY driver into the kernel to fix the Realtek
PHY probe issue.

@namiltd

namiltd commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

What about CONFIG_REALTEK_PHY_HWMON ?

@DragonBluep

Copy link
Copy Markdown
Contributor Author

What about CONFIG_REALTEK_PHY_HWMON ?

It's useless on this target. I remember the legacy Giga PHY doesn't support temperature report.

@namiltd

namiltd commented Mar 21, 2026 •

Copy link
Copy Markdown
Contributor

After this operation, initramfs-kernel.bin grows 3KBytes. It's not much, but devices with MT7620 usually have little free memory.

@bevanweiss

Copy link
Copy Markdown
Contributor

Maybe -kmod-phy-realtek for those routers that don't need it?

The dilemma here is that Ethernet driver expect to attach phy earlier.

Is kmod-phy-realtek already configured as a boot module (or is it just a normal, post-console module)?
Ideally I think the DSA / switch drivers should be able to defer the attachment work until the PHY driver is available (and PHY drivers should be configured as boot modules).
I've had some issues with recent testing around the PoE (PSE) driver situation, because the PSE driver becomes a dependency for the PHY driver, and we really want the PSE drivers to be modules (/packages) since there could be very many of them, and we don't want to add that burden to every board.

@hauke

hauke commented Apr 5, 2026

Copy link
Copy Markdown
Member

Is the generic PHY driver used instead of the Realtek PHY driver when it is not compiled into the kernel? If so please mention this in the commit message.

What problems do people have with this being compiled as a module?

The driver itself is pretty small and has more or less no extra dependencies:

config REALTEK_PHY
	tristate "Realtek PHYs"
	help
	  Supports the Realtek 821x PHY.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kernel pull request/issue with Linux kernel related changes target/ramips pull request/issue for ramips target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants