[问题描述]: rtcwake在arm上执行报错 [root@iZbp10tndzn2fahsrwa0gnZ ~]# rtcwake -m show -v Using UTC time. rtcwake: cannot open /sys/class/rtc/rtc0/device/power/wakeup: No such file or directory rtcwake: /dev/rtc0 not enabled for wakeup events [root@iZbp10tndzn2fahsrwa0gnZ ~]# rtcwake -m mem -s 5 rtcwake: cannot open /sys/class/rtc/rtc0/device/power/wakeup: No such file or directory rtcwake: /dev/rtc0 not enabled for wakeup events [root@iZbp10tndzn2fahsrwa0gnZ ~]# 在x86上执行 rtcwake -m mem -s 5,会导致机器挂起一段时间,时间不确定 [环境信息]: 内核信息: # uname -r 5.10.134-12.1.an23.aarch64 操作系统信息: # cat /etc/os-release [root@VM20210305-13 tone]# cat /etc/os-release NAME="Anolis OS" VERSION="23" ID="anolis" VERSION_ID="23" PLATFORM_ID="platform:an23" PRETTY_NAME="Anolis OS 23" ANSI_COLOR="0;31" HOME_URL="https://openanolis.cn/" BUG_REPORT_URL="https://bugzilla.openanolis.cn/" 软件包信息: [root@iZbp10tndzn2fahsrwa0gnZ ~]# yum provides rtcwake Failed to set locale, defaulting to C.UTF-8 Last metadata expiration check: 2:50:56 ago on Thu Oct 27 11:28:13 2022. util-linux-2.38~rc4-2.an23.aarch64 : Collection of basic system utilities Repo : @System Matched from: Filename : /usr/sbin/rtcwake util-linux-2.38~rc4-2.an23.aarch64 : Collection of basic system utilities Repo : BaseOS Matched from: Filename : /usr/sbin/rtcwake [问题发生概率]:必现 [复现步骤]: rtcwake -m mem -s 5
*** Bug 2112 has been marked as a duplicate of this bug. ***
经过查看发现,rtcwake 只能在 COMS 使能的情况下让机器处于睡眠状态然后等待被唤醒。 x86 的内核默认使能了CONFIG_RTC_DRV_CMOS=yes,所以支持使用该命令,而 arm 的内核默认使能的是CONFIG_RTC_DRV_EFI=y,这种模式不支持系统进入睡眠模式,所以执行失败为正常现象。 (1)x86 使能状态查询 [root@iZbp1fdgq19z7ze3tnm0vbZ rtc_cmos]# cat /boot/config-5.10.134-12.1.an23.x86_64 | grep CONFIG_RTC_DRV_CMOS CONFIG_RTC_DRV_CMOS=y [root@iZbp1fdgq19z7ze3tnm0vbZ rtc_cmos]# rtcwake -m show -v Using UTC time. delta = -28799 tzone = 0 tzname = UTC systime = 1667446011, (UTC) Thu Nov 3 03:26:51 2022 rtctime = 1667474810, (UTC) Thu Nov 3 11:26:50 2022 alarm 0, sys_time 1667446011, rtc_time 1667474810, seconds 0 suspend mode: show; printing alarm info alarm: off (2)arm 里使能状态查询 [root@iZbp1hja6glxg5e8ntui69Z devices]# cat /boot/config-5.10.134-12.1.an23.aarch64 | grep CONFIG_RTC_DRV_EFI=y CONFIG_RTC_DRV_EFI=y [root@iZbp1hja6glxg5e8ntui69Z devices]# cat /boot/config-5.10.134-12.1.an23.aarch64 | grep CONFIG_RTC_DRV_CMOS [root@iZbp1hja6glxg5e8ntui69Z devices]# rtcwake -m show -v Using UTC time. rtcwake: cannot open /sys/class/rtc/rtc0/device/power/wakeup: No such file or directory rtcwake: /dev/rtc0 not enabled for wakeup events
rtcwake -m mem -s 5,会导致机器挂起一段时间,时间不确定 === 这个模式是执行睡眠模式为mem(内存模式),本身就是会挂起到 RAM。
anolis 8 中也是同样配置。 [root@iZbp1iuho9qnre05kwkp1yZ 00:00]# cat /boot/config-4.18.0-372.26.1.an8_6.aarch64 | grep CONFIG_RTC_DRV_CMOS [root@iZbp1iuho9qnre05kwkp1yZ 00:00]# uname -r 4.18.0-372.26.1.an8_6.aarch64 [root@iZbp1iuho9qnre05kwkp1yZ 00:00]# cat /boot/config-4.18.0-372.26.1.an8_6.aarch64 | grep CONFIG_RTC_DRV_EFI CONFIG_RTC_DRV_EFI=y [root@iZbp1iuho9qnre05kwkp1yZ 00:00]# rtcwake -m show -v Using UTC time. rtcwake: cannot open /sys/class/rtc/rtc0/device/power/wakeup: No such file or directory rtcwake: /dev/rtc0 not enabled for wakeup events
我也遇到相同问题,请问解决了吗