aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/device.c
diff options
context:
space:
mode:
authorCornelia Huck <cornelia.huck@de.ibm.com>2009-03-04 06:44:00 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-03-24 19:38:26 -0400
commitffa6a7054d172a2f57248dff2de600ca795c5656 (patch)
treef93c6234bb90295c52fcef09e367ed77ff6c3645 /drivers/s390/cio/device.c
parent60530afe1ee8a5532cb09d0ab5bc3f1a6495b780 (diff)
Driver core: Fix device_move() vs. dpm list ordering, v2
dpm_list currently relies on the fact that child devices will be registered after their parents to get a correct suspend order. Using device_move() however destroys this assumption, as an already registered device may be moved under a newly registered one. This patch adds a new argument to device_move(), allowing callers to specify how dpm_list should be adapted. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/s390/cio/device.c')
-rw-r--r--drivers/s390/cio/device.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index 611d2e001dd5..e28f8ae53453 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -799,7 +799,7 @@ static void sch_attach_disconnected_device(struct subchannel *sch,
799 return; 799 return;
800 other_sch = to_subchannel(cdev->dev.parent); 800 other_sch = to_subchannel(cdev->dev.parent);
801 /* Note: device_move() changes cdev->dev.parent */ 801 /* Note: device_move() changes cdev->dev.parent */
802 ret = device_move(&cdev->dev, &sch->dev); 802 ret = device_move(&cdev->dev, &sch->dev, DPM_ORDER_PARENT_BEFORE_DEV);
803 if (ret) { 803 if (ret) {
804 CIO_MSG_EVENT(0, "Moving disconnected device 0.%x.%04x failed " 804 CIO_MSG_EVENT(0, "Moving disconnected device 0.%x.%04x failed "
805 "(ret=%d)!\n", cdev->private->dev_id.ssid, 805 "(ret=%d)!\n", cdev->private->dev_id.ssid,
@@ -830,7 +830,7 @@ static void sch_attach_orphaned_device(struct subchannel *sch,
830 * Try to move the ccw device to its new subchannel. 830 * Try to move the ccw device to its new subchannel.
831 * Note: device_move() changes cdev->dev.parent 831 * Note: device_move() changes cdev->dev.parent
832 */ 832 */
833 ret = device_move(&cdev->dev, &sch->dev); 833 ret = device_move(&cdev->dev, &sch->dev, DPM_ORDER_PARENT_BEFORE_DEV);
834 if (ret) { 834 if (ret) {
835 CIO_MSG_EVENT(0, "Moving device 0.%x.%04x from orphanage " 835 CIO_MSG_EVENT(0, "Moving device 0.%x.%04x from orphanage "
836 "failed (ret=%d)!\n", 836 "failed (ret=%d)!\n",
@@ -897,7 +897,8 @@ void ccw_device_move_to_orphanage(struct work_struct *work)
897 * ccw device can take its place on the subchannel. 897 * ccw device can take its place on the subchannel.
898 * Note: device_move() changes cdev->dev.parent 898 * Note: device_move() changes cdev->dev.parent
899 */ 899 */
900 ret = device_move(&cdev->dev, &css->pseudo_subchannel->dev); 900 ret = device_move(&cdev->dev, &css->pseudo_subchannel->dev,
901 DPM_ORDER_NONE);
901 if (ret) { 902 if (ret) {
902 CIO_MSG_EVENT(0, "Moving device 0.%x.%04x to orphanage failed " 903 CIO_MSG_EVENT(0, "Moving device 0.%x.%04x to orphanage failed "
903 "(ret=%d)!\n", cdev->private->dev_id.ssid, 904 "(ret=%d)!\n", cdev->private->dev_id.ssid,
@@ -1129,7 +1130,7 @@ static void ccw_device_move_to_sch(struct work_struct *work)
1129 * Try to move the ccw device to its new subchannel. 1130 * Try to move the ccw device to its new subchannel.
1130 * Note: device_move() changes cdev->dev.parent 1131 * Note: device_move() changes cdev->dev.parent
1131 */ 1132 */
1132 rc = device_move(&cdev->dev, &sch->dev); 1133 rc = device_move(&cdev->dev, &sch->dev, DPM_ORDER_PARENT_BEFORE_DEV);
1133 mutex_unlock(&sch->reg_mutex); 1134 mutex_unlock(&sch->reg_mutex);
1134 if (rc) { 1135 if (rc) {
1135 CIO_MSG_EVENT(0, "Moving device 0.%x.%04x to subchannel " 1136 CIO_MSG_EVENT(0, "Moving device 0.%x.%04x to subchannel "