diff options
Diffstat (limited to 'drivers/s390/block/dasd.c')
| -rw-r--r-- | drivers/s390/block/dasd.c | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 27a1be0cd4d4..442bb98a2821 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c | |||
| @@ -851,8 +851,10 @@ int dasd_start_IO(struct dasd_ccw_req *cqr) | |||
| 851 | 851 | ||
| 852 | /* Check the cqr */ | 852 | /* Check the cqr */ |
| 853 | rc = dasd_check_cqr(cqr); | 853 | rc = dasd_check_cqr(cqr); |
| 854 | if (rc) | 854 | if (rc) { |
| 855 | cqr->intrc = rc; | ||
| 855 | return rc; | 856 | return rc; |
| 857 | } | ||
| 856 | device = (struct dasd_device *) cqr->startdev; | 858 | device = (struct dasd_device *) cqr->startdev; |
| 857 | if (cqr->retries < 0) { | 859 | if (cqr->retries < 0) { |
| 858 | /* internal error 14 - start_IO run out of retries */ | 860 | /* internal error 14 - start_IO run out of retries */ |
| @@ -915,6 +917,7 @@ int dasd_start_IO(struct dasd_ccw_req *cqr) | |||
| 915 | BUG(); | 917 | BUG(); |
| 916 | break; | 918 | break; |
| 917 | } | 919 | } |
| 920 | cqr->intrc = rc; | ||
| 918 | return rc; | 921 | return rc; |
| 919 | } | 922 | } |
| 920 | 923 | ||
| @@ -1454,8 +1457,12 @@ int dasd_sleep_on(struct dasd_ccw_req *cqr) | |||
| 1454 | dasd_add_request_tail(cqr); | 1457 | dasd_add_request_tail(cqr); |
| 1455 | wait_event(generic_waitq, _wait_for_wakeup(cqr)); | 1458 | wait_event(generic_waitq, _wait_for_wakeup(cqr)); |
| 1456 | 1459 | ||
| 1457 | /* Request status is either done or failed. */ | 1460 | if (cqr->status == DASD_CQR_DONE) |
| 1458 | rc = (cqr->status == DASD_CQR_DONE) ? 0 : -EIO; | 1461 | rc = 0; |
| 1462 | else if (cqr->intrc) | ||
| 1463 | rc = cqr->intrc; | ||
| 1464 | else | ||
| 1465 | rc = -EIO; | ||
| 1459 | return rc; | 1466 | return rc; |
| 1460 | } | 1467 | } |
| 1461 | 1468 | ||
| @@ -1477,8 +1484,15 @@ int dasd_sleep_on_interruptible(struct dasd_ccw_req *cqr) | |||
| 1477 | dasd_cancel_req(cqr); | 1484 | dasd_cancel_req(cqr); |
| 1478 | /* wait (non-interruptible) for final status */ | 1485 | /* wait (non-interruptible) for final status */ |
| 1479 | wait_event(generic_waitq, _wait_for_wakeup(cqr)); | 1486 | wait_event(generic_waitq, _wait_for_wakeup(cqr)); |
| 1487 | cqr->intrc = rc; | ||
| 1480 | } | 1488 | } |
| 1481 | rc = (cqr->status == DASD_CQR_DONE) ? 0 : -EIO; | 1489 | |
| 1490 | if (cqr->status == DASD_CQR_DONE) | ||
| 1491 | rc = 0; | ||
| 1492 | else if (cqr->intrc) | ||
| 1493 | rc = cqr->intrc; | ||
| 1494 | else | ||
| 1495 | rc = -EIO; | ||
| 1482 | return rc; | 1496 | return rc; |
| 1483 | } | 1497 | } |
| 1484 | 1498 | ||
| @@ -1523,8 +1537,12 @@ int dasd_sleep_on_immediatly(struct dasd_ccw_req *cqr) | |||
| 1523 | 1537 | ||
| 1524 | wait_event(generic_waitq, _wait_for_wakeup(cqr)); | 1538 | wait_event(generic_waitq, _wait_for_wakeup(cqr)); |
| 1525 | 1539 | ||
| 1526 | /* Request status is either done or failed. */ | 1540 | if (cqr->status == DASD_CQR_DONE) |
| 1527 | rc = (cqr->status == DASD_CQR_DONE) ? 0 : -EIO; | 1541 | rc = 0; |
| 1542 | else if (cqr->intrc) | ||
| 1543 | rc = cqr->intrc; | ||
| 1544 | else | ||
| 1545 | rc = -EIO; | ||
| 1528 | return rc; | 1546 | return rc; |
| 1529 | } | 1547 | } |
| 1530 | 1548 | ||
| @@ -2427,12 +2445,12 @@ static struct dasd_ccw_req *dasd_generic_build_rdc(struct dasd_device *device, | |||
| 2427 | 2445 | ||
| 2428 | 2446 | ||
| 2429 | int dasd_generic_read_dev_chars(struct dasd_device *device, char *magic, | 2447 | int dasd_generic_read_dev_chars(struct dasd_device *device, char *magic, |
| 2430 | void **rdc_buffer, int rdc_buffer_size) | 2448 | void *rdc_buffer, int rdc_buffer_size) |
| 2431 | { | 2449 | { |
| 2432 | int ret; | 2450 | int ret; |
| 2433 | struct dasd_ccw_req *cqr; | 2451 | struct dasd_ccw_req *cqr; |
| 2434 | 2452 | ||
| 2435 | cqr = dasd_generic_build_rdc(device, *rdc_buffer, rdc_buffer_size, | 2453 | cqr = dasd_generic_build_rdc(device, rdc_buffer, rdc_buffer_size, |
| 2436 | magic); | 2454 | magic); |
| 2437 | if (IS_ERR(cqr)) | 2455 | if (IS_ERR(cqr)) |
| 2438 | return PTR_ERR(cqr); | 2456 | return PTR_ERR(cqr); |
