Skip to content

odroidhc4: let the ethernet PHY wake the board - #10741

Merged
igorpecovnik merged 1 commit into
armbian:mainfrom
iav:fix/odroidhc4-phy-wakeup
Sep 17, 2026
Merged

igorpecovnik merged 1 commit into
armbian:mainfrom
iav:fix/odroidhc4-phy-wakeup

Conversation

@iav

@iav iav commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Description

The RTL8211F on ODROID-HC4 has its interrupt wired to GPIOZ_14 and the device
tree already describes it, but the node does not declare that it can wake the
board. The Realtek PHY driver registers the interrupt as a wakeup IRQ only for
nodes that say so:

if (device_property_read_bool(dev, "wakeup-source") &&
    phy_interrupt_is_valid(phydev)) {
        device_set_wakeup_capable(dev, true);
        devm_pm_set_wake_irq(dev, phydev->irq);
}

Without the property Wake-on-LAN looks enabled and does nothing: ethtool -s end0 wol g succeeds, the PHY stores the magic packet and raises PME on its
interrupt line, but that interrupt is not a wakeup source, so it is masked
entering suspend and the board sleeps through the packet.

Added to meson64-6.18, -7.2 and -7.3. Not to 6.12: that kernel's Realtek driver
has no wakeup-source handling at all — no devm_pm_set_wake_irq() call — so
the property would sit in the device tree doing nothing.

Dependencies — please do not merge before these

This patch is inert on its own, and worse than inert if merged alone: userspace
will report Wake-on-LAN as enabled while the board still cannot be woken.

How Has This Been Tested?

Tested on ODROID-HC4, kernel 7.2.6, with both prerequisites applied.

  • Before the change: a magic packet leaves the board asleep, both to the
    broadcast address and to the subnet broadcast; only the RTC alarm brings
    it back (pm_wakeup_irq reports the RTC interrupt), and the network
    device reports wakeup_count 0. The PHY has no power/wakeup in sysfs
    at all.
  • After the change: the PHY gains power/wakeup, ethtool -s end0 wol g
    gives Wake-on: g, the PHY moves to wakeup=enabled by itself, and the
    same magic packet wakes the board within seconds.
  • Verified first as a device tree overlay on the running board, then as
    this patch.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: fe71f27e-aa7c-4b5b-9b8b-74cff6a6ef42

📥 Commits

Reviewing files that changed from the base of the PR and between 901cae7 and 9642388.

📒 Files selected for processing (4)
  • patch/kernel/archive/meson64-6.12/board-odroidhc4-phy-wakeup-source.patch
  • patch/kernel/archive/meson64-6.18/board-odroidhc4-phy-wakeup-source.patch
  • patch/kernel/archive/meson64-7.2/board-odroidhc4-phy-wakeup-source.patch
  • patch/kernel/archive/meson64-7.3/board-odroidhc4-phy-wakeup-source.patch

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The patches add wakeup-source to the ODROID-HC4 RTL8211F Ethernet PHY device-tree node for four meson64 kernel versions. The GPIOZ_14 interrupt can then act as a wakeup source for Wake-on-LAN during suspend.

Changes

ODROID-HC4 Wake-on-LAN support

Layer / File(s) Summary
PHY wakeup declaration
patch/kernel/archive/meson64-6.12/board-odroidhc4-phy-wakeup-source.patch, patch/kernel/archive/meson64-6.18/board-odroidhc4-phy-wakeup-source.patch, patch/kernel/archive/meson64-7.2/board-odroidhc4-phy-wakeup-source.patch, patch/kernel/archive/meson64-7.3/board-odroidhc4-phy-wakeup-source.patch
Each device-tree patch adds wakeup-source to the ODROID-HC4 Ethernet PHY node. The GPIOZ_14 interrupt can wake the board from suspend for Wake-on-LAN.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 96423

The change consistently enables the Ethernet PHY wakeup declaration across supported kernel versions, with no identified merge-blocking risk.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: enabling the ODROID-HC4 Ethernet PHY to wake the board.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added size/medium PR with more then 50 and less then 250 lines 11 Milestone: Fourth quarter release Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels Sep 17, 2026
The RTL8211F on HC4 has its interrupt wired to GPIOZ_14 and the device
tree already describes it, but the node does not declare that it can wake
the board. The Realtek PHY driver registers the interrupt as a wakeup IRQ
only for nodes that say so:

	if (device_property_read_bool(dev, "wakeup-source") &&
	    phy_interrupt_is_valid(phydev)) {
		device_set_wakeup_capable(dev, true);
		devm_pm_set_wake_irq(dev, phydev->irq);
	}

Without the property Wake-on-LAN looks enabled and does nothing:
'ethtool -s end0 wol g' succeeds, the PHY stores the magic packet and
raises PME on its interrupt line, but that interrupt is not a wakeup
source, so it is masked entering suspend and the board sleeps through the
packet.

Measured on ODROID-HC4. Before: a magic packet left the board asleep, the
RTC alarm had to bring it back, and the network device reported
wakeup_count 0. After: the same packet wakes the board within seconds.

Added to 6.18, 7.2 and 7.3 only. The 6.12 Realtek driver has no
wakeup-source handling at all, so the property would be inert there.

Depends on the GPIO interrupt controller being able to hold a wakeup
state: the PHY interrupt arrives through meson_gpio_irq_chip, so without
IRQCHIP_SKIP_SET_WAKE (armbian#10738) this property is worse than
useless — everything reports Wake-on-LAN as enabled while the board still
cannot be woken. And on HC4 a woken board also needs PCIe suspend/resume
support (armbian#10740) to find its SATA controller afterwards.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

✅ This PR has been reviewed and approved — all set for merge!

@github-actions github-actions Bot added Ready to merge Reviewed, tested and ready for merge and removed Needs review Seeking for review labels Sep 17, 2026
@igorpecovnik
igorpecovnik merged commit 3c3ad03 into armbian:main Sep 17, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

11 Milestone: Fourth quarter release Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... Ready to merge Reviewed, tested and ready for merge size/medium PR with more then 50 and less then 250 lines

Development

Successfully merging this pull request may close these issues.

3 participants