diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2009-01-01 13:51:15 -0500 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-01-07 14:13:26 -0500 |
commit | e7ae88486670f3904f187d0fff9dcf469bcdd8ba (patch) | |
tree | c2a1ff5cb3a8b24778789720f9a64f59e679dfd0 /drivers/pci/pcie/portdrv_bus.c | |
parent | facf6d1627a33badbbc154524c4a2c73c51bdc99 (diff) |
PCI: PCIe portdrv: Fix suspend and resume of PCI Express port services
There is a problem with the suspend and resume of PCI Express port
service devices that the ->suspend() and ->resume() routines of each
service device are called twice in each suspend-resume cycle, which
is obviously wrong.
The scenario is that first, the PCI Express port driver calls
suspend and resume routines of each port service driver from its
pcie_portdrv_suspend() and pcie_portdrv_resume() callbacks,
respectively (which is correct), and second, the pcie_port_bus_type
driver calls them from its ->suspend() and ->resume() callbacks
(which is not correct, because it doesn't happen at the right time).
The solution is to remove the ->suspend() and ->resume() callbacks
from pcie_port_bus_type and the associated functions.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/pcie/portdrv_bus.c')
-rw-r--r-- | drivers/pci/pcie/portdrv_bus.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/drivers/pci/pcie/portdrv_bus.c b/drivers/pci/pcie/portdrv_bus.c index 359fe5568df1..3a03db4323ad 100644 --- a/drivers/pci/pcie/portdrv_bus.c +++ b/drivers/pci/pcie/portdrv_bus.c | |||
@@ -16,14 +16,10 @@ | |||
16 | #include "portdrv.h" | 16 | #include "portdrv.h" |
17 | 17 | ||
18 | static int pcie_port_bus_match(struct device *dev, struct device_driver *drv); | 18 | static int pcie_port_bus_match(struct device *dev, struct device_driver *drv); |
19 | static int pcie_port_bus_suspend(struct device *dev, pm_message_t state); | ||
20 | static int pcie_port_bus_resume(struct device *dev); | ||
21 | 19 | ||
22 | struct bus_type pcie_port_bus_type = { | 20 | struct bus_type pcie_port_bus_type = { |
23 | .name = "pci_express", | 21 | .name = "pci_express", |
24 | .match = pcie_port_bus_match, | 22 | .match = pcie_port_bus_match, |
25 | .suspend = pcie_port_bus_suspend, | ||
26 | .resume = pcie_port_bus_resume, | ||
27 | }; | 23 | }; |
28 | EXPORT_SYMBOL_GPL(pcie_port_bus_type); | 24 | EXPORT_SYMBOL_GPL(pcie_port_bus_type); |
29 | 25 | ||
@@ -48,33 +44,3 @@ static int pcie_port_bus_match(struct device *dev, struct device_driver *drv) | |||
48 | 44 | ||
49 | return 1; | 45 | return 1; |
50 | } | 46 | } |
51 | |||
52 | static int pcie_port_bus_suspend(struct device *dev, pm_message_t state) | ||
53 | { | ||
54 | struct pcie_device *pciedev; | ||
55 | struct pcie_port_service_driver *driver; | ||
56 | |||
57 | if (!dev || !dev->driver) | ||
58 | return 0; | ||
59 | |||
60 | pciedev = to_pcie_device(dev); | ||
61 | driver = to_service_driver(dev->driver); | ||
62 | if (driver && driver->suspend) | ||
63 | driver->suspend(pciedev, state); | ||
64 | return 0; | ||
65 | } | ||
66 | |||
67 | static int pcie_port_bus_resume(struct device *dev) | ||
68 | { | ||
69 | struct pcie_device *pciedev; | ||
70 | struct pcie_port_service_driver *driver; | ||
71 | |||
72 | if (!dev || !dev->driver) | ||
73 | return 0; | ||
74 | |||
75 | pciedev = to_pcie_device(dev); | ||
76 | driver = to_service_driver(dev->driver); | ||
77 | if (driver && driver->resume) | ||
78 | driver->resume(pciedev); | ||
79 | return 0; | ||
80 | } | ||