Skip to content

rtc_cmos rtc_cmos: Alarms can be up to one month in the future after waking from suspend #3011

Closed

Description

@XiaoyunWu6666

Description
rtc_cmos rtc_cmos: Alarms can be up to one month in the future on CML_RVP_SDW after waking from suspend
happened in inner daily test 4834 model=CML_RVP_SDW testcase=check-suspend-resume-50

[console log]

2021-06-23 22:52:49 UTC [ERROR] Caught kernel log error
===========================>>
[ 4739.061314] kernel: rtc_cmos rtc_cmos: Alarms can be up to one month in the future
<<===========================

Reproduction
TPLG=sof-cml-rt700-4ch.tplg ~/sof-test/test-case/check-suspend-resume.sh -l 50

Reproduction rate unknown.
Platform
CML_RVP_SDW

Activity

  1. added
    CML
    NOT on topic/sof-dev
    on Jun 25, 2021
  2. changed the title [-][CML]rtc_cmos rtc_cmos: Alarms can be up to one month in the future on CML_RVP_SDW after waking from suspend[/-] [+][CML][NOT ON SOF_DEV]rtc_cmos rtc_cmos: Alarms can be up to one month in the future on CML_RVP_SDW after waking from suspend[/+] on Jun 25, 2021
  3. keqiaozhang commented on Jun 28, 2021

    @keqiaozhang

    @XiaoyunWu6666 ,please set the RTC time form system time.

  4. XiaoyunWu6666 commented on Jun 28, 2021

    @XiaoyunWu6666
    Author

    @keqiaozhang already ' sudo hwclock --systohc' on that DUT .
    Will track whether it reproduced in CI later . If not ,will close this issue . thanks

  5. marc-hb commented on Jun 30, 2021

    @marc-hb
    Collaborator

    @keqiaozhang already ' sudo hwclock --systohc' on that DUT .

    @plbossart can you confirm that we have CONFIG RTC_SYSTOHC enabled always? That makes hwclock unnecessary. It's ON on my system.

    Would we have any script messing with /etc/adjtime? I hope not...

  6. plbossart commented on Jun 30, 2021

    @plbossart
    Member

    @keqiaozhang already ' sudo hwclock --systohc' on that DUT .

    @plbossart can you confirm that we have CONFIG RTC_SYSTOHC enabled always? That makes hwclock unnecessary. It's ON on my system.

    yes, it's included in the build

    sof-dev-defconfig:CONFIG_RTC_SYSTOHC=y
    sof-dev-defconfig:CONFIG_RTC_SYSTOHC_DEVICE="rtc0"
    
  7. marc-hb commented on Jun 30, 2021

    @marc-hb
    Collaborator

    I searched the source code to understand the error message. It happens that an invalid value is passed to rtcwake. More specifically, Alarms can be up to one month in the future is supposed to be printed when the user tries to schedule an alarm more than one month ahead but the RTC clock does not support months. See the full code and commit message there:

    https://lore.kernel.org/patchwork/patch/722795/
    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6a6af3d04435

    Then I looked at the logs and the test did absolutely not try to schedule an alarm more than a month ahead. So I don't know what's going on.

    2021-06-23 22:52:01 UTC [REMOTE_INFO] ===== Round(24/50) =====
    2021-06-23 22:52:01 UTC [REMOTE_COMMAND] Run the command: rtcwake -m mem -s 5
    rtcwake: assuming RTC uses UTC ...
    rtcwake: wakeup from "mem" using /dev/rtc0 at Wed Jun 23 22:52:08 2021
    2021-06-23 22:52:08 UTC [REMOTE_COMMAND] sleep for 5
    2021-06-23 22:52:13 UTC [REMOTE_INFO] Check for the kernel log status
    declare -- cmd="journalctl_cmd --since=@1624488716"
    2021-06-23 22:52:13 UTC [REMOTE_INFO] Check for the wakeup_count
    2021-06-23 22:52:13 UTC [REMOTE_INFO] ===== Round(25/50) =====
    2021-06-23 22:52:13 UTC [REMOTE_COMMAND] Run the command: rtcwake -m mem -s 5
    rtcwake: assuming RTC uses UTC ...
    rtcwake: wakeup from "mem" using /dev/rtc0 at Wed Jun 23 22:52:20 2021
    2021-06-23 22:52:20 UTC [REMOTE_COMMAND] sleep for 5
    2021-06-23 22:52:25 UTC [REMOTE_INFO] Check for the kernel log status
    declare -- cmd="journalctl_cmd --since=@1624488728"
    2021-06-23 22:52:25 UTC [REMOTE_INFO] Check for the wakeup_count
    2021-06-23 22:52:25 UTC [REMOTE_INFO] ===== Round(26/50) =====
    2021-06-23 22:52:25 UTC [REMOTE_COMMAND] Run the command: rtcwake -m mem -s 5
    rtcwake: assuming RTC uses UTC ...
    rtcwake: wakeup from "mem" using /dev/rtc0 at Wed Jun 23 22:52:32 2021
    2021-06-23 22:52:32 UTC [REMOTE_COMMAND] sleep for 5
    2021-06-23 22:52:37 UTC [REMOTE_INFO] Check for the kernel log status
    declare -- cmd="journalctl_cmd --since=@1624488740"
    2021-06-23 22:52:37 UTC [REMOTE_INFO] Check for the wakeup_count
    2021-06-23 22:52:37 UTC [REMOTE_INFO] ===== Round(27/50) =====
    2021-06-23 22:52:37 UTC [REMOTE_COMMAND] Run the command: rtcwake -m mem -s 5
    rtcwake: assuming RTC uses UTC ...
    rtcwake: wakeup from "mem" using /dev/rtc0 at Wed Jun 23 22:52:44 2021
    2021-06-23 22:52:44 UTC [REMOTE_COMMAND] sleep for 5
    2021-06-23 22:52:49 UTC [REMOTE_INFO] Check for the kernel log status
    declare -- cmd="journalctl_cmd --since=@1624488752"
    2021-06-23 22:52:49 UTC [ERROR] Caught kernel log error
    ===========================>>
    [ 4739.061314] kernel: rtc_cmos rtc_cmos: Alarms can be up to one month in the future
    <<===========================
    2021-06-23 22:52:49 UTC [REMOTE_ERROR] Caught error in kernel log
    2021-06-23 22:52:49 UTC [REMOTE_ERROR] Starting func_exit_handler(), exit status=1, FUNCNAME stack:
    2021-06-23 22:52:49 UTC [REMOTE_ERROR]  die()  @  /home/ubuntu/sof-test/test-case/../case-lib/lib.sh
    2021-06-23 22:52:49 UTC [REMOTE_ERROR]  main()  @  /home/ubuntu/sof-test/test-case/check-suspend-resume.sh:91
    2021-06-23 22:52:49 UTC [REMOTE_INFO] Test Result: FAIL!
    
  8. marc-hb commented on Jun 30, 2021

    @marc-hb
    Collaborator

    I checked the logs and found something even more puzzling: this error message came at Jun 23 22:52:44, NOT at the time rtcwake was invoked but 5 seconds later when the system woke up!?

    The message can only be printed by cmos_set_alarm(), @plbossart, others any idea what else could be trying to set RTC alarms?

    I also compared the logs between successful rtcwake and the failing one and found no obvious difference.

    Jun 23 22:52:44 jf-cml-rvp-sdw-3 kernel: smpboot: Booting Node 0 Processor 10 APIC 0x9
    Jun 23 22:52:44 jf-cml-rvp-sdw-3 kernel: ACPI: \_SB_.PR10: Found 3 idle states
    Jun 23 22:52:44 jf-cml-rvp-sdw-3 kernel: CPU10 is up
    Jun 23 22:52:44 jf-cml-rvp-sdw-3 kernel: smpboot: Booting Node 0 Processor 11 APIC 0xb
    Jun 23 22:52:44 jf-cml-rvp-sdw-3 kernel: ACPI: \_SB_.PR11: Found 3 idle states
    Jun 23 22:52:44 jf-cml-rvp-sdw-3 kernel: CPU11 is up
    Jun 23 22:52:44 jf-cml-rvp-sdw-3 kernel: ACPI: Waking up from system sleep state S3
    Jun 23 22:52:44 jf-cml-rvp-sdw-3 kernel: ACPI: EC: interrupt unblocked
    Jun 23 22:52:44 jf-cml-rvp-sdw-3 kernel: ACPI: EC: event unblocked
    Jun 23 22:52:44 jf-cml-rvp-sdw-3 kernel: sd 2:0:0:0: [sda] Starting disk
    Jun 23 22:52:44 jf-cml-rvp-sdw-3 kernel: i915 0000:00:02.0: [drm] [ENCODER:94:DDI A/PHY A] is disabled/in DSI mode with an ungated DDI clock, gate it
    Jun 23 22:52:44 jf-cml-rvp-sdw-3 kernel: i915 0000:00:02.0: [drm] [ENCODER:102:DDI B/PHY B] is disabled/in DSI mode with an ungated DDI clock, gate it
    Jun 23 22:52:44 jf-cml-rvp-sdw-3 kernel: i915 0000:00:02.0: [drm] [ENCODER:117:DDI C/PHY C] is disabled/in DSI mode with an ungated DDI clock, gate it
    Jun 23 22:52:44 jf-cml-rvp-sdw-3 kernel: serial 00:06: activated
    Jun 23 22:52:44 jf-cml-rvp-sdw-3 kernel: mei_me 0000:00:16.0: hbm: dma setup response: failure = 3 REJECTED
    Jun 23 22:52:44 jf-cml-rvp-sdw-3 kernel: rtc_cmos rtc_cmos: Alarms can be up to one month in the future
    Jun 23 22:52:44 jf-cml-rvp-sdw-3 kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: Turning i915 HDAC power 1
    Jun 23 22:52:44 jf-cml-rvp-sdw-3 kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: Debug PCIR: 00000000 at  00000044
    Jun 23 22:52:44 jf-cml-rvp-sdw-3 kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: Debug PCIR: 00000040 at  00000048
    Jun 23 22:52:44 jf-cml-rvp-sdw-3 kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: Debug PCIW: 00000000 at  00000048
    Jun 23 22:52:44 jf-cml-rvp-sdw-3 kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: Debug PCIR: 00000000 at  00000048
    Jun 23 22:52:44 jf-cml-rvp-sdw-3 kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: Debug PCIW: 00000040 at  00000048
    Jun 23 22:52:44 jf-cml-rvp-sdw-3 kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: Turning i915 HDAC power 0
    Jun 23 22:52:44 jf-cml-rvp-sdw-3 kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: Current DSP power state: D0I0
    
  9. plbossart commented on Jul 1, 2021

    @plbossart
    Member

    Interesting @marc-hb, could it be that something other that sof-test sets an alarm on resume?

    Also wondering if the issue is this log only, what would happen if we ignore it?

  10. marc-hb commented on Jul 1, 2021

    @marc-hb
    Collaborator

    While this one looks spurious I'm reluctant to ignore time-related error messages considering how many time synchronizations issues and misconfigurations we had in the past and we still experience various TIMEOUTs, see links above.

    In fact is this message really "spurious"? Some rogue script invoking rtcwake could explain some TIMEOUTs.

  11. plbossart commented on Jul 1, 2021

    @plbossart
    Member

    I don't disagree, but I don't see how to backtrace who requested the alarm. Could be literally any userspace script or application, no?

  12. removed
    CML
    on Jul 5, 2021
  13. changed the title [-][CML][NOT ON SOF_DEV]rtc_cmos rtc_cmos: Alarms can be up to one month in the future on CML_RVP_SDW after waking from suspend[/-] [+][NOT ON SOF_DEV]rtc_cmos rtc_cmos: Alarms can be up to one month in the future on CML_RVP_SDW after waking from suspend[/+] on Jul 5, 2021
  14. added
    bug
    on Jul 12, 2021
  15. 21 remaining items

  16. plbossart commented on Oct 13, 2021

    @plbossart
    Member

    @fredoh9 @XiaoyunWu6666 @marc-hb do we still see this issue? if not can we close?

  17. XiaoyunWu6666 commented on Jan 24, 2022

    @XiaoyunWu6666
    Author
  18. plbossart commented on Jan 24, 2022

    @plbossart
    Member

    @marc-hb @XiaoyunWu6666 We seem to have moved to an issue that's no longer specific to CML_RVP_SDW, should we update title and tags for tracking purposes?

  19. changed the title [-]rtc_cmos rtc_cmos: Alarms can be up to one month in the future on CML_RVP_SDW after waking from suspend[/-] [+]rtc_cmos rtc_cmos: Alarms can be up to one month in the future after waking from suspend[/+] on Jan 24, 2022
  20. removed
    CML
    on Jan 24, 2022
  21. marc-hb commented on May 7, 2022

    @marc-hb
    Collaborator
  22. plbossart commented on Jun 29, 2022

    @plbossart
    Member

    @marc-hb @XiaoyunWu6666 i can't recall if this problem still exists?

  23. marc-hb commented on Jun 29, 2022

    @marc-hb
    Collaborator

    They may not print this message but we still experience rtcwake freezes on a regular basis so I would prefer to keep this open

  24. marc-hb commented on Jun 30, 2022

    @marc-hb
    Collaborator

    Fresh from the oven: https://sof-ci.01.org/sofpr/PR5875/build778/devicetest/?model=WHL_UPEXT_HDA_ZEPHYR&testcase=check-suspend-resume-5

    I checked journalctl on that system and while there was no rtcwake error message there definitely was a hard lockup: absolutely nothing in the logs after the call to rtcwake

    Interestingly, CI did NOT timed out and power-cycled the device because it immediately rebooted itself, it was up again less than 30 seconds later.

  25. added
    suspend resume
    on Jul 19, 2022
  26. plbossart commented on Jul 20, 2022

    @plbossart
    Member

    They may not print this message but we still experience rtcwake freezes on a regular basis so I would prefer to keep this open

    That would need to be tracked as a separate bug. This issue was only related to the 'one month into the future'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugsuspend resume

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions