From: Adam Belay <abelay@novell.com>
To: Greg KH <greg@kroah.com>, Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, linux-pci@atrey.karlin.mff.cuni.cz
Subject: [PATCH 7/9] PCI PM: handle PMCSR more carefully
Date: Mon, 05 Jun 2006 04:46:13 -0400 [thread overview]
Message-ID: <1149497174.7831.161.camel@localhost.localdomain> (raw)
This patch changes __pci_set_power_state() such that it only modifies
the power state byte in PMCSR. Otherwise a PME event might
accidentally be cleared (when entering a state greater than D0), or
PME_En might be cleared (when returning to D0) despite the device driver
intending to leave it enabled in D0.
Signed-off-by: Adam Belay <abelay@novell.com>
---
pm.c | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)
diff -urN a/drivers/pci/pm.c b/drivers/pci/pm.c
--- a/drivers/pci/pm.c 2006-06-04 02:41:21.000000000 -0400
+++ b/drivers/pci/pm.c 2006-06-04 03:39:20.000000000 -0400
@@ -114,23 +114,9 @@
static void __pci_set_power_state(struct pci_dev *dev, pci_power_t state)
{
struct pci_dev_pm *pm = dev->pm;
- u16 pmcsr;
-
- pci_read_config_word(dev, pm->pm_offset + PCI_PM_CTRL, &pmcsr);
-
- /* If we're (effectively) in D3, force entire word to 0.
- * This doesn't affect PME_Status, disables PME_En, and
- * sets PowerState to 0.
- */
- if (dev->current_state == PCI_D3) {
- pmcsr = 0;
- } else {
- pmcsr &= ~PCI_PM_CTRL_STATE_MASK;
- pmcsr |= state;
- }
/* enter specified state */
- pci_write_config_word(dev, pm->pm_offset + PCI_PM_CTRL, pmcsr);
+ pci_write_config_byte(dev, pm->pm_offset + PCI_PM_CTRL, state);
/* Mandatory power management transition delays */
/* see PCI PM 1.1 5.6.1 table 18 */
reply other threads:[~2006-06-05 8:36 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=1149497174.7831.161.camel@localhost.localdomain \
--to=abelay@novell.com \
--cc=akpm@osdl.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@atrey.karlin.mff.cuni.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
all inboxes | Powered by JetHome®