* [PATCH] Revert "PCI/PM: Remove pci_pm_complete()"
@ 2015-05-28 2:12 Rafael J. Wysocki
2015-05-28 20:38 ` Rafael J. Wysocki
0 siblings, 1 reply; 2+ messages in thread
From: Rafael J. Wysocki @ 2015-05-28 2:12 UTC (permalink / raw)
To: Linux PCI, Bjorn Helgaas; +Cc: Linux Kernel Mailing List, Linux PM list
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Revert commit 84822b158fd3 "PCI/PM: Remove pci_pm_complete()" that
removed the execution of the device driver's ->complete callback
from the PCI bus type.
That was a mistake, because those callbacks are not executed at all
now even if present.
Fixes: 84822b158fd3 "PCI/PM: Remove pci_pm_complete()"
Cc: 3.13+ <stable@vger.kernel.org> # 3.13+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 3cb2210de553..75c6aaec5c9b 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -669,10 +669,18 @@ static int pci_pm_prepare(struct device *dev)
return pci_dev_keep_suspended(to_pci_dev(dev));
}
+static void pci_pm_complete(struct device *dev)
+{
+ struct device_driver *drv = dev->driver;
+
+ if (drv && drv->pm && drv->pm->complete)
+ drv->pm->complete(dev);
+}
#else /* !CONFIG_PM_SLEEP */
#define pci_pm_prepare NULL
+#define pci_pm_complete NULL
#endif /* !CONFIG_PM_SLEEP */
@@ -1203,6 +1211,7 @@ static int pci_pm_runtime_idle(struct device *dev)
static const struct dev_pm_ops pci_dev_pm_ops = {
.prepare = pci_pm_prepare,
+ .complete = pci_pm_complete,
.suspend = pci_pm_suspend,
.resume = pci_pm_resume,
.freeze = pci_pm_freeze,
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Revert "PCI/PM: Remove pci_pm_complete()"
2015-05-28 2:12 [PATCH] Revert "PCI/PM: Remove pci_pm_complete()" Rafael J. Wysocki
@ 2015-05-28 20:38 ` Rafael J. Wysocki
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2015-05-28 20:38 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Linux PCI, Bjorn Helgaas, Linux Kernel Mailing List, Linux PM list
On Thu, May 28, 2015 at 4:12 AM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Revert commit 84822b158fd3 "PCI/PM: Remove pci_pm_complete()" that
> removed the execution of the device driver's ->complete callback
> from the PCI bus type.
>
> That was a mistake, because those callbacks are not executed at all
> now even if present.
>
> Fixes: 84822b158fd3 "PCI/PM: Remove pci_pm_complete()"
> Cc: 3.13+ <stable@vger.kernel.org> # 3.13+
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Scratch this, sorry.
The code is correct as is, because the bus type doesn't provide
->complete at all in which case the core will run the driver's
callback directly.
We'll probably need ->complete for PCI at one point, but then I'll
resubmit this one with a different changelog.
Thanks,
Rafael
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-05-28 20:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-28 2:12 [PATCH] Revert "PCI/PM: Remove pci_pm_complete()" Rafael J. Wysocki
2015-05-28 20:38 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).