From: Greg KH <greg@kroah.com>
To: Pavel Machek <pavel@ucw.cz>, linux-pm@lists.osdl.org
Cc: kernel list <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@zip.com.au>
Subject: Re: Cleanup PCI power states
Date: Thu, 16 Dec 2004 16:06:29 -0800 [thread overview]
Message-ID: <20041217000629.GB11531@kroah.com> (raw)
In-Reply-To: <20041125113913.GC1027@elf.ucw.cz>
On Thu, Nov 25, 2004 at 12:39:13PM +0100, Pavel Machek wrote:
> Hi!
>
> > > > > This is step 0 before adding type-safety to PCI layer... It introduces
> > > > > constants and uses them to clean driver up. I'd like this to go in
> > > > > now, so that I can convert drivers during 2.6.10... Please apply,
> > > >
> > > > The tree is in "bugfix only" mode right now. Changes like this need to
> > > > wait for 2.6.10 to come out before I can send it upward.
> > > >
> > > > So, care to hold on to it for a while? Or I can add it to my "to apply
> > > > after 2.6.10 comes out" tree, which will mean it will end up in the -mm
> > > > releases till that happens.
> > >
> > > I think I'd prefer visibility of "to apply after 2.6.10" tree... Thanks,
> >
> > Care to resend this, I seem to have lost them :(
>
> Could this go to "after 2.6.10 tree", too? It is a helper that
> converts system state into PCI state. We really do not want to have
> this copied into every driver, because it will need to change when
> system state gets type-checked / expanded to struct.
So this is how you want to switch stuff over? Can you give me an
example of how this will be used?
> --- clean/drivers/pci/pci.c 2004-10-01 00:30:16.000000000 +0200
> +++ linux/drivers/pci/pci.c 2004-11-14 23:36:46.000000000 +0100
> @@ -300,6 +300,30 @@
> }
>
> /**
> + * pci_choose_state - Choose the power state of a PCI device
> + * @dev: PCI device to be suspended
> + * @state: target sleep state for the whole system
> + *
> + * Returns PCI power state suitable for given device and given system
> + * message.
> + */
> +
> +pci_power_t pci_choose_state(struct pci_dev *dev, u32 state)
> +{
> + if (!pci_find_capability(dev, PCI_CAP_ID_PM))
> + return PCI_D0;
> +
> + switch (state) {
> + case 0: return PCI_D0;
> + case 2: return PCI_D2;
> + case 3: return PCI_D3hot;
> + default: BUG();
> + }
> +}
> +
> +EXPORT_SYMBOL(pci_choose_state);
EXPORT_SYMBOL_GPL() perhaps?
thanks,
greg k-h
next prev parent reply other threads:[~2004-12-17 0:07 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-16 13:04 Cleanup PCI power states Pavel Machek
2004-11-16 15:56 ` Greg KH
2004-11-17 12:08 ` Pavel Machek
2004-11-24 23:40 ` Greg KH
2004-11-25 11:36 ` Pavel Machek
2004-12-17 0:05 ` Greg KH
2004-12-17 0:31 ` Pavel Machek
2004-12-17 16:12 ` [linux-pm] " Alan Stern
2004-12-17 16:33 ` Pavel Machek
2004-12-17 22:02 ` Greg KH
2004-12-17 23:39 ` Pavel Machek
2004-12-21 19:57 ` Greg KH
2004-12-17 23:50 ` Pavel Machek
2004-12-21 20:03 ` Greg KH
2004-12-21 23:25 ` Pavel Machek
2004-12-21 23:29 ` Greg KH
2004-12-18 0:09 ` Pavel Machek
2004-12-21 20:04 ` Greg KH
2004-12-21 23:37 ` Pavel Machek
2004-12-22 0:41 ` Greg KH
2004-11-25 11:39 ` Pavel Machek
2004-12-17 0:06 ` Greg KH [this message]
2004-12-17 0:34 ` Pavel Machek
2004-12-17 7:48 ` [linux-pm] " Benjamin Herrenschmidt
2004-12-17 19:22 ` Greg KH
2004-12-17 22:02 ` Greg KH
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=20041217000629.GB11531@kroah.com \
--to=greg@kroah.com \
--cc=akpm@zip.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.osdl.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