* [2/6] 2.6.21-rc4: known regressions
[not found] <Pine.LNX.4.64.0703160925270.26106@woody.linux-foundation.org>
@ 2007-03-18 18:49 ` Adrian Bunk
2007-03-18 18:49 ` [3/6] " Adrian Bunk
` (4 subsequent siblings)
5 siblings, 0 replies; 69+ messages in thread
From: Adrian Bunk @ 2007-03-18 18:49 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton
Cc: Linux Kernel Mailing List, Randy Dunlap, gregkh, linux-pci,
Vladimir Brik, Andi Kleen, Ray Lee, lenb, linux-acpi, Colchao,
Mathieu Bérard, Tejun Heo, jgarzik, linux-ide,
Michal Jaegermann, Fabio Comolli, Plamen Petrov, Laurent Riffard,
Alan Cox
This email lists some known regressions in Linus' tree compared to 2.6.20.
If you find your name in the Cc header, you are either submitter of one
of the bugs, maintainer of an affectected subsystem or driver, a patch
of you caused a breakage or I'm considering you in any other way
possibly involved with one or more of these issues.
Due to the huge amount of recipients, please trim the Cc when answering.
Subject : x86_64: boot hangs unless CONFIG_PCIEPORTBUS=n and acpi=off
References : http://bugzilla.kernel.org/show_bug.cgi?id=8162
Submitter : Randy Dunlap <randy.dunlap@oracle.com>
Status : unknown
Subject : AMD Elan: Crash after "Allocating PCI resources"
References : http://bugzilla.kernel.org/show_bug.cgi?id=8161
Submitter : Vladimir Brik <no.hope@gmail.com>
Handled-By : Andi Kleen <ak@muc.de>
Status : patch available
Subject : ACPI regression with noapic
References : http://lkml.org/lkml/2007/3/8/468
Submitter : Ray Lee <ray-lk@madrabbit.org>
Status : unknown
Subject : acpi_serialize locks system during boot
References : http://bugzilla.kernel.org/show_bug.cgi?id=8171
Submitter : Colchao <colchaodemola@gmail.com>
Handled-By : Len Brown <len.brown@intel.com>
Patch : http://bugzilla.kernel.org/show_bug.cgi?id=8171
Status : patch available
Subject : NCQ problem with ahci and Hitachi drive (ACPI related)
References : http://lkml.org/lkml/2007/3/4/178
http://lkml.org/lkml/2007/3/9/475
Submitter : Mathieu Bérard <Mathieu.Berard@crans.org>
Handled-By : Tejun Heo <htejun@gmail.com>
Status : problem is being debugged
Subject : kernels fail to boot with drives on ATIIXP controller
(ACPI/IRQ related)
References : https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=229621
http://lkml.org/lkml/2007/3/4/257
Submitter : Michal Jaegermann <michal@ellpspace.math.ualberta.ca>
Status : unknown
Subject : libata: PATA UDMA/100 configured as UDMA/33
References : http://lkml.org/lkml/2007/2/20/294
http://www.mail-archive.com/linux-ide@vger.kernel.org/msg04115.html
http://bugzilla.kernel.org/show_bug.cgi?id=8133
http://bugzilla.kernel.org/show_bug.cgi?id=8164
Submitter : Fabio Comolli <fabio.comolli@gmail.com>
Plamen Petrov <plamen.petrov@tk.ru.acad.bg>
Laurent Riffard <laurent.riffard@free.fr>
Handled-By : Tejun Heo <htejun@gmail.com>
Alan Cox <alan@lxorguk.ukuu.org.uk>
Status : Alan: Some cases should be fixed now but probably not all
(eg the Nvidia one)
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 69+ messages in thread
* [3/6] 2.6.21-rc4: known regressions
[not found] <Pine.LNX.4.64.0703160925270.26106@woody.linux-foundation.org>
2007-03-18 18:49 ` [2/6] 2.6.21-rc4: known regressions Adrian Bunk
@ 2007-03-18 18:49 ` Adrian Bunk
2007-03-26 1:25 ` Jeff Chua
2007-03-23 18:48 ` [2/5] 2.6.21-rc4: known regressions (v2) Adrian Bunk
` (3 subsequent siblings)
5 siblings, 1 reply; 69+ messages in thread
From: Adrian Bunk @ 2007-03-18 18:49 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton
Cc: Jeremy Fitzhardinge, Soeren Sonnenburg, Marcus Better, linux-ide,
Jens Axboe, Thomas Gleixner, Alexey Starikovskiy, Thomas Meyer,
Mike Harris, Maxim Levitsky, Jeff Chua, Ray Lee, gregkh, linux-pm,
Linux Kernel Mailing List, linux-acpi, Eric W. Biederman,
linux-pci, jgarzik
This email lists some known regressions in Linus' tree compared to 2.6.20.
If you find your name in the Cc header, you are either submitter of one
of the bugs, maintainer of an affectected subsystem or driver, a patch
of you caused a breakage or I'm considering you in any other way
possibly involved with one or more of these issues.
Due to the huge amount of recipients, please trim the Cc when answering.
Subject : ThinkPad X60: resume no longer works (PCI related?)
References : http://lkml.org/lkml/2007/3/13/3
Submitter : Dave Jones <davej@redhat.com>
Jeremy Fitzhardinge <jeremy@goop.org>
Caused-By : PCI merge
commit 78149df6d565c36675463352d0bfe0000b02b7a7
Handled-By : Eric W. Biederman <ebiederm@xmission.com>
Rafael J. Wysocki <rjw@sisk.pl>
Status : problem is being debugged
Subject : ThinkPad doesn't resume from suspend to RAM
References : http://lkml.org/lkml/2007/2/27/80
http://lkml.org/lkml/2007/2/28/348
Submitter : Jens Axboe <jens.axboe@oracle.com>
Jeff Chua <jeff.chua.linux@gmail.com>
Status : unknown
Subject : suspend to disk hangs
References : http://lkml.org/lkml/2007/3/6/142
Submitter : Jeff Chua <jeff.chua.linux@gmail.com>
Status : unknown
Subject : suspend to disk hangs
References : http://lkml.org/lkml/2007/3/16/126
Submitter : Maxim Levitsky <maximlevitsky@gmail.com>
Status : unknown
Subject : suspend to disk hangs
References : http://bugzilla.kernel.org/show_bug.cgi?id=8224
Submitter : Mike Harris <atarimike@wavecable.com>
Status : unknown
Subject : ThinkPad R60: suspend broken
References : http://lkml.org/lkml/2007/3/16/57
Submitter : Marcus Better <marcus@better.se>
Status : unknown
Subject : laptop immediately resumes after suspend
References : http://lkml.org/lkml/2007/3/8/469
Submitter : Ray Lee <ray-lk@madrabbit.org>
Caused-By : Alexey Starikovskiy <alexey.y.starikovskiy@linux.intel.com>
commit ed41dab90eb40ac4911e60406bc653661f0e4ce1
Handled-By : Len Brown <lenb@kernel.org>
Patch : http://lkml.org/lkml/2007/3/12/228
Status : patch available
Subject : second suspend to disk in a row results in an oops (libata?)
References : http://lkml.org/lkml/2007/3/17/43
Submitter : Thomas Meyer <thomas@m3y3r.de>
Status : unknown
Subject : SATA breakage on resume
References : http://lkml.org/lkml/2007/3/7/233
Submitter : Thomas Gleixner <tglx@linutronix.de>
Soeren Sonnenburg <kernel@nn7.de>
Status : unknown
^ permalink raw reply [flat|nested] 69+ messages in thread
* [2/5] 2.6.21-rc4: known regressions (v2)
[not found] <Pine.LNX.4.64.0703160925270.26106@woody.linux-foundation.org>
2007-03-18 18:49 ` [2/6] 2.6.21-rc4: known regressions Adrian Bunk
2007-03-18 18:49 ` [3/6] " Adrian Bunk
@ 2007-03-23 18:48 ` Adrian Bunk
2007-03-26 10:01 ` Tejun Heo
2007-03-23 18:50 ` [3/5] " Adrian Bunk
` (2 subsequent siblings)
5 siblings, 1 reply; 69+ messages in thread
From: Adrian Bunk @ 2007-03-23 18:48 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton
Cc: Linux Kernel Mailing List, Michal Jaegermann, lenb, linux-acpi,
Ray Lee, Thomas Gleixner, Mathieu Bérard, Tejun Heo, jgarzik,
linux-ide, Fabio Comolli, Plamen Petrov, Laurent Riffard,
Lukas Hejtmanek, Alan Cox
This email lists some known regressions in Linus' tree compared to 2.6.20.
If you find your name in the Cc header, you are either submitter of one
of the bugs, maintainer of an affectected subsystem or driver, a patch
of you caused a breakage or I'm considering you in any other way
possibly involved with one or more of these issues.
Due to the huge amount of recipients, please trim the Cc when answering.
Subject : kernels fail to boot with drives on ATIIXP controller
(ACPI/IRQ related)
References : https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=229621
http://lkml.org/lkml/2007/3/4/257
Submitter : Michal Jaegermann <michal@ellpspace.math.ualberta.ca>
Status : unknown
Subject : x86_64: ACPI regression with noapic (APICTIMER_STOPS_ON_C3?)
References : http://lkml.org/lkml/2007/3/8/468
http://lkml.org/lkml/2007/3/22/156
Submitter : Ray Lee <ray-lk@madrabbit.org>
Handled-By : Thomas Gleixner <tglx@linutronix.de>
Status : problem is being debugged
Subject : NCQ problem with ahci and Hitachi drive (ACPI related)
References : http://lkml.org/lkml/2007/3/4/178
http://lkml.org/lkml/2007/3/9/475
Submitter : Mathieu Bérard <Mathieu.Berard@crans.org>
Handled-By : Tejun Heo <htejun@gmail.com>
Status : problem is being debugged
Subject : libata: PATA UDMA/100 configured as UDMA/33
References : http://lkml.org/lkml/2007/2/20/294
http://www.mail-archive.com/linux-ide@vger.kernel.org/msg04115.html
http://bugzilla.kernel.org/show_bug.cgi?id=8133
http://bugzilla.kernel.org/show_bug.cgi?id=8164
http://lkml.org/lkml/2007/3/21/330
Submitter : Fabio Comolli <fabio.comolli@gmail.com>
Plamen Petrov <plamen.petrov@tk.ru.acad.bg>
Laurent Riffard <laurent.riffard@free.fr>
Lukas Hejtmanek <xhejtman@mail.muni.cz>
Handled-By : Tejun Heo <htejun@gmail.com>
Alan Cox <alan@lxorguk.ukuu.org.uk>
Status : Alan: Some cases should be fixed now but probably not all
(eg the Nvidia one)
^ permalink raw reply [flat|nested] 69+ messages in thread
* [3/5] 2.6.21-rc4: known regressions (v2)
[not found] <Pine.LNX.4.64.0703160925270.26106@woody.linux-foundation.org>
` (2 preceding siblings ...)
2007-03-23 18:48 ` [2/5] 2.6.21-rc4: known regressions (v2) Adrian Bunk
@ 2007-03-23 18:50 ` Adrian Bunk
2007-03-23 19:07 ` Maxim
2007-03-24 17:04 ` Thomas Meyer
2007-03-23 18:50 ` [4/5] " Adrian Bunk
2007-03-24 11:25 ` 2.6.21-rc4: known regressions with patches (v2) Adrian Bunk
5 siblings, 2 replies; 69+ messages in thread
From: Adrian Bunk @ 2007-03-23 18:50 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton
Cc: Linux Kernel Mailing List, Dave Jones, Jeremy Fitzhardinge,
Eric W. Biederman, Rafael J. Wysocki, gregkh, linux-pci, pavel,
linux-pm, Frédéric RISS, Tino Keitel, Bob Moore, lenb,
linux-acpi, Tobias Doerffel, Jens Axboe, Jeff Chua,
Maxim Levitsky, Mike Harris, Marcus Better, Michael S. Tsirkin,
Thomas Meyer, Thomas Gleixner, Soeren Sonnenburg, jgarzik
This email lists some known regressions in Linus' tree compared to 2.6.20.
If you find your name in the Cc header, you are either submitter of one
of the bugs, maintainer of an affectected subsystem or driver, a patch
of you caused a breakage or I'm considering you in any other way
possibly involved with one or more of these issues.
Due to the huge amount of recipients, please trim the Cc when answering.
Subject : ThinkPad X60: resume no longer works (PCI related?)
References : http://lkml.org/lkml/2007/3/13/3
Submitter : Dave Jones <davej@redhat.com>
Jeremy Fitzhardinge <jeremy@goop.org>
Caused-By : PCI merge
commit 78149df6d565c36675463352d0bfe0000b02b7a7
Handled-By : Eric W. Biederman <ebiederm@xmission.com>
Rafael J. Wysocki <rjw@sisk.pl>
Status : problem is being debugged
Subject : MacMini: doesn't come out of suspend to ram
References : http://lkml.org/lkml/2007/3/21/374
Submitter : Frédéric RISS <frederic.riss@gmail.com>
Tino Keitel <tino.keitel@gmx.de>
Caused-By : Bob Moore <robert.moore@intel.com>
commit c5a7156959e89b32260ad6072bbf5077bcdfbeee
Status : unknown
Subject : Suspend to RAM doesn't work anymore (ACPI?)
References : http://lkml.org/lkml/2007/3/19/128
http://bugzilla.kernel.org/show_bug.cgi?id=8247
Submitter : Tobias Doerffel <tobias.doerffel@gmail.com>
Handled-By : Rafael J. Wysocki <rjw@sisk.pl>
Status : problem is being debugged
Subject : s2ram autowake regression (ACPI?)
References : http://lkml.org/lkml/2007/3/20/96
Submitter : Pavel Machek <pavel@ucw.cz>
Handled-By : Len Brown <lenb@kernel.org>
Status : submitter was asked to test a patch
Subject : ThinkPad doesn't resume from suspend to RAM
References : http://lkml.org/lkml/2007/2/27/80
http://lkml.org/lkml/2007/2/28/348
Submitter : Jens Axboe <jens.axboe@oracle.com>
Jeff Chua <jeff.chua.linux@gmail.com>
Status : unknown
Subject : suspend to disk hangs
References : http://lkml.org/lkml/2007/3/6/142
Submitter : Jeff Chua <jeff.chua.linux@gmail.com>
Status : unknown
Subject : suspend to disk hangs
References : http://lkml.org/lkml/2007/3/16/126
Submitter : Maxim Levitsky <maximlevitsky@gmail.com>
Caused-By : Rafael J. Wysocki <rjw@sisk.pl>
commit e3c7db621bed4afb8e231cb005057f2feb5db557
commit ed746e3b18f4df18afa3763155972c5835f284c5
commit 259130526c267550bc365d3015917d90667732f1
Status : unknown
Subject : suspend to disk hangs
References : http://bugzilla.kernel.org/show_bug.cgi?id=8224
Submitter : Mike Harris <atarimike@wavecable.com>
Status : unknown
Subject : ThinkPad R60: suspend to disk broken
References : http://lkml.org/lkml/2007/3/23/74
Submitter : Marcus Better <marcus@better.se>
Status : submitter tries to bisect
Subject : after resume: X hangs after drawing a couple of windows
References : http://lkml.org/lkml/2007/3/8/117
Submitter : Michael S. Tsirkin <mst@mellanox.co.il>
Status : unknown
Subject : second suspend to disk in a row results in an oops (libata?)
References : http://lkml.org/lkml/2007/3/17/43
Submitter : Thomas Meyer <thomas@m3y3r.de>
Status : unknown
Subject : SATA breakage on resume
References : http://lkml.org/lkml/2007/3/7/233
Submitter : Thomas Gleixner <tglx@linutronix.de>
Soeren Sonnenburg <kernel@nn7.de>
Status : unknown
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 69+ messages in thread
* [4/5] 2.6.21-rc4: known regressions (v2)
[not found] <Pine.LNX.4.64.0703160925270.26106@woody.linux-foundation.org>
` (3 preceding siblings ...)
2007-03-23 18:50 ` [3/5] " Adrian Bunk
@ 2007-03-23 18:50 ` Adrian Bunk
2007-03-24 11:25 ` 2.6.21-rc4: known regressions with patches (v2) Adrian Bunk
5 siblings, 0 replies; 69+ messages in thread
From: Adrian Bunk @ 2007-03-23 18:50 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton
Cc: Linux Kernel Mailing List, Michael S. Tsirkin, Soeren Sonnenburg,
Thomas Gleixner, Ingo Molnar, Tejun Heo, Rafael J. Wysocki,
Stephane Casset, Michal Piotrowski, David L, Bob Tracy,
John Stultz, bzolnier, linux-ide, Emil Karlson
This email lists some known regressions in Linus' tree compared to 2.6.20.
If you find your name in the Cc header, you are either submitter of one
of the bugs, maintainer of an affectected subsystem or driver, a patch
of you caused a breakage or I'm considering you in any other way
possibly involved with one or more of these issues.
Due to the huge amount of recipients, please trim the Cc when answering.
Subject : system doesn't come out of suspend (CONFIG_NO_HZ)
References : http://lkml.org/lkml/2007/2/22/391
Submitter : Michael S. Tsirkin <mst@mellanox.co.il>
Soeren Sonnenburg <kernel@nn7.de>
Handled-By : Thomas Gleixner <tglx@linutronix.de>
Ingo Molnar <mingo@elte.hu>
Tejun Heo <htejun@gmail.com>
Rafael J. Wysocki <rjw@sisk.pl>
Status : problem is being debugged
Subject : first disk access after resume takes several minutes
('date' does not advance after resume from RAM, CONFIG_NO_HZ=n)
References : http://lkml.org/lkml/2007/3/8/117
Submitter : Michael S. Tsirkin <mst@mellanox.co.il>
Handled-By : Thomas Gleixner <tglx@linutronix.de>
Ingo Molnar <mingo@elte.hu>
Status : problem is being debugged
Subject : Dynticks and High resolution Timer hanging the system
workaround: clocksource=acpi_pm
References : http://lkml.org/lkml/2007/3/7/504
Submitter : Stephane Casset <sept@logidee.com>
Caused-By : Thomas Gleixner <tglx@linutronix.de>
Status : unknown
Subject : soft lockup detected on CPU#0
References : http://lkml.org/lkml/2007/3/3/152
Submitter : Michal Piotrowski <michal.k.k.piotrowski@gmail.com>
Handled-By : Thomas Gleixner <tglx@linutronix.de>
Ingo Molnar <mingo@elte.hu>
Status : unknown
Subject : gettimeofday increments too slowly
References : http://bugzilla.kernel.org/show_bug.cgi?id=8027
Submitter : David L <idht4n@hotmail.com>
Caused-By : Thomas Gleixner <tglx@linutronix.de>
commit 92c7e00254b2d0efc1e36ac3e45474ce1871b6b2
Handled-By : Thomas Gleixner <tglx@linutronix.de>
Status : problem is being debugged
Subject : boot hangs during IDE detection (clocksource)
References : http://lkml.org/lkml/2007/3/19/465
Submitter : Bob Tracy <rct@gherkin.frus.com>
Caused-By : John Stultz <johnstul@us.ibm.com>
commit 6bb74df481223731af6c7e0ff3adb31f6442cfcd
Handled-By : John Stultz <johnstul@us.ibm.com>
Status : problem is being debugged
Subject : dynticks makes ksoftirqd1 use unreasonable amount of cpu time
References : http://bugzilla.kernel.org/show_bug.cgi?id=8100
Submitter : Emil Karlson <jkarlson@cc.hut.fi>
Handled-By : Thomas Gleixner <tglx@linutronix.de>
Status : problem is being debugged
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [3/5] 2.6.21-rc4: known regressions (v2)
2007-03-23 18:50 ` [3/5] " Adrian Bunk
@ 2007-03-23 19:07 ` Maxim
2007-03-24 17:04 ` Thomas Meyer
1 sibling, 0 replies; 69+ messages in thread
From: Maxim @ 2007-03-23 19:07 UTC (permalink / raw)
To: Adrian Bunk
Cc: Linus Torvalds, Andrew Morton, Linux Kernel Mailing List,
Dave Jones, Jeremy Fitzhardinge, Eric W. Biederman,
Rafael J. Wysocki, gregkh, linux-pci, pavel, linux-pm,
Frédéric RISS, Tino Keitel, Bob Moore, lenb, linux-acpi,
Tobias Doerffel, Jens Axboe, Jeff Chua, Mike Harris,
Marcus Better, Michael S. Tsirkin, Thomas Meyer, Thomas Gleixner
On Friday 23 March 2007 20:50:22 Adrian Bunk wrote:
> Subject : suspend to disk hangs
> References : http://lkml.org/lkml/2007/3/16/126
> Submitter : Maxim Levitsky <maximlevitsky@gmail.com>
> Caused-By : Rafael J. Wysocki <rjw@sisk.pl>
> commit e3c7db621bed4afb8e231cb005057f2feb5db557
> commit ed746e3b18f4df18afa3763155972c5835f284c5
> commit 259130526c267550bc365d3015917d90667732f1
> Status : unknown
>
>
Hello,
It is fixed
The problem is that now cpu_up/cpu_down is called with tasks frozen,
and this can lead to deadlock if some driver that registered cpu up/down notifier, sleeps,
On my system it froze in two places, one in XFS due to freezable workqueues, and in
microcode update driver that ask the "frozen" userspace for firmware.
Fix for XFS is already in mainline, and Rafael J. Wysocki. already posted a patch that fixes microcode issue,
I will test it.
But I feel that there are more drivers that can deadlock system in same way, on my system S3/S4 works perfect :-)
Even the weird hang i had disappeared.
Big thanks to Rafael J. Wysocki.
Best regards,
Maxim Levitsky
^ permalink raw reply [flat|nested] 69+ messages in thread
* 2.6.21-rc4: known regressions with patches (v2)
[not found] <Pine.LNX.4.64.0703160925270.26106@woody.linux-foundation.org>
` (4 preceding siblings ...)
2007-03-23 18:50 ` [4/5] " Adrian Bunk
@ 2007-03-24 11:25 ` Adrian Bunk
2007-03-26 12:37 ` Bob Tracy
5 siblings, 1 reply; 69+ messages in thread
From: Adrian Bunk @ 2007-03-24 11:25 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton
Cc: Linux Kernel Mailing List, Maxim Levitsky, Rafael J. Wysocki,
tigran, David L, Thomas Gleixner, Bob Tracy, John Stultz,
bzolnier, linux-ide, Albert Hopkins, Ayaz Abdulla, jgarzik,
netdev
This email lists some known regressions in Linus' tree compared to 2.6.20
with patches available.
If you find your name in the Cc header, you are either submitter of one
of the bugs, maintainer of an affectected subsystem or driver, a patch
of you caused a breakage or I'm considering you in any other way
possibly involved with one or more of these issues.
Due to the huge amount of recipients, please trim the Cc when answering.
Subject : suspend to disk hangs (microcode driver)
References : http://lkml.org/lkml/2007/3/16/126
Submitter : Maxim Levitsky <maximlevitsky@gmail.com>
Caused-By : Rafael J. Wysocki <rjw@sisk.pl>
commit e3c7db621bed4afb8e231cb005057f2feb5db557
commit ed746e3b18f4df18afa3763155972c5835f284c5
commit 259130526c267550bc365d3015917d90667732f1
Handled-By : Rafael J. Wysocki <rjw@sisk.pl>
Patch : http://lkml.org/lkml/2007/3/23/179
Status : patch available
Subject : gettimeofday increments too slowly
References : http://bugzilla.kernel.org/show_bug.cgi?id=8027
http://lkml.org/lkml/2007/3/23/329
Submitter : David L <idht4n@hotmail.com>
Caused-By : Thomas Gleixner <tglx@linutronix.de>
commit 92c7e00254b2d0efc1e36ac3e45474ce1871b6b2
Handled-By : Thomas Gleixner <tglx@linutronix.de>
Patch : http://lkml.org/lkml/2007/3/23/329
Status : patch available
Subject : boot hangs during IDE detection (clocksource)
References : http://lkml.org/lkml/2007/3/19/465
Submitter : Bob Tracy <rct@gherkin.frus.com>
Caused-By : John Stultz <johnstul@us.ibm.com>
commit 6bb74df481223731af6c7e0ff3adb31f6442cfcd
Handled-By : John Stultz <johnstul@us.ibm.com>
Patch : http://lkml.org/lkml/2007/3/22/287
Status : workaround-patch available
Subject : forcedeth: skb_over_panic
References : http://bugzilla.kernel.org/show_bug.cgi?id=8058
Submitter : Albert Hopkins <kernel@marduk.letterboxes.org>
Handled-By : Ayaz Abdulla <aabdulla@nvidia.com>
Patch : http://bugzilla.kernel.org/show_bug.cgi?id=8058
Status : patch available
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [3/5] 2.6.21-rc4: known regressions (v2)
2007-03-23 18:50 ` [3/5] " Adrian Bunk
2007-03-23 19:07 ` Maxim
@ 2007-03-24 17:04 ` Thomas Meyer
2007-03-24 18:02 ` Eric W. Biederman
1 sibling, 1 reply; 69+ messages in thread
From: Thomas Meyer @ 2007-03-24 17:04 UTC (permalink / raw)
To: Adrian Bunk
Cc: Linus Torvalds, Andrew Morton, Linux Kernel Mailing List,
Eric W. Biederman, linux-pci, linux-ide
Adrian Bunk schrieb:
> Subject : second suspend to disk in a row results in an oops (libata?)
> References : http://lkml.org/lkml/2007/3/17/43
> Submitter : Thomas Meyer <thomas@m3y3r.de>
> Status : unknown
>
The problem is identified: http://lkml.org/lkml/2007/3/22/150
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [3/5] 2.6.21-rc4: known regressions (v2)
2007-03-24 17:04 ` Thomas Meyer
@ 2007-03-24 18:02 ` Eric W. Biederman
0 siblings, 0 replies; 69+ messages in thread
From: Eric W. Biederman @ 2007-03-24 18:02 UTC (permalink / raw)
To: Thomas Meyer
Cc: Adrian Bunk, Linus Torvalds, Andrew Morton,
Linux Kernel Mailing List, linux-pci, linux-ide
Thomas Meyer <thomas@m3y3r.de> writes:
> Adrian Bunk schrieb:
>> Subject : second suspend to disk in a row results in an oops (libata?)
>> References : http://lkml.org/lkml/2007/3/17/43
>> Submitter : Thomas Meyer <thomas@m3y3r.de>
>> Status : unknown
>>
>
> The problem is identified: http://lkml.org/lkml/2007/3/22/150
Given the description above I'm a little confused. Doesn't this
happen every time now?
Or was this happening only the second time before I started my msi
fixes...
Eric
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [3/6] 2.6.21-rc4: known regressions
2007-03-18 18:49 ` [3/6] " Adrian Bunk
@ 2007-03-26 1:25 ` Jeff Chua
2007-03-26 4:05 ` Adrian Bunk
0 siblings, 1 reply; 69+ messages in thread
From: Jeff Chua @ 2007-03-26 1:25 UTC (permalink / raw)
To: Adrian Bunk
Cc: Linus Torvalds, Andrew Morton, Linux Kernel Mailing List,
Dave Jones, Jeremy Fitzhardinge, Eric W. Biederman,
Rafael J. Wysocki, pavel, linux-pm, gregkh, linux-pci, Jens Axboe,
Maxim Levitsky, Mike Harris, Marcus Better, Ray Lee,
Alexey Starikovskiy, Len Brown, linux-acpi, Thomas Meyer, jgarzik,
linux-ide, Thomas Gleixner, Soeren Sonnenburg
On 3/19/07, Adrian Bunk <bunk@stusta.de> wrote:
> Subject : ThinkPad doesn't resume from suspend to RAM
> References : http://lkml.org/lkml/2007/2/27/80
> http://lkml.org/lkml/2007/2/28/348
> Submitter : Jens Axboe <jens.axboe@oracle.com>
> Jeff Chua <jeff.chua.linux@gmail.com>
> Status : unknown
>
>
> Subject : suspend to disk hangs
> References : http://lkml.org/lkml/2007/3/6/142
> Submitter : Jeff Chua <jeff.chua.linux@gmail.com>
> Status : unknown
The good news is on 2.6.21-rc5, suspend to disk, and resume from disk works.
But, it only works with CONFIG_NO_HZ unset.
Setting CONFIG_NO_HZ will cause suspend to disk to hang just before
saving memory to disk.
Resume from RAM (s2ram) still broke (tried with or without
CONFIG_NO_HZ). Suspend to RAM seems ok, but upon resume, the screen
will only display "inu" and only after pressing the power button will
the system return to console. But "date" still doesn't advance.
Thanks,
Jeff.
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [3/6] 2.6.21-rc4: known regressions
2007-03-26 1:25 ` Jeff Chua
@ 2007-03-26 4:05 ` Adrian Bunk
2007-03-26 5:37 ` Jeff Chua
0 siblings, 1 reply; 69+ messages in thread
From: Adrian Bunk @ 2007-03-26 4:05 UTC (permalink / raw)
To: Jeff Chua
Cc: Linus Torvalds, Andrew Morton, Linux Kernel Mailing List,
Eric W. Biederman, Rafael J. Wysocki, pavel, linux-pm, gregkh,
linux-pci, Jens Axboe, Len Brown, linux-acpi, jgarzik, linux-ide,
Thomas Gleixner, Michael S. Tsirkin, Ingo Molnar
On Mon, Mar 26, 2007 at 09:25:51AM +0800, Jeff Chua wrote:
> On 3/19/07, Adrian Bunk <bunk@stusta.de> wrote:
>
> >Subject : ThinkPad doesn't resume from suspend to RAM
> >References : http://lkml.org/lkml/2007/2/27/80
> > http://lkml.org/lkml/2007/2/28/348
> >Submitter : Jens Axboe <jens.axboe@oracle.com>
> > Jeff Chua <jeff.chua.linux@gmail.com>
> >Status : unknown
> >
> >
> >Subject : suspend to disk hangs
> >References : http://lkml.org/lkml/2007/3/6/142
> >Submitter : Jeff Chua <jeff.chua.linux@gmail.com>
> >Status : unknown
>
> The good news is on 2.6.21-rc5, suspend to disk, and resume from disk works.
> But, it only works with CONFIG_NO_HZ unset.
Thanks for this information.
> Setting CONFIG_NO_HZ will cause suspend to disk to hang just before
> saving memory to disk.
Thanks, noted.
> Resume from RAM (s2ram) still broke (tried with or without
> CONFIG_NO_HZ). Suspend to RAM seems ok, but upon resume, the screen
> will only display "inu" and only after pressing the power button will
> the system return to console. But "date" still doesn't advance.
This might be related to the following regression:
Subject : first disk access after resume takes several minutes
('date' does not advance after resume from RAM, CONFIG_NO_HZ=n)
References : http://lkml.org/lkml/2007/3/8/117
http://lkml.org/lkml/2007/3/25/20
Submitter : Michael S. Tsirkin <mst@mellanox.co.il>
Handled-By : Thomas Gleixner <tglx@linutronix.de>
Ingo Molnar <mingo@elte.hu>
Status : problem is being debugged
> Thanks,
> Jeff.
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [3/6] 2.6.21-rc4: known regressions
2007-03-26 4:05 ` Adrian Bunk
@ 2007-03-26 5:37 ` Jeff Chua
2007-03-26 16:26 ` Thomas Gleixner
0 siblings, 1 reply; 69+ messages in thread
From: Jeff Chua @ 2007-03-26 5:37 UTC (permalink / raw)
To: Adrian Bunk
Cc: Linus Torvalds, Andrew Morton, Linux Kernel Mailing List,
Eric W. Biederman, Rafael J. Wysocki, pavel, linux-pm, gregkh,
linux-pci, Jens Axboe, Len Brown, linux-acpi, jgarzik, linux-ide,
Thomas Gleixner, Michael S. Tsirkin, Ingo Molnar
On 3/26/07, Adrian Bunk <bunk@stusta.de> wrote:
> > Resume from RAM (s2ram) still broke (tried with or without
> > CONFIG_NO_HZ). Suspend to RAM seems ok, but upon resume, the screen
> > will only display "inu" and only after pressing the power button will
> > the system return to console. But "date" still doesn't advance.
>
> This might be related to the following regression:
>
> Subject : first disk access after resume takes several minutes
> ('date' does not advance after resume from RAM, CONFIG_NO_HZ=n)
> References : http://lkml.org/lkml/2007/3/8/117
> http://lkml.org/lkml/2007/3/25/20
> Submitter : Michael S. Tsirkin <mst@mellanox.co.il>
> Handled-By : Thomas Gleixner <tglx@linutronix.de>
> Ingo Molnar <mingo@elte.hu>
> Status : problem is being debugged
Adrian,
It's related. I tested without CONFIG_HPET_TIMER, and now my X60 can
suspend and resume from RAM (s2ram). Even better, it works
with/without CONFIG_NO_HZ.
But, suspend to disk still broke with CONFIG_NO_HZ set.
Thanks,
Jeff.
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [2/5] 2.6.21-rc4: known regressions (v2)
2007-03-23 18:48 ` [2/5] 2.6.21-rc4: known regressions (v2) Adrian Bunk
@ 2007-03-26 10:01 ` Tejun Heo
0 siblings, 0 replies; 69+ messages in thread
From: Tejun Heo @ 2007-03-26 10:01 UTC (permalink / raw)
To: Adrian Bunk
Cc: Linus Torvalds, Andrew Morton, Linux Kernel Mailing List,
Mathieu Bérard, jgarzik, linux-ide, Fabio Comolli,
Plamen Petrov, Laurent Riffard, Lukas Hejtmanek, Alan Cox
Adrian Bunk wrote:
> Subject : NCQ problem with ahci and Hitachi drive (ACPI related)
> References : http://lkml.org/lkml/2007/3/4/178
> http://lkml.org/lkml/2007/3/9/475
> Submitter : Mathieu Bérard <Mathieu.Berard@crans.org>
> Handled-By : Tejun Heo <htejun@gmail.com>
> Status : problem is being debugged
Patch is available and whether to put it into mainline or not is being
discussed. libata EH does the right thing after several errors so
things should work properly after several errors.
http://thread.gmane.org/gmane.linux.kernel/496524
> Subject : libata: PATA UDMA/100 configured as UDMA/33
> References : http://lkml.org/lkml/2007/2/20/294
> http://www.mail-archive.com/linux-ide@vger.kernel.org/msg04115.html
> http://bugzilla.kernel.org/show_bug.cgi?id=8133
> http://bugzilla.kernel.org/show_bug.cgi?id=8164
> http://lkml.org/lkml/2007/3/21/330
> Submitter : Fabio Comolli <fabio.comolli@gmail.com>
> Plamen Petrov <plamen.petrov@tk.ru.acad.bg>
> Laurent Riffard <laurent.riffard@free.fr>
> Lukas Hejtmanek <xhejtman@mail.muni.cz>
> Handled-By : Tejun Heo <htejun@gmail.com>
> Alan Cox <alan@lxorguk.ukuu.org.uk>
> Status : Alan: Some cases should be fixed now but probably not all
> (eg the Nvidia one)
Further patch submitted.
http://thread.gmane.org/gmane.linux.ide/17444
This should fix all regression cases. sata_nv has been always broken so
isn't a regression. It needs acpi tricks and I don't think it fits
2.6.21 cycle.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: 2.6.21-rc4: known regressions with patches (v2)
2007-03-24 11:25 ` 2.6.21-rc4: known regressions with patches (v2) Adrian Bunk
@ 2007-03-26 12:37 ` Bob Tracy
0 siblings, 0 replies; 69+ messages in thread
From: Bob Tracy @ 2007-03-26 12:37 UTC (permalink / raw)
To: Adrian Bunk
Cc: torvalds, akpm, linux-kernel, linux-ide, tglx, johnstul, bzolnier
Adrian Bunk wrote:
> Subject : boot hangs during IDE detection (clocksource)
> References : http://lkml.org/lkml/2007/3/19/465
> Submitter : Bob Tracy <rct@gherkin.frus.com>
> Caused-By : John Stultz <johnstul@us.ibm.com>
> commit 6bb74df481223731af6c7e0ff3adb31f6442cfcd
> Handled-By : John Stultz <johnstul@us.ibm.com>
> Patch : http://lkml.org/lkml/2007/3/22/287
> Status : workaround-patch available
The subject problem is fixed *without* the workaround patch in
2.6.21-rc5. The acpi_pm clocksource patch for the case where the
PIIX4 bug is present should probably be included anyway.
--
-----------------------------------------------------------------------
Bob Tracy WTO + WIPO = DMCA? http://www.anti-dmca.org
rct@frus.com
-----------------------------------------------------------------------
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [3/6] 2.6.21-rc4: known regressions
2007-03-26 5:37 ` Jeff Chua
@ 2007-03-26 16:26 ` Thomas Gleixner
2007-03-26 17:46 ` Jeff Chua
0 siblings, 1 reply; 69+ messages in thread
From: Thomas Gleixner @ 2007-03-26 16:26 UTC (permalink / raw)
To: Jeff Chua
Cc: Adrian Bunk, Linus Torvalds, Andrew Morton,
Linux Kernel Mailing List, Eric W. Biederman, Rafael J. Wysocki,
pavel, linux-pm, gregkh, linux-pci, Jens Axboe, Len Brown,
linux-acpi, jgarzik, linux-ide, Michael S. Tsirkin, Ingo Molnar
On Mon, 2007-03-26 at 13:37 +0800, Jeff Chua wrote:
> On 3/26/07, Adrian Bunk <bunk@stusta.de> wrote:
>
> > > Resume from RAM (s2ram) still broke (tried with or without
> > > CONFIG_NO_HZ). Suspend to RAM seems ok, but upon resume, the screen
> > > will only display "inu" and only after pressing the power button will
> > > the system return to console. But "date" still doesn't advance.
> >
> > This might be related to the following regression:
> >
> > Subject : first disk access after resume takes several minutes
> > ('date' does not advance after resume from RAM, CONFIG_NO_HZ=n)
> > References : http://lkml.org/lkml/2007/3/8/117
> > http://lkml.org/lkml/2007/3/25/20
> > Submitter : Michael S. Tsirkin <mst@mellanox.co.il>
> > Handled-By : Thomas Gleixner <tglx@linutronix.de>
> > Ingo Molnar <mingo@elte.hu>
> > Status : problem is being debugged
>
> Adrian,
>
> It's related. I tested without CONFIG_HPET_TIMER, and now my X60 can
> suspend and resume from RAM (s2ram). Even better, it works
> with/without CONFIG_NO_HZ.
Does the patch below fix the HPET_TIMER=y case ?
tglx
diff --git a/arch/i386/kernel/hpet.c b/arch/i386/kernel/hpet.c
index f3ab61e..76afea6 100644
--- a/arch/i386/kernel/hpet.c
+++ b/arch/i386/kernel/hpet.c
@@ -197,7 +197,7 @@ static int hpet_next_event(unsigned long delta,
cnt += delta;
hpet_writel(cnt, HPET_T0_CMP);
- return ((long)(hpet_readl(HPET_COUNTER) - cnt ) > 0);
+ return ((long)(hpet_readl(HPET_COUNTER) - cnt ) > 0) ? -ETIME : 0;
}
/*
^ permalink raw reply related [flat|nested] 69+ messages in thread
* Re: [3/6] 2.6.21-rc4: known regressions
2007-03-26 16:26 ` Thomas Gleixner
@ 2007-03-26 17:46 ` Jeff Chua
2007-03-28 7:04 ` Thomas Gleixner
0 siblings, 1 reply; 69+ messages in thread
From: Jeff Chua @ 2007-03-26 17:46 UTC (permalink / raw)
To: Thomas Gleixner
Cc: Adrian Bunk, Linus Torvalds, Andrew Morton,
Linux Kernel Mailing List, Eric W. Biederman, Rafael J. Wysocki,
pavel, linux-pm, gregkh, linux-pci, Jens Axboe, Len Brown,
linux-acpi, jgarzik, linux-ide, Michael S. Tsirkin, Ingo Molnar
On 3/27/07, Thomas Gleixner <tglx@linutronix.de> wrote:
> > It's related. I tested without CONFIG_HPET_TIMER, and now my X60 can
> > suspend and resume from RAM (s2ram). Even better, it works
> > with/without CONFIG_NO_HZ.
>
> Does the patch below fix the HPET_TIMER=y case ?
Thomas, I tried, but it didn't help. Upon resume from ram, "date"
still didn't advance.
Thanks,
Jeff.
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [3/6] 2.6.21-rc4: known regressions
2007-03-26 17:46 ` Jeff Chua
@ 2007-03-28 7:04 ` Thomas Gleixner
2007-03-28 13:43 ` Maxim
0 siblings, 1 reply; 69+ messages in thread
From: Thomas Gleixner @ 2007-03-28 7:04 UTC (permalink / raw)
To: Jeff Chua
Cc: Adrian Bunk, Linus Torvalds, Andrew Morton,
Linux Kernel Mailing List, Eric W. Biederman, Rafael J. Wysocki,
pavel, linux-pm, gregkh, linux-pci, Jens Axboe, Len Brown,
linux-acpi, jgarzik, linux-ide, Michael S. Tsirkin, Ingo Molnar
On Tue, 2007-03-27 at 01:46 +0800, Jeff Chua wrote:
> On 3/27/07, Thomas Gleixner <tglx@linutronix.de> wrote:
>
> > > It's related. I tested without CONFIG_HPET_TIMER, and now my X60 can
> > > suspend and resume from RAM (s2ram). Even better, it works
> > > with/without CONFIG_NO_HZ.
> >
> > Does the patch below fix the HPET_TIMER=y case ?
>
> Thomas, I tried, but it didn't help. Upon resume from ram, "date"
> still didn't advance.
Can you please issue a SysRq-Q in this situation and provide the dmesg
output ?
Thanks,
tglx
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [3/6] 2.6.21-rc4: known regressions
2007-03-28 7:04 ` Thomas Gleixner
@ 2007-03-28 13:43 ` Maxim
2007-03-28 14:41 ` Ingo Molnar
2007-03-28 18:04 ` [3/6] 2.6.21-rc4: known regressions Michael S. Tsirkin
0 siblings, 2 replies; 69+ messages in thread
From: Maxim @ 2007-03-28 13:43 UTC (permalink / raw)
To: Thomas Gleixner
Cc: Jeff Chua, Adrian Bunk, Linus Torvalds, Andrew Morton,
Linux Kernel Mailing List, Eric W. Biederman, Rafael J. Wysocki,
pavel, linux-pm, gregkh, linux-pci, Jens Axboe, Len Brown,
linux-acpi, jgarzik, linux-ide, Michael S. Tsirkin, Ingo Molnar
On Wednesday 28 March 2007 09:04:28 Thomas Gleixner wrote:
> On Tue, 2007-03-27 at 01:46 +0800, Jeff Chua wrote:
> > On 3/27/07, Thomas Gleixner <tglx@linutronix.de> wrote:
> >
> > > > It's related. I tested without CONFIG_HPET_TIMER, and now my X60 can
> > > > suspend and resume from RAM (s2ram). Even better, it works
> > > > with/without CONFIG_NO_HZ.
> > >
> > > Does the patch below fix the HPET_TIMER=y case ?
> >
> > Thomas, I tried, but it didn't help. Upon resume from ram, "date"
> > still didn't advance.
>
> Can you please issue a SysRq-Q in this situation and provide the dmesg
> output ?
>
> Thanks,
>
> tglx
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
Hi,
I almost sure Iknow why this happens,
The problem is that both hpet clock source and hpet clockevents doesn't have a suspend/resume function
On resume we should enable the main counter _and_ enable legacy replacement mode,
On my system main counter in enabled, by I think by bios, but legacy replacement mode is not, so if
a system doesn't use lapic as a tick source, but use hpet+broadcast, it will hang for sure on resume, and i tested it
The patch below is a temporally fix, until clock-events and clocksources will get proper suspend/resume hooks:
Regards,
Maxim Levitsky
---
Add suspend/resume for HPET
Signed-off-by: Maxim Levitsky <maximlevisky@gmail.com>
---
diff --git a/arch/i386/kernel/hpet.c b/arch/i386/kernel/hpet.c
index 0fd9fba..a1ec79e 100644
--- a/arch/i386/kernel/hpet.c
+++ b/arch/i386/kernel/hpet.c
@@ -152,6 +152,16 @@ static void hpet_set_mode(enum clock_event_mode mode,
unsigned long cfg, cmp, now;
uint64_t delta;
+
+ if ( mode != CLOCK_EVT_MODE_UNUSED && mode != CLOCK_EVT_MODE_SHUTDOWN)
+ {
+ unsigned long cfg = hpet_readl(HPET_CFG);
+ cfg |= HPET_CFG_ENABLE | HPET_CFG_LEGACY;
+ hpet_writel(cfg, HPET_CFG);
+
+ }
+
+
switch(mode) {
case CLOCK_EVT_MODE_PERIODIC:
delta = ((uint64_t)(NSEC_PER_SEC/HZ)) * hpet_clockevent.mult;
^ permalink raw reply related [flat|nested] 69+ messages in thread
* Re: [3/6] 2.6.21-rc4: known regressions
2007-03-28 13:43 ` Maxim
@ 2007-03-28 14:41 ` Ingo Molnar
2007-03-28 15:01 ` Maxim
2007-03-28 18:04 ` [3/6] 2.6.21-rc4: known regressions Michael S. Tsirkin
1 sibling, 1 reply; 69+ messages in thread
From: Ingo Molnar @ 2007-03-28 14:41 UTC (permalink / raw)
To: Maxim
Cc: Jeff Chua, linux-ide, jgarzik, gregkh, linux-pm,
Linux Kernel Mailing List, Adrian Bunk, linux-acpi, linux-pci,
Eric W. Biederman, Jens Axboe, Michael S. Tsirkin, Andrew Morton,
Linus Torvalds, Thomas Gleixner
* Maxim <maximlevitsky@gmail.com> wrote:
> I almost sure I know why this happens,
cool! Your patch is a definite improvement on my t60 (where
suspend/resume never worked with hpet enabled). But it does not fix
everything - for example the timings are way off after resume. Thomas?
Ingo
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [3/6] 2.6.21-rc4: known regressions
2007-03-28 14:41 ` Ingo Molnar
@ 2007-03-28 15:01 ` Maxim
2007-03-28 16:38 ` Linus Torvalds
0 siblings, 1 reply; 69+ messages in thread
From: Maxim @ 2007-03-28 15:01 UTC (permalink / raw)
To: Ingo Molnar
Cc: Thomas Gleixner, Jeff Chua, Adrian Bunk, Linus Torvalds,
Andrew Morton, Linux Kernel Mailing List, Eric W. Biederman,
Rafael J. Wysocki, pavel, linux-pm, gregkh, linux-pci, Jens Axboe,
Len Brown, linux-acpi, jgarzik, linux-ide, Michael S. Tsirkin
On Wednesday 28 March 2007 16:41:48 Ingo Molnar wrote:
>
> * Maxim <maximlevitsky@gmail.com> wrote:
>
> > I almost sure I know why this happens,
>
> cool! Your patch is a definite improvement on my t60 (where
> suspend/resume never worked with hpet enabled). But it does not fix
> everything - for example the timings are way off after resume. Thomas?
>
> Ingo
>
The problem is that HPET consists of two parts:
one is a main counter and second is a a timers.
To enable main counter one must set HPET_CFG_ENABLE.
It is set only on boot, and not on resume now.
But on my system I think bios re-enables it.
Secondary to enable HPET to act as a timer on IRQ0 and to make it replace RTC IRQ8 one must set
HPET_CFG_LEGACY
This bit is definitely not set on resume, so on my system I get a hang if I use HPET as clockevents device,
and on other system where bios doesn't reenable HPET, then even if HPET is used as timing device
'date won't advance'
But I set those bits only in initialization of HPET clockevents device, and I set always, when it is turned on,
It is not that good,but works.
Now I don't have a clue how to set those bits if only HPET is used as clock source because now clocksources
don't have _any_ resume hook.
The timing problem you mention I think isd connected to the fact that HPET is not enabled instantly after resume, but after some time when clockevents
core calls HPET to enable event timer.
Best regards,
Maxim Levitsky
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [3/6] 2.6.21-rc4: known regressions
2007-03-28 15:01 ` Maxim
@ 2007-03-28 16:38 ` Linus Torvalds
2007-03-28 19:38 ` David Brownell
2007-03-29 4:41 ` [ PATCH] Add suspend/resume for HPET was: " Maxim
0 siblings, 2 replies; 69+ messages in thread
From: Linus Torvalds @ 2007-03-28 16:38 UTC (permalink / raw)
To: Maxim
Cc: Jeff Chua, linux-ide, gregkh, linux-pm, Linux Kernel Mailing List,
Adrian Bunk, linux-acpi, linux-pci, Eric W. Biederman,
Ingo Molnar, Jens Axboe, Michael S. Tsirkin, Thomas Gleixner,
jgarzik, Andrew Morton
On Wed, 28 Mar 2007, Maxim wrote:
>
> Now I don't have a clue how to set those bits if only HPET is used as clock source because now clocksources
> don't have _any_ resume hook.
One thing that drives me wild about that "clocksource resume" thing is
that it seems to think that clocksources are somehow different from any
other system devices..
Why isn't the HPET considered a "device", and has it's own *device*
"suspend" and "resume"? Why do we seem to think that only "set_mode()"
etc should wake up clock sources?
It's a *device*, dammit. It should save and resume like one (probably as a
system device). The "set_mode()" etc stuff is at a completely different
(higher) conceptual level.
Thomas? It does seem like Maxim has hit the nail on the head (at least
partly) on the HPET timer resume problems..
Linus
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [3/6] 2.6.21-rc4: known regressions
2007-03-28 13:43 ` Maxim
2007-03-28 14:41 ` Ingo Molnar
@ 2007-03-28 18:04 ` Michael S. Tsirkin
2007-03-28 18:32 ` Ingo Molnar
` (2 more replies)
1 sibling, 3 replies; 69+ messages in thread
From: Michael S. Tsirkin @ 2007-03-28 18:04 UTC (permalink / raw)
To: Maxim
Cc: Thomas Gleixner, Jeff Chua, Adrian Bunk, Linus Torvalds,
Andrew Morton, Linux Kernel Mailing List, Eric W. Biederman,
Rafael J. Wysocki, pavel, linux-pm, gregkh, linux-pci, Jens Axboe,
Len Brown, linux-acpi, jgarzik, linux-ide, Ingo Molnar
> Subject : first disk access after resume takes several minutes
> ('date' does not advance after resume from RAM, CONFIG_NO_HZ=n)
> References : http://lkml.org/lkml/2007/3/8/117
> http://lkml.org/lkml/2007/3/25/20
> Submitter : Michael S. Tsirkin <mst@mellanox.co.il>
...
> Subject : after resume: X hangs after drawing a couple of windows
> References : http://lkml.org/lkml/2007/3/8/117
> Submitter : Michael S. Tsirkin <mst@mellanox.co.il>
> Status : unknown
...
> > > > From: Jeff Chua <jeff.chua.linux@gmail.com>
> > > > > It's related. I tested without CONFIG_HPET_TIMER, and now my X60 can
> > > > > suspend and resume from RAM (s2ram). Even better, it works
> > > > > with/without CONFIG_NO_HZ.
>
> Quoting Maxim <maximlevitsky@gmail.com>:
>
> Hi,
> I almost sure Iknow why this happens,
> The problem is that both hpet clock source
> and hpet clockevents doesn't have a suspend/resume function
> On resume we should enable the main counter _and_ enable
> legacy replacement mode, On my system main counter in
> enabled, by I think by bios, but legacy replacement mode is
> not, so if a system doesn't use lapic as a tick source, but
> use hpet+broadcast, it will hang for sure on resume, and i
> tested it
>
> The patch below is a temporally fix, until
> clock-events and clocksources will get proper suspend/resume
> hooks:
>
> Regards,
> Maxim Levitsky
Bingo!
The patch below fixes the two problems (listed above) with
resume from RAM that I have observed on my T60 with
2.6.21-rc5: with this patch applied, and with CONFIG_NO_HZ
unset, date advances correctly, X functions properly and
there is no delay on first disk access.
Thanks very much.
---
> Add suspend/resume for HPET
> Signed-off-by: Maxim Levitsky <maximlevisky@gmail.com>
Maxim, do you plan to send this upstream?
Acked-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
---
diff --git a/arch/i386/kernel/hpet.c b/arch/i386/kernel/hpet.c
index 0fd9fba..a1ec79e 100644
--- a/arch/i386/kernel/hpet.c
+++ b/arch/i386/kernel/hpet.c
@@ -152,6 +152,16 @@ static void hpet_set_mode(enum clock_event_mode mode,
unsigned long cfg, cmp, now;
uint64_t delta;
+
+ if ( mode != CLOCK_EVT_MODE_UNUSED && mode != CLOCK_EVT_MODE_SHUTDOWN)
+ {
+ unsigned long cfg = hpet_readl(HPET_CFG);
+ cfg |= HPET_CFG_ENABLE | HPET_CFG_LEGACY;
+ hpet_writel(cfg, HPET_CFG);
+
+ }
+
+
switch(mode) {
case CLOCK_EVT_MODE_PERIODIC:
delta = ((uint64_t)(NSEC_PER_SEC/HZ)) * hpet_clockevent.mult;
--
MST
^ permalink raw reply related [flat|nested] 69+ messages in thread
* Re: [3/6] 2.6.21-rc4: known regressions
2007-03-28 18:04 ` [3/6] 2.6.21-rc4: known regressions Michael S. Tsirkin
@ 2007-03-28 18:32 ` Ingo Molnar
2007-03-28 18:35 ` Randy Dunlap
2007-03-29 14:24 ` Jeff Chua
2 siblings, 0 replies; 69+ messages in thread
From: Ingo Molnar @ 2007-03-28 18:32 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Maxim, Jeff Chua, linux-ide, jgarzik, gregkh, linux-pm,
Linux Kernel Mailing List, Adrian Bunk, linux-acpi, linux-pci,
Eric W. Biederman, Jens Axboe, Andrew Morton, Linus Torvalds,
Thomas Gleixner
* Michael S. Tsirkin <mst@dev.mellanox.co.il> wrote:
> Bingo!
>
> The patch below fixes the two problems (listed above) with resume from
> RAM that I have observed on my T60 with 2.6.21-rc5: with this patch
> applied, and with CONFIG_NO_HZ unset, date advances correctly, X
> functions properly and there is no delay on first disk access.
>
> Thanks very much.
[...]
>
> Maxim, do you plan to send this upstream?
we'll fix this the right way tomorrow, by adding a proper suspend/resume
sysdev handler - the lapic clockevents driver already has that. Maxim
definitely deserves alot of kudos for having found this bug!
Ingo
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [3/6] 2.6.21-rc4: known regressions
2007-03-28 18:04 ` [3/6] 2.6.21-rc4: known regressions Michael S. Tsirkin
2007-03-28 18:32 ` Ingo Molnar
@ 2007-03-28 18:35 ` Randy Dunlap
2007-03-29 14:24 ` Jeff Chua
2 siblings, 0 replies; 69+ messages in thread
From: Randy Dunlap @ 2007-03-28 18:35 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: jgarzik, Maxim, Jeff Chua, linux-ide, Torvalds, gregkh, linux-pm,
Linux Kernel Mailing List, Len, Adrian Bunk, linux-acpi,
linux-pci, Eric W. Biederman, Ingo Molnar, Jens Axboe,
Thomas Gleixner, Linus, Andrew Morton
On Wed, 28 Mar 2007 20:04:57 +0200 Michael S. Tsirkin wrote:
> > Subject : first disk access after resume takes several minutes
> > ('date' does not advance after resume from RAM, CONFIG_NO_HZ=n)
> > References : http://lkml.org/lkml/2007/3/8/117
> > http://lkml.org/lkml/2007/3/25/20
> > Submitter : Michael S. Tsirkin <mst@mellanox.co.il>
>
> ...
>
> > Subject : after resume: X hangs after drawing a couple of windows
> > References : http://lkml.org/lkml/2007/3/8/117
> > Submitter : Michael S. Tsirkin <mst@mellanox.co.il>
> > Status : unknown
>
> ...
>
> > > > > From: Jeff Chua <jeff.chua.linux@gmail.com>
> > > > > > It's related. I tested without CONFIG_HPET_TIMER, and now my X60 can
> > > > > > suspend and resume from RAM (s2ram). Even better, it works
> > > > > > with/without CONFIG_NO_HZ.
> >
> > Quoting Maxim <maximlevitsky@gmail.com>:
> >
> > Hi,
> > I almost sure Iknow why this happens,
> > The problem is that both hpet clock source
> > and hpet clockevents doesn't have a suspend/resume function
> > On resume we should enable the main counter _and_ enable
> > legacy replacement mode, On my system main counter in
> > enabled, by I think by bios, but legacy replacement mode is
> > not, so if a system doesn't use lapic as a tick source, but
> > use hpet+broadcast, it will hang for sure on resume, and i
> > tested it
> >
> > The patch below is a temporally fix, until
> > clock-events and clocksources will get proper suspend/resume
> > hooks:
> >
> > Regards,
> > Maxim Levitsky
>
> Bingo!
>
> The patch below fixes the two problems (listed above) with
> resume from RAM that I have observed on my T60 with
> 2.6.21-rc5: with this patch applied, and with CONFIG_NO_HZ
> unset, date advances correctly, X functions properly and
> there is no delay on first disk access.
>
> Thanks very much.
>
> ---
> > Add suspend/resume for HPET
> > Signed-off-by: Maxim Levitsky <maximlevisky@gmail.com>
>
> Maxim, do you plan to send this upstream?
with whitespace fixes, please...
> Acked-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
>
> ---
>
> diff --git a/arch/i386/kernel/hpet.c b/arch/i386/kernel/hpet.c
> index 0fd9fba..a1ec79e 100644
> --- a/arch/i386/kernel/hpet.c
> +++ b/arch/i386/kernel/hpet.c
> @@ -152,6 +152,16 @@ static void hpet_set_mode(enum clock_event_mode mode,
> unsigned long cfg, cmp, now;
> uint64_t delta;
>
> +
> + if ( mode != CLOCK_EVT_MODE_UNUSED && mode != CLOCK_EVT_MODE_SHUTDOWN)
> + {
if (mode != CLOCK_EVT_MODE_UNUSED && mode != CLOCK_EVT_MODE_SHUTDOWN) {
> + unsigned long cfg = hpet_readl(HPET_CFG);
> + cfg |= HPET_CFG_ENABLE | HPET_CFG_LEGACY;
> + hpet_writel(cfg, HPET_CFG);
> +
delete above line.
> + }
> +
> +
> switch(mode) {
> case CLOCK_EVT_MODE_PERIODIC:
> delta = ((uint64_t)(NSEC_PER_SEC/HZ)) * hpet_clockevent.mult;
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [3/6] 2.6.21-rc4: known regressions
2007-03-28 16:38 ` Linus Torvalds
@ 2007-03-28 19:38 ` David Brownell
2007-03-28 20:19 ` [linux-pm] " Maxim
2007-03-28 20:42 ` Linus Torvalds
2007-03-29 4:41 ` [ PATCH] Add suspend/resume for HPET was: " Maxim
1 sibling, 2 replies; 69+ messages in thread
From: David Brownell @ 2007-03-28 19:38 UTC (permalink / raw)
To: linux-pm
Cc: Maxim, Jeff Chua, linux-acpi, jgarzik, gregkh, linux-pm,
Linux Kernel Mailing List, Andrew Morton, Adrian Bunk, linux-ide,
Thomas Gleixner, Eric W. Biederman, Jens Axboe,
Michael S. Tsirkin, linux-pci, Linus Torvalds, Ingo Molnar
On Wednesday 28 March 2007 9:38 am, Linus Torvalds wrote:
> It's a *device*, dammit. It should save and resume like one (probably as a
> system device). The "set_mode()" etc stuff is at a completely different
> (higher) conceptual level.
Agreed, except about "probably as a system device".
Last I checked, there was no good reason to use sysdev suspend()/resume()
rather than platform_device suspend_late()/early_resume(). Which more
or less means no good reason to use sysdev in new code...
Also, making HPET use the legacy mode seems like a step backwards.
- Dave
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [linux-pm] [3/6] 2.6.21-rc4: known regressions
2007-03-28 19:38 ` David Brownell
@ 2007-03-28 20:19 ` Maxim
2007-03-28 20:59 ` David Brownell
2007-03-28 20:42 ` Linus Torvalds
1 sibling, 1 reply; 69+ messages in thread
From: Maxim @ 2007-03-28 20:19 UTC (permalink / raw)
To: David Brownell
Cc: linux-pm, Linus Torvalds, Jeff Chua, linux-ide, gregkh, linux-pm,
Linux Kernel Mailing List, Adrian Bunk, linux-acpi, linux-pci,
Eric W. Biederman, Ingo Molnar, Jens Axboe, Michael S. Tsirkin,
Thomas Gleixner, jgarzik, Andrew Morton
On Wednesday 28 March 2007 21:38:55 David Brownell wrote:
> On Wednesday 28 March 2007 9:38 am, Linus Torvalds wrote:
>
> > It's a *device*, dammit. It should save and resume like one (probably as a
> > system device). The "set_mode()" etc stuff is at a completely different
> > (higher) conceptual level.
>
> Agreed, except about "probably as a system device".
>
> Last I checked, there was no good reason to use sysdev suspend()/resume()
> rather than platform_device suspend_late()/early_resume(). Which more
> or less means no good reason to use sysdev in new code...
>
>
> Also, making HPET use the legacy mode seems like a step backwards.
>
> - Dave
>
Hi,
It is not 'legacy' mode,
It is a legacy replacement mode.
It this mode HPET takes over IRQ0 and IRQ 8 and provides this way replacement for PIT and RTC periodic function
Best regards,
Maxim Levitsky
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [3/6] 2.6.21-rc4: known regressions
2007-03-28 19:38 ` David Brownell
2007-03-28 20:19 ` [linux-pm] " Maxim
@ 2007-03-28 20:42 ` Linus Torvalds
2007-03-28 21:17 ` [linux-pm] " David Brownell
2007-03-28 22:26 ` Maxim
1 sibling, 2 replies; 69+ messages in thread
From: Linus Torvalds @ 2007-03-28 20:42 UTC (permalink / raw)
To: David Brownell
Cc: Maxim, Jeff Chua, linux-acpi, gregkh, linux-pm,
Linux Kernel Mailing List, Andrew Morton, Adrian Bunk, linux-ide,
Thomas Gleixner, Eric W. Biederman, Ingo Molnar, Jens Axboe,
Michael S. Tsirkin, linux-pci, jgarzik, linux-pm
On Wed, 28 Mar 2007, David Brownell wrote:
>
> On Wednesday 28 March 2007 9:38 am, Linus Torvalds wrote:
>
> > It's a *device*, dammit. It should save and resume like one (probably as a
> > system device). The "set_mode()" etc stuff is at a completely different
> > (higher) conceptual level.
>
> Agreed, except about "probably as a system device".
>
> Last I checked, there was no good reason to use sysdev suspend()/resume()
> rather than platform_device suspend_late()/early_resume(). Which more
> or less means no good reason to use sysdev in new code...
I won't disagree - it might well be much nicer to just show it in the
"real" device tree. I'm not 100% sure where in the tree it would go,
though. It should probably be "inside" the root entry, before any of the
PCI buses. It's generally what we've used those "system device" things
for, but I agree that it would be better to just make system devices show
up early on the regular device list than it is to have them be special
cases.
Bit I think that's a separate (and fairly small) issue compared to the
"don't use the clocksource infrastructure as a make-believe suspend/resume
mechanism" problem that Maxim's patch had.
(Maxim, don't take that the wrong way - I think your analysis and patch
were great, I just think another organization would be better)
> Also, making HPET use the legacy mode seems like a step backwards.
I don't think that's actually "legacy" in any sense but the interrupt
delivery, where the "legacy mode" bit is not so much that the HPET itself
is "legacy" but that it *replaces* legacy devices.
But I may have misunderstood the thing. I'm an old fart, so I know the old
timers much better than I know the new ones ;). Somebody feel free to hit
me with the clue-2x4.
Linus
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [linux-pm] [3/6] 2.6.21-rc4: known regressions
2007-03-28 20:19 ` [linux-pm] " Maxim
@ 2007-03-28 20:59 ` David Brownell
2007-03-28 21:27 ` Maxim
0 siblings, 1 reply; 69+ messages in thread
From: David Brownell @ 2007-03-28 20:59 UTC (permalink / raw)
To: Maxim
Cc: linux-pm, Linus Torvalds, Jeff Chua, linux-ide, gregkh, linux-pm,
Linux Kernel Mailing List, Adrian Bunk, linux-acpi, linux-pci,
Eric W. Biederman, Ingo Molnar, Jens Axboe, Michael S. Tsirkin,
Thomas Gleixner, jgarzik, Andrew Morton
On Wednesday 28 March 2007 1:19 pm, Maxim wrote:
> On Wednesday 28 March 2007 21:38:55 David Brownell wrote:
> >
> > Also, making HPET use the legacy mode seems like a step backwards.
> It is not 'legacy' mode,
> It is a legacy replacement mode.
Typo, sorry.
> It this mode HPET takes over IRQ0 and IRQ 8 and provides this way
> replacement for PIT and RTC periodic function
It's that RTC periodic thing that bothers me, I don't mind about
the PIT. Remember that IRQ8 is also used for other RTC functions.
Now, if there were a way to tell rtc-cmos that HPET is active,
and arrange some kind of handshake ... that would be different.
- Dave
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [linux-pm] [3/6] 2.6.21-rc4: known regressions
2007-03-28 20:42 ` Linus Torvalds
@ 2007-03-28 21:17 ` David Brownell
2007-03-28 22:26 ` Maxim
1 sibling, 0 replies; 69+ messages in thread
From: David Brownell @ 2007-03-28 21:17 UTC (permalink / raw)
To: Linus Torvalds
Cc: linux-pm, Maxim, Jeff Chua, linux-ide, gregkh, linux-pm,
Linux Kernel Mailing List, Adrian Bunk, linux-acpi, linux-pci,
Eric W. Biederman, Ingo Molnar, Jens Axboe, Michael S. Tsirkin,
Thomas Gleixner, jgarzik, Andrew Morton
On Wednesday 28 March 2007 1:42 pm, Linus Torvalds wrote:
>
> I won't disagree - it might well be much nicer to just show it in the
> "real" device tree. I'm not 100% sure where in the tree it would go,
> though. It should probably be "inside" the root entry, before any of the
> PCI buses.
Mixing "inside" and "before" is a small linguistic clue about
one of the issues with driver model PM. Off topic here; and
in terms of suspend/resume callback sequencing that answer
shouldn't matter much for HPET (as I understand things).
> It's generally what we've used those "system device" things
> for, but I agree that it would be better to just make system devices show
> up early on the regular device list than it is to have them be special
> cases.
Yes -- where "platform_device" is a regular Joe-Sixpack kind of
device, but "sysdev" is a special case.
> Bit I think that's a separate (and fairly small) issue compared to the
> "don't use the clocksource infrastructure as a make-believe suspend/resume
> mechanism" problem that Maxim's patch had.
Agreed -- although isn't it the "clockevent" change which is at issue?
A "clockevent" thingie wraps various kinds of timer IRQs; the clocksource
is conceptually just a free run counter. Clocksources have been around
for a while, with no particular problems.
It's clockevent sources have been the problem with dynamic tick solutions
all along, since they mask such chaos inside x86 hardware and interact
with so many different parts of the kernel. ;)
- Dave
> (Maxim, don't take that the wrong way - I think your analysis and patch
> were great, I just think another organization would be better)
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [linux-pm] [3/6] 2.6.21-rc4: known regressions
2007-03-28 20:59 ` David Brownell
@ 2007-03-28 21:27 ` Maxim
2007-03-29 22:33 ` David Brownell
0 siblings, 1 reply; 69+ messages in thread
From: Maxim @ 2007-03-28 21:27 UTC (permalink / raw)
To: David Brownell
Cc: linux-pm, Linus Torvalds, Jeff Chua, linux-ide, gregkh, linux-pm,
Linux Kernel Mailing List, Adrian Bunk, linux-acpi, linux-pci,
Eric W. Biederman, Ingo Molnar, Jens Axboe, Michael S. Tsirkin,
Thomas Gleixner, jgarzik, Andrew Morton
On Wednesday 28 March 2007 22:59:26 David Brownell wrote:
> On Wednesday 28 March 2007 1:19 pm, Maxim wrote:
> > On Wednesday 28 March 2007 21:38:55 David Brownell wrote:
>
> > >
> > > Also, making HPET use the legacy mode seems like a step backwards.
>
> > It is not 'legacy' mode,
> > It is a legacy replacement mode.
>
> Typo, sorry.
>
>
> > It this mode HPET takes over IRQ0 and IRQ 8 and provides this way
> > replacement for PIT and RTC periodic function
>
> It's that RTC periodic thing that bothers me, I don't mind about
> the PIT. Remember that IRQ8 is also used for other RTC functions.
>
> Now, if there were a way to tell rtc-cmos that HPET is active,
> and arrange some kind of handshake ... that would be different.
>
> - Dave
>
Yes,
When HPET is active it eats RTC IRQ,
So the only way out is to emulate RTC using HPET,
It is done this way in old rtc driver, rtc-cmos should do the same.
Of course suspend resume is not supported at all by old rtc driver
I already wrote complete support for suspend/resume for old rtc driver (I wrote it long time ago)
Now I fixed it to support HPET , and this way I discovered that HPET doesn't have suspend resume functions
I will do last checks now and send this patch very soon
I am also planning to add support of HPET and suspend/resume for rtc-cmos, but I didn't start this yet.
Best regards,
Maxim Levitsky
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [linux-pm] [3/6] 2.6.21-rc4: known regressions
2007-03-28 20:42 ` Linus Torvalds
2007-03-28 21:17 ` [linux-pm] " David Brownell
@ 2007-03-28 22:26 ` Maxim
1 sibling, 0 replies; 69+ messages in thread
From: Maxim @ 2007-03-28 22:26 UTC (permalink / raw)
To: Linus Torvalds
Cc: David Brownell, linux-pm, Jeff Chua, linux-ide, gregkh, linux-pm,
Linux Kernel Mailing List, Adrian Bunk, linux-acpi, linux-pci,
Eric W. Biederman, Ingo Molnar, Jens Axboe, Michael S. Tsirkin,
Thomas Gleixner, jgarzik, Andrew Morton
On Wednesday 28 March 2007 22:42:00 Linus Torvalds wrote:
>
> On Wed, 28 Mar 2007, David Brownell wrote:
> >
> > On Wednesday 28 March 2007 9:38 am, Linus Torvalds wrote:
> >
> > > It's a *device*, dammit. It should save and resume like one (probably as a
> > > system device). The "set_mode()" etc stuff is at a completely different
> > > (higher) conceptual level.
> >
> > Agreed, except about "probably as a system device".
> >
> > Last I checked, there was no good reason to use sysdev suspend()/resume()
> > rather than platform_device suspend_late()/early_resume(). Which more
> > or less means no good reason to use sysdev in new code...
>
> I won't disagree - it might well be much nicer to just show it in the
> "real" device tree. I'm not 100% sure where in the tree it would go,
> though. It should probably be "inside" the root entry, before any of the
> PCI buses. It's generally what we've used those "system device" things
> for, but I agree that it would be better to just make system devices show
> up early on the regular device list than it is to have them be special
> cases.
>
> Bit I think that's a separate (and fairly small) issue compared to the
> "don't use the clocksource infrastructure as a make-believe suspend/resume
> mechanism" problem that Maxim's patch had.
>
> (Maxim, don't take that the wrong way - I think your analysis and patch
> were great, I just think another organization would be better)
Exactly, I agree completely
I said that my patch was a temporary fix, and I agree that the best way is to create a new system device
and use its suspend/resume hooks to bring HPET back to life on resume.
>
> > Also, making HPET use the legacy mode seems like a step backwards.
>
> I don't think that's actually "legacy" in any sense but the interrupt
> delivery, where the "legacy mode" bit is not so much that the HPET itself
> is "legacy" but that it *replaces* legacy devices.
>
> But I may have misunderstood the thing. I'm an old fart, so I know the old
> timers much better than I know the new ones ;). Somebody feel free to hit
> me with the clue-2x4.
>
> Linus
>
Best regards,
Maxim Levitsky
^ permalink raw reply [flat|nested] 69+ messages in thread
* [ PATCH] Add suspend/resume for HPET was: Re: [3/6] 2.6.21-rc4: known regressions
2007-03-28 16:38 ` Linus Torvalds
2007-03-28 19:38 ` David Brownell
@ 2007-03-29 4:41 ` Maxim
2007-03-29 5:08 ` Linus Torvalds
1 sibling, 1 reply; 69+ messages in thread
From: Maxim @ 2007-03-29 4:41 UTC (permalink / raw)
To: Linus Torvalds
Cc: Ingo Molnar, Thomas Gleixner, Jeff Chua, Adrian Bunk,
Andrew Morton, Linux Kernel Mailing List, Eric W. Biederman,
Rafael J. Wysocki, pavel, linux-pm, gregkh, linux-pci, Jens Axboe,
Len Brown, linux-acpi, jgarzik, linux-ide, Michael S. Tsirkin
On Wednesday 28 March 2007 18:38:48 Linus Torvalds wrote:
>
> On Wed, 28 Mar 2007, Maxim wrote:
> >
> > Now I don't have a clue how to set those bits if only HPET is used as clock source because now clocksources
> > don't have _any_ resume hook.
>
> One thing that drives me wild about that "clocksource resume" thing is
> that it seems to think that clocksources are somehow different from any
> other system devices..
>
> Why isn't the HPET considered a "device", and has it's own *device*
> "suspend" and "resume"? Why do we seem to think that only "set_mode()"
> etc should wake up clock sources?
>
> It's a *device*, dammit. It should save and resume like one (probably as a
> system device). The "set_mode()" etc stuff is at a completely different
> (higher) conceptual level.
>
> Thomas? It does seem like Maxim has hit the nail on the head (at least
> partly) on the HPET timer resume problems..
>
> Linus
>
Hi,
I am sending here a patch that as was discussed here adds hpet to list of system devices
and adds suspend/resume hooks this way.
I tested it and it works fine.
---
Add suspend/resume support for HPET
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
---
arch/i386/kernel/hpet.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 64 insertions(+), 0 deletions(-)
diff --git a/arch/i386/kernel/hpet.c b/arch/i386/kernel/hpet.c
index 0fd9fba..ac41476 100644
--- a/arch/i386/kernel/hpet.c
+++ b/arch/i386/kernel/hpet.c
@@ -3,6 +3,8 @@
#include <linux/errno.h>
#include <linux/hpet.h>
#include <linux/init.h>
+#include <linux/sysdev.h>
+#include <linux/pm.h>
#include <asm/hpet.h>
#include <asm/io.h>
@@ -524,3 +526,65 @@ irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id)
return IRQ_HANDLED;
}
#endif
+
+
+/*
+ * Suspend/resume part
+ */
+
+#ifdef CONFIG_PM
+
+static int hpet_suspend(struct sys_device *sys_device, pm_message_t state)
+{
+ unsigned long cfg = hpet_readl(HPET_CFG);
+
+ cfg &= ~(HPET_CFG_ENABLE|HPET_CFG_LEGACY);
+ hpet_writel(cfg, HPET_CFG);
+
+ return 0;
+}
+
+static int hpet_resume(struct sys_device *sys_device)
+{
+ unsigned int id;
+
+ hpet_start_counter();
+
+ id = hpet_readl(HPET_ID);
+
+ if (id & HPET_ID_LEGSUP)
+ hpet_enable_int();
+
+ return 0;
+}
+
+static struct sysdev_class hpet_class = {
+ set_kset_name("hpet"),
+ .suspend = hpet_suspend,
+ .resume = hpet_resume,
+};
+
+static struct sys_device hpet_device = {
+ .id = 0,
+ .cls = &hpet_class,
+};
+
+
+static __init int hpet_register_sysfs(void)
+{
+ int err;
+
+ err = sysdev_class_register(&hpet_class);
+
+ if (!err) {
+ sysdev_register(&hpet_device);
+ if (err)
+ sysdev_class_unregister(&hpet_class);
+ }
+
+ return err;
+}
+
+device_initcall(hpet_register_sysfs);
+
+#endif
--
1.4.4.2
^ permalink raw reply related [flat|nested] 69+ messages in thread
* Re: [ PATCH] Add suspend/resume for HPET was: Re: [3/6] 2.6.21-rc4: known regressions
2007-03-29 4:41 ` [ PATCH] Add suspend/resume for HPET was: " Maxim
@ 2007-03-29 5:08 ` Linus Torvalds
2007-03-29 5:47 ` Maxim
0 siblings, 1 reply; 69+ messages in thread
From: Linus Torvalds @ 2007-03-29 5:08 UTC (permalink / raw)
To: Maxim
Cc: Jeff Chua, linux-ide, gregkh, linux-pm, Linux Kernel Mailing List,
Adrian Bunk, linux-acpi, linux-pci, Eric W. Biederman,
Ingo Molnar, Jens Axboe, Michael S. Tsirkin, Thomas Gleixner,
jgarzik, Andrew Morton
On Thu, 29 Mar 2007, Maxim wrote:
>
> I am sending here a patch that as was discussed here adds hpet to list of system devices
> and adds suspend/resume hooks this way.
> I tested it and it works fine.
Ok, it certainly looks better, but it *also* looks like it just assumes
the HPET is there. Which would work in testing _with_ a HPET, but would
likely break on hardware without one, no?
Shouldn't there be at least something like a
if (!is_hpet_capable())
return 0;
at the top of that init routine? I'd also expect that you'd need to check
that "hpet_virt_address" is valid or something?
(Or, better yet, shouldn't we set "boot_hpet_disable" when we decide not
to use the HPET, and set hpet_virt_address to NULL?)
Linus
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [ PATCH] Add suspend/resume for HPET was: Re: [3/6] 2.6.21-rc4: known regressions
2007-03-29 5:08 ` Linus Torvalds
@ 2007-03-29 5:47 ` Maxim
2007-03-29 13:20 ` Sergei Shtylyov
2007-03-29 16:35 ` [ PATCH] Add suspend/resume for HPET was: Re: [3/6] 2.6.21-rc4: known regressions Linus Torvalds
0 siblings, 2 replies; 69+ messages in thread
From: Maxim @ 2007-03-29 5:47 UTC (permalink / raw)
To: Linus Torvalds
Cc: Ingo Molnar, Thomas Gleixner, Jeff Chua, Adrian Bunk,
Andrew Morton, Linux Kernel Mailing List, Eric W. Biederman,
Rafael J. Wysocki, pavel, linux-pm, gregkh, linux-pci, Jens Axboe,
Len Brown, linux-acpi, jgarzik, linux-ide, Michael S. Tsirkin
On Thursday 29 March 2007 07:08:58 Linus Torvalds wrote:
>
> On Thu, 29 Mar 2007, Maxim wrote:
> >
> > I am sending here a patch that as was discussed here adds hpet to list of system devices
> > and adds suspend/resume hooks this way.
> > I tested it and it works fine.
>
> Ok, it certainly looks better, but it *also* looks like it just assumes
> the HPET is there. Which would work in testing _with_ a HPET, but would
> likely break on hardware without one, no?
>
> Shouldn't there be at least something like a
>
> if (!is_hpet_capable())
> return 0;
>
> at the top of that init routine? I'd also expect that you'd need to check
> that "hpet_virt_address" is valid or something?
>
> (Or, better yet, shouldn't we set "boot_hpet_disable" when we decide not
> to use the HPET, and set hpet_virt_address to NULL?)
This is done here
out_nohpet:
iounmap(hpet_virt_address);
hpet_virt_address = NULL;
>
> Linus
>
Hi,
Of course, I forgot.
I was planning to put sysdev code in hpet_enable()
but it is not possible because this function is called too early.
Thus I put sysdev initialization in separate function but forgot to test for HPET
Thanks a lot.
Best regards
Maxim Levitsky
---
This adds support of suspend/resume on i386 for HPET
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
---
arch/i386/kernel/hpet.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 68 insertions(+), 0 deletions(-)
diff --git a/arch/i386/kernel/hpet.c b/arch/i386/kernel/hpet.c
index 0fd9fba..7c67780 100644
--- a/arch/i386/kernel/hpet.c
+++ b/arch/i386/kernel/hpet.c
@@ -3,6 +3,8 @@
#include <linux/errno.h>
#include <linux/hpet.h>
#include <linux/init.h>
+#include <linux/sysdev.h>
+#include <linux/pm.h>
#include <asm/hpet.h>
#include <asm/io.h>
@@ -310,6 +312,7 @@ int __init hpet_enable(void)
out_nohpet:
iounmap(hpet_virt_address);
hpet_virt_address = NULL;
+ boot_hpet_disable = 1;
return 0;
}
@@ -524,3 +527,68 @@ irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id)
return IRQ_HANDLED;
}
#endif
+
+
+/*
+ * Suspend/resume part
+ */
+
+#ifdef CONFIG_PM
+
+static int hpet_suspend(struct sys_device *sys_device, pm_message_t state)
+{
+ unsigned long cfg = hpet_readl(HPET_CFG);
+
+ cfg &= ~(HPET_CFG_ENABLE|HPET_CFG_LEGACY);
+ hpet_writel(cfg, HPET_CFG);
+
+ return 0;
+}
+
+static int hpet_resume(struct sys_device *sys_device)
+{
+ unsigned int id;
+
+ hpet_start_counter();
+
+ id = hpet_readl(HPET_ID);
+
+ if (id & HPET_ID_LEGSUP)
+ hpet_enable_int();
+
+ return 0;
+}
+
+static struct sysdev_class hpet_class = {
+ set_kset_name("hpet"),
+ .suspend = hpet_suspend,
+ .resume = hpet_resume,
+};
+
+static struct sys_device hpet_device = {
+ .id = 0,
+ .cls = &hpet_class,
+};
+
+
+static __init int hpet_register_sysfs(void)
+{
+ int err;
+
+ if (!is_hpet_capable())
+ return 0;
+
+ err = sysdev_class_register(&hpet_class);
+
+ if (!err) {
+ sysdev_register(&hpet_device);
+ if (err)
+ sysdev_class_unregister(&hpet_class);
+ }
+
+ return err;
+}
+
+device_initcall(hpet_register_sysfs);
+
+#endif
--
1.4.4.2
^ permalink raw reply related [flat|nested] 69+ messages in thread
* Re: [ PATCH] Add suspend/resume for HPET was: Re: [3/6] 2.6.21-rc4: known regressions
2007-03-29 5:47 ` Maxim
@ 2007-03-29 13:20 ` Sergei Shtylyov
2007-03-29 13:31 ` Maxim
2007-03-29 16:35 ` [ PATCH] Add suspend/resume for HPET was: Re: [3/6] 2.6.21-rc4: known regressions Linus Torvalds
1 sibling, 1 reply; 69+ messages in thread
From: Sergei Shtylyov @ 2007-03-29 13:20 UTC (permalink / raw)
To: Maxim
Cc: gregkh, Jeff Chua, linux-ide, jgarzik, Ingo Molnar, linux-pm,
Linux Kernel Mailing List, Adrian Bunk, linux-acpi, linux-pci,
Eric W. Biederman, Jens Axboe, Michael S. Tsirkin,
Thomas Gleixner, Linus Torvalds, Andrew Morton
Hello.
Maxim wrote:
> ---
> This adds support of suspend/resume on i386 for HPET
The part after usually "---" gets cut off, the patch description and
signoff should actially *precede* it.
> Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
> diff --git a/arch/i386/kernel/hpet.c b/arch/i386/kernel/hpet.c
> index 0fd9fba..7c67780 100644
> --- a/arch/i386/kernel/hpet.c
> +++ b/arch/i386/kernel/hpet.c
[...]
> +static __init int hpet_register_sysfs(void)
> +{
> + int err;
> +
> + if (!is_hpet_capable())
> + return 0;
> +
> + err = sysdev_class_register(&hpet_class);
> +
> + if (!err) {
> + sysdev_register(&hpet_device);
> + if (err)
> + sysdev_class_unregister(&hpet_class);
This doesn't make sense, err will always be 0. Perhaps you actually
intended to check the result of sysdev_register()?
> + }
> +
> + return err;
> +}
> +
> +device_initcall(hpet_register_sysfs);
> +
> +#endif
WBR, Sergei
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [ PATCH] Add suspend/resume for HPET was: Re: [3/6] 2.6.21-rc4: known regressions
2007-03-29 13:20 ` Sergei Shtylyov
@ 2007-03-29 13:31 ` Maxim
2007-03-29 13:46 ` [PATCH v2] Add suspend/resume for HPET Maxim Levitsky
0 siblings, 1 reply; 69+ messages in thread
From: Maxim @ 2007-03-29 13:31 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: Linus Torvalds, Ingo Molnar, Thomas Gleixner, Jeff Chua,
Adrian Bunk, Andrew Morton, Linux Kernel Mailing List,
Eric W. Biederman, Rafael J. Wysocki, pavel, linux-pm, gregkh,
linux-pci, Jens Axboe, Len Brown, linux-acpi, jgarzik, linux-ide,
Michael S. Tsirkin
On Thursday 29 March 2007 15:20:27 Sergei Shtylyov wrote:
> Hello.
>
> Maxim wrote:
>
> > ---
> > This adds support of suspend/resume on i386 for HPET
>
> The part after usually "---" gets cut off, the patch description and
> signoff should actially *precede* it.
>
> > Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
>
> > diff --git a/arch/i386/kernel/hpet.c b/arch/i386/kernel/hpet.c
> > index 0fd9fba..7c67780 100644
> > --- a/arch/i386/kernel/hpet.c
> > +++ b/arch/i386/kernel/hpet.c
> [...]
> > +static __init int hpet_register_sysfs(void)
> > +{
> > + int err;
> > +
> > + if (!is_hpet_capable())
> > + return 0;
> > +
> > + err = sysdev_class_register(&hpet_class);
> > +
> > + if (!err) {
> > + sysdev_register(&hpet_device);
> > + if (err)
> > + sysdev_class_unregister(&hpet_class);
>
> This doesn't make sense, err will always be 0. Perhaps you actually
> intended to check the result of sysdev_register()?
>
> > + }
> > +
> > + return err;
> > +}
> > +
> > +device_initcall(hpet_register_sysfs);
> > +
> > +#endif
>
> WBR, Sergei
>
Hi,
Big thanks for pointing this out,
I will resend that updated patch.
Best regards,
Maxim Levitsky
^ permalink raw reply [flat|nested] 69+ messages in thread
* [PATCH v2] Add suspend/resume for HPET
2007-03-29 13:31 ` Maxim
@ 2007-03-29 13:46 ` Maxim Levitsky
2007-03-29 16:53 ` Linus Torvalds
` (2 more replies)
0 siblings, 3 replies; 69+ messages in thread
From: Maxim Levitsky @ 2007-03-29 13:46 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: gregkh, Jeff Chua, linux-ide, jgarzik, Ingo Molnar, linux-pm,
Linux Kernel Mailing List, Adrian Bunk, linux-acpi, linux-pci,
Eric W. Biederman, Jens Axboe, Michael S. Tsirkin,
Thomas Gleixner, Linus Torvalds, Andrew Morton
Subject: Add suspend/resume for HPET
This adds support of suspend/resume on i386 for HPET
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
---
arch/i386/kernel/hpet.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 68 insertions(+), 0 deletions(-)
diff --git a/arch/i386/kernel/hpet.c b/arch/i386/kernel/hpet.c
index 0fd9fba..7c67780 100644
--- a/arch/i386/kernel/hpet.c
+++ b/arch/i386/kernel/hpet.c
@@ -3,6 +3,8 @@
#include <linux/errno.h>
#include <linux/hpet.h>
#include <linux/init.h>
+#include <linux/sysdev.h>
+#include <linux/pm.h>
#include <asm/hpet.h>
#include <asm/io.h>
@@ -310,6 +312,7 @@ int __init hpet_enable(void)
out_nohpet:
iounmap(hpet_virt_address);
hpet_virt_address = NULL;
+ boot_hpet_disable = 1;
return 0;
}
@@ -524,3 +527,68 @@ irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id)
return IRQ_HANDLED;
}
#endif
+
+
+/*
+ * Suspend/resume part
+ */
+
+#ifdef CONFIG_PM
+
+static int hpet_suspend(struct sys_device *sys_device, pm_message_t state)
+{
+ unsigned long cfg = hpet_readl(HPET_CFG);
+
+ cfg &= ~(HPET_CFG_ENABLE|HPET_CFG_LEGACY);
+ hpet_writel(cfg, HPET_CFG);
+
+ return 0;
+}
+
+static int hpet_resume(struct sys_device *sys_device)
+{
+ unsigned int id;
+
+ hpet_start_counter();
+
+ id = hpet_readl(HPET_ID);
+
+ if (id & HPET_ID_LEGSUP)
+ hpet_enable_int();
+
+ return 0;
+}
+
+static struct sysdev_class hpet_class = {
+ set_kset_name("hpet"),
+ .suspend = hpet_suspend,
+ .resume = hpet_resume,
+};
+
+static struct sys_device hpet_device = {
+ .id = 0,
+ .cls = &hpet_class,
+};
+
+
+static __init int hpet_register_sysfs(void)
+{
+ int err;
+
+ if (!is_hpet_capable())
+ return 0;
+
+ err = sysdev_class_register(&hpet_class);
+
+ if (!err) {
+ err = sysdev_register(&hpet_device);
+ if (err)
+ sysdev_class_unregister(&hpet_class);
+ }
+
+ return err;
+}
+
+device_initcall(hpet_register_sysfs);
+
+#endif
--
1.4.4.2
^ permalink raw reply related [flat|nested] 69+ messages in thread
* Re: [3/6] 2.6.21-rc4: known regressions
2007-03-28 18:04 ` [3/6] 2.6.21-rc4: known regressions Michael S. Tsirkin
2007-03-28 18:32 ` Ingo Molnar
2007-03-28 18:35 ` Randy Dunlap
@ 2007-03-29 14:24 ` Jeff Chua
2 siblings, 0 replies; 69+ messages in thread
From: Jeff Chua @ 2007-03-29 14:24 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Maxim, Thomas Gleixner, Adrian Bunk, Linus Torvalds,
Andrew Morton, Linux Kernel Mailing List, Eric W. Biederman,
Rafael J. Wysocki, pavel, linux-pm, gregkh, linux-pci, Jens Axboe,
Len Brown, linux-acpi, jgarzik, linux-ide, Ingo Molnar
On 3/29/07, Michael S. Tsirkin <mst@dev.mellanox.co.il> wrote:
> > Quoting Maxim <maximlevitsky@gmail.com>:
> > The patch below is a temporally fix, until
> > clock-events and clocksources will get proper suspend/resume
> > hooks:
> Bingo!
I confirmed that it suspend/resume disk/ram all works on my X60s with
CONFIG_HPET_TIMER=y and CONFIG_NO_HZ unset.
But suspend to disk still hang with CONFIG_NO_HZ=y no matter what
setting CONFIG_HPET_TIMER is set to.
Thanks,
Jeff.
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [ PATCH] Add suspend/resume for HPET was: Re: [3/6] 2.6.21-rc4: known regressions
2007-03-29 5:47 ` Maxim
2007-03-29 13:20 ` Sergei Shtylyov
@ 2007-03-29 16:35 ` Linus Torvalds
2007-03-29 16:51 ` Maxim Levitsky
1 sibling, 1 reply; 69+ messages in thread
From: Linus Torvalds @ 2007-03-29 16:35 UTC (permalink / raw)
To: Maxim
Cc: Jeff Chua, linux-ide, gregkh, linux-pm, Linux Kernel Mailing List,
Adrian Bunk, linux-acpi, linux-pci, Eric W. Biederman,
Ingo Molnar, Jens Axboe, Michael S. Tsirkin, Thomas Gleixner,
jgarzik, Andrew Morton
On Thu, 29 Mar 2007, Maxim wrote:
> On Thursday 29 March 2007 07:08:58 Linus Torvalds wrote:
> >
> > (Or, better yet, shouldn't we set "boot_hpet_disable" when we decide not
> > to use the HPET, and set hpet_virt_address to NULL?)
>
> This is done here
>
> out_nohpet:
> iounmap(hpet_virt_address);
> hpet_virt_address = NULL;
No, that only clears hpet_virt_address, and thus makes all subsequent
"hpet_readl()" and "hpet_writel()" calls oops.
But it doesn't actually *tell* anybody that the HPET is disabled, so if
you later on do
if (is_hpet_capable()) {
time = hpet_readl(..);
..
you will just Oops!
So as far as I can see, even with your latest patch, if hpet_enable()
fails (and triggers the "goto out_nohpet" cases), you'll just oops
immediately when you try to suspend/resume the HPET.
THAT was what I meant - when we clear hpet_virt_address, we should also
tell all potential subsequent users that the HPET is not there!
Linus
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [ PATCH] Add suspend/resume for HPET was: Re: [3/6] 2.6.21-rc4: known regressions
2007-03-29 16:35 ` [ PATCH] Add suspend/resume for HPET was: Re: [3/6] 2.6.21-rc4: known regressions Linus Torvalds
@ 2007-03-29 16:51 ` Maxim Levitsky
2007-03-29 17:22 ` Linus Torvalds
0 siblings, 1 reply; 69+ messages in thread
From: Maxim Levitsky @ 2007-03-29 16:51 UTC (permalink / raw)
To: Linus Torvalds
Cc: Jeff Chua, linux-ide, gregkh, linux-pm, Linux Kernel Mailing List,
Adrian Bunk, linux-acpi, linux-pci, Eric W. Biederman,
Ingo Molnar, Jens Axboe, Michael S. Tsirkin, Thomas Gleixner,
jgarzik, Andrew Morton
On Thursday 29 March 2007 18:35:21 Linus Torvalds wrote:
>
> On Thu, 29 Mar 2007, Maxim wrote:
>
> > On Thursday 29 March 2007 07:08:58 Linus Torvalds wrote:
> > >
> > > (Or, better yet, shouldn't we set "boot_hpet_disable" when we decide not
> > > to use the HPET, and set hpet_virt_address to NULL?)
> >
> > This is done here
> >
> > out_nohpet:
> > iounmap(hpet_virt_address);
> > hpet_virt_address = NULL;
>
> No, that only clears hpet_virt_address, and thus makes all subsequent
> "hpet_readl()" and "hpet_writel()" calls oops.
>
> But it doesn't actually *tell* anybody that the HPET is disabled, so if
> you later on do
>
> if (is_hpet_capable()) {
> time = hpet_readl(..);
> ..
>
> you will just Oops!
>
> So as far as I can see, even with your latest patch, if hpet_enable()
> fails (and triggers the "goto out_nohpet" cases), you'll just oops
> immediately when you try to suspend/resume the HPET.
>
> THAT was what I meant - when we clear hpet_virt_address, we should also
> tell all potential subsequent users that the HPET is not there!
>
> Linus
>
Hi,
I agree, and as you said I did exactly that:
out_nohpet:
iounmap(hpet_virt_address);
hpet_virt_address = NULL;
boot_hpet_disable = 1; <<<--- this ensures that is_hpet_capable() will never return positive value
I also sent an updated version on my patch with subject line "[PATCH v2] Add suspend/resume for HPET"
I forgot (a typo) to check error code in hpet_register_sysfs
Thanks to Sergei Shtylyov for pointing me on that.
This patch should be ok.
Best regards,
Maxim Levitsky
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PATCH v2] Add suspend/resume for HPET
2007-03-29 13:46 ` [PATCH v2] Add suspend/resume for HPET Maxim Levitsky
@ 2007-03-29 16:53 ` Linus Torvalds
2007-03-29 17:28 ` Maxim Levitsky
2007-03-29 17:51 ` Ingo Molnar
2007-03-29 18:11 ` Jeff Chua
2007-03-31 15:51 ` Thomas Gleixner
2 siblings, 2 replies; 69+ messages in thread
From: Linus Torvalds @ 2007-03-29 16:53 UTC (permalink / raw)
To: Maxim Levitsky
Cc: Andrew Morton, Jeff Chua, linux-ide, Sergei Shtylyov, gregkh,
linux-pm, Linux Kernel Mailing List, Adrian Bunk, linux-acpi,
linux-pci, Eric W. Biederman, Jens Axboe, Michael S. Tsirkin,
Thomas Gleixner, jgarzik, Ingo Molnar
On Thu, 29 Mar 2007, Maxim Levitsky wrote:
>
> Subject: Add suspend/resume for HPET
>
> This adds support of suspend/resume on i386 for HPET
>
> Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
>
> ---
> arch/i386/kernel/hpet.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++
Btw, what about arch/x86_64/kernel/hpet.c?
That thing seems totally broken. Lookie here:
arch/x86_64/kernel/hpet.c:irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
drivers/char/rtc.c:extern irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id);
anybody see a problem? The x86-64 version doesn't seem to be very well
maintained. Is there some fundamental reason why this file isn't shared
across architectures?
Linus
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [ PATCH] Add suspend/resume for HPET was: Re: [3/6] 2.6.21-rc4: known regressions
2007-03-29 16:51 ` Maxim Levitsky
@ 2007-03-29 17:22 ` Linus Torvalds
2007-03-29 17:47 ` [patch, v2] add suspend/resume for HPET Ingo Molnar
0 siblings, 1 reply; 69+ messages in thread
From: Linus Torvalds @ 2007-03-29 17:22 UTC (permalink / raw)
To: Maxim Levitsky
Cc: Jeff Chua, linux-ide, gregkh, linux-pm, Linux Kernel Mailing List,
Adrian Bunk, linux-acpi, linux-pci, Eric W. Biederman,
Ingo Molnar, Jens Axboe, Michael S. Tsirkin, Thomas Gleixner,
jgarzik, Andrew Morton
On Thu, 29 Mar 2007, Maxim Levitsky wrote:
>
> I agree, and as you said I did exactly that:
Gaah. I'm blind. Sorry. Your patch did indeed do exactly that, I somehow
overlooked it.
Linus
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PATCH v2] Add suspend/resume for HPET
2007-03-29 16:53 ` Linus Torvalds
@ 2007-03-29 17:28 ` Maxim Levitsky
2007-03-29 17:51 ` Ingo Molnar
1 sibling, 0 replies; 69+ messages in thread
From: Maxim Levitsky @ 2007-03-29 17:28 UTC (permalink / raw)
To: Linus Torvalds
Cc: Sergei Shtylyov, Ingo Molnar, Thomas Gleixner, Jeff Chua,
Adrian Bunk, Andrew Morton, Linux Kernel Mailing List,
Eric W. Biederman, Rafael J. Wysocki, pavel, linux-pm, gregkh,
linux-pci, Jens Axboe, Len Brown, linux-acpi, jgarzik, linux-ide,
Michael S. Tsirkin
On Thursday 29 March 2007 18:53:37 Linus Torvalds wrote:
>
> On Thu, 29 Mar 2007, Maxim Levitsky wrote:
> >
> > Subject: Add suspend/resume for HPET
> >
> > This adds support of suspend/resume on i386 for HPET
> >
> > Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
> >
> > ---
> > arch/i386/kernel/hpet.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++
>
> Btw, what about arch/x86_64/kernel/hpet.c?
>
> That thing seems totally broken. Lookie here:
>
> arch/x86_64/kernel/hpet.c:irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
> drivers/char/rtc.c:extern irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id);
>
> anybody see a problem? The x86-64 version doesn't seem to be very well
> maintained. Is there some fundamental reason why this file isn't shared
> across architectures?
>
> Linus
>
Hi,
I agree with that, there seems to be lot of code duplication between i386 and x86_64.
By the way, x86_64 does take care of suspend/resume for hpet, it is done by
linux-2.6/arch/x86_64/kernel/time.c:timer_resume(struct sys_device *dev):
hpet_reenable()
on i386 PIT driver goes out of way when HPET is detected
So it seems that there is lot of work to do to remove redundant code.
Best regards,
Maxim Levitsky
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [patch, v2] add suspend/resume for HPET
2007-03-29 17:22 ` Linus Torvalds
@ 2007-03-29 17:47 ` Ingo Molnar
0 siblings, 0 replies; 69+ messages in thread
From: Ingo Molnar @ 2007-03-29 17:47 UTC (permalink / raw)
To: Linus Torvalds
Cc: Maxim Levitsky, Jeff Chua, linux-ide, gregkh, linux-pm,
Linux Kernel Mailing List, Adrian Bunk, linux-acpi, linux-pci,
Eric W. Biederman, Jens Axboe, Michael S. Tsirkin,
Thomas Gleixner, jgarzik, Andrew Morton
update: i've tested Maxim's v2 patch on both a hpet-capable and a
hpet-less system, and it works fine here.
on a dual-core hpet-capable system, running a NO_HZ+!HIGH_RES_TIMERS
kernel:
europe:~> grep Clock /proc/timer_list
Clock Event Device: hpet
Clock Event Device: lapic
Clock Event Device: lapic
s2ram works fine now - it hung on resume before.
on a dual-core non-hpet system, with a NO_HZ+!HIGH_RES_TIMERS kernel:
neptune:~> grep Clock /proc/timer_list
Clock Event Device: pit
Clock Event Device: lapic
Clock Event Device: lapic
s2ram worked fine before - and it still works now.
(The combination of NO_HZ+!HIGH_RES_TIMERS was the most fragile wrt.
suspend because in the !HIGH_RES_TIMERS there's just a single instance
after resume that we touch the timer hardware, and we very much rely on
the periodic interrupt being set to the precise value.)
So this is a go on my systems - good work Maxim! (I've reproduced
Maxim's patch below with minor patch-metadata updates.)
Ingo
---------------------------->
Subject: [patch] add suspend/resume for HPET
From: Maxim Levitsky <maximlevitsky@gmail.com>
This adds support for suspend/resume on i386 for HPET.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
---
arch/i386/kernel/hpet.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 68 insertions(+)
Index: linux/arch/i386/kernel/hpet.c
===================================================================
--- linux.orig/arch/i386/kernel/hpet.c
+++ linux/arch/i386/kernel/hpet.c
@@ -3,6 +3,8 @@
#include <linux/errno.h>
#include <linux/hpet.h>
#include <linux/init.h>
+#include <linux/sysdev.h>
+#include <linux/pm.h>
#include <asm/hpet.h>
#include <asm/io.h>
@@ -307,6 +309,7 @@ int __init hpet_enable(void)
out_nohpet:
iounmap(hpet_virt_address);
hpet_virt_address = NULL;
+ boot_hpet_disable = 1;
return 0;
}
@@ -523,3 +526,68 @@ irqreturn_t hpet_rtc_interrupt(int irq,
return IRQ_HANDLED;
}
#endif
+
+
+/*
+ * Suspend/resume part
+ */
+
+#ifdef CONFIG_PM
+
+static int hpet_suspend(struct sys_device *sys_device, pm_message_t state)
+{
+ unsigned long cfg = hpet_readl(HPET_CFG);
+
+ cfg &= ~(HPET_CFG_ENABLE|HPET_CFG_LEGACY);
+ hpet_writel(cfg, HPET_CFG);
+
+ return 0;
+}
+
+static int hpet_resume(struct sys_device *sys_device)
+{
+ unsigned int id;
+
+ hpet_start_counter();
+
+ id = hpet_readl(HPET_ID);
+
+ if (id & HPET_ID_LEGSUP)
+ hpet_enable_int();
+
+ return 0;
+}
+
+static struct sysdev_class hpet_class = {
+ set_kset_name("hpet"),
+ .suspend = hpet_suspend,
+ .resume = hpet_resume,
+};
+
+static struct sys_device hpet_device = {
+ .id = 0,
+ .cls = &hpet_class,
+};
+
+
+static __init int hpet_register_sysfs(void)
+{
+ int err;
+
+ if (!is_hpet_capable())
+ return 0;
+
+ err = sysdev_class_register(&hpet_class);
+
+ if (!err) {
+ err = sysdev_register(&hpet_device);
+ if (err)
+ sysdev_class_unregister(&hpet_class);
+ }
+
+ return err;
+}
+
+device_initcall(hpet_register_sysfs);
+
+#endif
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PATCH v2] Add suspend/resume for HPET
2007-03-29 16:53 ` Linus Torvalds
2007-03-29 17:28 ` Maxim Levitsky
@ 2007-03-29 17:51 ` Ingo Molnar
2007-03-29 20:46 ` Andi Kleen
1 sibling, 1 reply; 69+ messages in thread
From: Ingo Molnar @ 2007-03-29 17:51 UTC (permalink / raw)
To: Linus Torvalds
Cc: Maxim Levitsky, Jeff Chua, linux-ide, Sergei Shtylyov, gregkh,
linux-pm, Linux Kernel Mailing List, Adrian Bunk, linux-acpi,
linux-pci, Eric W. Biederman, Jens Axboe, Michael S. Tsirkin,
Thomas Gleixner, jgarzik, Andrew Morton
* Linus Torvalds <torvalds@linux-foundation.org> wrote:
> Btw, what about arch/x86_64/kernel/hpet.c?
at least wrt. suspend/resume it should be fine, because in
arch/x86_64/kernel/time.c it does this upon resume:
static int timer_resume(struct sys_device *dev)
{
if (hpet_address)
hpet_reenable();
else
i8254_timer_resume();
[ barring the issue that mixing two pieces of hardware like this in a
single resume function is wrong - all timer hardware should be
separated like we did it for i386. I've got 64-bit clockevents code in
-rt which does this separation. ]
> That thing seems totally broken. Lookie here:
>
> arch/x86_64/kernel/hpet.c:irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
> drivers/char/rtc.c:extern irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id);
>
> anybody see a problem? The x86-64 version doesn't seem to be very well
> maintained. Is there some fundamental reason why this file isn't
> shared across architectures?
there's no fundamental reason. x86_64 COW-ed hpet_timer.c and
time_hpet.c years ago and drifted off into different areas.
They should be unified: more power to arch/x86/ ;-)
Ingo
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PATCH v2] Add suspend/resume for HPET
2007-03-29 13:46 ` [PATCH v2] Add suspend/resume for HPET Maxim Levitsky
2007-03-29 16:53 ` Linus Torvalds
@ 2007-03-29 18:11 ` Jeff Chua
2007-03-31 15:51 ` Thomas Gleixner
2 siblings, 0 replies; 69+ messages in thread
From: Jeff Chua @ 2007-03-29 18:11 UTC (permalink / raw)
To: Maxim Levitsky
Cc: Sergei Shtylyov, Linus Torvalds, Ingo Molnar, Thomas Gleixner,
Adrian Bunk, Andrew Morton, Linux Kernel Mailing List,
Eric W. Biederman, Rafael J. Wysocki, pavel, linux-pm, gregkh,
linux-pci, Jens Axboe, Len Brown, linux-acpi, jgarzik, linux-ide,
Michael S. Tsirkin
On 3/29/07, Maxim Levitsky <maximlevitsky@gmail.com> wrote:
> Subject: Add suspend/resume for HPET
> This adds support of suspend/resume on i386 for HPET
> Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Confirmed that suspend/resume disk/ram works on X60s with
CONFIG_HPET_TIMER=y and CONFIG_NO_HZ unset.
But suspend to disk still hang with CONFIG_NO_HZ unset.
Thanks,
Jeff.
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PATCH v2] Add suspend/resume for HPET
2007-03-29 17:51 ` Ingo Molnar
@ 2007-03-29 20:46 ` Andi Kleen
0 siblings, 0 replies; 69+ messages in thread
From: Andi Kleen @ 2007-03-29 20:46 UTC (permalink / raw)
To: Ingo Molnar
Cc: Maxim Levitsky, Jeff Chua, linux-acpi, Sergei Shtylyov, jgarzik,
gregkh, linux-pm, Linux Kernel Mailing List, Andrew Morton,
Adrian Bunk, linux-ide, Eric W. Biederman, Jens Axboe,
Michael S. Tsirkin, linux-pci, Linus Torvalds, Thomas Gleixner
Ingo Molnar <mingo@elte.hu> writes:
>
> there's no fundamental reason. x86_64 COW-ed hpet_timer.c and
> time_hpet.c years ago and drifted off into different areas.
Not quite -- x86-64 did HPET long before i386; the only stuff cowed
was the character driver support code. But the core HPET code
was always totally different code streams. We never did the complicated
pluggable clock code i386 did though -- i never quite saw the point of that
because there aren't that many timers there.
Of course it is already obsolete with clocksources now.
-Andi
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [linux-pm] [3/6] 2.6.21-rc4: known regressions
2007-03-28 21:27 ` Maxim
@ 2007-03-29 22:33 ` David Brownell
2007-03-29 23:29 ` Maxim Levitsky
0 siblings, 1 reply; 69+ messages in thread
From: David Brownell @ 2007-03-29 22:33 UTC (permalink / raw)
To: Maxim
Cc: Adrian Bunk, Andrew Morton, Eric W. Biederman, gregkh,
Ingo Molnar, Jeff Chua, Jens Axboe, jgarzik, Linus Torvalds,
linux-acpi, linux-ide, Linux Kernel Mailing List, linux-pci,
linux-pm, Michael S. Tsirkin, Thomas Gleixner
On Wednesday 28 March 2007 2:27 pm, Maxim wrote:
> On Wednesday 28 March 2007 22:59:26 David Brownell wrote:
> When HPET is active it eats RTC IRQ,
Only when HPET timers 0 and 1 are set up for "Legacy Replacement Mode".
In the more sensible "Standard Mode", they have their own IRQs.
> So the only way out is to emulate RTC using HPET,
> It is done this way in old rtc driver, rtc-cmos should do the same.
No. Patches like
http://marc.info/?l=linux-kernel&m=117219531503973&w=2
should be merged (I hope they're in the 2.6.22 queue!), making
HPET run in "Standard Mode" so that HPET can stop sticking its
fingers in code where they don't belong.
> I am also planning to add support of HPET and suspend/resume
> for rtc-cmos, but I didn't start this yet.
It's already got suspend/resume support, and in the 2.6.22 queue
are RTC framework updates which will let the RTC framework replace
a lot more platform-specific RTC support. (Platform changes can come
later, where they're needed. ARM for example doesn't need any.)
Once HPET stops using "Legacy Replacement Mode" you won't need to
touch anything in the RTC stack (except maybe the legacy char/rtc.c
driver, removing HPET stuff).
The open issue with suspend/resume support in rtc-cmos relates to
how ACPI wakeup alarms should trigger. I've not made time to test
those patches.
- Dave
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [3/6] 2.6.21-rc4: known regressions
2007-03-29 22:33 ` David Brownell
@ 2007-03-29 23:29 ` Maxim Levitsky
2007-03-30 0:09 ` [linux-pm] " David Brownell
0 siblings, 1 reply; 69+ messages in thread
From: Maxim Levitsky @ 2007-03-29 23:29 UTC (permalink / raw)
To: David Brownell
Cc: Jeff Chua, linux-acpi, jgarzik, linux-pm, gregkh,
Linux Kernel Mailing List, Adrian Bunk, linux-ide, linux-pci,
Thomas Gleixner, Eric W. Biederman, Jens Axboe,
Michael S. Tsirkin, Andrew Morton, Linus Torvalds, Ingo Molnar
On Friday 30 March 2007 00:33:35 David Brownell wrote:
> On Wednesday 28 March 2007 2:27 pm, Maxim wrote:
> > On Wednesday 28 March 2007 22:59:26 David Brownell wrote:
>
> > When HPET is active it eats RTC IRQ,
>
> Only when HPET timers 0 and 1 are set up for "Legacy Replacement Mode".
> In the more sensible "Standard Mode", they have their own IRQs.
>
>
> > So the only way out is to emulate RTC using HPET,
> > It is done this way in old rtc driver, rtc-cmos should do the same.
>
> No. Patches like
>
> http://marc.info/?l=linux-kernel&m=117219531503973&w=2
>
> should be merged (I hope they're in the 2.6.22 queue!), making
> HPET run in "Standard Mode" so that HPET can stop sticking its
> fingers in code where they don't belong.
>
>
> > I am also planning to add support of HPET and suspend/resume
> > for rtc-cmos, but I didn't start this yet.
>
> It's already got suspend/resume support, and in the 2.6.22 queue
> are RTC framework updates which will let the RTC framework replace
> a lot more platform-specific RTC support. (Platform changes can come
> later, where they're needed. ARM for example doesn't need any.)
>
> Once HPET stops using "Legacy Replacement Mode" you won't need to
> touch anything in the RTC stack (except maybe the legacy char/rtc.c
> driver, removing HPET stuff).
>
> The open issue with suspend/resume support in rtc-cmos relates to
> how ACPI wakeup alarms should trigger. I've not made time to test
> those patches.
>
> - Dave
>
Hi,
It is not that simple,
Only in legacy replacement mode HPET can be put on IRQ0 (and sadly IRQ8)
At least this is true on some systems, on mine for example
On my system first 2 hpet timers can only be assigned to IRQ21-23
and third to ether IRQ11, IRQ21-IRQ23
Or in legacy replacement mode first is assigned IRQ0 and second IRQ8
this will make it difficult to use it as a clockevents source
Not to mention the fact that current code assumes that BIOS assigned IRQs to all timers which is not true on my system.
I have brand new intel DG965 motherboard.
What is wrong with relying on HPET to provide RTC IRQ ?
Best regards,
Maxim Levitsky
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [linux-pm] [3/6] 2.6.21-rc4: known regressions
2007-03-29 23:29 ` Maxim Levitsky
@ 2007-03-30 0:09 ` David Brownell
2007-03-30 0:48 ` Maxim Levitsky
0 siblings, 1 reply; 69+ messages in thread
From: David Brownell @ 2007-03-30 0:09 UTC (permalink / raw)
To: Maxim Levitsky
Cc: Adrian Bunk, Andrew Morton, Eric W. Biederman, gregkh,
Ingo Molnar, Jeff Chua, Jens Axboe, jgarzik, Linus Torvalds,
linux-acpi, linux-ide, Linux Kernel Mailing List, linux-pci,
linux-pm, Michael S. Tsirkin, Thomas Gleixner
On Thursday 29 March 2007 4:29 pm, Maxim Levitsky wrote:
> On Friday 30 March 2007 00:33:35 David Brownell wrote:
> > On Wednesday 28 March 2007 2:27 pm, Maxim wrote:
> > > So the only way out is to emulate RTC using HPET,
> > > It is done this way in old rtc driver, rtc-cmos should do the same.
> >
> > No. Patches like
> >
> > http://marc.info/?l=linux-kernel&m=117219531503973&w=2
also: http://marc.info/?l=linux-kernel&m=117219531526317&w=2
> > should be merged (I hope they're in the 2.6.22 queue!), making
> > HPET run in "Standard Mode" so that HPET can stop sticking its
> > fingers in code where they don't belong.
> >
> > ...
>
> It is not that simple,
>
> Only in legacy replacement mode HPET can be put on IRQ0 (and sadly IRQ8)
> At least this is true on some systems, on mine for example
Right, that's the entire point of legacy replacement mode.
But so what? In standard mode, HPET just uses other IRQs.
Nothing would care about irq0, and irq8 would be used by
the RTC as necessary.
> this will make it difficult to use it as a clockevents source
Why? It's not like the clockevent logic cares what IRQ a given
programmable timer uses. So long as the HPET driver can receive
its IRQ, it'll make a fine clockevent. There's no reason to have
HPET prevent other drivers from working, by insisting it use that
nasty "prevent other hardware from issuing IRQs" mode.
The patches from Venkatesh sure seem to have behaved for him.
And while he might have complained about difficulty, I think
that'd be more likely due to the SMP issues he also addressed
than because of some (historical?) attachment to irq0.
> Not to mention the fact that current code assumes that BIOS
> assigned IRQs to all timers which is not true on my system.
Getting IRQ routing sorted out is a problem that's been solved
numerous times before. And again, the patches referenced above
seem to have resolved any such issues.
> What is wrong with relying on HPET to provide RTC IRQ ?
For starters, it's not an RTC. Why in the world would you want to
make the OS think it's an RTC ... unless you're Microsoft, and are
desperate to get another periodic timer (and don't much care about
the other RTC functionality?
... that's all off-topic for 2.6.21 regressions though; it's too
late to merge x86_64 clockevent support, or fix HPET issues like
not using "standard mode".
- Dave
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [3/6] 2.6.21-rc4: known regressions
2007-03-30 0:09 ` [linux-pm] " David Brownell
@ 2007-03-30 0:48 ` Maxim Levitsky
0 siblings, 0 replies; 69+ messages in thread
From: Maxim Levitsky @ 2007-03-30 0:48 UTC (permalink / raw)
To: David Brownell
Cc: Jeff Chua, linux-acpi, jgarzik, linux-pm, gregkh,
Linux Kernel Mailing List, Adrian Bunk, linux-ide, linux-pci,
Thomas Gleixner, Eric W. Biederman, Jens Axboe,
Michael S. Tsirkin, Andrew Morton, Linus Torvalds, Ingo Molnar
On Friday 30 March 2007 03:09:14 David Brownell wrote:
> On Thursday 29 March 2007 4:29 pm, Maxim Levitsky wrote:
> > On Friday 30 March 2007 00:33:35 David Brownell wrote:
> > > On Wednesday 28 March 2007 2:27 pm, Maxim wrote:
>
> > > > So the only way out is to emulate RTC using HPET,
> > > > It is done this way in old rtc driver, rtc-cmos should do the same.
> > >
> > > No. Patches like
> > >
> > > http://marc.info/?l=linux-kernel&m=117219531503973&w=2
>
> also: http://marc.info/?l=linux-kernel&m=117219531526317&w=2
>
> > > should be merged (I hope they're in the 2.6.22 queue!), making
> > > HPET run in "Standard Mode" so that HPET can stop sticking its
> > > fingers in code where they don't belong.
> > >
> > > ...
> >
> > It is not that simple,
> >
> > Only in legacy replacement mode HPET can be put on IRQ0 (and sadly IRQ8)
> > At least this is true on some systems, on mine for example
>
> Right, that's the entire point of legacy replacement mode.
>
> But so what? In standard mode, HPET just uses other IRQs.
> Nothing would care about irq0, and irq8 would be used by
> the RTC as necessary.
>
>
> > this will make it difficult to use it as a clockevents source
>
> Why? It's not like the clockevent logic cares what IRQ a given
> programmable timer uses. So long as the HPET driver can receive
> its IRQ, it'll make a fine clockevent. There's no reason to have
> HPET prevent other drivers from working, by insisting it use that
> nasty "prevent other hardware from issuing IRQs" mode.
>
> The patches from Venkatesh sure seem to have behaved for him.
> And while he might have complained about difficulty, I think
> that'd be more likely due to the SMP issues he also addressed
> than because of some (historical?) attachment to irq0.
>
>
> > Not to mention the fact that current code assumes that BIOS
> > assigned IRQs to all timers which is not true on my system.
>
> Getting IRQ routing sorted out is a problem that's been solved
> numerous times before. And again, the patches referenced above
> seem to have resolved any such issues.
No they don't,
First patch does that:
hd.hd_irq[i] = (timer->hpet_config &
Tn_INT_ROUTE_CNF_MASK) >>
Tn_INT_ROUTE_CNF_SHIFT;
This just reads values assigned by BIOS.
>
>
> > What is wrong with relying on HPET to provide RTC IRQ ?
>
> For starters, it's not an RTC. Why in the world would you want to
> make the OS think it's an RTC ... unless you're Microsoft, and are
> desperate to get another periodic timer (and don't much care about
> the other RTC functionality?
>
>
> ... that's all off-topic for 2.6.21 regressions though; it's too
> late to merge x86_64 clockevent support, or fix HPET issues like
> not using "standard mode".
>
> - Dave
>
>
Hi,
I feel that you are right,
You meant that one of HPET timers will be used as clock source and will be assigned some IRQ (not IRQ0)
Seems fine,
Only one thing: the kernel must assign IRQs to HPETS , relying on bios is not good,
Also the IRQ for clocksource should be not shared, but maybe I am wrong here
(I am afraid that latencies might be a problem here)
By the way I never thought about the fact that legacy replacement mode is a 'virtual legacy'
I mean that it is intended to simulate RTCs and PITs on systems that don't have them, am I right here ?
HPET spec says that RTC is still requred to provide all its usial functions except periodic freq.
Best regards,
Maxim Levitsky
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PATCH v2] Add suspend/resume for HPET
2007-03-29 13:46 ` [PATCH v2] Add suspend/resume for HPET Maxim Levitsky
2007-03-29 16:53 ` Linus Torvalds
2007-03-29 18:11 ` Jeff Chua
@ 2007-03-31 15:51 ` Thomas Gleixner
2007-03-31 16:01 ` Jeff Chua
` (2 more replies)
2 siblings, 3 replies; 69+ messages in thread
From: Thomas Gleixner @ 2007-03-31 15:51 UTC (permalink / raw)
To: Maxim Levitsky
Cc: Jeff Chua, linux-ide, Sergei Shtylyov, jgarzik, gregkh, linux-pm,
Linux Kernel Mailing List, Adrian Bunk, linux-acpi, linux-pci,
Eric W. Biederman, Jens Axboe, Michael S. Tsirkin, Ingo Molnar,
Linus Torvalds, Andrew Morton
On Thu, 2007-03-29 at 15:46 +0200, Maxim Levitsky wrote:
> Subject: Add suspend/resume for HPET
> This adds support of suspend/resume on i386 for HPET
> Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
>
> +static struct sysdev_class hpet_class = {
> + set_kset_name("hpet"),
> + .suspend = hpet_suspend,
> + .resume = hpet_resume,
> +};
> +
> +static struct sys_device hpet_device = {
> + .id = 0,
> + .cls = &hpet_class,
> +};
Sorry for being inresponsive. I was travelling and unexpectedly cut off
from the internet for some days.
While I agree in principle with the patch, I'm a bit uncomfortable. The
sys device suspend / resume ordering is not guaranteed and relies on the
registering order.
Jeff still seems to have problems with CONFIG_NO_HZ=n and it might be
caused by time keeping / tick management resume happening before the
HPET resume.
The required resume order is:
clocksources
timekeeping
clockevents
tick management
I'm not sure how to do this properly with the sys device facilities, but
I look into it.
/me goes off to understand the sys device magic.
tglx
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PATCH v2] Add suspend/resume for HPET
2007-03-31 15:51 ` Thomas Gleixner
@ 2007-03-31 16:01 ` Jeff Chua
2007-03-31 16:09 ` Thomas Gleixner
2007-03-31 16:09 ` Linus Torvalds
2007-03-31 16:56 ` Maxim Levitsky
2 siblings, 1 reply; 69+ messages in thread
From: Jeff Chua @ 2007-03-31 16:01 UTC (permalink / raw)
To: tglx
Cc: Maxim Levitsky, linux-ide, Sergei Shtylyov, jgarzik, gregkh,
linux-pm, Linux Kernel Mailing List, Adrian Bunk, linux-acpi,
linux-pci, Eric W. Biederman, Jens Axboe, Michael S. Tsirkin,
Ingo Molnar, Linus Torvalds, Andrew Morton
On 3/31/07, Thomas Gleixner <tglx@linutronix.de> wrote:
> Jeff still seems to have problems with CONFIG_NO_HZ=n and it might be
> caused by time keeping / tick management resume happening before the
> HPET resume.
me>Confirmed that suspend/resume disk/ram works on X60s with
me>CONFIG_HPET_TIMER=y and CONFIG_NO_HZ unset.
me> But suspend to disk still hang with CONFIG_NO_HZ unset.
Oops, sorry. Typo (as a result copy/paste using mouse)
... I actually meant CONFIG_NO_HZ "set".
Just to be clear, suspend to disk still hang with CONFIG_NO_HZ=y. It
hang just before you see the percent saving %.
Jeff.
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PATCH v2] Add suspend/resume for HPET
2007-03-31 16:01 ` Jeff Chua
@ 2007-03-31 16:09 ` Thomas Gleixner
0 siblings, 0 replies; 69+ messages in thread
From: Thomas Gleixner @ 2007-03-31 16:09 UTC (permalink / raw)
To: Jeff Chua
Cc: Maxim Levitsky, Sergei Shtylyov, Linus Torvalds, Ingo Molnar,
Adrian Bunk, Andrew Morton, Linux Kernel Mailing List,
Eric W. Biederman, Rafael J. Wysocki, pavel, linux-pm, gregkh,
linux-pci, Jens Axboe, Len Brown, linux-acpi, jgarzik, linux-ide,
Michael S. Tsirkin
On Sun, 2007-04-01 at 00:01 +0800, Jeff Chua wrote:
> On 3/31/07, Thomas Gleixner <tglx@linutronix.de> wrote:
>
> > Jeff still seems to have problems with CONFIG_NO_HZ=n and it might be
> > caused by time keeping / tick management resume happening before the
> > HPET resume.
>
>
> me>Confirmed that suspend/resume disk/ram works on X60s with
> me>CONFIG_HPET_TIMER=y and CONFIG_NO_HZ unset.
> me> But suspend to disk still hang with CONFIG_NO_HZ unset.
>
>
> Oops, sorry. Typo (as a result copy/paste using mouse)
> ... I actually meant CONFIG_NO_HZ "set".
>
> Just to be clear, suspend to disk still hang with CONFIG_NO_HZ=y. It
> hang just before you see the percent saving %.
Ah, that's a different one then. In that path the timers should be
alive, but who knows.
tglx
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PATCH v2] Add suspend/resume for HPET
2007-03-31 15:51 ` Thomas Gleixner
2007-03-31 16:01 ` Jeff Chua
@ 2007-03-31 16:09 ` Linus Torvalds
2007-03-31 16:33 ` Thomas Gleixner
2007-03-31 16:56 ` Maxim Levitsky
2 siblings, 1 reply; 69+ messages in thread
From: Linus Torvalds @ 2007-03-31 16:09 UTC (permalink / raw)
To: Thomas Gleixner
Cc: Maxim Levitsky, Jeff Chua, linux-ide, Sergei Shtylyov, gregkh,
linux-pm, Linux Kernel Mailing List, Adrian Bunk, linux-acpi,
linux-pci, Eric W. Biederman, Jens Axboe, Michael S. Tsirkin,
Ingo Molnar, jgarzik, Andrew Morton
On Sat, 31 Mar 2007, Thomas Gleixner wrote:
>
> While I agree in principle with the patch, I'm a bit uncomfortable. The
> sys device suspend / resume ordering is not guaranteed and relies on the
> registering order.
Well, this is why we probably should try to get away from the "system
device" issue, exactly because system devices are totally outside the
normal ordering and only have a random linear order.
If the clocksources were actually in the device tree, you'd get all the
normal guarantees about hierarchical ordering..
Linus
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PATCH v2] Add suspend/resume for HPET
2007-03-31 16:09 ` Linus Torvalds
@ 2007-03-31 16:33 ` Thomas Gleixner
2007-03-31 16:41 ` Greg KH
2007-03-31 16:53 ` Linus Torvalds
0 siblings, 2 replies; 69+ messages in thread
From: Thomas Gleixner @ 2007-03-31 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Maxim Levitsky, Sergei Shtylyov, Ingo Molnar, Jeff Chua,
Adrian Bunk, Andrew Morton, Linux Kernel Mailing List,
Eric W. Biederman, Rafael J. Wysocki, pavel, linux-pm, gregkh,
linux-pci, Jens Axboe, Len Brown, linux-acpi, jgarzik, linux-ide,
Michael S. Tsirkin
On Sat, 2007-03-31 at 09:09 -0700, Linus Torvalds wrote:
>
> On Sat, 31 Mar 2007, Thomas Gleixner wrote:
> >
> > While I agree in principle with the patch, I'm a bit uncomfortable. The
> > sys device suspend / resume ordering is not guaranteed and relies on the
> > registering order.
>
> Well, this is why we probably should try to get away from the "system
> device" issue, exactly because system devices are totally outside the
> normal ordering and only have a random linear order.
>
> If the clocksources were actually in the device tree, you'd get all the
> normal guarantees about hierarchical ordering..
Right, but clock - sources/events need to be extremly late suspended and
early resumed. How can we ensure this ?
tglx
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PATCH v2] Add suspend/resume for HPET
2007-03-31 16:33 ` Thomas Gleixner
@ 2007-03-31 16:41 ` Greg KH
2007-03-31 16:53 ` Linus Torvalds
1 sibling, 0 replies; 69+ messages in thread
From: Greg KH @ 2007-03-31 16:41 UTC (permalink / raw)
To: Thomas Gleixner
Cc: Linus Torvalds, Maxim Levitsky, Sergei Shtylyov, Ingo Molnar,
Jeff Chua, Adrian Bunk, Andrew Morton, Linux Kernel Mailing List,
Eric W. Biederman, Rafael J. Wysocki, pavel, linux-pm, linux-pci,
Jens Axboe, Len Brown, linux-acpi, jgarzik, linux-ide,
Michael S. Tsirkin
On Sat, Mar 31, 2007 at 06:33:20PM +0200, Thomas Gleixner wrote:
> On Sat, 2007-03-31 at 09:09 -0700, Linus Torvalds wrote:
> >
> > On Sat, 31 Mar 2007, Thomas Gleixner wrote:
> > >
> > > While I agree in principle with the patch, I'm a bit uncomfortable. The
> > > sys device suspend / resume ordering is not guaranteed and relies on the
> > > registering order.
> >
> > Well, this is why we probably should try to get away from the "system
> > device" issue, exactly because system devices are totally outside the
> > normal ordering and only have a random linear order.
> >
> > If the clocksources were actually in the device tree, you'd get all the
> > normal guarantees about hierarchical ordering..
>
> Right, but clock - sources/events need to be extremly late suspended and
> early resumed. How can we ensure this ?
Put it at the top of the device tree.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PATCH v2] Add suspend/resume for HPET
2007-03-31 16:33 ` Thomas Gleixner
2007-03-31 16:41 ` Greg KH
@ 2007-03-31 16:53 ` Linus Torvalds
2007-03-31 17:02 ` Ingo Molnar
` (2 more replies)
1 sibling, 3 replies; 69+ messages in thread
From: Linus Torvalds @ 2007-03-31 16:53 UTC (permalink / raw)
To: Thomas Gleixner
Cc: Maxim Levitsky, Jeff Chua, linux-ide, Sergei Shtylyov, gregkh,
linux-pm, Linux Kernel Mailing List, Adrian Bunk, linux-acpi,
linux-pci, Eric W. Biederman, Jens Axboe, Michael S. Tsirkin,
Ingo Molnar, jgarzik, Andrew Morton
On Sat, 31 Mar 2007, Thomas Gleixner wrote:
>
> Right, but clock - sources/events need to be extremly late suspended and
> early resumed. How can we ensure this ?
Make them be at the top of the device tree by adding them early. That's
the whole point of the device tree after all - we have an ordering that is
enforced by its topology, and that we sort by when things were added.
Right now the way things work is (iirc - somebody like Greg should
double-check me) is that we add all devices to the power list at
device_add() time by traversing the devices fromt he root all the way out,
and doing a device_add() which does a device_pm_add(), which in turn adds
it to the power-management list - so that the list is always topologically
sorted.
So the only thing that needs to be done is to make sure that we add the
timer devices early during bootup - something we have to do *anyway*. If a
device is added early in bootup, that automatically means that it will be
suspended late, and resumed early - because we maintain that order all the
way through..
Linus
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PATCH v2] Add suspend/resume for HPET
2007-03-31 15:51 ` Thomas Gleixner
2007-03-31 16:01 ` Jeff Chua
2007-03-31 16:09 ` Linus Torvalds
@ 2007-03-31 16:56 ` Maxim Levitsky
2007-03-31 17:09 ` Linus Torvalds
2 siblings, 1 reply; 69+ messages in thread
From: Maxim Levitsky @ 2007-03-31 16:56 UTC (permalink / raw)
To: tglx
Cc: Sergei Shtylyov, Linus Torvalds, Ingo Molnar, Jeff Chua,
Adrian Bunk, Andrew Morton, Linux Kernel Mailing List,
Eric W. Biederman, Rafael J. Wysocki, pavel, linux-pm, gregkh,
linux-pci, Jens Axboe, Len Brown, linux-acpi, jgarzik, linux-ide,
Michael S. Tsirkin
On Saturday 31 March 2007 18:51:11 Thomas Gleixner wrote:
> On Thu, 2007-03-29 at 15:46 +0200, Maxim Levitsky wrote:
> > Subject: Add suspend/resume for HPET
> > This adds support of suspend/resume on i386 for HPET
> > Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
> >
> > +static struct sysdev_class hpet_class = {
> > + set_kset_name("hpet"),
> > + .suspend = hpet_suspend,
> > + .resume = hpet_resume,
> > +};
> > +
> > +static struct sys_device hpet_device = {
> > + .id = 0,
> > + .cls = &hpet_class,
> > +};
>
> Sorry for being inresponsive. I was travelling and unexpectedly cut off
> from the internet for some days.
>
> While I agree in principle with the patch, I'm a bit uncomfortable. The
> sys device suspend / resume ordering is not guaranteed and relies on the
> registering order.
>
> Jeff still seems to have problems with CONFIG_NO_HZ=n and it might be
> caused by time keeping / tick management resume happening before the
> HPET resume.
>
> The required resume order is:
>
> clocksources
> timekeeping
> clockevents
> tick management
>
> I'm not sure how to do this properly with the sys device facilities, but
> I look into it.
>
> /me goes off to understand the sys device magic.
>
> tglx
>
>
>
Hi,
So maybe I was right afrer all,
Maybe it is better to add a suspend/resume hook to each clock source and call
it from timekeeping_resume() ?
Or maybe even unite clocksources with clockevents, don't know
By the way I want to report maybe a bug / maybe a feature :-) :
(sorry for long explanation)
Basically I have two clockevent sources : PIT(HPET) and APIC
(Actually I it seems that in next version of kernel HPET will be switched out
of 'legacy replacement mode' , so PIT and HPET and RTC could coexist of same system,
But HPET won't be able to generate IRQ0, and it will be assigned some IRQ, possibly shared with other devices)
APIC timer is chosen by default and works fine,
since I don't have C2/C2 states on my system (ICH8 doesn't support them :-( )
But if I force it off (nolapic_timer) HPET or PIC is chosen and strangely they are
put in _periodic_ mode although they are capable of one-shot mode
Is this a bug ?
Secondary I am getting a very strange behavior if I use CONFIG_NOHZ + !CONFIG_HIGH_RES_TIMERS
and try to suspend to ram:
System resumes, but gets crazy:
'top' shows that ksoftirqd consumes 9999 % of cpu time (this is not a typo)
And other 'normal' programs that are running show same 9999 too.
System slows to crawl.
Also I found that one of APICS is in periodic mode, and second is in one shoot mode.
And I tested this with or without my patch (thank goodness it is not my fault)
CONFIG_NOHZ + CONFIG_HIGH_RES_TIMERS work just fine.
Best regards,
Maxim Levitsky
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PATCH v2] Add suspend/resume for HPET
2007-03-31 16:53 ` Linus Torvalds
@ 2007-03-31 17:02 ` Ingo Molnar
2007-03-31 18:18 ` [linux-pm] " David Brownell
2007-03-31 17:08 ` Greg KH
2007-03-31 17:55 ` [linux-pm] " David Brownell
2 siblings, 1 reply; 69+ messages in thread
From: Ingo Molnar @ 2007-03-31 17:02 UTC (permalink / raw)
To: Linus Torvalds
Cc: Maxim Levitsky, Jeff Chua, linux-ide, Sergei Shtylyov, gregkh,
linux-pm, Linux Kernel Mailing List, Adrian Bunk, linux-acpi,
linux-pci, Eric W. Biederman, Jens Axboe, Michael S. Tsirkin,
Thomas Gleixner, jgarzik, Andrew Morton
* Linus Torvalds <torvalds@linux-foundation.org> wrote:
> On Sat, 31 Mar 2007, Thomas Gleixner wrote:
> >
> > Right, but clock - sources/events need to be extremly late suspended and
> > early resumed. How can we ensure this ?
[...]
> So the only thing that needs to be done is to make sure that we add
> the timer devices early during bootup - something we have to do
> *anyway*. If a device is added early in bootup, that automatically
> means that it will be suspended late, and resumed early - because we
> maintain that order all the way through..
IIRC hpet is particularly hard to initialize early on in the bootup
sequence. So the way the clockevents code works is that it will always
try to make the best out of all available devices, and dynamically
adapts things as devices 'arrive' or 'depart' - no matter how late that
happens. (That way there's no dependency on how late a device gets
registered - it will only delay the switch to high-res mode for
example.) A given time device might 'depart' because for example the
watchdog mechanism finds that its quality is not good enough, or because
someone initiated cpufreq which breaks the TSC clocksource.
i dont think there's any particular problem here because suspend/resume
wont be done during bootup - but we might need a way to move a device to
earlier spots in the device tree, even if they got registered later on -
instead of forcing the time devices to be registered very early?
Ingo
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PATCH v2] Add suspend/resume for HPET
2007-03-31 16:53 ` Linus Torvalds
2007-03-31 17:02 ` Ingo Molnar
@ 2007-03-31 17:08 ` Greg KH
2007-03-31 17:55 ` [linux-pm] " David Brownell
2 siblings, 0 replies; 69+ messages in thread
From: Greg KH @ 2007-03-31 17:08 UTC (permalink / raw)
To: Linus Torvalds
Cc: Thomas Gleixner, Maxim Levitsky, Sergei Shtylyov, Ingo Molnar,
Jeff Chua, Adrian Bunk, Andrew Morton, Linux Kernel Mailing List,
Eric W. Biederman, Rafael J. Wysocki, pavel, linux-pm, linux-pci,
Jens Axboe, Len Brown, linux-acpi, jgarzik, linux-ide,
Michael S. Tsirkin
On Sat, Mar 31, 2007 at 09:53:43AM -0700, Linus Torvalds wrote:
> Make them be at the top of the device tree by adding them early. That's
> the whole point of the device tree after all - we have an ordering that is
> enforced by its topology, and that we sort by when things were added.
>
> Right now the way things work is (iirc - somebody like Greg should
> double-check me) is that we add all devices to the power list at
> device_add() time by traversing the devices fromt he root all the way out,
> and doing a device_add() which does a device_pm_add(), which in turn adds
> it to the power-management list - so that the list is always topologically
> sorted.
Yes, this is how it works (or if not, then there's a bug that needs to
be fixed, as that is how it _should_ work...)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PATCH v2] Add suspend/resume for HPET
2007-03-31 16:56 ` Maxim Levitsky
@ 2007-03-31 17:09 ` Linus Torvalds
2007-03-31 17:17 ` Ingo Molnar
0 siblings, 1 reply; 69+ messages in thread
From: Linus Torvalds @ 2007-03-31 17:09 UTC (permalink / raw)
To: Maxim Levitsky
Cc: Andrew Morton, Jeff Chua, linux-ide, Sergei Shtylyov, gregkh,
linux-pm, Linux Kernel Mailing List, Adrian Bunk, linux-acpi,
linux-pci, Eric W. Biederman, Jens Axboe, Michael S. Tsirkin,
tglx, jgarzik, Ingo Molnar
On Sat, 31 Mar 2007, Maxim Levitsky wrote:
>
> So maybe I was right afrer all,
> Maybe it is better to add a suspend/resume hook to each clock source and call
> it from timekeeping_resume() ?
Umm.. WHy not make the device tree look like this:
-- "clocksource" -- +-- HPET
|
+-- TSC
|
+-- i8259
|
+-- lapic timer
|
.. whatever else
and use the "struct device" that we *have* for this? The whole "struct
device" is literally designed to do this, and to be embedded into whatever
bigger structures you have that describes higher-level behaviour. Ie you'd
put a "struct device" inside the "struct clocksource".
That thingalready *has* the suspend/resume hooks, and it will mean that
people will see the clocks in the device tree rather than have a new
notion.
Linus
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PATCH v2] Add suspend/resume for HPET
2007-03-31 17:09 ` Linus Torvalds
@ 2007-03-31 17:17 ` Ingo Molnar
2007-03-31 17:58 ` Daniel Walker
0 siblings, 1 reply; 69+ messages in thread
From: Ingo Molnar @ 2007-03-31 17:17 UTC (permalink / raw)
To: Linus Torvalds
Cc: Maxim Levitsky, Jeff Chua, linux-ide, Sergei Shtylyov, gregkh,
linux-pm, Linux Kernel Mailing List, Adrian Bunk, linux-acpi,
linux-pci, Eric W. Biederman, Jens Axboe, Michael S. Tsirkin,
tglx, jgarzik, Andrew Morton
* Linus Torvalds <torvalds@linux-foundation.org> wrote:
> Umm.. WHy not make the device tree look like this:
>
> -- "clocksource" -- +-- HPET
> |
> +-- TSC
> |
> +-- i8259
> |
> +-- lapic timer
> |
> .. whatever else
>
> and use the "struct device" that we *have* for this? The whole "struct
> device" is literally designed to do this, and to be embedded into
> whatever bigger structures you have that describes higher-level
> behaviour. Ie you'd put a "struct device" inside the "struct
> clocksource".
yeah. There's some practical problems that need to be sorted out: much
of the current GTOD code is irq-driven (and all GTOD locks are
irq-safe), while the sysfs code needs to run in process-context level.
Clocksources 'arrive' and 'depart' in hardirq context (which is the
primary place where we notice their breakage, determine that they are
now verified to be usable, etc.). This came partly from legacy: the
gradual conversion of the monolithic time code, and the need to preserve
GTOD and non-GTOD architectures without too much duplication. It also
came partly because there's also a fundamental need to have accurate
time, which is better served from irq context.
i very much agree that this should and must be cleaned up, but it needs
quite a bit more logistics than it might appear at first sight.
Clockevents basically just followed (and had to follow) the direction of
clocksources in this regard.
Ingo
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [linux-pm] [PATCH v2] Add suspend/resume for HPET
2007-03-31 16:53 ` Linus Torvalds
2007-03-31 17:02 ` Ingo Molnar
2007-03-31 17:08 ` Greg KH
@ 2007-03-31 17:55 ` David Brownell
2 siblings, 0 replies; 69+ messages in thread
From: David Brownell @ 2007-03-31 17:55 UTC (permalink / raw)
To: linux-pm
Cc: Linus Torvalds, Thomas Gleixner, Maxim Levitsky, Jeff Chua,
linux-ide, Sergei Shtylyov, gregkh, linux-pm,
Linux Kernel Mailing List, Adrian Bunk, linux-acpi, linux-pci,
Eric W. Biederman, Jens Axboe, Michael S. Tsirkin, Ingo Molnar,
jgarzik, Andrew Morton
On Saturday 31 March 2007 9:53 am, Linus Torvalds wrote:
>
> On Sat, 31 Mar 2007, Thomas Gleixner wrote:
> >
> > Right, but clock - sources/events need to be extremly late suspended and
> > early resumed. How can we ensure this ?
>
> Make them be at the top of the device tree by adding them early. That's
> the whole point of the device tree after all - we have an ordering that is
> enforced by its topology, and that we sort by when things were added.
Right, but "when things get added" doesn't correlate well to
"when they should get suspended/resumed". It's also in basic
conflict with runtime PM models, where devices may be suspended
at essentially any time. And sysdevs are even stranger.
One way out: rather than constructing that list as devices get
enumerated, it could be constructed by a (linear-time, non-recursive)
walk of the device tree(s) before they get suspended.
(Or equivalently: construct lists at enumeration time, but just
adding them *right after their parent* rather than at the end of
the list.)
Would that solve the problem here? Potentially ... if the tree is
structured to meet Thomas' rules:
> > The required resume order is:
> >
> > clocksources
> > timekeeping
> > clockevents
> > tick management
> So the only thing that needs to be done is to make sure that we add the
> timer devices early during bootup - something we have to do *anyway*. If a
> device is added early in bootup, that automatically means that it will be
> suspended late, and resumed early - because we maintain that order all the
> way through..
> -- "clocksource" -- +-- HPET
> |
> +-- TSC
> |
> +-- i8259
> |
> +-- lapic timer
> |
> .. whatever else
If each of those were a device node, with "clocksource" suspend/resume
methods handling Thomas' "timekeeping" item, and simlarly for "clockevent"
devices ... I could see that all working neatly.
- Dave
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PATCH v2] Add suspend/resume for HPET
2007-03-31 17:17 ` Ingo Molnar
@ 2007-03-31 17:58 ` Daniel Walker
0 siblings, 0 replies; 69+ messages in thread
From: Daniel Walker @ 2007-03-31 17:58 UTC (permalink / raw)
To: Ingo Molnar
Cc: Linus Torvalds, Maxim Levitsky, tglx, Sergei Shtylyov, Jeff Chua,
Adrian Bunk, Andrew Morton, Linux Kernel Mailing List,
Eric W. Biederman, Rafael J. Wysocki, pavel, linux-pm, gregkh,
linux-pci, Jens Axboe, Len Brown, linux-acpi, jgarzik, linux-ide,
Michael S. Tsirkin
On Sat, 2007-03-31 at 19:17 +0200, Ingo Molnar wrote:
> yeah. There's some practical problems that need to be sorted out: much
> of the current GTOD code is irq-driven (and all GTOD locks are
> irq-safe), while the sysfs code needs to run in process-context level.
>
> Clocksources 'arrive' and 'depart' in hardirq context (which is the
> primary place where we notice their breakage, determine that they are
> now verified to be usable, etc.). This came partly from legacy: the
> gradual conversion of the monolithic time code, and the need to preserve
> GTOD and non-GTOD architectures without too much duplication. It also
> came partly because there's also a fundamental need to have accurate
> time, which is better served from irq context.
>
Is this in reference to the irq-context clocksource polling stuff? I
don't see a dire reason to keep that code, and I agree removing that is
a certainly a worth while cleanup .. I added this cleanup to one of my
trees when you first suggested it , and there is some infrastructure
that really should be added to facilitate it.
Daniel
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [linux-pm] [PATCH v2] Add suspend/resume for HPET
2007-03-31 17:02 ` Ingo Molnar
@ 2007-03-31 18:18 ` David Brownell
2007-03-31 19:32 ` David Brownell
0 siblings, 1 reply; 69+ messages in thread
From: David Brownell @ 2007-03-31 18:18 UTC (permalink / raw)
To: linux-pm
Cc: Adrian Bunk, Andrew Morton, Eric W. Biederman, gregkh,
Ingo Molnar, Jeff Chua, Jens Axboe, jgarzik, Linus Torvalds,
linux-acpi, linux-ide, Linux Kernel Mailing List, linux-pci,
Maxim Levitsky, Michael S. Tsirkin, Sergei Shtylyov,
Thomas Gleixner
( please remove obsolute linux-pm@lists.osdl.org from further messages!! )
On Saturday 31 March 2007 10:02 am, Ingo Molnar wrote:
>
> i dont think there's any particular problem here because suspend/resume
> wont be done during bootup - but we might need a way to move a device to
> earlier spots in the device tree, even if they got registered later on -
> instead of forcing the time devices to be registered very early?
I'm about ready to test the appended patch... a "move one device" call
might be safest at this point in the release cycle though.
- Dave
======================== SNIP!
Change how the PM list is constructed, so that devices are added right
after their parents (when they have one) rather than at the end of the
list. This preserves sequencing guarantees, but enables sequencing of
suspend/resume operations by more important characteristics than "when
device happened to enumerate" ... e.g. clocksources and clockevents
at a clearly defined point during suspend and resume.
This patch has a potential downside for devices that have multiple
power dependencies and which "just happened to work" before.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
--- g26.orig/drivers/base/power/main.c 2006-07-02 12:30:30.000000000 -0700
+++ g26/drivers/base/power/main.c 2007-03-31 11:02:28.000000000 -0700
@@ -52,12 +52,17 @@ EXPORT_SYMBOL_GPL(device_pm_set_parent);
int device_pm_add(struct device * dev)
{
int error;
+ struct device *parent = dev->parent;
- pr_debug("PM: Adding info for %s:%s\n",
- dev->bus ? dev->bus->name : "No Bus", dev->kobj.name);
+ pr_debug("PM: Adding info for %s:%s, after %s\n",
+ dev->bus ? dev->bus->name : "No Bus", dev->kobj.name,
+ parent ? parent->bus_id : "(no parent)");
down(&dpm_list_sem);
- list_add_tail(&dev->power.entry, &dpm_active);
- device_pm_set_parent(dev, dev->parent);
+ if (parent)
+ list_add(&dev->power.entry, &parent->power.entry);
+ else
+ list_add_tail(&dev->power.entry, &dpm_active);
+ device_pm_set_parent(dev, parent);
if ((error = dpm_sysfs_add(dev)))
list_del(&dev->power.entry);
up(&dpm_list_sem);
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [linux-pm] [PATCH v2] Add suspend/resume for HPET
2007-03-31 18:18 ` [linux-pm] " David Brownell
@ 2007-03-31 19:32 ` David Brownell
2007-04-01 3:13 ` Jeff Chua
0 siblings, 1 reply; 69+ messages in thread
From: David Brownell @ 2007-03-31 19:32 UTC (permalink / raw)
To: linux-pm
Cc: Adrian Bunk, Andrew Morton, Eric W. Biederman, gregkh,
Ingo Molnar, Jeff Chua, Jens Axboe, jgarzik, Linus Torvalds,
linux-acpi, linux-ide, Linux Kernel Mailing List, linux-pci,
Maxim Levitsky, Michael S. Tsirkin, Sergei Shtylyov,
Thomas Gleixner
On Saturday 31 March 2007 11:18 am, David Brownell wrote:
> ( please remove obsolute linux-pm@lists.osdl.org from further messages!! )
>
> On Saturday 31 March 2007 10:02 am, Ingo Molnar wrote:
> >
> > i dont think there's any particular problem here because suspend/resume
> > wont be done during bootup - but we might need a way to move a device to
> > earlier spots in the device tree, even if they got registered later on -
> > instead of forcing the time devices to be registered very early?
>
> I'm about ready to test the appended patch... a "move one device" call
> might be safest at this point in the release cycle though.
As expected, this behaved OK on an x86 laptop. I'll see if it breaks
some of the ARM boards I have handy.
To be clear, what this means is that if "clockevent" and "clocksource"
devices get registered "very early", and the various clockevent and
clock source devices get registered, then the suspend/resume methods
for those will all get grouped together ... suspended "very late" and
resumed "very early", regardless of when they get registered. Pretty
much the driver model parts of what Linus was suggesting; clockevent
bits would still be needed.
- Dave
> - Dave
>
> ======================== SNIP!
> Change how the PM list is constructed, so that devices are added right
> after their parents (when they have one) rather than at the end of the
> list. This preserves sequencing guarantees, but enables sequencing of
> suspend/resume operations by more important characteristics than "when
> device happened to enumerate" ... e.g. clocksources and clockevents
> at a clearly defined point during suspend and resume.
>
> This patch has a potential downside for devices that have multiple
> power dependencies and which "just happened to work" before.
>
> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
>
> --- g26.orig/drivers/base/power/main.c 2006-07-02 12:30:30.000000000 -0700
> +++ g26/drivers/base/power/main.c 2007-03-31 11:02:28.000000000 -0700
> @@ -52,12 +52,17 @@ EXPORT_SYMBOL_GPL(device_pm_set_parent);
> int device_pm_add(struct device * dev)
> {
> int error;
> + struct device *parent = dev->parent;
>
> - pr_debug("PM: Adding info for %s:%s\n",
> - dev->bus ? dev->bus->name : "No Bus", dev->kobj.name);
> + pr_debug("PM: Adding info for %s:%s, after %s\n",
> + dev->bus ? dev->bus->name : "No Bus", dev->kobj.name,
> + parent ? parent->bus_id : "(no parent)");
> down(&dpm_list_sem);
> - list_add_tail(&dev->power.entry, &dpm_active);
> - device_pm_set_parent(dev, dev->parent);
> + if (parent)
> + list_add(&dev->power.entry, &parent->power.entry);
> + else
> + list_add_tail(&dev->power.entry, &dpm_active);
> + device_pm_set_parent(dev, parent);
> if ((error = dpm_sysfs_add(dev)))
> list_del(&dev->power.entry);
> up(&dpm_list_sem);
>
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PATCH v2] Add suspend/resume for HPET
2007-03-31 19:32 ` David Brownell
@ 2007-04-01 3:13 ` Jeff Chua
2007-04-01 4:13 ` David Brownell
0 siblings, 1 reply; 69+ messages in thread
From: Jeff Chua @ 2007-04-01 3:13 UTC (permalink / raw)
To: David Brownell
Cc: Andrew Morton, linux-acpi, Sergei Shtylyov, jgarzik, gregkh,
Linux Kernel Mailing List, Adrian Bunk, linux-ide, linux-pci,
Thomas Gleixner, Eric W. Biederman, Jens Axboe,
Michael S. Tsirkin, Ingo Molnar, Linus Torvalds, linux-pm,
Maxim Levitsky
On 4/1/07, David Brownell <david-b@pacbell.net> wrote:
> for those will all get grouped together ... suspended "very late" and
> resumed "very early", regardless of when they get registered. Pretty
> much the driver model parts of what Linus was suggesting; clockevent
> bits would still be needed.
I tested your patch with CONFIG_NO_HZ=y, but it still hangs while
suspending to disk (before the percent saving).
But one discovery. I get tired of all these hangs, so I decided to
press some keys and the power button. Accidentally, the suspend
proceeded and successfully suspended!
I tried many more times, and discovered that to proceed with the
suspend, hit any 4 keys slowly. (e.g. "F1 F2 F3 F4", or "1 2 3 4").
My .config has CONFIG_NO_HZ=y and CONFIG_HIGH_RES_TIMERS=y, but I
suppose CONFIG_HIGH_RES_TIMERS=y gots nothing to do with the hang.
I went back with my vanilla 2.6.21-rc5 with Maxim's patch, and with
hitting the keys, I could suspend to disk with CONFIG_NO_HZ=y and
CONFIG_HIGH_RES_TIMERS=y.
Jeff.
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PATCH v2] Add suspend/resume for HPET
2007-04-01 3:13 ` Jeff Chua
@ 2007-04-01 4:13 ` David Brownell
0 siblings, 0 replies; 69+ messages in thread
From: David Brownell @ 2007-04-01 4:13 UTC (permalink / raw)
To: Jeff Chua
Cc: Andrew Morton, linux-acpi, Sergei Shtylyov, jgarzik, gregkh,
Linux Kernel Mailing List, Adrian Bunk, linux-ide, linux-pci,
Thomas Gleixner, Eric W. Biederman, Jens Axboe,
Michael S. Tsirkin, Ingo Molnar, Linus Torvalds, linux-pm,
Maxim Levitsky
On Saturday 31 March 2007 8:13 pm, Jeff Chua wrote:
> On 4/1/07, David Brownell <david-b@pacbell.net> wrote:
> > for those will all get grouped together ... suspended "very late" and
> > resumed "very early", regardless of when they get registered. Pretty
> > much the driver model parts of what Linus was suggesting; clockevent
> > bits would still be needed.
>
> I tested your patch with CONFIG_NO_HZ=y, but it still hangs while
> suspending to disk (before the percent saving).
Of course. No clockevent updates...
^ permalink raw reply [flat|nested] 69+ messages in thread
end of thread, other threads:[~2007-04-01 4:13 UTC | newest]
Thread overview: 69+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <Pine.LNX.4.64.0703160925270.26106@woody.linux-foundation.org>
2007-03-18 18:49 ` [2/6] 2.6.21-rc4: known regressions Adrian Bunk
2007-03-18 18:49 ` [3/6] " Adrian Bunk
2007-03-26 1:25 ` Jeff Chua
2007-03-26 4:05 ` Adrian Bunk
2007-03-26 5:37 ` Jeff Chua
2007-03-26 16:26 ` Thomas Gleixner
2007-03-26 17:46 ` Jeff Chua
2007-03-28 7:04 ` Thomas Gleixner
2007-03-28 13:43 ` Maxim
2007-03-28 14:41 ` Ingo Molnar
2007-03-28 15:01 ` Maxim
2007-03-28 16:38 ` Linus Torvalds
2007-03-28 19:38 ` David Brownell
2007-03-28 20:19 ` [linux-pm] " Maxim
2007-03-28 20:59 ` David Brownell
2007-03-28 21:27 ` Maxim
2007-03-29 22:33 ` David Brownell
2007-03-29 23:29 ` Maxim Levitsky
2007-03-30 0:09 ` [linux-pm] " David Brownell
2007-03-30 0:48 ` Maxim Levitsky
2007-03-28 20:42 ` Linus Torvalds
2007-03-28 21:17 ` [linux-pm] " David Brownell
2007-03-28 22:26 ` Maxim
2007-03-29 4:41 ` [ PATCH] Add suspend/resume for HPET was: " Maxim
2007-03-29 5:08 ` Linus Torvalds
2007-03-29 5:47 ` Maxim
2007-03-29 13:20 ` Sergei Shtylyov
2007-03-29 13:31 ` Maxim
2007-03-29 13:46 ` [PATCH v2] Add suspend/resume for HPET Maxim Levitsky
2007-03-29 16:53 ` Linus Torvalds
2007-03-29 17:28 ` Maxim Levitsky
2007-03-29 17:51 ` Ingo Molnar
2007-03-29 20:46 ` Andi Kleen
2007-03-29 18:11 ` Jeff Chua
2007-03-31 15:51 ` Thomas Gleixner
2007-03-31 16:01 ` Jeff Chua
2007-03-31 16:09 ` Thomas Gleixner
2007-03-31 16:09 ` Linus Torvalds
2007-03-31 16:33 ` Thomas Gleixner
2007-03-31 16:41 ` Greg KH
2007-03-31 16:53 ` Linus Torvalds
2007-03-31 17:02 ` Ingo Molnar
2007-03-31 18:18 ` [linux-pm] " David Brownell
2007-03-31 19:32 ` David Brownell
2007-04-01 3:13 ` Jeff Chua
2007-04-01 4:13 ` David Brownell
2007-03-31 17:08 ` Greg KH
2007-03-31 17:55 ` [linux-pm] " David Brownell
2007-03-31 16:56 ` Maxim Levitsky
2007-03-31 17:09 ` Linus Torvalds
2007-03-31 17:17 ` Ingo Molnar
2007-03-31 17:58 ` Daniel Walker
2007-03-29 16:35 ` [ PATCH] Add suspend/resume for HPET was: Re: [3/6] 2.6.21-rc4: known regressions Linus Torvalds
2007-03-29 16:51 ` Maxim Levitsky
2007-03-29 17:22 ` Linus Torvalds
2007-03-29 17:47 ` [patch, v2] add suspend/resume for HPET Ingo Molnar
2007-03-28 18:04 ` [3/6] 2.6.21-rc4: known regressions Michael S. Tsirkin
2007-03-28 18:32 ` Ingo Molnar
2007-03-28 18:35 ` Randy Dunlap
2007-03-29 14:24 ` Jeff Chua
2007-03-23 18:48 ` [2/5] 2.6.21-rc4: known regressions (v2) Adrian Bunk
2007-03-26 10:01 ` Tejun Heo
2007-03-23 18:50 ` [3/5] " Adrian Bunk
2007-03-23 19:07 ` Maxim
2007-03-24 17:04 ` Thomas Meyer
2007-03-24 18:02 ` Eric W. Biederman
2007-03-23 18:50 ` [4/5] " Adrian Bunk
2007-03-24 11:25 ` 2.6.21-rc4: known regressions with patches (v2) Adrian Bunk
2007-03-26 12:37 ` Bob Tracy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).