From: <benh@kernel.crashing.org>
To: "Alan Cox" <alan@redhat.com>, "Pavel Machek" <pavel@ucw.cz>
Cc: <torvalds@transmeta.com>, "kernel list" <linux-kernel@vger.kernel.org>
Subject: Re: swsusp: don't eat ide disks
Date: Sun, 3 Nov 2002 15:57:34 +0100 [thread overview]
Message-ID: <20021103145735.14872@smtp.wanadoo.fr> (raw)
In-Reply-To: <200211022006.gA2K6XW08545@devserv.devel.redhat.com>
>> Here's patch to prevent random scribling over disks during
>> suspend... In the meantime alan killed (unreferenced at that time)
>> idedisk_suspend() and idedisk_release(), so I have to reintroduce
>> them.
>
>Please fix this at a different level. idedisk is not the place to be
>doing this. If the device layer is doing the right thing then the
>request queue will be idle.
Hrm... I don't think so Alan. The PM ordering is bus driven,
so actual bus binding of the disk is it's controller, not
the request queue which is the functional binding. It's up to
the disk driver to shut down processing of the request queue.
On the same idea, it's not the network layer that will stop
sending packets to an eth driver, it's the eth driver that
gets suspended by it's bus binding (PCI for example) that
will eventually request the network layer not to send it
any more packets (netif_stop_queue() typically).
So in our case, what we want is the pci controller driver
getting the suspend request (and non-PCI IDE controller will
have to write their own bus binding according to the new model).
It will then tell it's own subdevices (disks in this case) to
suspend (hrm... I don't have the source at hand, I'm away for
a few days right now, does disks have struct device attached
as childs of the ATA controller ? they should...). At that
point, it's up to the _disk_ suspend() function to actually
request the block layer to stop queue processing, typically
this can be done by just not eating requests from the queue,
or better, by (un)plugging the queue on suspend/resume.
Now, there is indeed as subtle race if the disk driver wants
to queue itself a request to actually send the suspend command
to the disk. This request has to be the _last_ of the queue.
That is, the queue must be stopped right after processing this
request with no room for a new request to be taken in between.
The way I see it is that the queue should be stopped not by
the suspend function itself, but by the request processing
function when fetching that STANDBY request from the queue.
We need special care not to mixup with hdparm originated
STANDBY though (but do those go through the queue ? I'm not
sure how far the cleanup went here....)
Ben.
next prev parent reply other threads:[~2002-11-03 14:51 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-02 18:47 swsusp: don't eat ide disks Pavel Machek
2002-11-02 19:39 ` Linus Torvalds
2002-11-02 20:06 ` Alan Cox
2002-11-02 20:25 ` Pavel Machek
2002-11-02 22:04 ` Alan Cox
2002-11-03 20:11 ` Pavel Machek
2002-11-04 1:04 ` Rik van Riel
2002-11-06 12:34 ` Pavel Machek
2002-11-03 14:57 ` benh [this message]
2002-11-03 16:25 ` Alan Cox
2002-11-03 16:24 ` benh
2002-11-03 16:36 ` Alan Cox
2002-11-04 7:47 ` benh
2002-11-03 20:12 ` Pavel Machek
2002-11-03 21:33 ` Alan Cox
2002-11-03 22:09 ` Pavel Machek
2002-11-03 22:41 ` Alan Cox
2002-11-03 22:27 ` Pavel Machek
2002-11-03 23:56 ` Alan Cox
2002-11-04 8:16 ` benh
2002-11-04 13:33 ` Alan Cox
2002-11-03 22:48 ` Linus Torvalds
2002-11-03 22:53 ` Linus Torvalds
2002-11-04 8:08 ` benh
2002-11-04 14:59 ` Linus Torvalds
2002-11-04 15:27 ` Benjamin Herrenschmidt
2002-11-04 9:44 ` Jens Axboe
2002-11-04 13:37 ` Alan Cox
2002-11-03 22:56 ` Pavel Machek
2002-11-03 23:38 ` Linus Torvalds
2002-11-06 13:57 ` Pavel Machek
2002-11-04 7:57 ` benh
2002-11-04 9:39 ` Jens Axboe
2002-11-04 9:50 ` Jens Axboe
2002-11-07 13:06 ` David Woodhouse
2002-11-07 16:15 ` Pavel Machek
2002-11-07 16:18 ` David Woodhouse
2002-11-07 20:52 ` Pavel Machek
-- strict thread matches above, loose matches on Subject: below --
2002-11-07 18:26 Grover, Andrew
2002-11-07 22:25 ` David Woodhouse
2002-11-08 11:09 ` Benjamin Herrenschmidt
2002-11-10 11:54 ` Pavel Machek
2002-11-11 6:38 ` David Woodhouse
2002-11-12 17:41 ` Pavel Machek
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=20021103145735.14872@smtp.wanadoo.fr \
--to=benh@kernel.crashing.org \
--cc=alan@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=torvalds@transmeta.com \
/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