aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/block
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/block')
-rw-r--r--drivers/s390/block/dasd.c71
-rw-r--r--drivers/s390/block/dasd_diag.c6
-rw-r--r--drivers/s390/block/dasd_eckd.c50
-rw-r--r--drivers/s390/block/dasd_fba.c29
-rw-r--r--drivers/s390/block/dasd_int.h3
-rw-r--r--drivers/s390/block/dcssblk.c6
-rw-r--r--drivers/s390/block/xpram.c2
7 files changed, 96 insertions, 71 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index d1815272c435..442bb98a2821 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -603,7 +603,7 @@ static void dasd_profile_end(struct dasd_block *block,
603 if (dasd_profile_level != DASD_PROFILE_ON) 603 if (dasd_profile_level != DASD_PROFILE_ON)
604 return; 604 return;
605 605
606 sectors = req->nr_sectors; 606 sectors = blk_rq_sectors(req);
607 if (!cqr->buildclk || !cqr->startclk || 607 if (!cqr->buildclk || !cqr->startclk ||
608 !cqr->stopclk || !cqr->endclk || 608 !cqr->stopclk || !cqr->endclk ||
609 !sectors) 609 !sectors)
@@ -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
@@ -1614,15 +1632,6 @@ void dasd_block_clear_timer(struct dasd_block *block)
1614} 1632}
1615 1633
1616/* 1634/*
1617 * posts the buffer_cache about a finalized request
1618 */
1619static inline void dasd_end_request(struct request *req, int error)
1620{
1621 if (__blk_end_request(req, error, blk_rq_bytes(req)))
1622 BUG();
1623}
1624
1625/*
1626 * Process finished error recovery ccw. 1635 * Process finished error recovery ccw.
1627 */ 1636 */
1628static inline void __dasd_block_process_erp(struct dasd_block *block, 1637static inline void __dasd_block_process_erp(struct dasd_block *block,
@@ -1665,18 +1674,14 @@ static void __dasd_process_request_queue(struct dasd_block *block)
1665 if (basedev->state < DASD_STATE_READY) 1674 if (basedev->state < DASD_STATE_READY)
1666 return; 1675 return;
1667 /* Now we try to fetch requests from the request queue */ 1676 /* Now we try to fetch requests from the request queue */
1668 while (!blk_queue_plugged(queue) && 1677 while (!blk_queue_plugged(queue) && (req = blk_peek_request(queue))) {
1669 elv_next_request(queue)) {
1670
1671 req = elv_next_request(queue);
1672
1673 if (basedev->features & DASD_FEATURE_READONLY && 1678 if (basedev->features & DASD_FEATURE_READONLY &&
1674 rq_data_dir(req) == WRITE) { 1679 rq_data_dir(req) == WRITE) {
1675 DBF_DEV_EVENT(DBF_ERR, basedev, 1680 DBF_DEV_EVENT(DBF_ERR, basedev,
1676 "Rejecting write request %p", 1681 "Rejecting write request %p",
1677 req); 1682 req);
1678 blkdev_dequeue_request(req); 1683 blk_start_request(req);
1679 dasd_end_request(req, -EIO); 1684 __blk_end_request_all(req, -EIO);
1680 continue; 1685 continue;
1681 } 1686 }
1682 cqr = basedev->discipline->build_cp(basedev, block, req); 1687 cqr = basedev->discipline->build_cp(basedev, block, req);
@@ -1704,8 +1709,8 @@ static void __dasd_process_request_queue(struct dasd_block *block)
1704 "CCW creation failed (rc=%ld) " 1709 "CCW creation failed (rc=%ld) "
1705 "on request %p", 1710 "on request %p",
1706 PTR_ERR(cqr), req); 1711 PTR_ERR(cqr), req);
1707 blkdev_dequeue_request(req); 1712 blk_start_request(req);
1708 dasd_end_request(req, -EIO); 1713 __blk_end_request_all(req, -EIO);
1709 continue; 1714 continue;
1710 } 1715 }
1711 /* 1716 /*
@@ -1714,7 +1719,7 @@ static void __dasd_process_request_queue(struct dasd_block *block)
1714 */ 1719 */
1715 cqr->callback_data = (void *) req; 1720 cqr->callback_data = (void *) req;
1716 cqr->status = DASD_CQR_FILLED; 1721 cqr->status = DASD_CQR_FILLED;
1717 blkdev_dequeue_request(req); 1722 blk_start_request(req);
1718 list_add_tail(&cqr->blocklist, &block->ccw_queue); 1723 list_add_tail(&cqr->blocklist, &block->ccw_queue);
1719 dasd_profile_start(block, cqr, req); 1724 dasd_profile_start(block, cqr, req);
1720 } 1725 }
@@ -1731,7 +1736,7 @@ static void __dasd_cleanup_cqr(struct dasd_ccw_req *cqr)
1731 status = cqr->block->base->discipline->free_cp(cqr, req); 1736 status = cqr->block->base->discipline->free_cp(cqr, req);
1732 if (status <= 0) 1737 if (status <= 0)
1733 error = status ? status : -EIO; 1738 error = status ? status : -EIO;
1734 dasd_end_request(req, error); 1739 __blk_end_request_all(req, error);
1735} 1740}
1736 1741
1737/* 1742/*
@@ -2003,7 +2008,7 @@ static void dasd_setup_queue(struct dasd_block *block)
2003{ 2008{
2004 int max; 2009 int max;
2005 2010
2006 blk_queue_hardsect_size(block->request_queue, block->bp_block); 2011 blk_queue_logical_block_size(block->request_queue, block->bp_block);
2007 max = block->base->discipline->max_blocks << block->s2b_shift; 2012 max = block->base->discipline->max_blocks << block->s2b_shift;
2008 blk_queue_max_sectors(block->request_queue, max); 2013 blk_queue_max_sectors(block->request_queue, max);
2009 blk_queue_max_phys_segments(block->request_queue, -1L); 2014 blk_queue_max_phys_segments(block->request_queue, -1L);
@@ -2038,10 +2043,8 @@ static void dasd_flush_request_queue(struct dasd_block *block)
2038 return; 2043 return;
2039 2044
2040 spin_lock_irq(&block->request_queue_lock); 2045 spin_lock_irq(&block->request_queue_lock);
2041 while ((req = elv_next_request(block->request_queue))) { 2046 while ((req = blk_fetch_request(block->request_queue)))
2042 blkdev_dequeue_request(req); 2047 __blk_end_request_all(req, -EIO);
2043 dasd_end_request(req, -EIO);
2044 }
2045 spin_unlock_irq(&block->request_queue_lock); 2048 spin_unlock_irq(&block->request_queue_lock);
2046} 2049}
2047 2050
@@ -2442,12 +2445,12 @@ static struct dasd_ccw_req *dasd_generic_build_rdc(struct dasd_device *device,
2442 2445
2443 2446
2444int dasd_generic_read_dev_chars(struct dasd_device *device, char *magic, 2447int dasd_generic_read_dev_chars(struct dasd_device *device, char *magic,
2445 void **rdc_buffer, int rdc_buffer_size) 2448 void *rdc_buffer, int rdc_buffer_size)
2446{ 2449{
2447 int ret; 2450 int ret;
2448 struct dasd_ccw_req *cqr; 2451 struct dasd_ccw_req *cqr;
2449 2452
2450 cqr = dasd_generic_build_rdc(device, *rdc_buffer, rdc_buffer_size, 2453 cqr = dasd_generic_build_rdc(device, rdc_buffer, rdc_buffer_size,
2451 magic); 2454 magic);
2452 if (IS_ERR(cqr)) 2455 if (IS_ERR(cqr))
2453 return PTR_ERR(cqr); 2456 return PTR_ERR(cqr);
diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c
index b9a7f7733446..644086ba2ede 100644
--- a/drivers/s390/block/dasd_diag.c
+++ b/drivers/s390/block/dasd_diag.c
@@ -202,6 +202,7 @@ dasd_start_diag(struct dasd_ccw_req * cqr)
202 rc = -EIO; 202 rc = -EIO;
203 break; 203 break;
204 } 204 }
205 cqr->intrc = rc;
205 return rc; 206 return rc;
206} 207}
207 208
@@ -505,8 +506,9 @@ static struct dasd_ccw_req *dasd_diag_build_cp(struct dasd_device *memdev,
505 return ERR_PTR(-EINVAL); 506 return ERR_PTR(-EINVAL);
506 blksize = block->bp_block; 507 blksize = block->bp_block;
507 /* Calculate record id of first and last block. */ 508 /* Calculate record id of first and last block. */
508 first_rec = req->sector >> block->s2b_shift; 509 first_rec = blk_rq_pos(req) >> block->s2b_shift;
509 last_rec = (req->sector + req->nr_sectors - 1) >> block->s2b_shift; 510 last_rec =
511 (blk_rq_pos(req) + blk_rq_sectors(req) - 1) >> block->s2b_shift;
510 /* Check struct bio and count the number of blocks for the request. */ 512 /* Check struct bio and count the number of blocks for the request. */
511 count = 0; 513 count = 0;
512 rq_for_each_segment(bv, req, iter) { 514 rq_for_each_segment(bv, req, iter) {
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index cb52da033f06..cf0cfdba1244 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -1097,20 +1097,20 @@ dasd_eckd_check_characteristics(struct dasd_device *device)
1097{ 1097{
1098 struct dasd_eckd_private *private; 1098 struct dasd_eckd_private *private;
1099 struct dasd_block *block; 1099 struct dasd_block *block;
1100 void *rdc_data;
1101 int is_known, rc; 1100 int is_known, rc;
1102 1101
1103 private = (struct dasd_eckd_private *) device->private; 1102 private = (struct dasd_eckd_private *) device->private;
1104 if (private == NULL) { 1103 if (!private) {
1105 private = kzalloc(sizeof(struct dasd_eckd_private), 1104 private = kzalloc(sizeof(*private), GFP_KERNEL | GFP_DMA);
1106 GFP_KERNEL | GFP_DMA); 1105 if (!private) {
1107 if (private == NULL) {
1108 dev_warn(&device->cdev->dev, 1106 dev_warn(&device->cdev->dev,
1109 "Allocating memory for private DASD data " 1107 "Allocating memory for private DASD data "
1110 "failed\n"); 1108 "failed\n");
1111 return -ENOMEM; 1109 return -ENOMEM;
1112 } 1110 }
1113 device->private = (void *) private; 1111 device->private = (void *) private;
1112 } else {
1113 memset(private, 0, sizeof(*private));
1114 } 1114 }
1115 /* Invalidate status of initial analysis. */ 1115 /* Invalidate status of initial analysis. */
1116 private->init_cqr_status = -1; 1116 private->init_cqr_status = -1;
@@ -1161,9 +1161,8 @@ dasd_eckd_check_characteristics(struct dasd_device *device)
1161 goto out_err3; 1161 goto out_err3;
1162 1162
1163 /* Read Device Characteristics */ 1163 /* Read Device Characteristics */
1164 rdc_data = (void *) &(private->rdc_data); 1164 rc = dasd_generic_read_dev_chars(device, "ECKD", &private->rdc_data,
1165 memset(rdc_data, 0, sizeof(rdc_data)); 1165 64);
1166 rc = dasd_generic_read_dev_chars(device, "ECKD", &rdc_data, 64);
1167 if (rc) { 1166 if (rc) {
1168 DBF_EVENT(DBF_WARNING, 1167 DBF_EVENT(DBF_WARNING,
1169 "Read device characteristics failed, rc=%d for " 1168 "Read device characteristics failed, rc=%d for "
@@ -1183,7 +1182,7 @@ dasd_eckd_check_characteristics(struct dasd_device *device)
1183 private->rdc_data.dev_model, 1182 private->rdc_data.dev_model,
1184 private->rdc_data.cu_type, 1183 private->rdc_data.cu_type,
1185 private->rdc_data.cu_model.model, 1184 private->rdc_data.cu_model.model,
1186 private->real_cyl, 1185 private->real_cyl,
1187 private->rdc_data.trk_per_cyl, 1186 private->rdc_data.trk_per_cyl,
1188 private->rdc_data.sec_per_trk); 1187 private->rdc_data.sec_per_trk);
1189 return 0; 1188 return 0;
@@ -2336,9 +2335,10 @@ static struct dasd_ccw_req *dasd_eckd_build_cp(struct dasd_device *startdev,
2336{ 2335{
2337 int tpm, cmdrtd, cmdwtd; 2336 int tpm, cmdrtd, cmdwtd;
2338 int use_prefix; 2337 int use_prefix;
2339 2338#if defined(CONFIG_64BIT)
2340 struct dasd_eckd_private *private;
2341 int fcx_in_css, fcx_in_gneq, fcx_in_features; 2339 int fcx_in_css, fcx_in_gneq, fcx_in_features;
2340#endif
2341 struct dasd_eckd_private *private;
2342 struct dasd_device *basedev; 2342 struct dasd_device *basedev;
2343 sector_t first_rec, last_rec; 2343 sector_t first_rec, last_rec;
2344 sector_t first_trk, last_trk; 2344 sector_t first_trk, last_trk;
@@ -2354,18 +2354,22 @@ static struct dasd_ccw_req *dasd_eckd_build_cp(struct dasd_device *startdev,
2354 blksize = block->bp_block; 2354 blksize = block->bp_block;
2355 blk_per_trk = recs_per_track(&private->rdc_data, 0, blksize); 2355 blk_per_trk = recs_per_track(&private->rdc_data, 0, blksize);
2356 /* Calculate record id of first and last block. */ 2356 /* Calculate record id of first and last block. */
2357 first_rec = first_trk = req->sector >> block->s2b_shift; 2357 first_rec = first_trk = blk_rq_pos(req) >> block->s2b_shift;
2358 first_offs = sector_div(first_trk, blk_per_trk); 2358 first_offs = sector_div(first_trk, blk_per_trk);
2359 last_rec = last_trk = 2359 last_rec = last_trk =
2360 (req->sector + req->nr_sectors - 1) >> block->s2b_shift; 2360 (blk_rq_pos(req) + blk_rq_sectors(req) - 1) >> block->s2b_shift;
2361 last_offs = sector_div(last_trk, blk_per_trk); 2361 last_offs = sector_div(last_trk, blk_per_trk);
2362 cdlspecial = (private->uses_cdl && first_rec < 2*blk_per_trk); 2362 cdlspecial = (private->uses_cdl && first_rec < 2*blk_per_trk);
2363 2363
2364 /* is transport mode supported ? */ 2364 /* is transport mode supported? */
2365#if defined(CONFIG_64BIT)
2365 fcx_in_css = css_general_characteristics.fcx; 2366 fcx_in_css = css_general_characteristics.fcx;
2366 fcx_in_gneq = private->gneq->reserved2[7] & 0x04; 2367 fcx_in_gneq = private->gneq->reserved2[7] & 0x04;
2367 fcx_in_features = private->features.feature[40] & 0x80; 2368 fcx_in_features = private->features.feature[40] & 0x80;
2368 tpm = fcx_in_css && fcx_in_gneq && fcx_in_features; 2369 tpm = fcx_in_css && fcx_in_gneq && fcx_in_features;
2370#else
2371 tpm = 0;
2372#endif
2369 2373
2370 /* is read track data and write track data in command mode supported? */ 2374 /* is read track data and write track data in command mode supported? */
2371 cmdrtd = private->features.feature[9] & 0x20; 2375 cmdrtd = private->features.feature[9] & 0x20;
@@ -2420,7 +2424,7 @@ dasd_eckd_free_cp(struct dasd_ccw_req *cqr, struct request *req)
2420 private = (struct dasd_eckd_private *) cqr->block->base->private; 2424 private = (struct dasd_eckd_private *) cqr->block->base->private;
2421 blksize = cqr->block->bp_block; 2425 blksize = cqr->block->bp_block;
2422 blk_per_trk = recs_per_track(&private->rdc_data, 0, blksize); 2426 blk_per_trk = recs_per_track(&private->rdc_data, 0, blksize);
2423 recid = req->sector >> cqr->block->s2b_shift; 2427 recid = blk_rq_pos(req) >> cqr->block->s2b_shift;
2424 ccw = cqr->cpaddr; 2428 ccw = cqr->cpaddr;
2425 /* Skip over define extent & locate record. */ 2429 /* Skip over define extent & locate record. */
2426 ccw++; 2430 ccw++;
@@ -3013,8 +3017,9 @@ static void dasd_eckd_dump_sense_ccw(struct dasd_device *device,
3013 " I/O status report for device %s:\n", 3017 " I/O status report for device %s:\n",
3014 dev_name(&device->cdev->dev)); 3018 dev_name(&device->cdev->dev));
3015 len += sprintf(page + len, KERN_ERR PRINTK_HEADER 3019 len += sprintf(page + len, KERN_ERR PRINTK_HEADER
3016 " in req: %p CS: 0x%02X DS: 0x%02X\n", req, 3020 " in req: %p CS: 0x%02X DS: 0x%02X CC: 0x%02X RC: %d\n",
3017 scsw_cstat(&irb->scsw), scsw_dstat(&irb->scsw)); 3021 req, scsw_cstat(&irb->scsw), scsw_dstat(&irb->scsw),
3022 scsw_cc(&irb->scsw), req->intrc);
3018 len += sprintf(page + len, KERN_ERR PRINTK_HEADER 3023 len += sprintf(page + len, KERN_ERR PRINTK_HEADER
3019 " device %s: Failing CCW: %p\n", 3024 " device %s: Failing CCW: %p\n",
3020 dev_name(&device->cdev->dev), 3025 dev_name(&device->cdev->dev),
@@ -3115,9 +3120,10 @@ static void dasd_eckd_dump_sense_tcw(struct dasd_device *device,
3115 " I/O status report for device %s:\n", 3120 " I/O status report for device %s:\n",
3116 dev_name(&device->cdev->dev)); 3121 dev_name(&device->cdev->dev));
3117 len += sprintf(page + len, KERN_ERR PRINTK_HEADER 3122 len += sprintf(page + len, KERN_ERR PRINTK_HEADER
3118 " in req: %p CS: 0x%02X DS: 0x%02X " 3123 " in req: %p CS: 0x%02X DS: 0x%02X CC: 0x%02X RC: %d "
3119 "fcxs: 0x%02X schxs: 0x%02X\n", req, 3124 "fcxs: 0x%02X schxs: 0x%02X\n", req,
3120 scsw_cstat(&irb->scsw), scsw_dstat(&irb->scsw), 3125 scsw_cstat(&irb->scsw), scsw_dstat(&irb->scsw),
3126 scsw_cc(&irb->scsw), req->intrc,
3121 irb->scsw.tm.fcxs, irb->scsw.tm.schxs); 3127 irb->scsw.tm.fcxs, irb->scsw.tm.schxs);
3122 len += sprintf(page + len, KERN_ERR PRINTK_HEADER 3128 len += sprintf(page + len, KERN_ERR PRINTK_HEADER
3123 " device %s: Failing TCW: %p\n", 3129 " device %s: Failing TCW: %p\n",
@@ -3273,8 +3279,14 @@ static struct dasd_discipline dasd_eckd_discipline = {
3273static int __init 3279static int __init
3274dasd_eckd_init(void) 3280dasd_eckd_init(void)
3275{ 3281{
3282 int ret;
3283
3276 ASCEBC(dasd_eckd_discipline.ebcname, 4); 3284 ASCEBC(dasd_eckd_discipline.ebcname, 4);
3277 return ccw_driver_register(&dasd_eckd_driver); 3285 ret = ccw_driver_register(&dasd_eckd_driver);
3286 if (!ret)
3287 wait_for_device_probe();
3288
3289 return ret;
3278} 3290}
3279 3291
3280static void __exit 3292static void __exit
diff --git a/drivers/s390/block/dasd_fba.c b/drivers/s390/block/dasd_fba.c
index a3eb6fd14673..597c6ffdb9f2 100644
--- a/drivers/s390/block/dasd_fba.c
+++ b/drivers/s390/block/dasd_fba.c
@@ -122,20 +122,20 @@ dasd_fba_check_characteristics(struct dasd_device *device)
122 struct dasd_block *block; 122 struct dasd_block *block;
123 struct dasd_fba_private *private; 123 struct dasd_fba_private *private;
124 struct ccw_device *cdev = device->cdev; 124 struct ccw_device *cdev = device->cdev;
125 void *rdc_data;
126 int rc; 125 int rc;
127 126
128 private = (struct dasd_fba_private *) device->private; 127 private = (struct dasd_fba_private *) device->private;
129 if (private == NULL) { 128 if (!private) {
130 private = kzalloc(sizeof(struct dasd_fba_private), 129 private = kzalloc(sizeof(*private), GFP_KERNEL | GFP_DMA);
131 GFP_KERNEL | GFP_DMA); 130 if (!private) {
132 if (private == NULL) {
133 dev_warn(&device->cdev->dev, 131 dev_warn(&device->cdev->dev,
134 "Allocating memory for private DASD " 132 "Allocating memory for private DASD "
135 "data failed\n"); 133 "data failed\n");
136 return -ENOMEM; 134 return -ENOMEM;
137 } 135 }
138 device->private = (void *) private; 136 device->private = (void *) private;
137 } else {
138 memset(private, 0, sizeof(*private));
139 } 139 }
140 block = dasd_alloc_block(); 140 block = dasd_alloc_block();
141 if (IS_ERR(block)) { 141 if (IS_ERR(block)) {
@@ -150,8 +150,8 @@ dasd_fba_check_characteristics(struct dasd_device *device)
150 block->base = device; 150 block->base = device;
151 151
152 /* Read Device Characteristics */ 152 /* Read Device Characteristics */
153 rdc_data = (void *) &(private->rdc_data); 153 rc = dasd_generic_read_dev_chars(device, "FBA ", &private->rdc_data,
154 rc = dasd_generic_read_dev_chars(device, "FBA ", &rdc_data, 32); 154 32);
155 if (rc) { 155 if (rc) {
156 DBF_EVENT(DBF_WARNING, "Read device characteristics returned " 156 DBF_EVENT(DBF_WARNING, "Read device characteristics returned "
157 "error %d for device: %s", 157 "error %d for device: %s",
@@ -270,8 +270,9 @@ static struct dasd_ccw_req *dasd_fba_build_cp(struct dasd_device * memdev,
270 return ERR_PTR(-EINVAL); 270 return ERR_PTR(-EINVAL);
271 blksize = block->bp_block; 271 blksize = block->bp_block;
272 /* Calculate record id of first and last block. */ 272 /* Calculate record id of first and last block. */
273 first_rec = req->sector >> block->s2b_shift; 273 first_rec = blk_rq_pos(req) >> block->s2b_shift;
274 last_rec = (req->sector + req->nr_sectors - 1) >> block->s2b_shift; 274 last_rec =
275 (blk_rq_pos(req) + blk_rq_sectors(req) - 1) >> block->s2b_shift;
275 /* Check struct bio and count the number of blocks for the request. */ 276 /* Check struct bio and count the number of blocks for the request. */
276 count = 0; 277 count = 0;
277 cidaw = 0; 278 cidaw = 0;
@@ -309,7 +310,7 @@ static struct dasd_ccw_req *dasd_fba_build_cp(struct dasd_device * memdev,
309 ccw = cqr->cpaddr; 310 ccw = cqr->cpaddr;
310 /* First ccw is define extent. */ 311 /* First ccw is define extent. */
311 define_extent(ccw++, cqr->data, rq_data_dir(req), 312 define_extent(ccw++, cqr->data, rq_data_dir(req),
312 block->bp_block, req->sector, req->nr_sectors); 313 block->bp_block, blk_rq_pos(req), blk_rq_sectors(req));
313 /* Build locate_record + read/write ccws. */ 314 /* Build locate_record + read/write ccws. */
314 idaws = (unsigned long *) (cqr->data + sizeof(struct DE_fba_data)); 315 idaws = (unsigned long *) (cqr->data + sizeof(struct DE_fba_data));
315 LO_data = (struct LO_fba_data *) (idaws + cidaw); 316 LO_data = (struct LO_fba_data *) (idaws + cidaw);
@@ -603,8 +604,14 @@ static struct dasd_discipline dasd_fba_discipline = {
603static int __init 604static int __init
604dasd_fba_init(void) 605dasd_fba_init(void)
605{ 606{
607 int ret;
608
606 ASCEBC(dasd_fba_discipline.ebcname, 4); 609 ASCEBC(dasd_fba_discipline.ebcname, 4);
607 return ccw_driver_register(&dasd_fba_driver); 610 ret = ccw_driver_register(&dasd_fba_driver);
611 if (!ret)
612 wait_for_device_probe();
613
614 return ret;
608} 615}
609 616
610static void __exit 617static void __exit
diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h
index c1e487f774c6..f97ceb795078 100644
--- a/drivers/s390/block/dasd_int.h
+++ b/drivers/s390/block/dasd_int.h
@@ -173,6 +173,7 @@ struct dasd_ccw_req {
173 void *data; /* pointer to data area */ 173 void *data; /* pointer to data area */
174 174
175 /* these are important for recovering erroneous requests */ 175 /* these are important for recovering erroneous requests */
176 int intrc; /* internal error, e.g. from start_IO */
176 struct irb irb; /* device status in case of an error */ 177 struct irb irb; /* device status in case of an error */
177 struct dasd_ccw_req *refers; /* ERP-chain queueing. */ 178 struct dasd_ccw_req *refers; /* ERP-chain queueing. */
178 void *function; /* originating ERP action */ 179 void *function; /* originating ERP action */
@@ -578,7 +579,7 @@ int dasd_generic_set_offline (struct ccw_device *cdev);
578int dasd_generic_notify(struct ccw_device *, int); 579int dasd_generic_notify(struct ccw_device *, int);
579void dasd_generic_handle_state_change(struct dasd_device *); 580void dasd_generic_handle_state_change(struct dasd_device *);
580 581
581int dasd_generic_read_dev_chars(struct dasd_device *, char *, void **, int); 582int dasd_generic_read_dev_chars(struct dasd_device *, char *, void *, int);
582char *dasd_get_sense(struct irb *); 583char *dasd_get_sense(struct irb *);
583 584
584/* externals in dasd_devmap.c */ 585/* externals in dasd_devmap.c */
diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c
index cfdcf1aed33c..b21caf177e37 100644
--- a/drivers/s390/block/dcssblk.c
+++ b/drivers/s390/block/dcssblk.c
@@ -127,7 +127,7 @@ dcssblk_assign_free_minor(struct dcssblk_dev_info *dev_info)
127 found = 0; 127 found = 0;
128 // test if minor available 128 // test if minor available
129 list_for_each_entry(entry, &dcssblk_devices, lh) 129 list_for_each_entry(entry, &dcssblk_devices, lh)
130 if (minor == MINOR(disk_devt(entry->gd))) 130 if (minor == entry->gd->first_minor)
131 found++; 131 found++;
132 if (!found) break; // got unused minor 132 if (!found) break; // got unused minor
133 } 133 }
@@ -602,7 +602,7 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char
602 dev_info->gd->private_data = dev_info; 602 dev_info->gd->private_data = dev_info;
603 dev_info->gd->driverfs_dev = &dev_info->dev; 603 dev_info->gd->driverfs_dev = &dev_info->dev;
604 blk_queue_make_request(dev_info->dcssblk_queue, dcssblk_make_request); 604 blk_queue_make_request(dev_info->dcssblk_queue, dcssblk_make_request);
605 blk_queue_hardsect_size(dev_info->dcssblk_queue, 4096); 605 blk_queue_logical_block_size(dev_info->dcssblk_queue, 4096);
606 606
607 seg_byte_size = (dev_info->end - dev_info->start + 1); 607 seg_byte_size = (dev_info->end - dev_info->start + 1);
608 set_capacity(dev_info->gd, seg_byte_size >> 9); // size in sectors 608 set_capacity(dev_info->gd, seg_byte_size >> 9); // size in sectors
@@ -625,7 +625,7 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char
625 if (rc) 625 if (rc)
626 goto release_gd; 626 goto release_gd;
627 sprintf(dev_info->gd->disk_name, "dcssblk%d", 627 sprintf(dev_info->gd->disk_name, "dcssblk%d",
628 MINOR(disk_devt(dev_info->gd))); 628 dev_info->gd->first_minor);
629 list_add_tail(&dev_info->lh, &dcssblk_devices); 629 list_add_tail(&dev_info->lh, &dcssblk_devices);
630 630
631 if (!try_module_get(THIS_MODULE)) { 631 if (!try_module_get(THIS_MODULE)) {
diff --git a/drivers/s390/block/xpram.c b/drivers/s390/block/xpram.c
index 76814f3e898a..0ae0c83ef879 100644
--- a/drivers/s390/block/xpram.c
+++ b/drivers/s390/block/xpram.c
@@ -343,7 +343,7 @@ static int __init xpram_setup_blkdev(void)
343 goto out; 343 goto out;
344 } 344 }
345 blk_queue_make_request(xpram_queues[i], xpram_make_request); 345 blk_queue_make_request(xpram_queues[i], xpram_make_request);
346 blk_queue_hardsect_size(xpram_queues[i], 4096); 346 blk_queue_logical_block_size(xpram_queues[i], 4096);
347 } 347 }
348 348
349 /* 349 /*