Re: Regression, thermal: core: battery reading wrong after wake from S3 [Was: Bug Report according to thermal_core.c]

From: fhortner@xxxxxxxx
Date: Thu Jun 13 2024 - 16:14:19 EST


Am 13.06.24 um 17:14 schrieb Rafael J. Wysocki:
Let's see if the ACPI thermal zone is the real culprit.

The attached patch only adds the delay for thermal zone 0 which is the
ACPI thermal zone.  It also prints the ID and type for all of the
resuming thermal zones.

Please test it (removing all of the test changes/patches tried so far)
and let me know what happens to the battery readings.
Patch

thermal-delay-resume.patch

does not work. Output according to dmesg.txt
Attached is a slightly modified version of the last patch I sent.
Please test it and let me know if it addresses the problem you are
seeing.

If it helps, I think we are done with this at least for now.
patch thermal-core-resume-prio.patch with .priority = -1 does work
One more thing to try is the attached patch (independent of the
previous one) to lower the priority of the thermal PM notifier to make
it run always after the ACPI battery one.

Please test this one too and let me know if it works for you.
patch
thermal-core-resume-prio.patch

with .priority = INT_MIN does also work.

If you need any further tests, please don't hesitate to tell me so.

Thank you for your help!


[ 96.212045] e1000e 0000:00:1f.6 enp0s31f6: NIC Link is Down
[ 96.239599] wlp82s0: deauthenticating from e4:f4:c6:0f:be:ad by local choice (Reason: 3=DEAUTH_LEAVING)
[ 96.674472] PM: suspend entry (deep)
[ 96.687430] Filesystems sync: 0.012 seconds
[ 96.729577] Freezing user space processes
[ 96.730874] Freezing user space processes completed (elapsed 0.001 seconds)
[ 96.730877] OOM killer disabled.
[ 96.730878] Freezing remaining freezable tasks
[ 96.731836] Freezing remaining freezable tasks completed (elapsed 0.000 seconds)
[ 96.731876] printk: Suspending console(s) (use no_console_suspend to debug)
[ 96.896883] e1000e: EEE TX LPI TIMER: 00000011
[ 97.847980] PM: suspend devices took 1.116 seconds
[ 97.879656] ACPI: EC: interrupt blocked
[ 97.959073] ACPI: PM: Preparing to enter system sleep state S3
[ 97.964998] ACPI: EC: event blocked
[ 97.965001] ACPI: EC: EC stopped
[ 97.965003] ACPI: PM: Saving platform NVS memory
[ 97.965143] Disabling non-boot CPUs ...
[ 97.968006] smpboot: CPU 1 is now offline
[ 97.973198] smpboot: CPU 2 is now offline
[ 97.977287] smpboot: CPU 3 is now offline
[ 97.982708] smpboot: CPU 4 is now offline
[ 97.986669] smpboot: CPU 5 is now offline
[ 97.992260] smpboot: CPU 6 is now offline
[ 97.995749] smpboot: CPU 7 is now offline
[ 98.000255] smpboot: CPU 8 is now offline
[ 98.003969] smpboot: CPU 9 is now offline
[ 98.008460] smpboot: CPU 10 is now offline
[ 98.011587] smpboot: CPU 11 is now offline
[ 98.015256] ACPI: PM: Low-level resume complete
[ 98.015302] ACPI: EC: EC started
[ 98.015302] ACPI: PM: Restoring platform NVS memory
[ 98.016072] Enabling non-boot CPUs ...
[ 98.016123] smpboot: Booting Node 0 Processor 1 APIC 0x2
[ 98.016959] CPU1 is up
[ 98.016991] smpboot: Booting Node 0 Processor 2 APIC 0x4
[ 98.017732] CPU2 is up
[ 98.017759] smpboot: Booting Node 0 Processor 3 APIC 0x6
[ 98.018516] CPU3 is up
[ 98.018542] smpboot: Booting Node 0 Processor 4 APIC 0x8
[ 98.019333] CPU4 is up
[ 98.019364] smpboot: Booting Node 0 Processor 5 APIC 0xa
[ 98.020178] CPU5 is up
[ 98.020203] smpboot: Booting Node 0 Processor 6 APIC 0x1
[ 98.021181] CPU6 is up
[ 98.021211] smpboot: Booting Node 0 Processor 7 APIC 0x3
[ 98.022044] CPU7 is up
[ 98.022070] smpboot: Booting Node 0 Processor 8 APIC 0x5
[ 98.022921] CPU8 is up
[ 98.022948] smpboot: Booting Node 0 Processor 9 APIC 0x7
[ 98.023825] CPU9 is up
[ 98.023851] smpboot: Booting Node 0 Processor 10 APIC 0x9
[ 98.024747] CPU10 is up
[ 98.024772] smpboot: Booting Node 0 Processor 11 APIC 0xb
[ 98.025695] CPU11 is up
[ 98.030392] ACPI: PM: Waking up from system sleep state S3
[ 98.107582] ACPI: EC: interrupt unblocked
[ 99.367831] ACPI: EC: event unblocked
[ 99.373907] i915 0000:00:02.0: [drm] [ENCODER:98:DDI A/PHY A] is disabled/in DSI mode with an ungated DDI clock, gate it
[ 99.383524] nvme nvme0: 12/0/0 default/read/poll queues
[ 99.387529] nvme nvme1: D3 entry latency set to 8 seconds
[ 99.405888] nvme nvme1: 12/0/0 default/read/poll queues
[ 99.658575] usb 1-8: reset high-speed USB device number 3 using xhci_hcd
[ 99.849890] PM: resume devices took 0.482 seconds
[ 99.850463] mei_hdcp 0000:00:16.0-b638ab7e-94e2-4ea2-a552-d1c54b627f04: bound 0000:00:02.0 (ops i915_hdcp_ops [i915])
[ 99.851964] OOM killer enabled.
[ 99.851969] Restarting tasks ...
[ 99.852075] pci_bus 0000:06: Allocating resources
[ 99.852130] pci_bus 0000:2c: Allocating resources
[ 99.852237] pci_bus 0000:06: Allocating resources
[ 99.852266] pci_bus 0000:2c: Allocating resources
[ 99.852364] usb 1-9: USB disconnect, device number 4
[ 99.855436] done.
[ 99.855461] random: crng reseeded on system resumption
[ 99.855583] thermal thermal_zone0: [acpitz]: thermal_zone_device_resume
[ 99.855587] thermal thermal_zone0: [acpitz]: Sleeping
[ 99.855596] thermal thermal_zone1: [INT3400 Thermal]: thermal_zone_device_resume
[ 99.855599] thermal thermal_zone2: [SEN1]: thermal_zone_device_resume
[ 99.856071] thermal thermal_zone3: [SEN2]: thermal_zone_device_resume
[ 99.856532] thermal thermal_zone4: [pch_cannonlake]: thermal_zone_device_resume
[ 99.856542] thermal thermal_zone5: [SEN3]: thermal_zone_device_resume
[ 99.856638] thermal thermal_zone6: [SEN0]: thermal_zone_device_resume
[ 99.856729] thermal thermal_zone7: [B0D4]: thermal_zone_device_resume
[ 99.856845] thermal thermal_zone8: [SEN4]: thermal_zone_device_resume
[ 99.856939] thermal thermal_zone9: [SEN5]: thermal_zone_device_resume
[ 99.857058] thermal thermal_zone10: [SEN6]: thermal_zone_device_resume
[ 99.857633] thermal thermal_zone11: [SEN7]: thermal_zone_device_resume
[ 99.861519] thermal thermal_zone12: [SEN8]: thermal_zone_device_resume
[ 99.862066] thermal thermal_zone13: [SEN9]: thermal_zone_device_resume
[ 99.862181] thermal thermal_zone14: [SENA]: thermal_zone_device_resume
[ 99.864671] thermal thermal_zone15: [SENB]: thermal_zone_device_resume
[ 99.867575] thermal thermal_zone16: [SENC]: thermal_zone_device_resume
[ 99.867804] thermal thermal_zone17: [SEND]: thermal_zone_device_resume
[ 99.872301] thermal thermal_zone18: [x86_pkg_temp]: thermal_zone_device_resume
[ 99.872663] thermal thermal_zone19: [iwlwifi_1]: thermal_zone_device_resume
[ 99.929212] thinkpad_acpi: battery 1 registered (start 0, stop 80, behaviours: 0x7)
[ 99.954500] PM: suspend exit
[ 99.970116] usb 1-9: new full-speed USB device number 6 using xhci_hcd
[ 100.099418] usb 1-9: New USB device found, idVendor=06cb, idProduct=00bd, bcdDevice= 0.00
[ 100.099422] usb 1-9: New USB device strings: Mfr=0, Product=0, SerialNumber=1
[ 100.099424] usb 1-9: SerialNumber: 67b7546ad745
[ 104.044186] wlp82s0: authenticate with e4:f4:c6:0f:be:ad (local address=f6:a5:a0:e4:66:16)
[ 104.046503] wlp82s0: send auth to e4:f4:c6:0f:be:ad (try 1/3)
[ 104.077462] wlp82s0: authenticated
[ 104.078184] wlp82s0: associate with e4:f4:c6:0f:be:ad (try 1/3)
[ 104.084924] wlp82s0: RX AssocResp from e4:f4:c6:0f:be:ad (capab=0x1411 status=0 aid=5)
[ 104.131659] wlp82s0: associated