Support AMD P-State cpufreq control mechanism

Bug #1956509 reported by You-Sheng Yang
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HWE Next
Fix Released
Undecided
Unassigned
linux (Ubuntu)
Fix Released
High
You-Sheng Yang
Focal
Invalid
Undecided
Unassigned
Jammy
Fix Released
High
You-Sheng Yang
Kinetic
Fix Released
Undecided
Unassigned
linux-oem-5.14 (Ubuntu)
Invalid
Undecided
Unassigned
Focal
Fix Released
High
You-Sheng Yang
Jammy
Invalid
Undecided
Unassigned
Kinetic
Invalid
Undecided
Unassigned
linux-oem-5.17 (Ubuntu)
Invalid
High
You-Sheng Yang
Focal
Invalid
Undecided
Unassigned
Jammy
Fix Released
High
You-Sheng Yang
Kinetic
Invalid
Undecided
Unassigned

Bug Description

[SRU Justification]

[Impact]

AMD P-State CPU performance scaling driver not yet supported on AMD Zen
based CPU series.

[Fix]

Mainline commits starting at commit d341db8f48ea ("x86/cpufeatures: Add
AMD Collaborative Processor Performance Control feature flag") from v5.17.

Even this committed, the defconfig will build it as module, and that
prevents AMD P-State driver from actually taking effect. Therefore an
additional fix to the kernel configs is necessary.

[Test Case]

$ sudo cpupower frequency-info
analyzing CPU 0:
  driver: amd-pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 131 us
  hardware limits: 400 MHz - 3.10 GHz
  available cpufreq governors: conservative ondemand userspace powersave
performance schedutil
  current policy: frequency should be within 1.60 GHz and 3.10 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 1.59 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
    Boost States: 0
    Total States: 3
    Pstate-P0: 3100MHz
    Pstate-P1: 1800MHz
    Pstate-P2: 1600MHz

[Where problems could occur]

The CPPC feature is implemented in two ways depending on underlying HW
details for the APU/CPU:
* Dedicated MSR
* Shared memory

The metrics used to measure power/performance efficiency don't show any
improvement on the designs that use shared memory. They do show
improvements in the MSR designs.

So the code will only enable it by default on the MSR implementation.

[Other Info]

Althought the v5.17 kernel and newer should have already this committed,
an additional fix to the kernel configs is necessary, and
unstable/oem-5.17 are also nominated (in a separate thread for they don't
need other parts but the config).

========== original bug report ==========

https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=40181d67f1e9f1ac87af9c0c194e40ab2a081974

$ sudo cpupower frequency-info
analyzing CPU 0:
  driver: amd-pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 131 us
  hardware limits: 400 MHz - 3.10 GHz
  available cpufreq governors: conservative ondemand userspace powersave performance schedutil
  current policy: frequency should be within 1.60 GHz and 3.10 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 1.59 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
    Boost States: 0
    Total States: 3
    Pstate-P0: 3100MHz
    Pstate-P1: 1800MHz
    Pstate-P2: 1600MHz

Revision history for this message
You-Sheng Yang (vicamo) wrote :
tags: added: amd oem-priority originate-from-1956507
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 1956509

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
You-Sheng Yang (vicamo)
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
You-Sheng Yang (vicamo)
Changed in linux (Ubuntu Focal):
status: New → Invalid
Changed in linux (Ubuntu Jammy):
assignee: nobody → You-Sheng Yang (vicamo)
importance: Undecided → High
status: Confirmed → In Progress
Changed in linux-oem-5.14 (Ubuntu Focal):
assignee: nobody → You-Sheng Yang (vicamo)
importance: Undecided → High
status: New → In Progress
Changed in linux-oem-5.14 (Ubuntu Jammy):
status: New → Invalid
Changed in linux-oem-5.17 (Ubuntu Focal):
status: New → Invalid
Changed in linux-oem-5.17 (Ubuntu Jammy):
assignee: nobody → You-Sheng Yang (vicamo)
importance: Undecided → High
status: New → In Progress
Revision history for this message
You-Sheng Yang (vicamo) wrote :

The major patchset has been available in v5.17 or above, but we still need to enable AMD P-State as built-in in linux-unstable/jammy and linux-oem-5.17/jammy, so that it will take precedence over acpi-cpufreq.

Revision history for this message
You-Sheng Yang (vicamo) wrote :
description: updated
Timo Aaltonen (tjaalton)
Changed in linux-oem-5.14 (Ubuntu Focal):
status: In Progress → Fix Committed
Timo Aaltonen (tjaalton)
Changed in linux-oem-5.17 (Ubuntu Jammy):
status: In Progress → Fix Committed
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the linux/5.15.0-28.29 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-jammy' to 'verification-done-jammy'. If the problem still exists, change the tag 'verification-needed-jammy' to 'verification-failed-jammy'.

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-jammy
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-1035.38 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
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

still unverified..

Revision history for this message
You-Sheng Yang (vicamo) wrote :

Verified linux-oem-5.14/focal-proposed version 5.14.0-1035.38 on oem platform:

$ sudo cpupower frequency-info
analyzing CPU 0:
  driver: amd-pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 131 us
  hardware limits: 400 MHz - 4.79 GHz
  available cpufreq governors: conservative ondemand userspace powersave performance schedutil
  current policy: frequency should be within 400 MHz and 4.79 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 1.02 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
    Boost States: 0
    Total States: 3
    Pstate-P0: 3200MHz
    Pstate-P1: 1800MHz
    Pstate-P2: 1600MHz

tags: added: verification-done-focal
removed: verification-needed-focal
Revision history for this message
You-Sheng Yang (vicamo) wrote :

Verified linux/jammy version 5.15.0-28-generic:

$ uname -r
5.15.0-28-generic
$ sudo cpupower frequency-info
[sudo] password for ubuntu:
analyzing CPU 0:
  driver: amd-pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 131 us
  hardware limits: 400 MHz - 4.79 GHz
  available cpufreq governors: conservative ondemand userspace powersave performance schedutil
  current policy: frequency should be within 400 MHz and 4.79 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 1.05 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
    Boost States: 0
    Total States: 3
    Pstate-P0: 3200MHz
    Pstate-P1: 1800MHz
    Pstate-P2: 1600MHz

tags: added: verification-done-jammy
removed: verification-needed-jammy
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (78.4 KiB)

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

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

  * focal/linux-oem-5.14: 5.14.0-1036.40 -proposed tracker (LP: #1971982)

  * AMD APU s2idle is broken after the ASIC reset fix (LP: #1972134)
    - drm/amdgpu: unify BO evicting method in amdgpu_ttm
    - drm/amdgpu: explicitly check for s0ix when evicting resources

  * amd_gpio AMDI0030:00: Failed to translate GPIO pin 0x0000 to IRQ, err -517
    (LP: #1971597)
    - gpio: Request interrupts after IRQ is initialized

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

  * focal/linux-oem-5.14: 5.14.0-1035.38 -proposed tracker (LP: #1969056)

  * Packaging resync (LP: #1786013)
    - [Packaging] resync getabis

  * Mute/mic LEDs no function on EliteBook G9 platfroms (LP: #1970552)
    - ALSA: hda/realtek: Enable mute/micmute LEDs support for HP Laptops

  * Mute/mic LEDs no function on HP EliteBook 845/865 G9 (LP: #1970178)
    - ALSA: hda/realtek: Enable mute/micmute LEDs and limit mic boost on EliteBook
      845/865 G9

  * Focal update: upstream stable patchset 2022-04-22 (LP: #1969892)
    - Revert "swiotlb: rework "fix info leak with DMA_FROM_DEVICE""
    - USB: serial: pl2303: add IBM device IDs
    - dt-bindings: usb: hcd: correct usb-device path
    - USB: serial: pl2303: fix GS type detection
    - USB: serial: simple: add Nokia phone driver
    - mm: kfence: fix missing objcg housekeeping for SLAB
    - HID: logitech-dj: add new lightspeed receiver id
    - HID: Add support for open wheel and no attachment to T300
    - xfrm: fix tunnel model fragmentation behavior
    - ARM: mstar: Select HAVE_ARM_ARCH_TIMER
    - virtio_console: break out of buf poll on remove
    - vdpa/mlx5: should verify CTRL_VQ feature exists for MQ
    - tools/virtio: fix virtio_test execution
    - ethernet: sun: Free the coherent when failing in probing
    - gpio: Revert regression in sysfs-gpio (gpiolib.c)
    - spi: Fix invalid sgs value
    - net:mcf8390: Use platform_get_irq() to get the interrupt
    - Revert "gpio: Revert regression in sysfs-gpio (gpiolib.c)"
    - spi: Fix erroneous sgs value with min_t()
    - Input: zinitix - do not report shadow fingers
    - af_key: add __GFP_ZERO flag for compose_sadb_supported in function
      pfkey_register
    - net: dsa: microchip: add spi_device_id tables
    - selftests: vm: fix clang build error multiple output files
    - locking/lockdep: Avoid potential access of invalid memory in lock_class
    - drm/amdgpu: move PX checking into amdgpu_device_ip_early_init
    - drm/amdgpu: only check for _PR3 on dGPUs
    - iommu/iova: Improve 32-bit free space estimate
    - tpm: fix reference counting for struct tpm_chip
    - usb: typec: tipd: Forward plug orientation to typec subsystem
    - USB: usb-storage: Fix use of bitfields for hardware data in ene_ub6250.c
    - xhci: fix garbage USBSTS being logged in some cases
    - xhci: fix runtime PM imbalance in USB2 resume
    - xhci: make xhci_handshake timeout for xhci_reset() adjustable
    - xhci: fix uninitialized string returned by xhci_decode_ctrl_ctx()
    - mei: me: disable driver on the ign firmware
    - mei: ...

Changed in linux-oem-5.14 (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (96.0 KiB)

This bug was fixed in the package linux-oem-5.17 - 5.17.0-1004.4

---------------
linux-oem-5.17 (5.17.0-1004.4) jammy; urgency=medium

  * jammy/linux-oem-5.17: 5.17.0-1004.4 -proposed tracker (LP: #1970584)

  * Packaging resync (LP: #1786013)
    - [Packaging] update Ubuntu.md

  * alsa: enable the cirrus-logic side-codec to make the speaker output sound
    (LP: #1965496)
    - spi: Make spi_alloc_device and spi_add_device public again
    - spi: Create helper API to lookup ACPI info for spi device
    - spi: Support selection of the index of the ACPI Spi Resource before alloc
    - spi: Add API to count spi acpi resources
    - platform/x86: i2c-multi-instantiate: Rename it for a generic serial driver
      name
    - platform/x86: serial-multi-instantiate: Reorganize I2C functions
    - platform/x86: serial-multi-instantiate: Add SPI support
    - ACPI / scan: Create platform device for CS35L41
    - [Config]: enable SERIAL_MULTI_INSTANTIATE

  * Bolt doesn't work with native USB4 hosts (LP: #1962349)
    - thunderbolt: Retry DROM reads for more failure scenarios
    - thunderbolt: Do not resume routers if UID is not set
    - thunderbolt: Do not make DROM read success compulsory
    - PCI/ACPI: Allow D3 only if Root Port can signal and wake from D3

  * DMCUB hangs if a PSR unsupported set version command is sent on AMD
    Rembrandt platform (LP: #1969407)
    - drm/amd/display: Only set PSR version when valid

  * Micmute LED support for Zbook Fury 16 G9 (LP: #1968892)
    - ALSA: hda/realtek: Add support for HP Laptops
    - ALSA: hda/realtek: Add mute and micmut LED support for Zbook Fury 17 G9

  * PCIE LnkCtl ASPM not enabled under VMD mode for Alder Lake platforms
    (LP: #1942160)
    - SAUCE: PCI/ASPM: Enable ASPM for links under VMD domain
    - SAUCE: PCI/ASPM: Enable LTR for endpoints behind VMD
    - SAUCE: vmd: fixup bridge ASPM by driver name instead

  * Support AMD P-State cpufreq control mechanism (LP: #1956509)
    - [Config] enable X86_AMD_PSTATE as built-in on amd64

  * Use kernel-testing repo from launchpad for ADT tests (LP: #1968016)
    - [Debian] Use kernel-testing repo from launchpad

  * Fix beacon loss for rtl8821ce on certain platforms (LP: #1969771)
    - SAUCE: rtw88: pci: 8821c: Disable 21ce completion timeout

  * alsa/sdw: Fix the audio issue on a Dell machine without internal mic
    (LP: #1966841)
    - ASoC: Intel: soc-acpi: add entries in ADL match table

  * WCN6856 BT keep in OFF state after coldboot system (LP: #1967067)
    - Bluetooth: btusb: Improve stability for QCA devices

  * Miscellaneous Ubuntu changes
    - [Config] update configs and annotations after stable updates

  [ Ubuntu: 5.17.0-8.8~22.04.2 ]

  * jammy/linux-hwe-5.17: 5.17.0-8.8~22.04.2 -proposed tracker (LP: #1969219)
  * Packaging resync (LP: #1786013)
    - [Packaging] update Ubuntu.md
    - [Packaging] update update.conf

  [ Ubuntu: 5.17.0-8.8~22.04.1 ]

  * Empty entry

  [ Ubuntu: 5.17.0-8.8 ]

  * jammy/linux-unstable: 5.17.0-8.8 -proposed tracker (LP: #1969016)
  * Packaging resync (LP: #1786013)
    - debian/dkms-versions -- update from kernel-versions (main/master)

  [ Ubuntu: 5.17.0-7.7 ]

  * jammy/linux-unsta...

Changed in linux-oem-5.17 (Ubuntu Jammy):
status: Fix Committed → Fix Released
Changed in linux-oem-5.17 (Ubuntu):
status: Fix Committed → Invalid
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (101.7 KiB)

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

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

  * CVE-2022-21499
    - SAUCE: debug: Lock down kgdb

linux (5.15.0-34.35) jammy; urgency=medium

  * jammy/linux: 5.15.0-34.35 -proposed tracker (LP: #1974322)

  * AMD APU s2idle is broken after the ASIC reset fix (LP: #1972134)
    - drm/amdgpu: unify BO evicting method in amdgpu_ttm
    - drm/amdgpu: explicitly check for s0ix when evicting resources

  * amd_gpio AMDI0030:00: Failed to translate GPIO pin 0x0000 to IRQ, err -517
    (LP: #1971597)
    - gpio: Request interrupts after IRQ is initialized

  * config CONFIG_HISI_PMU for kunpeng920 (LP: #1956086)
    - [Config] CONFIG_HISI_PMU=m

  * Mute/mic LEDs no function on EliteBook G9 platfroms (LP: #1970552)
    - ALSA: hda/realtek: Enable mute/micmute LEDs support for HP Laptops

  * network-manager/1.36.4-2ubuntu1 ADT test failure with linux/5.15.0-28.29
    (LP: #1971418)
    - Revert "rfkill: make new event layout opt-in"

  * PCIE LnkCtl ASPM not enabled under VMD mode for Alder Lake platforms
    (LP: #1942160)
    - SAUCE: vmd: fixup bridge ASPM by driver name instead

  * Mute/mic LEDs no function on HP EliteBook 845/865 G9 (LP: #1970178)
    - ALSA: hda/realtek: Enable mute/micmute LEDs and limit mic boost on EliteBook
      845/865 G9

  * Enable headset mic on Lenovo P360 (LP: #1967069)
    - ALSA: hda/realtek: Enable headset mic on Lenovo P360

  * WCN6856 BT keep in OFF state after coldboot system (LP: #1967067)
    - Bluetooth: btusb: Improve stability for QCA devices

  * Screen sometimes can't update [Failed to post KMS update: CRTC property
    (GAMMA_LUT) not found] (LP: #1967274)
    - drm/i915/xelpd: Enable Pipe color support for D13 platform
    - drm/i915: Use unlocked register accesses for LUT loads
    - drm/i915/xelpd: Enable Pipe Degamma
    - drm/i915/xelpd: Add Pipe Color Lut caps to platform config

  * Jammy update: v5.15.35 upstream stable release (LP: #1969857)
    - drm/amd/display: Add pstate verification and recovery for DCN31
    - drm/amd/display: Fix p-state allow debug index on dcn31
    - hamradio: defer 6pack kfree after unregister_netdev
    - hamradio: remove needs_free_netdev to avoid UAF
    - cpuidle: PSCI: Move the `has_lpi` check to the beginning of the function
    - ACPI: processor idle: Check for architectural support for LPI
    - ACPI: processor: idle: fix lockup regression on 32-bit ThinkPad T40
    - btrfs: remove unused parameter nr_pages in add_ra_bio_pages()
    - btrfs: remove no longer used counter when reading data page
    - btrfs: remove unused variable in btrfs_{start,write}_dirty_block_groups()
    - soc: qcom: aoss: Expose send for generic usecase
    - dt-bindings: net: qcom,ipa: add optional qcom,qmp property
    - net: ipa: request IPA register values be retained
    - btrfs: release correct delalloc amount in direct IO write path
    - ALSA: core: Add snd_card_free_on_error() helper
    - ALSA: sis7019: Fix the missing error handling
    - ALSA: ali5451: Fix the missing snd_card_free() call at probe error
    - ALSA: als300: Fix the missing snd_card_free() call at probe error
    - ALSA: als4000: Fix ...

Changed in linux (Ubuntu Jammy):
status: In Progress → Fix Released
Timo Aaltonen (tjaalton)
Changed in linux (Ubuntu):
status: In Progress → Fix Released
Changed in hwe-next:
status: New → Fix Released
Changed in linux (Ubuntu Kinetic):
status: New → Fix Released
Changed in linux-oem-5.14 (Ubuntu Kinetic):
status: New → Invalid
Changed in linux-oem-5.17 (Ubuntu Kinetic):
status: New → Invalid
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.