lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090611115458.66650e04@jbarnes-g45>
Date:	Thu, 11 Jun 2009 11:54:58 -0700
From:	Jesse Barnes <jesse.barnes@...el.com>
To:	"Rafael J. Wysocki" <rjw@...k.pl>
Cc:	pm list <linux-pm@...ts.linux-foundation.org>,
	Linux PCI <linux-pci@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] PCI PM: Read device power state from register after
 updating it

On Tue, 26 May 2009 21:52:29 +0200
"Rafael J. Wysocki" <rjw@...k.pl> wrote:

> On Monday 18 May 2009, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <rjw@...k.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.

-- 
Jesse Barnes, Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ