odroidhc4: let the ethernet PHY wake the board - #10741
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe patches add ChangesODROID-HC4 Wake-on-LAN support
Priority: ➖ Normal Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to 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)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
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>
9642388 to
6e93405
Compare
|
✅ This PR has been reviewed and approved — all set for merge! |
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:
Without the property Wake-on-LAN looks enabled and does nothing:
ethtool -s end0 wol gsucceeds, the PHY stores the magic packet and raises PME on itsinterrupt 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-sourcehandling at all — nodevm_pm_set_wake_irq()call — sothe 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.
IRQCHIP_SKIP_SET_WAKEfor the Amlogic GPIOinterrupt controller. The PHY interrupt arrives through
meson_gpio_irq_chip; without the flagenable_irq_wake()fails with-ENXIO and the interrupt is masked entering suspend. Required.
pci-meson.c(draft).Not required for the wake itself, but on HC4 the SATA controller sits
behind PCIe: without it the board wakes up into a hung PCIe controller,
which on a NAS is worse than not waking at all.
How Has This Been Tested?
Tested on ODROID-HC4, kernel 7.2.6, with both prerequisites applied.
broadcast address and to the subnet broadcast; only the RTC alarm brings
it back (
pm_wakeup_irqreports the RTC interrupt), and the networkdevice reports
wakeup_count 0. The PHY has nopower/wakeupin sysfsat all.
power/wakeup,ethtool -s end0 wol ggives
Wake-on: g, the PHY moves towakeup=enabledby itself, and thesame magic packet wakes the board within seconds.
this patch.
Checklist: