Bug 2605 - [Anolis 23 Preview][aarch64]rtcwake命令执行失败
Summary: [Anolis 23 Preview][aarch64]rtcwake命令执行失败
Status: RESOLVED BYDESIGN
Alias: None
Product: Anolis OS 23
Classification: Anolis OS
Component: BaseOS Packages (show other bugs) BaseOS Packages
Version: 23.0
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: beta
Assignee: happy_orange
QA Contact:
URL:
Whiteboard:
Keywords:
: 2112 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-10-27 14:20 UTC by gitpush
Modified: 2023-03-08 15:51 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gitpush alibaba_cloud_group 2022-10-27 14:20:34 UTC
[问题描述]:
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
Comment 1 xuchunmei alibaba_cloud_group 2022-11-03 09:43:23 UTC
*** Bug 2112 has been marked as a duplicate of this bug. ***
Comment 2 happy_orange alibaba_cloud_group 2022-11-03 11:34:59 UTC
经过查看发现,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
Comment 3 happy_orange alibaba_cloud_group 2022-11-03 11:39:32 UTC
rtcwake -m mem -s 5,会导致机器挂起一段时间,时间不确定

===
这个模式是执行睡眠模式为mem(内存模式),本身就是会挂起到 RAM。
Comment 4 happy_orange alibaba_cloud_group 2022-11-03 11:50:25 UTC
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
Comment 5 mmyJerry 2023-03-08 15:51:46 UTC
我也遇到相同问题,请问解决了吗