Merge ~narahuang/plainbox-provider-checkbox/+git/plainbox-provider-checkbox:SLP_S0-in-s2-idle-check into plainbox-provider-checkbox:master

Proposed by Nara Huang
Status: Work in progress
Proposed branch: ~narahuang/plainbox-provider-checkbox/+git/plainbox-provider-checkbox:SLP_S0-in-s2-idle-check
Merge into: plainbox-provider-checkbox:master
Diff against target: 33 lines (+25/-0)
1 file modified
units/power-management/jobs.pxu (+25/-0)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Disapprove
Jonathan Cave (community) Needs Information
Review via email: mp+373248@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

Do you want the test to fail if /sys/kernel/debug/pmc_core/slp_s0_residency_usec is not present?

We could check this path in a resource job and mark the test as skipped in such case.

The new requirements would then be something like:

requires:
 cpuinfo.type == "GenuineIntel"
 pmc_core.slp_s0 == "supported"

pmc_core being the name of this new resource job.

What do you think?

review: Needs Information
Revision history for this message
Nara Huang (narahuang) wrote :

> Do you want the test to fail if
> /sys/kernel/debug/pmc_core/slp_s0_residency_usec is not present?
>
> We could check this path in a resource job and mark the test as skipped in
> such case.
>
> The new requirements would then be something like:
>
> requires:
> cpuinfo.type == "GenuineIntel"
> pmc_core.slp_s0 == "supported"
>
> pmc_core being the name of this new resource job.
>
> What do you think?
That would be great!
I can study how to write the resource job...

Revision history for this message
Jonathan Cave (jocave) wrote :

If I could chip having just done a quick bit of research about what pmc_core is... I thing the resource job could produce output like:

supported: True <- test based on /sys/kernel/debug/pmc_core directory
slp_s0_residency_usec: 10 <- contents of the slp_s0_residency_usec file
<filename>: <value> <- name of other files in dir and their contents

This should provide useful features for any future test we might want to write. On devices that do not support this feature, just:

supported: False

Revision history for this message
Nara Huang (narahuang) wrote :

Checked with HWE khfeng, if the system node is not there, that's also an issue.

So I would like to keep the existence check, but change log message for tester to file a bug on that case.

Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

OK for me but let's land it after the deb release (0.49 of p-p-c)

Revision history for this message
Jonathan Cave (jocave) wrote :

This isn't included in any test plans so shouldnt do any harm - but I don't understand yet how it will be used because I don't believe this feature is supported on all Intel kernels.

review: Needs Information
Revision history for this message
Nara Huang (narahuang) wrote :

This is from HWE's request, please refer to bug
https://bugs.launchpad.net/plainbox-provider-checkbox/+bug/1838409

Revision history for this message
Kai-Heng Feng (kaihengfeng) :
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

See below (suggestion to rely on fwts to catch problems that only occur after multiple cycles)

Revision history for this message
Kai-Heng Feng (kaihengfeng) :
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

It's not clear to me how it will actually work. It seems assuming that by default the suspend action will use S2idle rather than S3. not all systems/releases have this.

review: Disapprove

Unmerged commits

6cf801f... by Nara Huang

Add job to check Intel SoC hits SLP_S0 in S2 idle

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/units/power-management/jobs.pxu b/units/power-management/jobs.pxu
2index 904c2f0..ed2e986 100644
3--- a/units/power-management/jobs.pxu
4+++ b/units/power-management/jobs.pxu
5@@ -318,3 +318,28 @@ requires: cpuinfo.platform in ('i386', 'x86_64', 'ppc64el', 'pSeries')
6 _description: Check to see if CONFIG_NO_HZ is set in the kernel (this is just a simple regression check)
7 command:
8 zgrep 'CONFIG_NO_HZ=y' /snap/{kernel}/current/config-`uname -r` >/dev/null 2>&1 || ( echo "WARNING: Tickless Idle is NOT set" >&2 && exit 1 )
9+
10+id: power-management/slp_s0-in-S2-idle
11+category_id: com.canonical.plainbox::power-management
12+unit: job
13+plugin: shell
14+estimated_duration: 0.6
15+requires: cpuinfo.type == "GenuineIntel"
16+user: root
17+command:
18+if [ ! -f /sys/kernel/debug/pmc_core/slp_s0_residency_usec ]; then
19+ echo "SLP S0 system node is missing"
20+ exit 1
21+fi
22+OUTPUT=$(cat /sys/kernel/debug/pmc_core/slp_s0_residency_usec)
23+if [ $OUTPUT -eq 0 ]; then
24+ echo "Didn't reach deepest power saving mode"
25+ exit 1
26+else
27+ echo "Reached deepest power saving mode"
28+ exit 0
29+fi
30+_summary:
31+ Check system can reach deepest power saving mode with S2 idle.
32+_description:
33+ Check system can reach deepest power saving mode with S2 idle.

Subscribers

People subscribed via source and target branches