From: Pavel Machek <pavel@ucw.cz>
To: Rafa? Bilski <rafalbilski@interia.pl>
Cc: linux-kernel@vger.kernel.org
Subject: Re: PCI - Unnecessary high-level?
Date: Wed, 31 May 2006 01:01:09 +0000 [thread overview]
Message-ID: <20060531010108.GA4073@ucw.cz> (raw)
In-Reply-To: <4480ACC0.2020806@interia.pl>
On Fri 02-06-06 23:25:20, Rafa? Bilski wrote:
> Why pci_device->suspend() is called with pm_message_t?
> IMO this is low-level PCI driver specific function.
> All drivers are calling pci_choose_state(). If this function
> would be called with pci_power_t maybe would be more PCI aware
> code compatible. Maybe code below would be better?
No. Low-level drivers want to know difference between SUSPEND and
FREEZE, for example.
Pavel
>
>
> --- linux-2.6.17-rc5/include/linux/pci.h.orig 2006-05-31 09:00:42.000000000 +0200
> +++ linux-2.6.17-rc5/include/linux/pci.h 2006-06-02 22:41:11.000000000 +0200
> @@ -342,7 +342,7 @@ struct pci_driver {
> const struct pci_device_id *id_table; /* must be non-NULL for probe to be called */
> int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */
> void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */
> - int (*suspend) (struct pci_dev *dev, pm_message_t state); /* Device suspended */
> + int (*suspend) (struct pci_dev *dev, pci_power_t state); /* Device suspended */
> int (*resume) (struct pci_dev *dev); /* Device woken up */
> int (*enable_wake) (struct pci_dev *dev, pci_power_t state, int enable); /* Enable wake event */
> void (*shutdown) (struct pci_dev *dev);
>
>
> --- linux-2.6.17-rc5/drivers/pci/pci-driver.c.orig 2006-05-31 09:00:31.000000000 +0200
> +++ linux-2.6.17-rc5/drivers/pci/pci-driver.c 2006-06-02 22:44:18.000000000 +0200
> @@ -272,7 +272,7 @@ static int pci_device_suspend(struct dev
> int i = 0;
>
> if (drv && drv->suspend) {
> - i = drv->suspend(pci_dev, state);
> + i = drv->suspend( pci_dev, pci_choose_state(state) );
> suspend_report_result(drv->suspend, i);
> } else {
> pci_save_state(pci_dev);
>
>
> ----------------------------------------------------------------------
> Poznaj Stefana! Zmien komunikator! >>> http://link.interia.pl/f1924
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
Thanks for all the (sleeping) penguins.
prev parent reply other threads:[~2006-06-03 20:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-02 21:25 PCI - Unnecessary high-level? Rafa? Bilski
2006-05-31 1:01 ` Pavel Machek [this message]
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=20060531010108.GA4073@ucw.cz \
--to=pavel@ucw.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=rafalbilski@interia.pl \
/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