From: <benh@kernel.crashing.org>
To: Pavel Machek <pavel@ucw.cz>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
<dalecki@evision-ventures.com>,
kernel list <linux-kernel@vger.kernel.org>
Subject: Re: Suspend support for IDE
Date: Fri, 8 Mar 2002 19:33:23 +0100 [thread overview]
Message-ID: <20020308183323.5029@mailhost.mipsys.com> (raw)
In-Reply-To: <E16jPEs-00073F-00@the-village.bc.nu>
In-Reply-To: <E16jPEs-00073F-00@the-village.bc.nu>
>> + 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
>
>> +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;
>> +}
I wouldn't do it this way in fact. The IDE disk is a device on the IDE
bus, so it's up to the IDE bus to get the PM requests, and pass them down
appropriately to the low level driver. The IDE common code has to make
sure any further request is properly blocked etc... Then, the controller
itself can eventually be suspended as well.
You can see code that blocks the IDE requests in ide-pmac sleep code,
it isn't perfect (I have a few known issues when waking up from sleep
with mounted CD/DVDs for example) but except from these it appear
to work well. It is currently specific to the pmac PM scheme, but I hope to
find time to port this over to the new macanism and make it more generic
in the future. That code is appropriate for what I need, you may, as Alan
states, need additional care to please your BIOS, like switching back to
PIO0, which means also updating your controller timings.
Ben.
next prev parent reply other threads:[~2002-03-08 18:33 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 [this message]
2002-03-09 21:03 ` Pavel Machek
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=20020308183323.5029@mailhost.mipsys.com \
--to=benh@kernel.crashing.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=dalecki@evision-ventures.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@ucw.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