Fix the in-motion function does not work

Bug #2018275 reported by koba
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
thermald (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
Fix Released
Undecided
koba

Bug Description

[Summary]
in-Motion condition doesn't work with adaptive performance policy

[Fix]
This patch fix the issue,
cc0890a59725) Always match motion = 0

[Test cases]
1. Install the Ubuntu 22.04-oem image on BMM4-DVT2-C2X
2. run the thermald applied the fix.
#thermald --no-daemon --loglevel=debug --adaptive --ignore-cpuid-check > thermald_log.log" and check the log
3. in-motion condition works

[Where problems could occur]
because motion is always 0, the rules with motion=1 wouldn't be hit.
but motion=1 isn't supported.

koba (kobako)
tags: added: originate-from-1987259
koba (kobako)
Changed in thermald (Ubuntu Jammy):
status: New → In Progress
assignee: nobody → koba (kobako)
Revision history for this message
Chris Halse Rogers (raof) wrote :

What *is* the in-motion condition? How would someone trigger it, and what would be the consequences of it not triggering, or triggering at an inappropriate time?

Revision history for this message
koba (kobako) wrote :

@Raof,
As per Dell and Intel, here're some documents
~~~
1. Currently, Motion condition is not supported against v2.5.0 release.
2. A patch in WIP branch to have the partial support, Motion = 0: https://github.com/intel/thermal_daemon/commit/cc0890a5972575eee2ab778772b1ee9ae1c75dba
3. Some background of this “motion”:
 1) Per Intel document #607821, the Motion variant is to indicate the system put on the desk “Motion=0”, or it is carried on moving or it is put on the lap (Motion=1).
 2) For the Dell Latitude laptops, in the adaptive performance condition table (APCT), Motion variant is added for each condition_set.
Taking our current POC system for example, as you known, there are totally 8 condition sets, 7 of them are with Motion=0, 1 of them is with Motion=1.
If we do not apply above mentioned patch, the system will be working under the “highest power” mode which is defined in the APCT table, but could not switch to other cooler mode.
[1660808299][INFO]Falling back to use configuration with the highest power

~~~

Revision history for this message
Julian Andres Klode (juliank) wrote (last edit ):

The bug description does not match the requirements for an SRU, particularly "low" is no reasonable answer to "where problems could occur"

Changed in thermald (Ubuntu Jammy):
status: In Progress → Incomplete
Revision history for this message
koba (kobako) wrote :

@Julian, add more explanation in [where problems could occur]

description: updated
Changed in thermald (Ubuntu Jammy):
status: Incomplete → In Progress
Revision history for this message
Chris Halse Rogers (raof) wrote :

Ok, "here's a patch from an unmerged branch abandoned a year ago" isn't particularly reassuring. However, investigation reveals that an equivalent commit was merged to trunk and exists in 2.5.1: https://github.com/intel/thermal_daemon/commit/4339234275b87b3973487cade283addd14fc9818

So, reverse-engineering the problem this is fixing:
* there exists a laptop with a firmware thermal table that contains a "motion" condition in each of its entries
* To determine the policy to apply thermald checks against each condition in each of the table entries. If it encounters a condition it does not understand, the check returns THD_ERROR (and presumably the check fails?)
* Since each entry of the firmware table on this laptop contains a "motion" condition, they are all rejected, and thermald instead applies the default "max power" policy.
* The patch implements a stub motion condition check - if the table specifies "motion = 0" then the condition is satisfied.

Am I correct in that understanding?

So the risk of regression here is mostly that thermald will *start working* on such laptops. Or, alternatively, if there is a laptop where *some, but not all* table entries contain a "motion" condition then this will be enabling extra policy options, which might be inappropriate?

koba (kobako)
description: updated
Revision history for this message
koba (kobako) wrote :

@Raof,
your understandings are correct.
Then, "motion=1" isn't supported currently.

For apct, the motion variant may not exist in each entries.
so extra policy rules maybe hit.

if these cause the problem,
1. the apct have the incorrect rules and table needs correction.
2. need fully support in "motion", need to enable the motion variant fully.

Revision history for this message
Chris Halse Rogers (raof) wrote :

This patch is in 2.5.1, and so is fixed in Kinetic and newer.

Changed in thermald (Ubuntu):
status: New → Fix Released
Revision history for this message
Chris Halse Rogers (raof) wrote : Please test proposed package

Hello koba, or anyone else affected,

Accepted thermald into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/thermald/2.4.9-1ubuntu0.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in thermald (Ubuntu Jammy):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
koba (kobako) wrote (last edit ):

Verified,
~~~
$ uname -a

Linux u-Precision-5480 6.1.0-1016-oem #16-Ubuntu SMP PREEMPT_DYNAMIC Wed Jun 21 08:45:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

$ sudo apt policy thermald
[sudo] password for x31:
thermald:
  Installed: 2.4.9-1ubuntu0.3
  Candidate: 2.4.9-1ubuntu0.3
  Version table:
 *** 2.4.9-1ubuntu0.3 500
        500 http://tw.archive.ubuntu.com/ubuntu jammy-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     2.4.9-1ubuntu0.3 500
        500 https://ppa.launchpadcontent.net/kobako/exp-thermald/ubuntu jammy/main amd64 Packages
     2.4.9-1ubuntu0.2 500
        500 http://tw.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
     2.4.9-1 500
        500 http://tw.archive.ubuntu.com/ubuntu jammy/main amd64 Packages

#if motion==1, ignore
[1688919145][DEBUG]evaluate condition.condition 4
[1688919145][DEBUG]Match motion == 0 :1
[1688919145][DEBUG]evaluate condition set 1
[1688919145][DEBUG]evaluate condition.condition at index 0
~~~

tags: added: verification-done verification-done-jammy
removed: verification-needed verification-needed-jammy
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for thermald has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package thermald - 2.4.9-1ubuntu0.3

---------------
thermald (2.4.9-1ubuntu0.3) jammy; urgency=medium

  * Cherry-pick following fixes from thermald 2.5.1 and 2.5.2 (LP: #1995606)
  * debian/patches/0013-Add-AlderLake-N.patch
    - Add support for Adler Lake N (LP: #2012260)
  * debian/patches/0007-Add-INT3400-base-path-for-Raptor-Lake.patch
    - Fix RPL: Add INT3400 base path(LP: #1989044)
  * debian/patches/0014-Process-ITMT-v2.patch
    - Support ITMTv2 for Raptor Lake (LP: #2007579)
  * debian/patches/0008-Install-passive-default.patch
    - Fix throttled GPU (LP: #1981087)
  * debian/patches/0012-Always-match-motion-0.patch
    - Fix in-motion function doesn't work (LP: #2018275)
  * debian/patches/0003-Parse-ITMT-Table.patch
  * debian/patches/0004-Add-capability-for-min-max-per-trip.patch
  * debian/patches/0005-Install-ITMT_target.patch
  * debian/patches/0006-Use-per-trip-min-max.patch
  * debian/patches/0009-Parse-idsp-and-trips.patch
  * debian/patches/0010-use-PL1-max-min-from-PPCC-when-policies-match.patch
  * debian/patches/0011-Parse-GDDV-before-thd_engine-init.patch
    - Fix i9-12900k shutdown when run Prime95 and stress-ng (LP: #2018236)

 -- Koba Ko <email address hidden> Wed, 05 Jul 2023 13:37:32 +0200

Changed in thermald (Ubuntu Jammy):
status: Fix Committed → 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.