diff options
Diffstat (limited to 'drivers/s390/cio/device.c')
-rw-r--r-- | drivers/s390/cio/device.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 4093adc12f2c..f780bdd3a04e 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c | |||
@@ -131,6 +131,10 @@ static void io_subchannel_shutdown(struct subchannel *); | |||
131 | static int io_subchannel_sch_event(struct subchannel *, int); | 131 | static int io_subchannel_sch_event(struct subchannel *, int); |
132 | static int io_subchannel_chp_event(struct subchannel *, struct chp_link *, | 132 | static int io_subchannel_chp_event(struct subchannel *, struct chp_link *, |
133 | int); | 133 | int); |
134 | static void recovery_func(unsigned long data); | ||
135 | struct workqueue_struct *ccw_device_work; | ||
136 | wait_queue_head_t ccw_device_init_wq; | ||
137 | atomic_t ccw_device_init_count; | ||
134 | 138 | ||
135 | static struct css_device_id io_subchannel_ids[] = { | 139 | static struct css_device_id io_subchannel_ids[] = { |
136 | { .match_flags = 0x1, .type = SUBCHANNEL_TYPE_IO, }, | 140 | { .match_flags = 0x1, .type = SUBCHANNEL_TYPE_IO, }, |
@@ -151,6 +155,13 @@ static int io_subchannel_prepare(struct subchannel *sch) | |||
151 | return 0; | 155 | return 0; |
152 | } | 156 | } |
153 | 157 | ||
158 | static void io_subchannel_settle(void) | ||
159 | { | ||
160 | wait_event(ccw_device_init_wq, | ||
161 | atomic_read(&ccw_device_init_count) == 0); | ||
162 | flush_workqueue(ccw_device_work); | ||
163 | } | ||
164 | |||
154 | static struct css_driver io_subchannel_driver = { | 165 | static struct css_driver io_subchannel_driver = { |
155 | .owner = THIS_MODULE, | 166 | .owner = THIS_MODULE, |
156 | .subchannel_type = io_subchannel_ids, | 167 | .subchannel_type = io_subchannel_ids, |
@@ -162,14 +173,9 @@ static struct css_driver io_subchannel_driver = { | |||
162 | .remove = io_subchannel_remove, | 173 | .remove = io_subchannel_remove, |
163 | .shutdown = io_subchannel_shutdown, | 174 | .shutdown = io_subchannel_shutdown, |
164 | .prepare = io_subchannel_prepare, | 175 | .prepare = io_subchannel_prepare, |
176 | .settle = io_subchannel_settle, | ||
165 | }; | 177 | }; |
166 | 178 | ||
167 | struct workqueue_struct *ccw_device_work; | ||
168 | wait_queue_head_t ccw_device_init_wq; | ||
169 | atomic_t ccw_device_init_count; | ||
170 | |||
171 | static void recovery_func(unsigned long data); | ||
172 | |||
173 | int __init io_subchannel_init(void) | 179 | int __init io_subchannel_init(void) |
174 | { | 180 | { |
175 | int ret; | 181 | int ret; |