Bug 209931 - boot performance: Power Resource [PIN] results in 260 ms delay - Dell XPS 13 9310
Summary: boot performance: Power Resource [PIN] results in 260 ms delay - Dell XPS 13 ...
Status: NEW
Alias: None
Product: Power Management
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Zhang Rui
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-29 07:24 UTC by Paul Menzel
Modified: 2022-05-12 14:09 UTC (History)
5 users (show)

See Also:
Kernel Version: 5.10-rc1
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Output of `acpidump` (2.20 MB, text/plain)
2020-10-29 07:24 UTC, Paul Menzel
Details
Linux 5.10+ messages with `initcall_debug` (output of `dmesg`) (214.75 KB, text/plain)
2020-10-29 07:26 UTC, Paul Menzel
Details

Description Paul Menzel 2020-10-29 07:24:55 UTC
Created attachment 293287 [details]
Output of `acpidump`

Looking at the boottime of the Dell XPS 13 9310 with Ubuntu 20.04 (and 20.10) the Linux kernel takes *four* seconds until it loads the init program (systemd).

260 ms seem to be spent to figure out that the power resource PIN, whatever that is, is off.

```
[    0.000000] Linux version 5.10.0-rc1+ (helmut@helmut-XPS-13-9310) (gcc (Ubuntu 10.2.0-13ubuntu1) 10.2.0, GNU ld (GNU Binutils for Ubuntu) 2.35.1) #2 SMP Tue Oct 27 14:58:21 CET 2020
[…]
[    0.257267] ACPI: Enabled 8 GPEs in block 00 to 7F
[    0.263619] ACPI: Power Resource [BTPR] (on)
[    0.278865] ACPI: Power Resource [V0PR] (on)
[    0.279049] ACPI: Power Resource [V1PR] (on)
[    0.279230] ACPI: Power Resource [V2PR] (on)
[    0.285237] ACPI: Power Resource [WRST] (on)
[    0.298118] ACPI: Power Resource [TBT0] (on)
[    0.298169] ACPI: Power Resource [TBT1] (on)
[    0.298217] ACPI: Power Resource [D3C] (on)
[    0.558918] ACPI: Power Resource [PIN] (off)
[    0.559413] ACPI: PCI Root Bridge [PC00] (domain 0000 [bus 00-fe])
[    0.559419] acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI HPX-Type3]
[…]
```
Comment 1 Paul Menzel 2020-10-29 07:26:58 UTC
Created attachment 293289 [details]
Linux 5.10+ messages with `initcall_debug` (output of `dmesg`)
Comment 2 Paul Menzel 2020-11-04 15:26:26 UTC
It could be related to not having `PINCTRL_TIGERLAKE` selected in Debian’s Linux kernel configuration [1], but I couldn’t test it yet.

[1]: https://bugs.debian.org/973372
Comment 3 Paul Menzel 2020-11-04 15:26:59 UTC
(In reply to Paul Menzel from comment #2)
> It could be related to not having `PINCTRL_TIGERLAKE` selected in Debian’s
> Linux kernel configuration [1], but I couldn’t test it yet.
> 
> [1]: https://bugs.debian.org/973372

Sorry, commented on wrong bug.
Comment 4 Stelian Pop 2021-02-25 10:34:35 UTC
Same here, with 5.11:

[    0.260314] ACPI: Power Resource [D3C] (on)
[    0.501555] ACPI: Power Resource [PIN] (off)

The BIOS version of my XPS is v2.0.0.
Comment 5 Paul Menzel 2022-05-12 13:51:40 UTC
This is still happening with Linux 5.17.3:

    [    0.000000] Linux version 5.17.0-1-amd64 (debian-kernel@lists.debian.org) (gcc-11 (Debian 11.2.0-20) 11.2.0, GNU ld (GNU Binutils for Debian) 2.38) #1 SMP PREEMPT Debian 5.17.3-1 (2022-04-18)
    […]
    [    0.000000] DMI: Dell Inc. XPS 13 9310/0GG9PT, BIOS 2.2.0 04/06/2021
    […]
    [    0.166572] ACPI: PM: Power Resource [D3C]
    [    0.407884] ACPI: PM: Power Resource [PIN]
    [    0.408109] ACPI: PCI Root Bridge [PC00] (domain 0000 [bus 00-fe])
    […]

on/off is not there anymore in newer Linux versions it seems.
Comment 6 Paul Menzel 2022-05-12 14:09:36 UTC
If somebody has time, and wants to debug this, you could use ftrace to trace the method `acpi_init()`. In Linux’s source tree run

    sudo tools/power/pm-graph/bootgraph.py -f -manual # actually import from [1]

and copy that command line to the Linux kernel command line. It’s a good start, but the two parameters

1.  ftrace_graph_filter=do_one_initcall
2.  ftrace_graph_max_depth=2

can be adapted. I think `do_one_initcall` could be replaced by `acpi_init` as a first step.

You can easier let `bootgraph.py` analyze the data, or do it manually.

    $ echo 0 | sudo tee /sys/kernel/debug/tracing/tracing_on
    $ sudo less /sys/kernel/debug/tracing/trace

Then look at the timestamps annotated with @ for the ones taking very long.

[1]: https://github.com/intel/pm-graph

Note You need to log in before you can comment on or make changes to this bug.