diff options
Diffstat (limited to 'drivers/s390/cio/device_fsm.c')
-rw-r--r-- | drivers/s390/cio/device_fsm.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c index 8b5fe57fb2f3..550508df952b 100644 --- a/drivers/s390/cio/device_fsm.c +++ b/drivers/s390/cio/device_fsm.c | |||
@@ -337,26 +337,34 @@ int ccw_device_notify(struct ccw_device *cdev, int event) | |||
337 | return 0; | 337 | return 0; |
338 | if (!cdev->online) | 338 | if (!cdev->online) |
339 | return 0; | 339 | return 0; |
340 | CIO_MSG_EVENT(2, "notify called for 0.%x.%04x, event=%d\n", | ||
341 | cdev->private->dev_id.ssid, cdev->private->dev_id.devno, | ||
342 | event); | ||
340 | return cdev->drv->notify ? cdev->drv->notify(cdev, event) : 0; | 343 | return cdev->drv->notify ? cdev->drv->notify(cdev, event) : 0; |
341 | } | 344 | } |
342 | 345 | ||
343 | static void | 346 | static void cmf_reenable_delayed(struct work_struct *work) |
344 | ccw_device_oper_notify(struct work_struct *work) | ||
345 | { | 347 | { |
346 | struct ccw_device_private *priv; | 348 | struct ccw_device_private *priv; |
347 | struct ccw_device *cdev; | 349 | struct ccw_device *cdev; |
348 | int ret; | ||
349 | 350 | ||
350 | priv = container_of(work, struct ccw_device_private, kick_work); | 351 | priv = container_of(work, struct ccw_device_private, kick_work); |
351 | cdev = priv->cdev; | 352 | cdev = priv->cdev; |
352 | ret = ccw_device_notify(cdev, CIO_OPER); | 353 | cmf_reenable(cdev); |
353 | if (ret) { | 354 | } |
355 | |||
356 | static void ccw_device_oper_notify(struct ccw_device *cdev) | ||
357 | { | ||
358 | if (ccw_device_notify(cdev, CIO_OPER)) { | ||
354 | /* Reenable channel measurements, if needed. */ | 359 | /* Reenable channel measurements, if needed. */ |
355 | cmf_reenable(cdev); | 360 | PREPARE_WORK(&cdev->private->kick_work, cmf_reenable_delayed); |
356 | wake_up(&cdev->private->wait_q); | 361 | queue_work(ccw_device_work, &cdev->private->kick_work); |
357 | } else | 362 | return; |
358 | /* Driver doesn't want device back. */ | 363 | } |
359 | ccw_device_do_unreg_rereg(work); | 364 | /* Driver doesn't want device back. */ |
365 | ccw_device_set_notoper(cdev); | ||
366 | PREPARE_WORK(&cdev->private->kick_work, ccw_device_do_unreg_rereg); | ||
367 | queue_work(ccw_device_work, &cdev->private->kick_work); | ||
360 | } | 368 | } |
361 | 369 | ||
362 | /* | 370 | /* |
@@ -386,8 +394,7 @@ ccw_device_done(struct ccw_device *cdev, int state) | |||
386 | 394 | ||
387 | if (cdev->private->flags.donotify) { | 395 | if (cdev->private->flags.donotify) { |
388 | cdev->private->flags.donotify = 0; | 396 | cdev->private->flags.donotify = 0; |
389 | PREPARE_WORK(&cdev->private->kick_work, ccw_device_oper_notify); | 397 | ccw_device_oper_notify(cdev); |
390 | queue_work(ccw_device_notify_work, &cdev->private->kick_work); | ||
391 | } | 398 | } |
392 | wake_up(&cdev->private->wait_q); | 399 | wake_up(&cdev->private->wait_q); |
393 | 400 | ||