diff options
Diffstat (limited to 'drivers/s390/block/dasd.c')
-rw-r--r-- | drivers/s390/block/dasd.c | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index be34ef41b7c7..57fd66357b95 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -579,7 +579,8 @@ void dasd_kick_device(struct dasd_device *device) { dasd_get_device(device); /* queue call to dasd_kick_device to the kernel event daemon. */ - schedule_work(&device->kick_work); + if (!schedule_work(&device->kick_work)) + dasd_put_device(device); } EXPORT_SYMBOL(dasd_kick_device); @@ -599,7 +600,8 @@ void dasd_reload_device(struct dasd_device *device) { dasd_get_device(device); /* queue call to dasd_reload_device to the kernel event daemon. */ - schedule_work(&device->reload_device); + if (!schedule_work(&device->reload_device)) + dasd_put_device(device); } EXPORT_SYMBOL(dasd_reload_device); @@ -619,7 +621,8 @@ void dasd_restore_device(struct dasd_device *device) { dasd_get_device(device); /* queue call to dasd_restore_device to the kernel event daemon. */ - schedule_work(&device->restore_device); + if (!schedule_work(&device->restore_device)) + dasd_put_device(device); } /* @@ -1237,7 +1240,6 @@ EXPORT_SYMBOL(dasd_smalloc_request); */ void dasd_kfree_request(struct dasd_ccw_req *cqr, struct dasd_device *device) { -#ifdef CONFIG_64BIT struct ccw1 *ccw; /* Clear any idals used for the request. */ @@ -1245,7 +1247,6 @@ void dasd_kfree_request(struct dasd_ccw_req *cqr, struct dasd_device *device) do { clear_normalized_cda(ccw); } while (ccw++->flags & (CCW_FLAG_CC | CCW_FLAG_DC)); -#endif kfree(cqr->cpaddr); kfree(cqr->data); kfree(cqr); @@ -2165,18 +2166,22 @@ static int _dasd_sleep_on(struct dasd_ccw_req *maincqr, int interruptible) cqr->intrc = -ENOLINK; continue; } - /* Don't try to start requests if device is stopped */ - if (interruptible) { - rc = wait_event_interruptible( - generic_waitq, !(device->stopped)); - if (rc == -ERESTARTSYS) { - cqr->status = DASD_CQR_FAILED; - maincqr->intrc = rc; - continue; - } - } else - wait_event(generic_waitq, !(device->stopped)); - + /* + * Don't try to start requests if device is stopped + * except path verification requests + */ + if (!test_bit(DASD_CQR_VERIFY_PATH, &cqr->flags)) { + if (interruptible) { + rc = wait_event_interruptible( + generic_waitq, !(device->stopped)); + if (rc == -ERESTARTSYS) { + cqr->status = DASD_CQR_FAILED; + maincqr->intrc = rc; + continue; + } + } else + wait_event(generic_waitq, !(device->stopped)); + } if (!cqr->callback) cqr->callback = dasd_wakeup_cb; @@ -2526,6 +2531,11 @@ static void __dasd_process_request_queue(struct dasd_block *block) __blk_end_request_all(req, -EIO); return; } + + /* if device ist stopped do not fetch new requests */ + if (basedev->stopped) + return; + /* Now we try to fetch requests from the request queue */ while ((req = blk_peek_request(queue))) { if (basedev->features & DASD_FEATURE_READONLY && @@ -2967,8 +2977,6 @@ enum blk_eh_timer_return dasd_times_out(struct request *req) */ static int dasd_alloc_queue(struct dasd_block *block) { - int rc; - block->request_queue = blk_init_queue(do_dasd_request, &block->request_queue_lock); if (block->request_queue == NULL) @@ -2976,14 +2984,7 @@ static int dasd_alloc_queue(struct dasd_block *block) block->request_queue->queuedata = block; - elevator_exit(block->request_queue->elevator); - block->request_queue->elevator = NULL; - mutex_lock(&block->request_queue->sysfs_lock); - rc = elevator_init(block->request_queue, "deadline"); - if (rc) - blk_cleanup_queue(block->request_queue); - mutex_unlock(&block->request_queue->sysfs_lock); - return rc; + return 0; } /* |