public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Jesse Barnes <jesse.barnes@intel.com>
Cc: pm list <linux-pm@lists.linux-foundation.org>,
	Linux PCI <linux-pci@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Jiri Slaby <jirislaby@gmail.com>
Subject: Re: [PATCH 2/2] PCI PM: Read device power state from register after updating it
Date: Thu, 11 Jun 2009 21:53:16 +0200	[thread overview]
Message-ID: <200906112153.16853.rjw@sisk.pl> (raw)
In-Reply-To: <20090611115458.66650e04@jbarnes-g45>

On Thursday 11 June 2009, Jesse Barnes wrote:
> On Tue, 26 May 2009 21:52:29 +0200
> "Rafael J. Wysocki" <rjw@sisk.pl> wrote:
> 
> > On Monday 18 May 2009, Rafael J. Wysocki wrote:
> > > From: Rafael J. Wysocki <rjw@sisk.pl>
> > > 
> > > After attempting to change the power state of a PCI device
> > > pci_raw_set_power_state() doesn't check if the value it wrote into
> > > the device's PCI_PM_CTRL register has been stored in there.  Still,
> > > it modifies the device's current_state field as though that's the
> > > case.  This may cause the driver of the device to think that its
> > > power state has been changed while in fact it hasn't.
> > > 
> > > To prevent such situations from happening modify
> > > pci_raw_set_power_state() so that it reads the device's PCI_PM_CTRL
> > > register after writing into it and uses the value read from the
> > > register to update the device's current_state field.  Also make it
> > > return -EIO if the new state of the device is not equal to the state
> > > requested by the called.
> > > 
> > > To distinguish this error condition from the other ones make
> > > pci_raw_set_power_state() return -ENOSYS instead of -EIO when it is
> > > impossible to change the power state of the device, because it
> > > doesn't support the native PCI PM at all or the requested target
> > > state is not supported by it.
> > 
> > Having reconsidered it I think that -ENODEV is probably better than
> > -ENOSYS for this purpose.  Updated patch follows.
> 
> Applied to linux-next, thanks Rafael.

Please drop.  It has been reported by Jiri to cause a regression to happen.

Best,
Rafael

  reply	other threads:[~2009-06-11 19:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-18 20:46 [PATCH 0/2] PCI PM: Two patches for 2.6.31 Rafael J. Wysocki
2009-05-18 20:51 ` [PATCH 1/2] PCI PM: Follow PCI_PM_CTRL_NO_SOFT_RESET during transitions from D3 Rafael J. Wysocki
2009-06-11 18:26   ` Jesse Barnes
2009-05-18 20:52 ` [PATCH 2/2] PCI PM: Read device power state from register after updating it Rafael J. Wysocki
2009-05-26 19:52   ` Rafael J. Wysocki
2009-06-11 18:54     ` Jesse Barnes
2009-06-11 19:53       ` Rafael J. Wysocki [this message]
2009-06-11 20:00         ` Jesse Barnes

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=200906112153.16853.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=jesse.barnes@intel.com \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.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