Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2049216ybi; Mon, 1 Jul 2019 05:19:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1TiauFioZ/Z1eNd2FtKJOaHqxr7bldAnE3L+tTtepAhpj/heri4yTC1sSh5Nc2Rs6YRPc X-Received: by 2002:a17:902:2869:: with SMTP id e96mr27691154plb.203.1561983541853; Mon, 01 Jul 2019 05:19:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561983541; cv=none; d=google.com; s=arc-20160816; b=k5HKjQ859z7rA0Y+NH8ZoVvo3g4ml/spyVkdDQXwn9K/WGV6A1UQkohZjQbgwH/IJW 4Z536DcR7DoPLkmNG7CJJ1bIoo5fz69dKYtZN03JOlCY0d3tnwWZgrM9QgKmAs8Ni50H 7ge+gbK4WYPf12rB9SNTqeqOVjeq2WyNSteF+Tmck8Zb5IugEdqFXtOCwMkS8jvGU9DF a8ZHHX7SDEBcJBqj0eNWZlI4pJqTFYZHilJVal2xobYlW5l4HY4a3a9WFU2oc1fauZD7 F+3LVNzCcW7/cTncN7Ja1F8sRltcFlgg8N8jy8brTyVCO/DtxSmhJwLPrmJN8gEHrRQH 8XDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=/oAfuh1+S5+VKDm/e3GiRSW6ccuw9bLDeQgYOldktao=; b=m5CsthyTqogn1IRzvyNnYfdiw5C4EUeV0Jjn9psNECU08GEHTf4VJLhGHwy9KVHvMy 7lJYAj/QMShpowwY6xgMvZFk/wfwSzm8wZLjiTWlbwZiyuVyL9LOsiTxya4+/s75Bg49 5s6ECG6t2/R5qmIgaTf6JaAiukikJ/uJRTcFdg3Vk+450V10D054X0+hTp6BZg5NBScO LkvA+48NGKNLbbQffqmc3i/Xyp96F3+Mc8ZMP1Cnrvdm7D4UAYumsSt0vNwqr/DmUzbi 0bYAQMdcjt90mRO6/v9XJNqF+Yku4h57TJ4UTNGRZ513LO+fIvkxMDIvQBaeWyIhy+HY rL4Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q191si11202811pfq.63.2019.07.01.05.18.38; Mon, 01 Jul 2019 05:19:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728185AbfGAK6b (ORCPT + 99 others); Mon, 1 Jul 2019 06:58:31 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:58928 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727777AbfGAK6U (ORCPT ); Mon, 1 Jul 2019 06:58:20 -0400 Received: from 79.184.254.216.ipv4.supernova.orange.pl (79.184.254.216) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.267) id 8ee318da5a3211b0; Mon, 1 Jul 2019 12:58:18 +0200 From: "Rafael J. Wysocki" To: Linux PM Cc: Linux PCI , Linux ACPI , LKML , Bjorn Helgaas , Andy Shevchenko , Mika Westerberg , Hans De Goede , "Robert R. Howell" Subject: [PATCH v2 2/5] PCI: PM: Simplify bus-level hibernation callbacks Date: Mon, 01 Jul 2019 12:46:45 +0200 Message-ID: <1631366.A1uHhESlUo@kreacher> In-Reply-To: <4976412.ihyb9sT5jY@kreacher> References: <4976412.ihyb9sT5jY@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki After a previous change causing all runtime-suspended PCI devices to be resumed before creating a snapshot image of memory during hibernation, it is not necessary to worry about the case in which them might be left in runtime-suspend any more, so get rid of the code related to that from bus-level PCI hibernation callbacks. Signed-off-by: Rafael J. Wysocki --- -> v2: No changes. --- drivers/pci/pci-driver.c | 27 --------------------------- 1 file changed, 27 deletions(-) Index: linux-pm/drivers/pci/pci-driver.c =================================================================== --- linux-pm.orig/drivers/pci/pci-driver.c +++ linux-pm/drivers/pci/pci-driver.c @@ -1034,22 +1034,11 @@ static int pci_pm_freeze(struct device * return 0; } -static int pci_pm_freeze_late(struct device *dev) -{ - if (dev_pm_smart_suspend_and_suspended(dev)) - return 0; - - return pm_generic_freeze_late(dev); -} - static int pci_pm_freeze_noirq(struct device *dev) { struct pci_dev *pci_dev = to_pci_dev(dev); struct device_driver *drv = dev->driver; - if (dev_pm_smart_suspend_and_suspended(dev)) - return 0; - if (pci_has_legacy_pm_support(pci_dev)) return pci_legacy_suspend_late(dev, PMSG_FREEZE); @@ -1079,16 +1068,6 @@ static int pci_pm_thaw_noirq(struct devi struct device_driver *drv = dev->driver; int error = 0; - /* - * If the device is in runtime suspend, the code below may not work - * correctly with it, so skip that code and make the PM core skip all of - * the subsequent "thaw" callbacks for the device. - */ - if (dev_pm_smart_suspend_and_suspended(dev)) { - dev_pm_skip_next_resume_phases(dev); - return 0; - } - if (pcibios_pm_ops.thaw_noirq) { error = pcibios_pm_ops.thaw_noirq(dev); if (error) @@ -1226,10 +1205,6 @@ static int pci_pm_restore_noirq(struct d struct device_driver *drv = dev->driver; int error = 0; - /* This is analogous to the pci_pm_resume_noirq() case. */ - if (dev_pm_smart_suspend_and_suspended(dev)) - pm_runtime_set_active(dev); - if (pcibios_pm_ops.restore_noirq) { error = pcibios_pm_ops.restore_noirq(dev); if (error) @@ -1279,7 +1254,6 @@ static int pci_pm_restore(struct device #else /* !CONFIG_HIBERNATE_CALLBACKS */ #define pci_pm_freeze NULL -#define pci_pm_freeze_late NULL #define pci_pm_freeze_noirq NULL #define pci_pm_thaw NULL #define pci_pm_thaw_noirq NULL @@ -1405,7 +1379,6 @@ static const struct dev_pm_ops pci_dev_p .suspend_late = pci_pm_suspend_late, .resume = pci_pm_resume, .freeze = pci_pm_freeze, - .freeze_late = pci_pm_freeze_late, .thaw = pci_pm_thaw, .poweroff = pci_pm_poweroff, .poweroff_late = pci_pm_poweroff_late,