From patchwork Mon Feb 4 11:56:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konstantin Khlebnikov X-Patchwork-Id: 2091331 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 9AC50E00E5 for ; Mon, 4 Feb 2013 12:14:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754691Ab3BDMOw (ORCPT ); Mon, 4 Feb 2013 07:14:52 -0500 Received: from mail-lb0-f179.google.com ([209.85.217.179]:43452 "EHLO mail-lb0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754621Ab3BDL4K (ORCPT ); Mon, 4 Feb 2013 06:56:10 -0500 Received: by mail-lb0-f179.google.com with SMTP id j14so6616398lbo.38 for ; Mon, 04 Feb 2013 03:56:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=+KC+lU+qhNL41PFXS0qB9TlLAZ+IvC3SoYV1E9AgH5Q=; b=CjlDZVVHEmGuAeK1/YzTlSTmhDyhjXap21uu8O6eCWAYtJQ0uPj65rcLWXx964gqBt RxmC8xhSxMVCs1M+Bq71PQDL3vY0wMV4oHazNnXCOFMncjjIbDnSGvMoMBAvd00vx3tf KP1tN8ExyfqGGW4xpqXlHcltJx6EAMpWnyXyjZQ04o5hlLdz1vxtkVOu8sY0d+ekgGaf RlbORFOBKeaB70lktokw7qHLOF4rE+z3mkKTgJ0ma40gFPPyYffVGmKPo4Bk2OQqRdl/ AvEQi08AnNFEMpf6AMFN5jma2o1LH5v27xnLaFRruupcdMnFfkQ9Gy5T2YyBVyi9XLba fg8g== X-Received: by 10.112.104.103 with SMTP id gd7mr4329549lbb.54.1359978967844; Mon, 04 Feb 2013 03:56:07 -0800 (PST) Received: from localhost (swsoft-msk-nat.sw.ru. [195.214.232.10]) by mx.google.com with ESMTPS id h6sm2243270lbm.3.2013.02.04.03.56.06 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 04 Feb 2013 03:56:07 -0800 (PST) Subject: [PATCH v2 4/7] PCI/PM: clear state_saved during suspend To: e1000-devel@lists.sourceforge.net, linux-pci@vger.kernel.org, "Rafael J. Wysocki" , linux-kernel@vger.kernel.org From: Konstantin Khlebnikov Cc: Bjorn Helgaas Date: Mon, 04 Feb 2013 15:56:05 +0400 Message-ID: <20130204115605.5569.84605.stgit@zurg> In-Reply-To: <20130204115246.5569.85829.stgit@zurg> References: <20130204115246.5569.85829.stgit@zurg> User-Agent: StGit/0.15 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Rafael J. Wysocki This patch clears pci_dev->state_saved at the beginnig of suspending. PCI config state may be saved long before that. Some divers calls pci_save_state() from its ->probe() callback to get snapshot of sane configuration space to use in the ->slot_reset() callback. Signed-off-by: Konstantin Khlebnikov # add comment Cc: linux-pci@vger.kernel.org Cc: Bjorn Helgaas Cc: Rafael J. Wysocki --- 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 diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index dc5bdce..f9aa311 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c @@ -628,6 +628,7 @@ static int pci_pm_suspend(struct device *dev) goto Fixup; } + pci_dev->state_saved = false; if (pm->suspend) { pci_power_t prev = pci_dev->current_state; int error; @@ -774,6 +775,7 @@ static int pci_pm_freeze(struct device *dev) return 0; } + pci_dev->state_saved = false; if (pm->freeze) { int error; @@ -862,6 +864,7 @@ static int pci_pm_poweroff(struct device *dev) goto Fixup; } + pci_dev->state_saved = false; if (pm->poweroff) { int error; @@ -987,6 +990,7 @@ static int pci_pm_runtime_suspend(struct device *dev) if (!pm || !pm->runtime_suspend) return -ENOSYS; + pci_dev->state_saved = false; pci_dev->no_d3cold = false; error = pm->runtime_suspend(dev); suspend_report_result(pm->runtime_suspend, error);