public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adam Belay <ambx1@neo.rr.com>
To: Pavel Machek <pavel@suse.cz>
Cc: Andrew Morton <akpm@zip.com.au>,
	kernel list <linux-kernel@vger.kernel.org>
Subject: Re: [patch] properly stop devices before poweroff
Date: Sun, 1 May 2005 20:01:46 -0400	[thread overview]
Message-ID: <20050502000146.GI3951@neo.rr.com> (raw)
In-Reply-To: <20050501231635.GJ1909@elf.ucw.cz>

On Mon, May 02, 2005 at 01:16:35AM +0200, Pavel Machek wrote:
> Hi!
> 
> > > Without this patch, Linux provokes emergency disk shutdowns and
> > > similar nastiness. It was in SuSE kernels for some time, IIRC.
> > > 
> > > Signed-off-by: Pavel Machek <pavel@suse.cz>
> > 
> > Hi Pavel,
> > 
> > Although I like using pm_message_t, I'm not sure if we want to commit to only
> > PMSG_SUSPEND and PMSG_FREEZE for shutdown and reboot.  Would it be possible
> > to create a PMSG_HALT and PMSG_REBOOT?  I think this would give drivers more
> > control and flexability to make the right decision.  What is your opinion?
> > 
> > Of course, I'm still considering the posibility that we really want to do
> > PMSG_SUSPEND on a shutdown.  This may work ok on X86, I'm not sure about other
> > architectures.
> 
> Thats okay, nobody really knows yet. I believe that SUSPEND and HALT
> are very similar, and flags best way to separate them. I believe that
> FREEZE and REBOOT are very similar, too, and again would use flags to
> tell between them.

I'm not so sure about SUSPEND and HALT being similar.  It might be much faster
to have a routine that ignores slow state changes and goes directly for
stopping device activity.  Still, I'm not entirely decided.  On ACPI systems
SUSPEND should generally work, as it's the intended behavior for S4 which is
basically like S5 in many cases.  However, having a specific HALT message
might allow driver developers to clarify this ambiguity on a per-device basis.

As for FREEZE, it does seem to match with REBOOT well.  But it really depends
on what other things we intend to use FREEZE for (ex. CPUFREQ might require
something slightly different).

> 
> > I know you mentioned previously adding more flags and data to pm_message_t,
> > what exactly are your plans?
> 
> First I want type checking for pm_message_t. That's 2.6.12-early
> material. Then, when it is *really clear* that flags are needed, I'll
> add them. "really needed" as in "we have a driver where it matters".

I think it's already clear that we need to pass the specific device state.
Also the intended global system state transition might be helpful.

However, at the moment I'm considering using a slightly different API for
these sort of things.  It would include "->prepare_state_change()" and
"->complete_state_change()"  I'll have further justification for these
changes soon, however, I would like to leave the current stuff around also
as it would still be useful for shutdown and reboot, non-PM suspend issues,
and backward compatibilty.

Thanks,
Adam

  reply	other threads:[~2005-05-02  0:06 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-21 11:13 [patch] properly stop devices before poweroff Pavel Machek
2005-04-29 13:18 ` Andrew Morton
2005-04-29 13:36   ` Zwane Mwaikambo
2005-04-30  9:47     ` Andrew Morton
2005-04-30 13:40       ` Pavel Machek
2005-05-01 19:09   ` Kenji Kaneshige
2005-05-01 19:57     ` Pavel Machek
2005-05-01 22:16     ` Adam Belay
2005-05-16  7:56       ` Andrew Morton
2005-05-19 12:43         ` Kenji Kaneshige
2005-05-01 22:24 ` Adam Belay
2005-05-01 23:16   ` Pavel Machek
2005-05-02  0:01     ` Adam Belay [this message]
2005-05-02  9:55       ` Pavel Machek
  -- strict thread matches above, loose matches on Subject: below --
2005-04-21 11:30 tvrtko.ursulin
2005-04-21 11:38 ` Pavel Machek
2005-04-21 15:02 tvrtko.ursulin
2005-07-26 19:02 Luck, Tony
2005-07-26 19:10 ` Andrew Morton
2005-07-27  0:14   ` tony.luck
2005-07-27  0:23     ` Andrew Morton
2005-07-27  7:40     ` Pavel Machek
2005-07-28  1:37 ` Kenji Kaneshige
2005-07-28  1:41   ` Andrew Morton
2005-07-27 21:14 Luck, Tony
     [not found] <200506260105.j5Q15eBj021334@hera.kernel.org>
2005-08-01 15:19 ` [PATCH] " Olaf Hering

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20050502000146.GI3951@neo.rr.com \
    --to=ambx1@neo.rr.com \
    --cc=akpm@zip.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox