From patchwork Tue Jan 29 04:34:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Huang, Ying" X-Patchwork-Id: 2059121 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 8376340AEF for ; Tue, 29 Jan 2013 04:35:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756677Ab3A2Eee (ORCPT ); Mon, 28 Jan 2013 23:34:34 -0500 Received: from mga02.intel.com ([134.134.136.20]:65168 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756624Ab3A2Eec (ORCPT ); Mon, 28 Jan 2013 23:34:32 -0500 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 28 Jan 2013 20:34:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,556,1355126400"; d="scan'208";a="253942330" Received: from yhuang-dev.sh.intel.com ([10.239.13.18]) by orsmga001.jf.intel.com with ESMTP; 28 Jan 2013 20:34:27 -0800 From: Huang Ying To: Bjorn Helgaas Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org, "Rafael J. Wysocki" , Huang Ying Subject: [PATCH 4/4] PCI/PM: Enable D3cold support for system suspend Date: Tue, 29 Jan 2013 12:34:18 +0800 Message-Id: <1359434058-15918-5-git-send-email-ying.huang@intel.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1359434058-15918-1-git-send-email-ying.huang@intel.com> References: <1359434058-15918-1-git-send-email-ying.huang@intel.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Device may need to be put in D3cold on some platforms, especially because we treat ACPI_STATE_D3 as ACPI_STATE_D3_COLD now. Signed-off-by: Huang Ying --- drivers/pci/pci-driver.c | 5 +++++ drivers/pci/pci.c | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c @@ -579,6 +579,7 @@ static bool pci_has_legacy_pm_support(st static int pci_pm_prepare(struct device *dev) { struct device_driver *drv = dev->driver; + struct pci_dev *pci_dev = to_pci_dev(dev); int error = 0; /* @@ -592,6 +593,10 @@ static int pci_pm_prepare(struct device */ pm_runtime_resume(dev); + if (!pci_dev->d3cold_allowed) + pci_dev->no_d3cold = true; + else + pci_dev->no_d3cold = false; if (drv && drv->pm && drv->pm->prepare) error = drv->pm->prepare(dev); --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -1798,10 +1798,6 @@ int pci_prepare_to_sleep(struct pci_dev if (target_state == PCI_POWER_ERROR) return -EIO; - /* D3cold during system suspend/hibernate is not supported */ - if (target_state > PCI_D3hot) - target_state = PCI_D3hot; - pci_enable_wake(dev, target_state, device_may_wakeup(&dev->dev)); error = pci_set_power_state(dev, target_state);