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>
Cc: <linux-pm-devel@lists.sourceforge.net>,
	Jeff Garzik <jgarzik@mandrakesoft.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: PCI power management
Date: Thu, 19 Apr 2001 15:43:33 +0200	[thread overview]
Message-ID: <20010419134333.31606@mailhost.mipsys.com> (raw)
In-Reply-To: <E14qEYX-0007Cl-00@the-village.bc.nu>
In-Reply-To: <E14qEYX-0007Cl-00@the-village.bc.nu>

>null = 'do absolutely nothing'
>generic = 'do D3 as per the specification'
>
>The idea being the PM layer would go around calling
>
>	dev->power_off(dev);
>
>as a default notifier for PCI devices.

Ok, I see. I didn't understand that the functions you were talking about
would be defaults to put directly in the pci_dev structure.

>And in the case of the cards like that you would need a custom mask. So you'd
>do
>	pci_set_power_handler(dev, atyfb_power_on, atyfb_power_off)
>
>to get a custom function. For most authors however they can call the power
>handler setup just using prerolled functions that do the right thing and know
>about any architecture horrors they dont.

Right. However, rare are the drivers that don't need at least to know
that a power management sequence is going on. All bus mastering drivers,
at least, must stop bus mastering (and clearing the bit in the command
register is not enough on a bunch of them). Most drivers have to cleanly
stop ongoing operations, refuse (or block) requests while the driver is
sleeping, etc... and finally configure things back once waking up. I
don't see much cases where a simple "default" function would work. 

My current scheme on powerbook don't do half of that... it still sorta
works since I manage to stop all scheduling and shut things down in the
proper order, but it's neither a clean nor a safe way to do things.

>I'd rather
>
>	pci_dev->powerstate
>
>or similar as a set of flags in the device.

Ok, agree with that one.

I sill consider, however, that the current suspend/resume callbacks in
the pci_dev structure are not the best way to do things. I would have
really prefered that each pci_dev embed a pm notifier structure. In some
cases, we want to pass more than simple suspend/resume messages (suspend
request, suspend now, suspend cancel, and resume are the 4 messages I use
on powerbooks). 

Also, this can be generalized to other type of drivers (USB, IEEE1394,
..), eventually passing bus-specific messages

Ben.




  reply	other threads:[~2001-04-19 13:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.10.10104181150530.7690-100000@nobelium.transmeta.com>
2001-04-19  8:25 ` PCI power management Jeff Garzik
2001-04-19 10:08   ` Benjamin Herrenschmidt
2001-04-19 10:38     ` CaT
2001-04-19 12:10       ` Benjamin Herrenschmidt
2001-04-19 12:57     ` Alan Cox
2001-04-19 13:14       ` Benjamin Herrenschmidt
2001-04-19 13:33         ` Alan Cox
2001-04-19 13:43           ` Benjamin Herrenschmidt [this message]
2001-04-20  0:05     ` Patrick Mochel
2001-04-20 12:06       ` Benjamin Herrenschmidt
2001-04-20 12:40         ` Jeff Garzik
2001-04-20 12:56           ` Benjamin Herrenschmidt
2001-04-21  9:09             ` Russell King
2001-04-19 10:18   ` Benjamin Herrenschmidt
2001-04-19 13:24     ` Jeff Garzik
2001-04-20  0:11       ` [Linux-pm-devel] " Patrick Mochel
2001-04-19 23:03   ` Patrick Mochel
2004-08-02 21:33 pci " Erik Rigtorp
2004-08-02 23:45 ` Brian Gerst

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=20010419134333.31606@mailhost.mipsys.com \
    --to=benh@kernel.crashing.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=jgarzik@mandrakesoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm-devel@lists.sourceforge.net \
    /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