archive mirror
 help / color / mirror / Atom feed
From: Patrick Mochel <>
To: Alan Cox <>
Cc: Jeff Garzik <>,
	Jeff Golds <>,
Subject: Re: Problems with arch/i386/kernel/apm.c
Date: Tue, 12 Jun 2001 16:48:31 -0700 (PDT)	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Mon, 11 Jun 2001, Alan Cox wrote:

> > > needed.  What I am really desiring to know is if there are any devices
> > > that depend on the apm::send_event(APM_NORMAL_RESUME) happening while
> > > interrupts are disabled.
> > 
> > Good spotting...  If any devices depend on what you describe, I would
> > argue that their drivers should handle that not the core apm code...
> The drivers can't handle it at the moment. I've been talking to many people
> about this all hitting this sort of driver problem.
> I think the fix is to keep two classes of power management objects and do
> the following
> 	Call each 'nonirq' suspend function
> 	(aborting if need be)
> 	cli()
> 	Call each irq blocked suspend function
> 	suspend

It shouldn't be necessary to keep two classes of PM objects; instead walk
the device tree twice on suspend.

The first one is an opportunity for the driver to save any device state; a
method to notify the driver that it's going to sleep (as some PPC people
requested); or to do what it needs to with interrupts enabled. 

This also gives the system a graceful way to abort the process should any
of the drivers complain that it absolutely cannot suspend (none of the
devices will actually be powered off at that point).

We then disable interrupts and walk the tree again, actually shutting off
devices. This way, no special cases are made, and no partitioning of the
power management objects is needed.

> resume:
> 	call each irq blocked resume function
> 	sti();
> 	call each nonirq resume

Is this really necessary? We should (note _should_) be able to enable
interrupts, then walk the device tree to resume everything. 

Linus confirmed this assumption, but it may turn out to not be the case.
If that is so, then it will be easy enough to do a two stage walk of the
tree, like in suspend - one to power on the device and reinitialize it,
the next to restore state and continue on once interrupts have been


  reply	other threads:[~2001-06-12 23:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-11 17:57 Jeff Golds
2001-06-11 18:11 ` Jeff Garzik
2001-06-11 18:42   ` Alan Cox
2001-06-12 23:48     ` Patrick Mochel [this message]
2001-06-14  8:18       ` Alan Cox
2001-06-11 19:37 ` John Fremlin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \
    --subject='Re: Problems with arch/i386/kernel/apm.c' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).