Add s0i3 RTC wake up for AMD systems

Bug #1950013 reported by Alex Hung
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HWE Next
Fix Released
Undecided
Alex Hung
linux (Ubuntu)
Fix Released
Undecided
Unassigned
Focal
Invalid
Undecided
Unassigned
linux-oem-5.14 (Ubuntu)
Invalid
Undecided
Unassigned
Focal
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

  RTC based wakeup is not supported natively by the hardware for s0i3.

[Fix]

  A firmware and driver updates were implemented. The driver passes wakeup time to SMU to to enable RTC from S0i3.

  Note this s0i3 RTC wake up also requires new firmware.

  The first patch is the prerequisite actual fix (patch 2 and 3).

[Test]

  This is requested by AMD and tested by an AMD developer as below:

    Testing a suspend run with RTC for 15 seconds and then 30 seconds:
    ```
    $ sudo rtcwake --seconds 15 -m mem
    rtcwake: assuming RTC uses UTC ...
    rtcwake: wakeup from "mem" using /dev/rtc0 at Fri Nov 5 02:31:45 2021
    $ sudo rtcwake --seconds 30 -m mem
    rtcwake: assuming RTC uses UTC ...
    rtcwake: wakeup from "mem" using /dev/rtc0 at Fri Nov 5 02:33:13 2021
    $ sudo cat /sys/kernel/debug/amd_pmc/s0ix_stats
    === S0ix statistics ===
    S0ix Entry Time: 4793618285
    S0ix Exit Time: 6209036738
    Residency Time: 29487884
    ```
    Residency divided by 1000000 is 29.4 seconds.

    Reading idle mask works fine too.

[Where problems could occur]

  Low risk.

  First patch only exports Idlemask value.
  The actual fix only affects a specific AMD CPU (CZN).

CVE References

Alex Hung (alexhung)
description: updated
tags: added: amd oem-priority originate-from-1947889
Changed in hwe-next:
assignee: nobody → Alex Hung (alexhung)
Revision history for this message
Alex Hung (alexhung) wrote :
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

also needed in jammy kernel

Changed in linux (Ubuntu Focal):
status: New → Invalid
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1950013

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Timo Aaltonen (tjaalton)
Changed in linux-oem-5.14 (Ubuntu Focal):
status: New → Fix Committed
Changed in linux-oem-5.14 (Ubuntu):
status: New → Invalid
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the linux-oem-5.14/5.14.0-1008.8 kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-focal' to 'verification-done-focal'. If the problem still exists, change the tag 'verification-needed-focal' to 'verification-failed-focal'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-focal
Alex Hung (alexhung)
tags: added: verification-done-focal
removed: verification-needed-focal
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (21.0 KiB)

This bug was fixed in the package linux-oem-5.14 - 5.14.0-1008.8

---------------
linux-oem-5.14 (5.14.0-1008.8) focal; urgency=medium

  * focal/linux-oem-5.14: 5.14.0-1008.8 -proposed tracker (LP: #1949844)

  * Packaging resync (LP: #1786013)
    - [Packaging] update update.conf
    - debian/dkms-versions -- update from kernel-versions (main/2021.11.08)

  * Let NVMe with HMB use native power control again (LP: #1950042)
    - nvme-pci: use attribute group for cmb sysfs
    - nvme-pci: cmb sysfs: one file, one value
    - nvme-pci: disable hmb on idle suspend
    - nvme: allow user toggling hmb usage

  * Add s0i3 RTC wake up for AMD systems (LP: #1950013)
    - platform/x86: amd-pmc: Export Idlemask values based on the APU
    - platform/x86: amd-pmc: adjust arguments for `amd_pmc_send_cmd`
    - platform/x86: amd-pmc: Add special handling for timer based S0i3 wakeup

  * require CAP_NET_ADMIN to attach N_HCI ldisc (LP: #1949516)
    - Bluetooth: hci_ldisc: require CAP_NET_ADMIN to attach N_HCI ldisc

  * AMD ACP 6.x DMIC Supports (LP: #1949245)
    - ASoC: amd: add Yellow Carp ACP6x IP register header
    - ASoC: amd: add Yellow Carp ACP PCI driver
    - ASoC: amd: add acp6x init/de-init functions
    - ASoC: amd: add platform devices for acp6x pdm driver and dmic driver
    - ASoC: amd: add acp6x pdm platform driver
    - ASoC: amd: add acp6x irq handler
    - ASoC: amd: add acp6x pdm driver dma ops
    - ASoC: amd: add acp6x pci driver pm ops
    - ASoC: amd: add acp6x pdm driver pm ops
    - ASoC: amd: enable Yellow carp acp6x drivers build
    - ASoC: amd: create platform device for acp6x machine driver
    - ASoC: amd: add YC machine driver using dmic
    - ASoC: amd: enable Yellow Carp platform machine driver build
    - [Config] Enable AMD ACP 6 DMIC Support

  * Focal update: v5.14.17 upstream stable release (LP: #1950165)
    - scsi: core: Put LLD module refcnt after SCSI device is released
    - sfc: Fix reading non-legacy supported link modes
    - vrf: Revert "Reset skb conntrack connection..."
    - media: firewire: firedtv-avc: fix a buffer overflow in avc_ca_pmt()
    - Revert "xhci: Set HCD flag to defer primary roothub registration"
    - Revert "usb: core: hcd: Add support for deferring roothub registration"
    - drm/amdkfd: fix boot failure when iommu is disabled in Picasso.
    - drm/i915: Remove memory frequency calculation
    - Revert "soc: imx: gpcv2: move reset assert after requesting domain power up"
    - ARM: 9120/1: Revert "amba: make use of -1 IRQs warn"
    - Revert "wcn36xx: Disable bmps when encryption is disabled"
    - drm/amdgpu: revert "Add autodump debugfs node for gpu reset v8"
    - drm/amd/display: Revert "Directly retrain link from debugfs"
    - Revert "drm/i915/gt: Propagate change in error status to children on unhold"
    - ALSA: usb-audio: Add Schiit Hel device to mixer map quirk table
    - ALSA: usb-audio: Add Audient iD14 to mixer map quirk table
    - Linux 5.14.17

  * Focal update: v5.14.16 upstream stable release (LP: #1950164)
    - ARM: 9132/1: Fix __get_user_check failure with ARM KASAN images
    - ARM: 9133/1: mm: proc-macros: ensure *_tlb_fns are 4B aligned
    - ARM: 9134/1: r...

Changed in linux-oem-5.14 (Ubuntu Focal):
status: Fix Committed → Fix Released
Alex Hung (alexhung)
Changed in hwe-next:
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux - 5.15.0-17.17

---------------
linux (5.15.0-17.17) jammy; urgency=medium

  * jammy/linux: 5.15.0-17.17 -proposed tracker (LP: #1957809)

 -- Andrea Righi <email address hidden> Thu, 13 Jan 2022 17:11:21 +0100

Changed in linux (Ubuntu):
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.