Welcome to Toradex Community.
Is this a custom Linux image or a default toradex image? Please note wake-on-lan is not enabled in our default Linux image. Enable the fsl,magic-packet flag in Device-tree and update the same in Linux BSP.
This issue can be reproduced with the stock Linux Reference Minimal Image.
However, please note that this issue is not about wake-on-lan. We are setting the alarm on the real-time clock to wake up the module from suspend. Regardless of the status of the Ethernet interface, it should work.
In fact, this issue does not occur with BSP 5.3.0 or earlier. It seems that something was changed from 5.4.0 onward and since then this issue has carried on to all the later versions.
Yes , we are also able to see the issue.
It happens only in case we do it down manually (ifconfig eth0 down).
Suspend mode deactivates the ethernet as well, and get resumed after wakeup, so why do you want it do it manually?
Also, in case if LAN is disconnected from the network, then also it is able to wakeup.
Any specific need to do that?
Our application automatically turns the Ethernet interface down whenever it is not required, so as to reduce battery consumption as much as possible. That is, the decision to turn the Ethernet interface down is taken by the application independently of when to enter the suspend state.
Since you have confirmed the reproducibility of the issue, please forward this bug to the maintainers so that it may be fixed in the next patch release of 5.7.
Sorry for my delayed response but I was down with fever after Embedded World.
Anyway, I just tested this on stock reference BSP6.1 (6.0.17-6.1.0+git.71e1e02850ab) and…it has not been “fixed”, but rather something more twisted is now happening. The system seemingly goes to sleep only for a fraction of a second before waking up, regardless of the value that is written to wakealarm.
The systemd-journald logs look like this when I attempt to run the same script as in my original post in this thread:
Mar 22 09:01:39 systemd-networkd[406]: eth0: Link DOWN
Mar 22 09:01:39 systemd-journald[114]: Forwarding to syslog missed 1 messages.
Mar 22 09:01:39 systemd-networkd[406]: eth0: Lost carrier
Mar 22 09:01:39 kernel: PM: suspend entry (deep)
Mar 22 09:01:39 kernel[193]: [ 1432.658733] PM: suspend entry (deep)
Mar 22 09:01:39 kernel: Filesystems sync: 0.069 seconds
Mar 22 09:01:39 kernel[193]: [ 1432.735638] Filesystems sync: 0.069 seconds
Mar 22 09:01:40 kernel: Freezing user space processes ... (elapsed 0.003 seconds) done.
Mar 22 09:01:40 kernel: OOM killer disabled.
Mar 22 09:01:40 kernel: Freezing remaining freezable tasks ... (elapsed 0.005 seconds) done.
Mar 22 09:01:40 kernel: printk: Suspending console(s) (use no_console_suspend to debug)
Mar 22 09:01:40 kernel: PM: suspend devices took 0.090 seconds
Mar 22 09:01:40 kernel: Disabling non-boot CPUs ...
Mar 22 09:01:40 kernel: usb-conn-gpio connector: repeated role: device
Mar 22 09:01:40 kernel: PM: resume devices took 0.360 seconds
Mar 22 09:01:40 kernel: OOM killer enabled.
Mar 22 09:01:40 kernel: Restarting tasks ... done.
Mar 22 09:01:40 kernel: random: crng reseeded on system resumption
Mar 22 09:01:40 kernel[193]: [ 1432.762748] Freezing user space processes ... (elapsed 0.003 seconds) done.
Mar 22 09:01:40 kernel[193]: [ 1432.777458] OOM killer disabled.
Mar 22 09:01:40 kernel[193]: [ 1432.784474] Freezing remaining freezable tasks ... (elapsed 0.005 seconds) done.
Mar 22 09:01:40 kernel[193]: [ 1432.804591] printk: Suspending console(s) (use no_console_suspend to debug)
Mar 22 09:01:40 kernel[193]: [ 1432.903777] PM: suspend devices took 0.090 seconds
Mar 22 09:01:40 kernel[193]: [ 1432.946161] Disabling non-boot CPUs ...
Mar 22 09:01:40 kernel[193]: [ 1433.192672] usb-conn-gpio connector: repeated role: device
Mar 22 09:01:40 kernel[193]: [ 1433.330345] PM: resume devices took 0.360 seconds
Mar 22 09:01:40 kernel[193]: [ 1433.364001] OOM killer enabled.
Mar 22 09:01:40 kernel[193]: [ 1433.370641] Restarting tasks ... done.
Mar 22 09:01:40 kernel: PM: suspend exit
Mar 22 09:01:40 systemd-networkd[406]: usb0: Lost carrier
Mar 22 09:01:40 kernel[193]: [ 1433.404073] random: crng reseeded on system resumption
Mar 22 09:01:40 systemd-networkd[406]: usb0: DHCPv6 lease lost
Mar 22 09:01:40 kernel[193]: [ 1433.438631] PM: suspend exit
Mar 22 09:01:40 systemd-timesyncd[136]: No network connectivity, watching for changes.
Mar 22 09:01:40 systemd-networkd[406]: usb0: Gained carrier
Mar 22 09:01:40 systemd-timesyncd[136]: Network configuration changed, trying to establish connection.
Please tell me if I am doing something wrong or you can also see the same behavior.