public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Benjamin Herrenschmidt" <benh@kernel.crashing.org>
To: "Alan Cox" <alan@lxorguk.ukuu.org.uk>,
	"Linus Torvalds" <torvalds@transmeta.com>
Cc: "Pavel Machek" <pavel@ucw.cz>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: prevent swsusp from eating disks
Date: Wed, 30 Oct 2002 16:48:36 +0100	[thread overview]
Message-ID: <20021030154836.14201@192.168.4.1> (raw)
In-Reply-To: <1035991224.5141.70.camel@irongate.swansea.linux.org.uk>

>> Why aren't those fields initialized explicitly in the static declaration
>> of idedisk_driver? And what are the do_idedisk_suspend/do_idedisk_resume
>> functions, that _are_ initialized explicitly?
>> 
>> I want to understand the madness, not add to it.
>
>The IDE devices are already beginning to use the pci suspend/resume
>callbacks so I would prefer that we have a very clear model of WTF is
>going on here.

The way it should be done is as follow (propagation of suspend/resume):

arch->pci_bus->...->pci_driver->ide_subdriver

The details as I see them (and that would match my needs on ppc) are
that the suspend request originates from the bus binding of the
controller, as any other device. (non PCI hosts will need specific
arch tweaks here or whatever parent bus they have in the news model
will deal with sending them the suspend call).

The driver (interface driver) is then acting like a bus. So it's
it's responsiblity to forward the request to it's sub-drivers
(typically ide-disk, ide-cd, whatever is attached to that
physical interface). Once the subdrivers are done, the interface
driver can proceed to shutting down the actual HW.

However, that leads to some problems regarding the existing bits
of code I see in there.

One of them is that the do_idedisk_suspend & friends don't take
the proper "level" parameter defined by the device model, which
makes it difficult to implement the various suspend/resume steps
as defined by the new driver model.

Another is that I feel (and I know Pavel doesn't agree here) that
the disk driver should also block further incoming requests (that
is leave them in the queue) instead of panic'ing. That is the
driver should not rely on not beeing fed any more request, but
rather make sure it will leave them in the queue and deal with
them when resumed.

I hope I'll finally find enough time to tackle porting of all
of the Pmac stuff to the new model, that will give me a chance
to implement our power management scheme based on the new
semantics and thus validate them (FYI, we've had fairly well
working power management on pmac for a couple of years now,
based on an arch specific mecanism & driver hooks, and I hope
I discussed enough with Patrick & Greg to make sure our experience
in this domain ended up in the design of the new model).

Ben.



  reply	other threads:[~2002-10-30 15:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-29 23:14 prevent swsusp from eating disks Pavel Machek
2002-10-30  0:39 ` Linus Torvalds
2002-10-30 15:20   ` Alan Cox
2002-10-30 15:48     ` Benjamin Herrenschmidt [this message]
2002-10-30 19:42       ` Alan Cox
2002-10-31  1:39         ` Benjamin Herrenschmidt
2002-10-31 21:36           ` 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=20021030154836.14201@192.168.4.1 \
    --to=benh@kernel.crashing.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --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