diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2009-03-31 13:16:04 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-03-31 13:17:05 -0400 |
commit | c4621a62649a56f155a96dfc5de479be226f0768 (patch) | |
tree | 76812f021dc4eec912f67a4662abed6ec8e8f626 /drivers | |
parent | 156013ffd1225ef862853a4340b46f76845f8db1 (diff) |
[S390] cio: introduce ccw_device_schedule_sch_unregister
Introduce ccw_device_schedule_sch_unregister as a wrapper for queuing
ccw_device_call_sch_unregister on the slow_path_wq. This wrapper
will be used in the next patch.
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/s390/cio/device.c | 21 | ||||
-rw-r--r-- | drivers/s390/cio/device.h | 1 |
2 files changed, 12 insertions, 10 deletions
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 9f016fef6101..cdbf664ed446 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c | |||
@@ -310,8 +310,6 @@ static void ccw_device_remove_orphan_cb(struct work_struct *work) | |||
310 | put_device(&cdev->dev); | 310 | put_device(&cdev->dev); |
311 | } | 311 | } |
312 | 312 | ||
313 | static void ccw_device_call_sch_unregister(struct work_struct *work); | ||
314 | |||
315 | static void | 313 | static void |
316 | ccw_device_remove_disconnected(struct ccw_device *cdev) | 314 | ccw_device_remove_disconnected(struct ccw_device *cdev) |
317 | { | 315 | { |
@@ -335,11 +333,10 @@ ccw_device_remove_disconnected(struct ccw_device *cdev) | |||
335 | spin_unlock_irqrestore(cdev->ccwlock, flags); | 333 | spin_unlock_irqrestore(cdev->ccwlock, flags); |
336 | PREPARE_WORK(&cdev->private->kick_work, | 334 | PREPARE_WORK(&cdev->private->kick_work, |
337 | ccw_device_remove_orphan_cb); | 335 | ccw_device_remove_orphan_cb); |
336 | queue_work(slow_path_wq, &cdev->private->kick_work); | ||
338 | } else | 337 | } else |
339 | /* Deregister subchannel, which will kill the ccw device. */ | 338 | /* Deregister subchannel, which will kill the ccw device. */ |
340 | PREPARE_WORK(&cdev->private->kick_work, | 339 | ccw_device_schedule_sch_unregister(cdev); |
341 | ccw_device_call_sch_unregister); | ||
342 | queue_work(slow_path_wq, &cdev->private->kick_work); | ||
343 | } | 340 | } |
344 | 341 | ||
345 | /** | 342 | /** |
@@ -1020,6 +1017,13 @@ static void ccw_device_call_sch_unregister(struct work_struct *work) | |||
1020 | put_device(&sch->dev); | 1017 | put_device(&sch->dev); |
1021 | } | 1018 | } |
1022 | 1019 | ||
1020 | void ccw_device_schedule_sch_unregister(struct ccw_device *cdev) | ||
1021 | { | ||
1022 | PREPARE_WORK(&cdev->private->kick_work, | ||
1023 | ccw_device_call_sch_unregister); | ||
1024 | queue_work(slow_path_wq, &cdev->private->kick_work); | ||
1025 | } | ||
1026 | |||
1023 | /* | 1027 | /* |
1024 | * subchannel recognition done. Called from the state machine. | 1028 | * subchannel recognition done. Called from the state machine. |
1025 | */ | 1029 | */ |
@@ -1036,9 +1040,7 @@ io_subchannel_recog_done(struct ccw_device *cdev) | |||
1036 | /* Remove device found not operational. */ | 1040 | /* Remove device found not operational. */ |
1037 | if (!get_device(&cdev->dev)) | 1041 | if (!get_device(&cdev->dev)) |
1038 | break; | 1042 | break; |
1039 | PREPARE_WORK(&cdev->private->kick_work, | 1043 | ccw_device_schedule_sch_unregister(cdev); |
1040 | ccw_device_call_sch_unregister); | ||
1041 | queue_work(slow_path_wq, &cdev->private->kick_work); | ||
1042 | if (atomic_dec_and_test(&ccw_device_init_count)) | 1044 | if (atomic_dec_and_test(&ccw_device_init_count)) |
1043 | wake_up(&ccw_device_init_wq); | 1045 | wake_up(&ccw_device_init_wq); |
1044 | break; | 1046 | break; |
@@ -1557,8 +1559,7 @@ static int purge_fn(struct device *dev, void *data) | |||
1557 | goto out; | 1559 | goto out; |
1558 | CIO_MSG_EVENT(3, "ccw: purging 0.%x.%04x\n", priv->dev_id.ssid, | 1560 | CIO_MSG_EVENT(3, "ccw: purging 0.%x.%04x\n", priv->dev_id.ssid, |
1559 | priv->dev_id.devno); | 1561 | priv->dev_id.devno); |
1560 | PREPARE_WORK(&cdev->private->kick_work, ccw_device_call_sch_unregister); | 1562 | ccw_device_schedule_sch_unregister(cdev); |
1561 | queue_work(slow_path_wq, &cdev->private->kick_work); | ||
1562 | 1563 | ||
1563 | out: | 1564 | out: |
1564 | /* Abort loop in case of pending signal. */ | 1565 | /* Abort loop in case of pending signal. */ |
diff --git a/drivers/s390/cio/device.h b/drivers/s390/cio/device.h index 85e01846ca65..f1cbbd94ad4e 100644 --- a/drivers/s390/cio/device.h +++ b/drivers/s390/cio/device.h | |||
@@ -87,6 +87,7 @@ int ccw_device_is_orphan(struct ccw_device *); | |||
87 | int ccw_device_recognition(struct ccw_device *); | 87 | int ccw_device_recognition(struct ccw_device *); |
88 | int ccw_device_online(struct ccw_device *); | 88 | int ccw_device_online(struct ccw_device *); |
89 | int ccw_device_offline(struct ccw_device *); | 89 | int ccw_device_offline(struct ccw_device *); |
90 | void ccw_device_schedule_sch_unregister(struct ccw_device *); | ||
90 | int ccw_purge_blacklisted(void); | 91 | int ccw_purge_blacklisted(void); |
91 | 92 | ||
92 | /* Function prototypes for device status and basic sense stuff. */ | 93 | /* Function prototypes for device status and basic sense stuff. */ |