mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Regression, thermal: core: battery reading wrong after wake from S3 [Was: Bug Report according to thermal_core.c]
       [not found] ` <7f4a777b-88f6-4429-b168-d1337d291386@yahoo.de>
@ 2024-05-30 10:21   ` Linux regression tracking (Thorsten Leemhuis)
  2024-05-30 10:49     ` fhortner
  0 siblings, 1 reply; 10+ messages in thread
From: Linux regression tracking (Thorsten Leemhuis) @ 2024-05-30 10:21 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: fhortner, linux-pm, LKML, Linux kernel regressions list

[adding the culprits author, LKML, and the regression mailing list to
the list of recipients; changing subject, too]

On 29.05.24 21:52, fhortner@yahoo.de wrote:
> After bisection I have reported a bug according to thermal_core.c:
> After "Resume thermal zones asynchronously" commit: Wrong Battery
> Reading after Wake from S3 Sleep - Lenovo Thinkpad P1 Gen2
>
> https://bugzilla.kernel.org/show_bug.cgi?id=218881
> Could you please have a look at it 
> 
> I have performed a bisection and the culprit is this commit: Resume
> thermal zones asynchronously
> git bisect bad 5a5efdaffda5d23717d9117cf36cda9eafcf2fae
> # first bad commit: [5a5efdaffda5d23717d9117cf36cda9eafcf2fae] thermal:
> core: Resume thermal zones asynchronously
> 
> I have also verified it by compiling a kernel

Side note: not critical at all, but would have been good if you had
specified which kernel version you build.

> without this commit.

Thanks for the report. To be sure the issue doesn't fall through the
cracks unnoticed, I'm adding it to regzbot, the Linux kernel regression
tracking bot:

#regzbot ^introduced 5a5efdaffda5d23717d9117cf36cda9eafcf2
#regzbot dup: https://bugzilla.kernel.org/show_bug.cgi?id=218881
#regzbot title
#regzbot ignore-activity

Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat)
--
Everything you wanna know about Linux kernel regression tracking:
https://linux-regtracking.leemhuis.info/about/#tldr
That page also explains what to do if mails like this annoy you.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Regression, thermal: core: battery reading wrong after wake from S3 [Was: Bug Report according to thermal_core.c]
  2024-05-30 10:21   ` Regression, thermal: core: battery reading wrong after wake from S3 [Was: Bug Report according to thermal_core.c] Linux regression tracking (Thorsten Leemhuis)
@ 2024-05-30 10:49     ` fhortner
  2024-06-03 18:38       ` Rafael J. Wysocki
  0 siblings, 1 reply; 10+ messages in thread
From: fhortner @ 2024-05-30 10:49 UTC (permalink / raw)
  To: Linux regressions mailing list, Rafael J. Wysocki; +Cc: linux-pm, LKML

Thanks Thorsten for the side note.

I have compiled kernel 6.8.11 with reverted commit 
5a5efdaffda5d23717d9117cf36cda9eafcf2fae.

Battery Status works fine now with reverted commit after S3 Sleep and 
Wake cycles.

Best, Reinhard


Am 30.05.24 um 12:21 schrieb Linux regression tracking (Thorsten Leemhuis):
> [adding the culprits author, LKML, and the regression mailing list to
> the list of recipients; changing subject, too]
>
> On 29.05.24 21:52, fhortner@yahoo.de wrote:
>> After bisection I have reported a bug according to thermal_core.c:
>> After "Resume thermal zones asynchronously" commit: Wrong Battery
>> Reading after Wake from S3 Sleep - Lenovo Thinkpad P1 Gen2
>>
>> https://bugzilla.kernel.org/show_bug.cgi?id=218881
>> Could you please have a look at it
>>
>> I have performed a bisection and the culprit is this commit: Resume
>> thermal zones asynchronously
>> git bisect bad 5a5efdaffda5d23717d9117cf36cda9eafcf2fae
>> # first bad commit: [5a5efdaffda5d23717d9117cf36cda9eafcf2fae] thermal:
>> core: Resume thermal zones asynchronously
>>
>> I have also verified it by compiling a kernel
> Side note: not critical at all, but would have been good if you had
> specified which kernel version you build.
>
>> without this commit.
> Thanks for the report. To be sure the issue doesn't fall through the
> cracks unnoticed, I'm adding it to regzbot, the Linux kernel regression
> tracking bot:
>
> #regzbot ^introduced 5a5efdaffda5d23717d9117cf36cda9eafcf2
> #regzbot dup: https://bugzilla.kernel.org/show_bug.cgi?id=218881
> #regzbot title
> #regzbot ignore-activity
>
> Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat)
> --
> Everything you wanna know about Linux kernel regression tracking:
> https://linux-regtracking.leemhuis.info/about/#tldr
> That page also explains what to do if mails like this annoy you.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Regression, thermal: core: battery reading wrong after wake from S3 [Was: Bug Report according to thermal_core.c]
  2024-05-30 10:49     ` fhortner
@ 2024-06-03 18:38       ` Rafael J. Wysocki
  2024-06-03 18:49         ` fhortner
       [not found]         ` <312649b1-eea9-4346-af93-76a821e88eb7@yahoo.de>
  0 siblings, 2 replies; 10+ messages in thread
From: Rafael J. Wysocki @ 2024-06-03 18:38 UTC (permalink / raw)
  To: fhortner
  Cc: Linux regressions mailing list, Rafael J. Wysocki, linux-pm, LKML

On Thu, May 30, 2024 at 1:10 PM fhortner@yahoo.de <fhortner@yahoo.de> wrote:
>
> Thanks Thorsten for the side note.
>
> I have compiled kernel 6.8.11 with reverted commit
> 5a5efdaffda5d23717d9117cf36cda9eafcf2fae.
>
> Battery Status works fine now with reverted commit after S3 Sleep and
> Wake cycles.

Well, the connection between the battery status and the resume of
thermal zones is somewhat unclear to me at the moment.

Most likely, the commit in question changes the timing of system
resume which affects the battery behavior and it seems to be related
to the EC somehow.

Let's first see what thermal zones there are on your system, so please
send the output of

$ cat /sys/class/thermal/thermal_zone*/type

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Regression, thermal: core: battery reading wrong after wake from S3 [Was: Bug Report according to thermal_core.c]
  2024-06-03 18:38       ` Rafael J. Wysocki
@ 2024-06-03 18:49         ` fhortner
       [not found]         ` <312649b1-eea9-4346-af93-76a821e88eb7@yahoo.de>
  1 sibling, 0 replies; 10+ messages in thread
From: fhortner @ 2024-06-03 18:49 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Linux regressions mailing list, Rafael J. Wysocki, linux-pm, LKML

I Totally agree, this was also my first thought, what has the battery 
state to do with thermals.
But at least, so far, we have in total three repros confirmed in the bug 
report. All of the same machine.
Thinkpad X1 Xtreme Gen2 = Thinkpad P1 Gen2. The only difference is the 
graphics Nvidia Geforce vs Nvidia Quadro

these are the types of thermal zones:

cat /sys/class/thermal/thermal_zone*/type
acpitz
SEN6
SEN7
SEN8
SEN9
SENA
SENB
SENC
SEND
x86_pkg_temp
iwlwifi_1
INT3400 Thermal
SEN1
SEN2
pch_cannonlake
SEN3
SEN0
B0D4
SEN4
SEN5


Am 03.06.24 um 20:38 schrieb Rafael J. Wysocki:
> On Thu, May 30, 2024 at 1:10 PM fhortner@yahoo.de <fhortner@yahoo.de> wrote:
>> Thanks Thorsten for the side note.
>>
>> I have compiled kernel 6.8.11 with reverted commit
>> 5a5efdaffda5d23717d9117cf36cda9eafcf2fae.
>>
>> Battery Status works fine now with reverted commit after S3 Sleep and
>> Wake cycles.
> Well, the connection between the battery status and the resume of
> thermal zones is somewhat unclear to me at the moment.
>
> Most likely, the commit in question changes the timing of system
> resume which affects the battery behavior and it seems to be related
> to the EC somehow.
>
> Let's first see what thermal zones there are on your system, so please
> send the output of
>
> $ cat /sys/class/thermal/thermal_zone*/type


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Regression, thermal: core: battery reading wrong after wake from S3 [Was: Bug Report according to thermal_core.c]
       [not found]                           ` <CAJZ5v0jtjXfvr4GXukjyO9XsEO6K2Nfux3otpFPP4vWS_9_qEQ@mail.gmail.com>
@ 2024-06-12 17:23                             ` Rafael J. Wysocki
  2024-06-13 15:14                               ` Rafael J. Wysocki
  0 siblings, 1 reply; 10+ messages in thread
From: Rafael J. Wysocki @ 2024-06-12 17:23 UTC (permalink / raw)
  To: fhortner
  Cc: Linux PM, Linux Kernel Mailing List, Linux regressions mailing list

[-- Attachment #1: Type: text/plain, Size: 1253 bytes --]

Restored list CCs.

On Wed, Jun 12, 2024 at 3:41 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> On Wed, Jun 12, 2024 at 11:56 AM fhortner@yahoo.de <fhortner@yahoo.de> wrote:
> >
> > Am 11.06.24 um 16:42 schrieb Rafael J. Wysocki:
> >
> > This doesn't make them run in a different order, it just delays both
> > of them, because the notifiers are called sequentially.
> >
> > However, if you added the msleep() at the beginning of
> > thermal_zone_device_resume(), it would change the ordering of this
> > function with respect to the PM notifiers, so please try doing this.
> >
> > I did so and added msleep(1000) to thermal_core.c line 1634
> > I have also reverted the patch you sent me.
> >
> > The battery readings after resume from S3 sleep where fine.
> > I have tried 2 reboots with 4 sleep/wake cycles, respectively
>
> Thanks!
>
> This means that the two code paths in question somehow interfere
> destructively when they are running in parallel with each other.

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.

[-- Attachment #2: thermal-core-resume-prio.patch --]
[-- Type: text/x-patch, Size: 499 bytes --]

---
 drivers/thermal/thermal_core.c |    1 +
 1 file changed, 1 insertion(+)

Index: linux-pm/drivers/thermal/thermal_core.c
===================================================================
--- linux-pm.orig/drivers/thermal/thermal_core.c
+++ linux-pm/drivers/thermal/thermal_core.c
@@ -1712,6 +1712,7 @@ static int thermal_pm_notify(struct noti
 
 static struct notifier_block thermal_pm_nb = {
 	.notifier_call = thermal_pm_notify,
+	.priority = -1,
 };
 
 static int __init thermal_init(void)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Regression, thermal: core: battery reading wrong after wake from S3 [Was: Bug Report according to thermal_core.c]
  2024-06-12 17:23                             ` Rafael J. Wysocki
@ 2024-06-13 15:14                               ` Rafael J. Wysocki
  2024-06-13 19:43                                 ` fhortner
  0 siblings, 1 reply; 10+ messages in thread
From: Rafael J. Wysocki @ 2024-06-13 15:14 UTC (permalink / raw)
  To: fhortner
  Cc: Linux PM, Linux Kernel Mailing List, Linux regressions mailing list

[-- Attachment #1: Type: text/plain, Size: 1605 bytes --]

On Wed, Jun 12, 2024 at 7:23 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> Restored list CCs.
>
> On Wed, Jun 12, 2024 at 3:41 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
> >
> > On Wed, Jun 12, 2024 at 11:56 AM fhortner@yahoo.de <fhortner@yahoo.de> wrote:
> > >
> > > Am 11.06.24 um 16:42 schrieb Rafael J. Wysocki:
> > >
> > > This doesn't make them run in a different order, it just delays both
> > > of them, because the notifiers are called sequentially.
> > >
> > > However, if you added the msleep() at the beginning of
> > > thermal_zone_device_resume(), it would change the ordering of this
> > > function with respect to the PM notifiers, so please try doing this.
> > >
> > > I did so and added msleep(1000) to thermal_core.c line 1634
> > > I have also reverted the patch you sent me.
> > >
> > > The battery readings after resume from S3 sleep where fine.
> > > I have tried 2 reboots with 4 sleep/wake cycles, respectively
> >
> > Thanks!
> >
> > This means that the two code paths in question somehow interfere
> > destructively when they are running in parallel with each other.
>
> 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.

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.

[-- Attachment #2: thermal-core-resume-prio.patch --]
[-- Type: text/x-patch, Size: 688 bytes --]

---
 drivers/thermal/thermal_core.c |    6 ++++++
 1 file changed, 6 insertions(+)

Index: linux-pm/drivers/thermal/thermal_core.c
===================================================================
--- linux-pm.orig/drivers/thermal/thermal_core.c
+++ linux-pm/drivers/thermal/thermal_core.c
@@ -1712,6 +1712,12 @@ static int thermal_pm_notify(struct noti
 
 static struct notifier_block thermal_pm_nb = {
 	.notifier_call = thermal_pm_notify,
+	/*
+	 * Run at the lowest priority to avoid interference between the thermal
+	 * zone resume work items spawned by thermal_pm_notify() and the other
+	 * PM notifiers.
+	 */
+	.priority = INT_MIN,
 };
 
 static int __init thermal_init(void)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Regression, thermal: core: battery reading wrong after wake from S3 [Was: Bug Report according to thermal_core.c]
  2024-06-13 15:14                               ` Rafael J. Wysocki
@ 2024-06-13 19:43                                 ` fhortner
  2024-06-14 10:18                                   ` Rafael J. Wysocki
  0 siblings, 1 reply; 10+ messages in thread
From: fhortner @ 2024-06-13 19:43 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Linux PM, Linux Kernel Mailing List, Linux regressions mailing list


[-- Attachment #1.1: Type: text/plain, Size: 1189 bytes --]

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!


[-- Attachment #1.2: Type: text/html, Size: 2840 bytes --]

[-- Attachment #2: dmesg.txt --]
[-- Type: text/plain, Size: 6134 bytes --]

[   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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Regression, thermal: core: battery reading wrong after wake from S3 [Was: Bug Report according to thermal_core.c]
  2024-06-13 19:43                                 ` fhortner
@ 2024-06-14 10:18                                   ` Rafael J. Wysocki
  2024-06-16  7:39                                     ` fhortner
  0 siblings, 1 reply; 10+ messages in thread
From: Rafael J. Wysocki @ 2024-06-14 10:18 UTC (permalink / raw)
  To: fhortner
  Cc: Rafael J. Wysocki, Linux PM, Linux Kernel Mailing List,
	Linux regressions mailing list

On Thu, Jun 13, 2024 at 10:04 PM fhortner@yahoo.de <fhortner@yahoo.de> wrote:
>
> 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.

No, thank you, I think you've done enough and it is appreciated.

I don't see any particular drawbacks of this approach and investing
more time in trying to get to the bottom of the issue is probably not
worth it.

I'm going to submit the last patch as the proposed solution.

> Thank you for your help!

No problem and thank you!

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Regression, thermal: core: battery reading wrong after wake from S3 [Was: Bug Report according to thermal_core.c]
  2024-06-14 10:18                                   ` Rafael J. Wysocki
@ 2024-06-16  7:39                                     ` fhortner
  2024-06-17 10:46                                       ` Rafael J. Wysocki
  0 siblings, 1 reply; 10+ messages in thread
From: fhortner @ 2024-06-16  7:39 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Linux PM, Linux Kernel Mailing List, Linux regressions mailing list

Currently I am running kernel 6.8.12 with reverted commit.
But yesterday I had a strange behavior.
After resuming from S3 the laptop registered a low battery, immediately 
after resume (notification in KDE Plasme). But as far as I could check, 
the battery level and stats where fine. Nevertheless, after 1 minute it 
shut off. I guess the low battery reading directly after after resume 
triggered it.

It is not directly related with the commit, because I have reverted it, 
but nevertheless, maybe it is helpful to understand the underlying 
firmware issue.

I' going to test your last patch and let you know.


Am 14.06.24 um 12:18 schrieb Rafael J. Wysocki:
> On Thu, Jun 13, 2024 at 10:04 PM fhortner@yahoo.de <fhortner@yahoo.de> wrote:
>> 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.
> No, thank you, I think you've done enough and it is appreciated.
>
> I don't see any particular drawbacks of this approach and investing
> more time in trying to get to the bottom of the issue is probably not
> worth it.
>
> I'm going to submit the last patch as the proposed solution.
>
>> Thank you for your help!
> No problem and thank you!


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Regression, thermal: core: battery reading wrong after wake from S3 [Was: Bug Report according to thermal_core.c]
  2024-06-16  7:39                                     ` fhortner
@ 2024-06-17 10:46                                       ` Rafael J. Wysocki
  0 siblings, 0 replies; 10+ messages in thread
From: Rafael J. Wysocki @ 2024-06-17 10:46 UTC (permalink / raw)
  To: fhortner
  Cc: Rafael J. Wysocki, Linux PM, Linux Kernel Mailing List,
	Linux regressions mailing list

On Sun, Jun 16, 2024 at 9:50 AM fhortner@yahoo.de <fhortner@yahoo.de> wrote:
>
> Currently I am running kernel 6.8.12 with reverted commit.
> But yesterday I had a strange behavior.
> After resuming from S3 the laptop registered a low battery, immediately
> after resume (notification in KDE Plasme). But as far as I could check,
> the battery level and stats where fine. Nevertheless, after 1 minute it
> shut off. I guess the low battery reading directly after after resume
> triggered it.
>
> It is not directly related with the commit, because I have reverted it,
> but nevertheless, maybe it is helpful to understand the underlying
> firmware issue.

We can do that, but please create a new non-regression BZ entry for it
against ACPI/battery and let me know its number.

> I' going to test your last patch and let you know.

OK

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-06-17 10:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1051df4c-067f-455e-8c7f-9dc47dc8ed00@yahoo.de>
     [not found] ` <7f4a777b-88f6-4429-b168-d1337d291386@yahoo.de>
2024-05-30 10:21   ` Regression, thermal: core: battery reading wrong after wake from S3 [Was: Bug Report according to thermal_core.c] Linux regression tracking (Thorsten Leemhuis)
2024-05-30 10:49     ` fhortner
2024-06-03 18:38       ` Rafael J. Wysocki
2024-06-03 18:49         ` fhortner
     [not found]         ` <312649b1-eea9-4346-af93-76a821e88eb7@yahoo.de>
     [not found]           ` <CAJZ5v0jfvRWK0M3Xf=36e74cVQ9rN5T1WdZZVnuk1XmZ=xu==g@mail.gmail.com>
     [not found]             ` <78549853-1763-40cf-9974-3fc737fad093@yahoo.de>
     [not found]               ` <CAJZ5v0h5pQDaA-bEOmcz_TpE87kFqWLFLJC+=OLjg5ZtF3hxpQ@mail.gmail.com>
     [not found]                 ` <91d94429-fc7e-4828-914d-1a251ee1ba99@yahoo.de>
     [not found]                   ` <CAJZ5v0gPZHDfuK1FRdTAG8Eqjf0NWUQdf-_GCWsWf6dCBE=1dg@mail.gmail.com>
     [not found]                     ` <543787c3-db5b-4f63-b5e0-df508300db73@yahoo.de>
     [not found]                       ` <CAJZ5v0h7jDw3yX689nZdB+YeJbCk0vFoUgVb4Yi0cqDxjL5chQ@mail.gmail.com>
     [not found]                         ` <40ec1e53-2bc8-48aa-9909-fac9072adb57@yahoo.de>
     [not found]                           ` <CAJZ5v0jtjXfvr4GXukjyO9XsEO6K2Nfux3otpFPP4vWS_9_qEQ@mail.gmail.com>
2024-06-12 17:23                             ` Rafael J. Wysocki
2024-06-13 15:14                               ` Rafael J. Wysocki
2024-06-13 19:43                                 ` fhortner
2024-06-14 10:18                                   ` Rafael J. Wysocki
2024-06-16  7:39                                     ` fhortner
2024-06-17 10:46                                       ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®