From patchwork Mon Sep 17 08:54:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Huang, Ying" X-Patchwork-Id: 1466311 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 19659DFFFF for ; Mon, 17 Sep 2012 08:55:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753521Ab2IQIzn (ORCPT ); Mon, 17 Sep 2012 04:55:43 -0400 Received: from mga01.intel.com ([192.55.52.88]:12419 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754032Ab2IQIyt (ORCPT ); Mon, 17 Sep 2012 04:54:49 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 17 Sep 2012 01:54:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,434,1344236400"; d="scan'208";a="222936825" Received: from yhuang-dev.sh.intel.com ([10.239.13.28]) by fmsmga002.fm.intel.com with ESMTP; 17 Sep 2012 01:54:47 -0700 From: Huang Ying To: Bjorn Helgaas Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-pm@vger.kernel.org, "Rafael J. Wysocki" , Huang Ying Subject: [RFC 1/3] PCI/PM: Fix kexec for D3cold and bridge suspending Date: Mon, 17 Sep 2012 16:54:34 +0800 Message-Id: <1347872076-5260-2-git-send-email-ying.huang@intel.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1347872076-5260-1-git-send-email-ying.huang@intel.com> References: <1347872076-5260-1-git-send-email-ying.huang@intel.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org If PCI devices are put into D3cold before kexec, because the configuration registers of PCI devices in D3cold are not accessible. And if PCI bridges are put into low power state before kexec, configuration registers of PCI devices underneath the PCI bridges are not accessible too. These will make some PCI devices can not be scanned after kexec, so resume the PCI devices in D3cold or PCI bridges in low power state before kexec. Signed-off-by: Huang Ying Acked-by: "Eric W. Biederman" --- drivers/pci/pci-driver.c | 4 ++++ 1 file changed, 4 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" 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 @@ -421,6 +421,10 @@ static void pci_device_shutdown(struct d struct pci_dev *pci_dev = to_pci_dev(dev); struct pci_driver *drv = pci_dev->driver; + /* Resume bridges and devices in D3cold for kexec to work properly */ + if (pci_dev->current_state == PCI_D3cold || pci_dev->subordinate) + pm_runtime_resume(dev); + if (drv && drv->shutdown) drv->shutdown(pci_dev); pci_msi_shutdown(pci_dev);