From: Pavel Machek <pavel@ucw.cz>
To: kernel list <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@zip.com.au>
Subject: [patch] suspend: PCI power managment reference implementation
Date: Fri, 27 May 2005 14:04:07 +0200 [thread overview]
Message-ID: <20050527120406.GA2088@elf.ucw.cz> (raw)
Added reference implementation of suspend and resume routines.
From: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Pavel Machek <pavel@suse.cz>
---
commit d9b44d1230ad7a7474583eef8ae57060137466c4
tree c50cf60fc2e546606c2f6e7c5f3f32655dee778d
parent 54afa0887fd3618c7fa350b14cc57446db2a261a
author <pavel@amd.(none)> Fri, 27 May 2005 09:19:51 +0200
committer <pavel@amd.(none)> Fri, 27 May 2005 09:19:51 +0200
Documentation/power/pci.txt | 38 ++++++++++++++++++++++++++++++++++++++
1 files changed, 38 insertions(+)
Index: Documentation/power/pci.txt
===================================================================
--- 805a02ec2bcff3671d7b1e701bd1981ad2fa196c/Documentation/power/pci.txt (mode:100644)
+++ c50cf60fc2e546606c2f6e7c5f3f32655dee778d/Documentation/power/pci.txt (mode:100644)
@@ -291,6 +291,44 @@
pci_enable_wake (one for both D3hot and D3cold).
+A reference implementation
+-------------------------
+.suspend()
+{
+ /* driver specific operations */
+
+ /* Disable IRQ */
+ free_irq();
+ /* If using MSI */
+ pci_disable_msi();
+
+ pci_save_state();
+ pci_enable_wake();
+ /* Disable IO/bus master/irq router */
+ pci_disable_device();
+ pci_set_power_state(pci_choose_state());
+}
+
+.resume()
+{
+ pci_set_power_state(PCI_D0);
+ pci_restore_state();
+ /* device's irq possibly is changed, driver should take care */
+ pci_enable_device();
+ pci_set_master();
+
+ /* if using MSI, device's vector possibly is changed */
+ pci_enable_msi();
+
+ request_irq();
+ /* driver specific operations; */
+}
+
+This is a typical implementation. Drivers can slightly change the order
+of the operations in the implementation, ignore some operations or add
+more deriver specific operations in it, but drivers should do something like
+this on the whole.
+
5. Resources
~~~~~~~~~~~~
reply other threads:[~2005-05-27 12:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20050527120406.GA2088@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=akpm@zip.com.au \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®