public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [2.6.17-rc5-mm2] crash when doing second suspend: BUG in arch/i386/kernel/nmi.c:174
       [not found]   ` <20060607004217.GF11696@redhat.com>
@ 2006-06-07  0:50     ` Nigel Cunningham
  2006-06-07  3:29       ` [linux-pm] " David Brownell
  0 siblings, 1 reply; 2+ messages in thread
From: Nigel Cunningham @ 2006-06-07  0:50 UTC (permalink / raw)
  To: Don Zickus, Linux-pm list
  Cc: Andi Kleen, Andrew Morton, shaohua.li, miles.lane, jeremy,
	linux-kernel

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

Hi.

On Wednesday 07 June 2006 10:42, Don Zickus wrote:
> On Wed, Jun 07, 2006 at 10:05:07AM +1000, Nigel Cunningham wrote:
> > Hi.
> >
> > On Wednesday 07 June 2006 09:55, Don Zickus wrote:
> > > > > So my question is/was what is the proper way to handle processor
> > > > > level subsystems during the suspend/resume path on an SMP system. 
> > > > > I really don't understand the hotplug path nor the suspend/resume
> > > > > path very well.
> > > >
> > > > Make it work properly for CPU hotplug for individual CPU and then in
> > > > suspend you take care of "global" state and the last CPU.
> > >
> > > So the assumption is treat all the cpus the same either all on or all
> > > off, no mixed mode (some cpus on, some cpus off).  I guess I was trying
> > > to hard to work on the per-cpu level.
> >
> > This sounds wrong to me. Shouldn't the the effect of hotunplugging a cpu
> > be to put the driver in a state equivalent to if that cpu simply didn't
> > exist? Unplugging shouldn't assume we're going to subsequently have
> > either a driver suspend, or a replug.
>
> This is my biggest problem or maybe my complete lack of understanding, is
> that I don't know how to determine what state I am in during a hotplug
> event, either a cpu removal or a suspend.  Therefore I feel like I have to
> store some persistant data around _just_ in case this is a suspend event.
> Also at the opposite end, how to separate a cpu insert vs. a cpu resume.
> The different being initialize to a global state vs. initialize to a last
> known state.
>
> I thought it would make more sense if a few more states were to the
> hotplug event list.  For example, in addition to CPU_ONLINE and CPU_DEAD,
> there could also be something like CPU_SUSPEND, CPU_FREEZE, CPU_RESUME,
> and CPU_THAW.
>
> Anyway, I am probably complicating the matter.  I'll whip something up and
> post it for review.

Act like...

Unplug: It's going away, never to return.
Plug: It's just appeared from nowhere, is completely uninitialised and may be 
a different item to anything that happened to look the same before.
Suspend: It's going to be put into a low (possibly no-) power state. It's 
going to come back, and when it does, you want to be able to put it back in 
the state it's in prior to this call.
Resume: You want to restore the state you saved in memory when given the 
suspend call earlier.

Regarding _FREEZE, there is work in progress to add this. I haven't been 
following the conversation really closely recently, but my understanding is 
that you should expect it to be similar to suspend, except that you can 
guarantee that power will not be lost. All activity should be stopped so that 
you get a consistent state which you can restore in the resume call. Every 
suspend or freeze must be followed by a resume.

I'll add the linux-pm list to the cc, just in case I've gotten something wrong 
or the other guys want to comment and have missed this thread.

Hope this helps.

Regards,

Nigel
-- 
Nigel, Michelle and Alisdair Cunningham
5 Mitchell Street
Cobden 3266
Victoria, Australia

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [linux-pm] [2.6.17-rc5-mm2] crash when doing second suspend: BUG in arch/i386/kernel/nmi.c:174
  2006-06-07  0:50     ` [2.6.17-rc5-mm2] crash when doing second suspend: BUG in arch/i386/kernel/nmi.c:174 Nigel Cunningham
@ 2006-06-07  3:29       ` David Brownell
  0 siblings, 0 replies; 2+ messages in thread
From: David Brownell @ 2006-06-07  3:29 UTC (permalink / raw)
  To: linux-pm
  Cc: Nigel Cunningham, Don Zickus, Andrew Morton, jeremy, miles.lane,
	Andi Kleen, linux-kernel

On Tuesday 06 June 2006 5:50 pm, Nigel Cunningham wrote:

> Suspend: It's going to be put into a low (possibly no-) power state. It's 
> going to come back, and when it does, you want to be able to put it back in 
> the state it's in prior to this call.

Not exactly.  Suspended devices can in general can resume() into a RESET
state in which case software reinit is appropriate ... or they can come back
in the state that the suspend() left them in, modulo changes that may come
from hot-unplugging hardware connected to that device.  (Which may be a
wakeup event, depending on system configuration.)

CPU suspend might have additional rules (just like for any pm-smart class
of drivers), but those are the generic rules.  Not that I think many
platforms treat CPUs quite the same as other hardware!  :)

I don't think the PM events -- suspend()/resume() -- should ever be
entangled with hotplug events.  The former apply to devices which are
known; the latter are how they become known (or get forgotten).


> Every suspend or freeze must be followed by a resume.

Freeze is an optional nuance; it's basically OK to treat every suspend() as
an "enter low power mode" suspend request, regardless of the event signified
by its parameter.  The canonical/main example of when it might _not_ do that
is avoiding disk drive spindown on freeze durin swsusp.

It's a bit problematic just now to handle hot-unplug during suspend(), so
the best advice just now is to make sure that if that's physically possible
(like ejecting a PCMCIA/Cardbus adapter) then driver resume() checks whether
the device is present, just like it checks for power-lost/reset.

- Dave

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

end of thread, other threads:[~2006-06-07  3:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <4480C102.3060400@goop.org>
     [not found] ` <200606071005.14307.ncunningham@linuxmail.org>
     [not found]   ` <20060607004217.GF11696@redhat.com>
2006-06-07  0:50     ` [2.6.17-rc5-mm2] crash when doing second suspend: BUG in arch/i386/kernel/nmi.c:174 Nigel Cunningham
2006-06-07  3:29       ` [linux-pm] " David Brownell

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