OSDN Git Service

PM / core: fix deferred probe breaking suspend resume order
authorFeng Kan <fkan@apm.com>
Tue, 10 Apr 2018 23:57:06 +0000 (16:57 -0700)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 24 Apr 2018 10:18:25 +0000 (12:18 +0200)
commit494fd7b7ad10c33d3a7ff7d10b71b3ecad10474a
tree142266c224b8a9ac90ebb9850861ddbb1c0d118c
parent6d08b06e67cd117f6992c46611dfb4ce267cd71e
PM / core: fix deferred probe breaking suspend resume order

When bridge and its endpoint is enumerated the devices are added to the
dpm list. Afterward, the bridge defers probe when IOMMU is not ready.
This causes the bridge to be moved to the end of the dpm list when
deferred probe kicks in. The order of the dpm list for bridge and
endpoint is reversed.

Add reordering code to move the bridge and its children and consumers to
the end of the pm list so the order for suspend and resume is not altered.
The code also move device and its children and consumers to the tail of
device_kset list if it is registered.

Signed-off-by: Toan Le <toanle@apm.com>
Signed-off-by: Feng Kan <fkan@apm.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/base.h
drivers/base/core.c
drivers/base/dd.c