aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/block/dasd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/block/dasd.c')
-rw-r--r--drivers/s390/block/dasd.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index e5b84db0aa03..749836668655 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -470,7 +470,7 @@ static int dasd_decrease_state(struct dasd_device *device)
470 */ 470 */
471static void dasd_change_state(struct dasd_device *device) 471static void dasd_change_state(struct dasd_device *device)
472{ 472{
473 int rc; 473 int rc;
474 474
475 if (device->state == device->target) 475 if (device->state == device->target)
476 /* Already where we want to go today... */ 476 /* Already where we want to go today... */
@@ -479,8 +479,10 @@ static void dasd_change_state(struct dasd_device *device)
479 rc = dasd_increase_state(device); 479 rc = dasd_increase_state(device);
480 else 480 else
481 rc = dasd_decrease_state(device); 481 rc = dasd_decrease_state(device);
482 if (rc && rc != -EAGAIN) 482 if (rc == -EAGAIN)
483 device->target = device->state; 483 return;
484 if (rc)
485 device->target = device->state;
484 486
485 if (device->state == device->target) { 487 if (device->state == device->target) {
486 wake_up(&dasd_init_waitq); 488 wake_up(&dasd_init_waitq);
@@ -2503,15 +2505,25 @@ int dasd_generic_restore_device(struct ccw_device *cdev)
2503 if (IS_ERR(device)) 2505 if (IS_ERR(device))
2504 return PTR_ERR(device); 2506 return PTR_ERR(device);
2505 2507
2508 /* allow new IO again */
2509 device->stopped &= ~DASD_STOPPED_PM;
2510 device->stopped &= ~DASD_UNRESUMED_PM;
2511
2506 dasd_schedule_device_bh(device); 2512 dasd_schedule_device_bh(device);
2507 if (device->block) 2513 if (device->block)
2508 dasd_schedule_block_bh(device->block); 2514 dasd_schedule_block_bh(device->block);
2509 2515
2510 if (device->discipline->restore) 2516 if (device->discipline->restore)
2511 rc = device->discipline->restore(device); 2517 rc = device->discipline->restore(device);
2518 if (rc)
2519 /*
2520 * if the resume failed for the DASD we put it in
2521 * an UNRESUMED stop state
2522 */
2523 device->stopped |= DASD_UNRESUMED_PM;
2512 2524
2513 dasd_put_device(device); 2525 dasd_put_device(device);
2514 return rc; 2526 return 0;
2515} 2527}
2516EXPORT_SYMBOL_GPL(dasd_generic_restore_device); 2528EXPORT_SYMBOL_GPL(dasd_generic_restore_device);
2517 2529