aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/block
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/block')
-rw-r--r--drivers/s390/block/dasd.c20
-rw-r--r--drivers/s390/block/dasd_eckd.c10
2 files changed, 17 insertions, 13 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
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index 1c28ec3e4ccb..f8b1f04f26b8 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -3243,9 +3243,6 @@ int dasd_eckd_restore_device(struct dasd_device *device)
3243 int is_known, rc; 3243 int is_known, rc;
3244 struct dasd_uid temp_uid; 3244 struct dasd_uid temp_uid;
3245 3245
3246 /* allow new IO again */
3247 device->stopped &= ~DASD_STOPPED_PM;
3248
3249 private = (struct dasd_eckd_private *) device->private; 3246 private = (struct dasd_eckd_private *) device->private;
3250 3247
3251 /* Read Configuration Data */ 3248 /* Read Configuration Data */
@@ -3295,12 +3292,7 @@ int dasd_eckd_restore_device(struct dasd_device *device)
3295 return 0; 3292 return 0;
3296 3293
3297out_err: 3294out_err:
3298 /* 3295 return -1;
3299 * if the resume failed for the DASD we put it in
3300 * an UNRESUMED stop state
3301 */
3302 device->stopped |= DASD_UNRESUMED_PM;
3303 return 0;
3304} 3296}
3305 3297
3306static struct ccw_driver dasd_eckd_driver = { 3298static struct ccw_driver dasd_eckd_driver = {