Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757822AbZFKS1h (ORCPT ); Thu, 11 Jun 2009 14:27:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757266AbZFKS13 (ORCPT ); Thu, 11 Jun 2009 14:27:29 -0400 Received: from mga11.intel.com ([192.55.52.93]:15654 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757515AbZFKS12 (ORCPT ); Thu, 11 Jun 2009 14:27:28 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.42,203,1243839600"; d="scan'208";a="465547177" Date: Thu, 11 Jun 2009 11:26:49 -0700 From: Jesse Barnes To: "Rafael J. Wysocki" Cc: pm list , Linux PCI , LKML Subject: Re: [PATCH 1/2] PCI PM: Follow PCI_PM_CTRL_NO_SOFT_RESET during transitions from D3 Message-ID: <20090611112649.719a0eb5@jbarnes-g45> In-Reply-To: <200905182251.13197.rjw@sisk.pl> References: <200905182246.41129.rjw@sisk.pl> <200905182251.13197.rjw@sisk.pl> X-Mailer: Claws Mail 3.7.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1986 Lines: 49 On Mon, 18 May 2009 22:51:12 +0200 "Rafael J. Wysocki" wrote: > From: Rafael J. Wysocki > > According to the PCI PM specification (PCI Bus Power Management > Interface Specification, Rev. 1.2, Section 5.4.1) we are supposed to > reinitialize devices that have PCI_PM_CTRL_NO_SOFT_RESET clear during > all transitions from PCI_D3hot to PCI_D0, but we only do it if the > device's current_state field is equal to PCI_UNKNOWN. > > This may lead to problems if a device with PCI_PM_CTRL_NO_SOFT_RESET > unset is put into PCI_D3hot at run time by its driver and > pci_set_power_state() is used to put it back into PCI_D0, because in > that case the device will remain uninitialized after > pci_set_power_state() has returned. Prevent that from happening by > modifying pci_raw_set_power_state() to reinitialize devices with > PCI_PM_CTRL_NO_SOFT_RESET unset during all transitions from D3 to D0. > > Signed-off-by: Rafael J. Wysocki > --- > drivers/pci/pci.c | 2 ++ > 1 file changed, 2 insertions(+) > > Index: linux-2.6/drivers/pci/pci.c > =================================================================== > --- linux-2.6.orig/drivers/pci/pci.c > +++ linux-2.6/drivers/pci/pci.c > @@ -480,6 +480,8 @@ static int pci_raw_set_power_state(struc > pmcsr &= ~PCI_PM_CTRL_STATE_MASK; > pmcsr |= state; > break; > + case PCI_D3hot: > + case PCI_D3cold: > case PCI_UNKNOWN: /* Boot-up */ > if ((pmcsr & PCI_PM_CTRL_STATE_MASK) == PCI_D3hot > && !(pmcsr & PCI_PM_CTRL_NO_SOFT_RESET)) > Applied to my linux-next branch, thanks Rafael. I've also included stable@kernel.org in the cc, since this is a small but important fix. -- 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/