From: Pavel Machek <pavel@ucw.cz>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: dalecki@evision-ventures.com, kernel list <linux-kernel@vger.kernel.org>
Subject: Re: Suspend support for IDE
Date: Sat, 9 Mar 2002 22:03:19 +0100 [thread overview]
Message-ID: <20020309210319.GA691@elf.ucw.cz> (raw)
In-Reply-To: <20020308180204.GA7035@elf.ucw.cz> <E16jPEs-00073F-00@the-village.bc.nu>
In-Reply-To: <E16jPEs-00073F-00@the-village.bc.nu>
Hi!
> > + while (HWGROUP(drive)->handler)
> > + schedule();
>
> You need to yield. Remember the process might be hard real time and blocking
> your real work from occuring. while(foo) schedule() is always a bug
The process calling this is kernel thread doing powermangment; we have
it under full control. yield() is probably more intuitive, through.
> > +static int idedisk_resume(struct device *dev, u32 level)
> > +{
> > + ide_drive_t *drive = dev->driver_data;
> > + if (!drive->blocked)
> > + panic("ide: Resume but not suspended?\n");
> > + drive->blocked = 0;
> > +}
>
> Also remember you must perform the sequences to wake up the drive and
> restore the controller logic (and of course in the right order). Newer
> disks won't just wake up when fed a random command (eg ibm
> microdrives)
Wake from S3 or S4 should look like power-up from disks perspective. I
should need no commands to do that.
Restoring right UDMA mode... Well, I'll need to do that,
probably. (What I have there is just enough to prevent disk
corruption. I'm still likely to see some bus resets, but no longer
data loose, I believe.)
> The suspend order similarly is important - finish the current
> command,
The while loop above should make sure no command is happening just
now, right?
> then flush the disk cache, then when it completes you can tell the
> drive
Disks that need cache flush are broken, anyway -- they lied us on
command completion -- right?
> to power down.
Why should I tell the drive to power down? It is going to loose its
power, anyway (I believe in both S3 and S4).
> On some systems you want to drop it back to PIO0 non DMA
> before the powerdown or S4BIOS restore from disk will fail.
S4BIOS is not on my list just now; agreed it would be better.
--
(about SSSCA) "I don't say this lightly. However, I really think that the U.S.
no longer is classifiable as a democracy, but rather as a plutocracy." --hpa
next prev parent reply other threads:[~2002-03-09 21:40 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-08 18:02 Suspend support for IDE Pavel Machek
2002-03-08 18:37 ` Alan Cox
2002-03-08 18:33 ` benh
2002-03-09 21:03 ` Pavel Machek [this message]
2002-03-09 22:05 ` Alan Cox
2002-03-10 0:52 ` Barry K. Nathan
2002-03-11 0:10 ` Reid Hekman
2002-03-11 5:47 ` Andre Hedrick
2002-03-10 8:23 ` Rogier Wolff
2002-03-10 22:16 ` Derek J Witt
2002-03-10 22:37 ` Alan Cox
2002-03-11 12:15 ` Pavel Machek
2002-03-09 22:08 ` Martin Dalecki
2002-03-09 13:02 ` Martin Dalecki
[not found] <Pine.LNX.4.33.0203101801150.30628-100000@coffee.psychology.mcmaster.ca>
2002-03-11 0:44 ` Derek J Witt
2002-03-11 1:01 ` Mark Hahn
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=20020309210319.GA691@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=dalecki@evision-ventures.com \
--cc=linux-kernel@vger.kernel.org \
/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