diff options
author | David S. Miller <davem@davemloft.net> | 2009-06-15 06:02:23 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-15 06:02:23 -0400 |
commit | 9cbc1cb8cd46ce1f7645b9de249b2ce8460129bb (patch) | |
tree | 8d104ec2a459346b99413b0b77421ca7b9936c1a /drivers/s390 | |
parent | ca44d6e60f9de26281fda203f58b570e1748c015 (diff) | |
parent | 45e3e1935e2857c54783291107d33323b3ef33c8 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
Documentation/feature-removal-schedule.txt
drivers/scsi/fcoe/fcoe.c
net/core/drop_monitor.c
net/core/net-traces.c
Diffstat (limited to 'drivers/s390')
27 files changed, 282 insertions, 272 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 | */ | ||
1619 | static 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 | */ |
1628 | static inline void __dasd_block_process_erp(struct dasd_block *block, | 1637 | static 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 | ||
2444 | 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, |
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 = { | |||
3273 | static int __init | 3279 | static int __init |
3274 | dasd_eckd_init(void) | 3280 | dasd_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 | ||
3280 | static void __exit | 3292 | static 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 = { | |||
603 | static int __init | 604 | static int __init |
604 | dasd_fba_init(void) | 605 | dasd_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 | ||
610 | static void __exit | 617 | static 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); | |||
578 | int dasd_generic_notify(struct ccw_device *, int); | 579 | int dasd_generic_notify(struct ccw_device *, int); |
579 | void dasd_generic_handle_state_change(struct dasd_device *); | 580 | void dasd_generic_handle_state_change(struct dasd_device *); |
580 | 581 | ||
581 | int dasd_generic_read_dev_chars(struct dasd_device *, char *, void **, int); | 582 | int dasd_generic_read_dev_chars(struct dasd_device *, char *, void *, int); |
582 | char *dasd_get_sense(struct irb *); | 583 | char *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 | /* |
diff --git a/drivers/s390/char/con3270.c b/drivers/s390/char/con3270.c index d028d2ee83dd..ed5396dae58e 100644 --- a/drivers/s390/char/con3270.c +++ b/drivers/s390/char/con3270.c | |||
@@ -64,7 +64,7 @@ static struct con3270 *condev; | |||
64 | #define CON_UPDATE_ERASE 1 /* Use EWRITEA instead of WRITE. */ | 64 | #define CON_UPDATE_ERASE 1 /* Use EWRITEA instead of WRITE. */ |
65 | #define CON_UPDATE_LIST 2 /* Update lines in tty3270->update. */ | 65 | #define CON_UPDATE_LIST 2 /* Update lines in tty3270->update. */ |
66 | #define CON_UPDATE_STATUS 4 /* Update status line. */ | 66 | #define CON_UPDATE_STATUS 4 /* Update status line. */ |
67 | #define CON_UPDATE_ALL 7 | 67 | #define CON_UPDATE_ALL 8 /* Recreate screen. */ |
68 | 68 | ||
69 | static void con3270_update(struct con3270 *); | 69 | static void con3270_update(struct con3270 *); |
70 | 70 | ||
@@ -73,18 +73,10 @@ static void con3270_update(struct con3270 *); | |||
73 | */ | 73 | */ |
74 | static void con3270_set_timer(struct con3270 *cp, int expires) | 74 | static void con3270_set_timer(struct con3270 *cp, int expires) |
75 | { | 75 | { |
76 | if (expires == 0) { | 76 | if (expires == 0) |
77 | if (timer_pending(&cp->timer)) | 77 | del_timer(&cp->timer); |
78 | del_timer(&cp->timer); | 78 | else |
79 | return; | 79 | mod_timer(&cp->timer, jiffies + expires); |
80 | } | ||
81 | if (timer_pending(&cp->timer) && | ||
82 | mod_timer(&cp->timer, jiffies + expires)) | ||
83 | return; | ||
84 | cp->timer.function = (void (*)(unsigned long)) con3270_update; | ||
85 | cp->timer.data = (unsigned long) cp; | ||
86 | cp->timer.expires = jiffies + expires; | ||
87 | add_timer(&cp->timer); | ||
88 | } | 80 | } |
89 | 81 | ||
90 | /* | 82 | /* |
@@ -225,6 +217,12 @@ con3270_update(struct con3270 *cp) | |||
225 | 217 | ||
226 | spin_lock_irqsave(&cp->view.lock, flags); | 218 | spin_lock_irqsave(&cp->view.lock, flags); |
227 | updated = 0; | 219 | updated = 0; |
220 | if (cp->update_flags & CON_UPDATE_ALL) { | ||
221 | con3270_rebuild_update(cp); | ||
222 | con3270_update_status(cp); | ||
223 | cp->update_flags = CON_UPDATE_ERASE | CON_UPDATE_LIST | | ||
224 | CON_UPDATE_STATUS; | ||
225 | } | ||
228 | if (cp->update_flags & CON_UPDATE_ERASE) { | 226 | if (cp->update_flags & CON_UPDATE_ERASE) { |
229 | /* Use erase write alternate to initialize display. */ | 227 | /* Use erase write alternate to initialize display. */ |
230 | raw3270_request_set_cmd(wrq, TC_EWRITEA); | 228 | raw3270_request_set_cmd(wrq, TC_EWRITEA); |
@@ -302,7 +300,6 @@ con3270_read_tasklet(struct raw3270_request *rrq) | |||
302 | deactivate = 1; | 300 | deactivate = 1; |
303 | break; | 301 | break; |
304 | case 0x6d: /* clear: start from scratch. */ | 302 | case 0x6d: /* clear: start from scratch. */ |
305 | con3270_rebuild_update(cp); | ||
306 | cp->update_flags = CON_UPDATE_ALL; | 303 | cp->update_flags = CON_UPDATE_ALL; |
307 | con3270_set_timer(cp, 1); | 304 | con3270_set_timer(cp, 1); |
308 | break; | 305 | break; |
@@ -382,30 +379,21 @@ con3270_issue_read(struct con3270 *cp) | |||
382 | static int | 379 | static int |
383 | con3270_activate(struct raw3270_view *view) | 380 | con3270_activate(struct raw3270_view *view) |
384 | { | 381 | { |
385 | unsigned long flags; | ||
386 | struct con3270 *cp; | 382 | struct con3270 *cp; |
387 | 383 | ||
388 | cp = (struct con3270 *) view; | 384 | cp = (struct con3270 *) view; |
389 | spin_lock_irqsave(&cp->view.lock, flags); | ||
390 | cp->nr_up = 0; | ||
391 | con3270_rebuild_update(cp); | ||
392 | con3270_update_status(cp); | ||
393 | cp->update_flags = CON_UPDATE_ALL; | 385 | cp->update_flags = CON_UPDATE_ALL; |
394 | con3270_set_timer(cp, 1); | 386 | con3270_set_timer(cp, 1); |
395 | spin_unlock_irqrestore(&cp->view.lock, flags); | ||
396 | return 0; | 387 | return 0; |
397 | } | 388 | } |
398 | 389 | ||
399 | static void | 390 | static void |
400 | con3270_deactivate(struct raw3270_view *view) | 391 | con3270_deactivate(struct raw3270_view *view) |
401 | { | 392 | { |
402 | unsigned long flags; | ||
403 | struct con3270 *cp; | 393 | struct con3270 *cp; |
404 | 394 | ||
405 | cp = (struct con3270 *) view; | 395 | cp = (struct con3270 *) view; |
406 | spin_lock_irqsave(&cp->view.lock, flags); | ||
407 | del_timer(&cp->timer); | 396 | del_timer(&cp->timer); |
408 | spin_unlock_irqrestore(&cp->view.lock, flags); | ||
409 | } | 397 | } |
410 | 398 | ||
411 | static int | 399 | static int |
@@ -504,6 +492,7 @@ con3270_write(struct console *co, const char *str, unsigned int count) | |||
504 | con3270_cline_end(cp); | 492 | con3270_cline_end(cp); |
505 | } | 493 | } |
506 | /* Setup timer to output current console buffer after 1/10 second */ | 494 | /* Setup timer to output current console buffer after 1/10 second */ |
495 | cp->nr_up = 0; | ||
507 | if (cp->view.dev && !timer_pending(&cp->timer)) | 496 | if (cp->view.dev && !timer_pending(&cp->timer)) |
508 | con3270_set_timer(cp, HZ/10); | 497 | con3270_set_timer(cp, HZ/10); |
509 | spin_unlock_irqrestore(&cp->view.lock,flags); | 498 | spin_unlock_irqrestore(&cp->view.lock,flags); |
@@ -624,7 +613,8 @@ con3270_init(void) | |||
624 | 613 | ||
625 | INIT_LIST_HEAD(&condev->lines); | 614 | INIT_LIST_HEAD(&condev->lines); |
626 | INIT_LIST_HEAD(&condev->update); | 615 | INIT_LIST_HEAD(&condev->update); |
627 | init_timer(&condev->timer); | 616 | setup_timer(&condev->timer, (void (*)(unsigned long)) con3270_update, |
617 | (unsigned long) condev); | ||
628 | tasklet_init(&condev->readlet, | 618 | tasklet_init(&condev->readlet, |
629 | (void (*)(unsigned long)) con3270_read_tasklet, | 619 | (void (*)(unsigned long)) con3270_read_tasklet, |
630 | (unsigned long) condev->read); | 620 | (unsigned long) condev->read); |
diff --git a/drivers/s390/char/tape_34xx.c b/drivers/s390/char/tape_34xx.c index 5f8e8ef43dd3..2d00a383a475 100644 --- a/drivers/s390/char/tape_34xx.c +++ b/drivers/s390/char/tape_34xx.c | |||
@@ -1134,7 +1134,7 @@ tape_34xx_bread(struct tape_device *device, struct request *req) | |||
1134 | /* Setup ccws. */ | 1134 | /* Setup ccws. */ |
1135 | request->op = TO_BLOCK; | 1135 | request->op = TO_BLOCK; |
1136 | start_block = (struct tape_34xx_block_id *) request->cpdata; | 1136 | start_block = (struct tape_34xx_block_id *) request->cpdata; |
1137 | start_block->block = req->sector >> TAPEBLOCK_HSEC_S2B; | 1137 | start_block->block = blk_rq_pos(req) >> TAPEBLOCK_HSEC_S2B; |
1138 | DBF_EVENT(6, "start_block = %i\n", start_block->block); | 1138 | DBF_EVENT(6, "start_block = %i\n", start_block->block); |
1139 | 1139 | ||
1140 | ccw = request->cpaddr; | 1140 | ccw = request->cpaddr; |
diff --git a/drivers/s390/char/tape_3590.c b/drivers/s390/char/tape_3590.c index 823b05bd0dd7..c453b2f3e9f4 100644 --- a/drivers/s390/char/tape_3590.c +++ b/drivers/s390/char/tape_3590.c | |||
@@ -633,7 +633,7 @@ tape_3590_bread(struct tape_device *device, struct request *req) | |||
633 | struct req_iterator iter; | 633 | struct req_iterator iter; |
634 | 634 | ||
635 | DBF_EVENT(6, "xBREDid:"); | 635 | DBF_EVENT(6, "xBREDid:"); |
636 | start_block = req->sector >> TAPEBLOCK_HSEC_S2B; | 636 | start_block = blk_rq_pos(req) >> TAPEBLOCK_HSEC_S2B; |
637 | DBF_EVENT(6, "start_block = %i\n", start_block); | 637 | DBF_EVENT(6, "start_block = %i\n", start_block); |
638 | 638 | ||
639 | rq_for_each_segment(bv, req, iter) | 639 | rq_for_each_segment(bv, req, iter) |
diff --git a/drivers/s390/char/tape_block.c b/drivers/s390/char/tape_block.c index f32e89e7c4f2..47ff695255ea 100644 --- a/drivers/s390/char/tape_block.c +++ b/drivers/s390/char/tape_block.c | |||
@@ -74,13 +74,6 @@ tapeblock_trigger_requeue(struct tape_device *device) | |||
74 | * Post finished request. | 74 | * Post finished request. |
75 | */ | 75 | */ |
76 | static void | 76 | static void |
77 | tapeblock_end_request(struct request *req, int error) | ||
78 | { | ||
79 | if (blk_end_request(req, error, blk_rq_bytes(req))) | ||
80 | BUG(); | ||
81 | } | ||
82 | |||
83 | static void | ||
84 | __tapeblock_end_request(struct tape_request *ccw_req, void *data) | 77 | __tapeblock_end_request(struct tape_request *ccw_req, void *data) |
85 | { | 78 | { |
86 | struct tape_device *device; | 79 | struct tape_device *device; |
@@ -90,17 +83,17 @@ __tapeblock_end_request(struct tape_request *ccw_req, void *data) | |||
90 | 83 | ||
91 | device = ccw_req->device; | 84 | device = ccw_req->device; |
92 | req = (struct request *) data; | 85 | req = (struct request *) data; |
93 | tapeblock_end_request(req, (ccw_req->rc == 0) ? 0 : -EIO); | 86 | blk_end_request_all(req, (ccw_req->rc == 0) ? 0 : -EIO); |
94 | if (ccw_req->rc == 0) | 87 | if (ccw_req->rc == 0) |
95 | /* Update position. */ | 88 | /* Update position. */ |
96 | device->blk_data.block_position = | 89 | device->blk_data.block_position = |
97 | (req->sector + req->nr_sectors) >> TAPEBLOCK_HSEC_S2B; | 90 | (blk_rq_pos(req) + blk_rq_sectors(req)) >> TAPEBLOCK_HSEC_S2B; |
98 | else | 91 | else |
99 | /* We lost the position information due to an error. */ | 92 | /* We lost the position information due to an error. */ |
100 | device->blk_data.block_position = -1; | 93 | device->blk_data.block_position = -1; |
101 | device->discipline->free_bread(ccw_req); | 94 | device->discipline->free_bread(ccw_req); |
102 | if (!list_empty(&device->req_queue) || | 95 | if (!list_empty(&device->req_queue) || |
103 | elv_next_request(device->blk_data.request_queue)) | 96 | blk_peek_request(device->blk_data.request_queue)) |
104 | tapeblock_trigger_requeue(device); | 97 | tapeblock_trigger_requeue(device); |
105 | } | 98 | } |
106 | 99 | ||
@@ -118,7 +111,7 @@ tapeblock_start_request(struct tape_device *device, struct request *req) | |||
118 | ccw_req = device->discipline->bread(device, req); | 111 | ccw_req = device->discipline->bread(device, req); |
119 | if (IS_ERR(ccw_req)) { | 112 | if (IS_ERR(ccw_req)) { |
120 | DBF_EVENT(1, "TBLOCK: bread failed\n"); | 113 | DBF_EVENT(1, "TBLOCK: bread failed\n"); |
121 | tapeblock_end_request(req, -EIO); | 114 | blk_end_request_all(req, -EIO); |
122 | return PTR_ERR(ccw_req); | 115 | return PTR_ERR(ccw_req); |
123 | } | 116 | } |
124 | ccw_req->callback = __tapeblock_end_request; | 117 | ccw_req->callback = __tapeblock_end_request; |
@@ -131,7 +124,7 @@ tapeblock_start_request(struct tape_device *device, struct request *req) | |||
131 | * Start/enqueueing failed. No retries in | 124 | * Start/enqueueing failed. No retries in |
132 | * this case. | 125 | * this case. |
133 | */ | 126 | */ |
134 | tapeblock_end_request(req, -EIO); | 127 | blk_end_request_all(req, -EIO); |
135 | device->discipline->free_bread(ccw_req); | 128 | device->discipline->free_bread(ccw_req); |
136 | } | 129 | } |
137 | 130 | ||
@@ -169,19 +162,16 @@ tapeblock_requeue(struct work_struct *work) { | |||
169 | spin_lock_irq(&device->blk_data.request_queue_lock); | 162 | spin_lock_irq(&device->blk_data.request_queue_lock); |
170 | while ( | 163 | while ( |
171 | !blk_queue_plugged(queue) && | 164 | !blk_queue_plugged(queue) && |
172 | elv_next_request(queue) && | 165 | (req = blk_fetch_request(queue)) && |
173 | nr_queued < TAPEBLOCK_MIN_REQUEUE | 166 | nr_queued < TAPEBLOCK_MIN_REQUEUE |
174 | ) { | 167 | ) { |
175 | req = elv_next_request(queue); | ||
176 | if (rq_data_dir(req) == WRITE) { | 168 | if (rq_data_dir(req) == WRITE) { |
177 | DBF_EVENT(1, "TBLOCK: Rejecting write request\n"); | 169 | DBF_EVENT(1, "TBLOCK: Rejecting write request\n"); |
178 | blkdev_dequeue_request(req); | ||
179 | spin_unlock_irq(&device->blk_data.request_queue_lock); | 170 | spin_unlock_irq(&device->blk_data.request_queue_lock); |
180 | tapeblock_end_request(req, -EIO); | 171 | blk_end_request_all(req, -EIO); |
181 | spin_lock_irq(&device->blk_data.request_queue_lock); | 172 | spin_lock_irq(&device->blk_data.request_queue_lock); |
182 | continue; | 173 | continue; |
183 | } | 174 | } |
184 | blkdev_dequeue_request(req); | ||
185 | nr_queued++; | 175 | nr_queued++; |
186 | spin_unlock_irq(&device->blk_data.request_queue_lock); | 176 | spin_unlock_irq(&device->blk_data.request_queue_lock); |
187 | rc = tapeblock_start_request(device, req); | 177 | rc = tapeblock_start_request(device, req); |
@@ -232,7 +222,7 @@ tapeblock_setup_device(struct tape_device * device) | |||
232 | if (rc) | 222 | if (rc) |
233 | goto cleanup_queue; | 223 | goto cleanup_queue; |
234 | 224 | ||
235 | blk_queue_hardsect_size(blkdat->request_queue, TAPEBLOCK_HSEC_SIZE); | 225 | blk_queue_logical_block_size(blkdat->request_queue, TAPEBLOCK_HSEC_SIZE); |
236 | blk_queue_max_sectors(blkdat->request_queue, TAPEBLOCK_MAX_SEC); | 226 | blk_queue_max_sectors(blkdat->request_queue, TAPEBLOCK_MAX_SEC); |
237 | blk_queue_max_phys_segments(blkdat->request_queue, -1L); | 227 | blk_queue_max_phys_segments(blkdat->request_queue, -1L); |
238 | blk_queue_max_hw_segments(blkdat->request_queue, -1L); | 228 | blk_queue_max_hw_segments(blkdat->request_queue, -1L); |
diff --git a/drivers/s390/char/tty3270.c b/drivers/s390/char/tty3270.c index a7fe6302c982..38385677c653 100644 --- a/drivers/s390/char/tty3270.c +++ b/drivers/s390/char/tty3270.c | |||
@@ -112,7 +112,7 @@ struct tty3270 { | |||
112 | #define TTY_UPDATE_LIST 2 /* Update lines in tty3270->update. */ | 112 | #define TTY_UPDATE_LIST 2 /* Update lines in tty3270->update. */ |
113 | #define TTY_UPDATE_INPUT 4 /* Update input line. */ | 113 | #define TTY_UPDATE_INPUT 4 /* Update input line. */ |
114 | #define TTY_UPDATE_STATUS 8 /* Update status line. */ | 114 | #define TTY_UPDATE_STATUS 8 /* Update status line. */ |
115 | #define TTY_UPDATE_ALL 15 | 115 | #define TTY_UPDATE_ALL 16 /* Recreate screen. */ |
116 | 116 | ||
117 | static void tty3270_update(struct tty3270 *); | 117 | static void tty3270_update(struct tty3270 *); |
118 | 118 | ||
@@ -121,19 +121,10 @@ static void tty3270_update(struct tty3270 *); | |||
121 | */ | 121 | */ |
122 | static void tty3270_set_timer(struct tty3270 *tp, int expires) | 122 | static void tty3270_set_timer(struct tty3270 *tp, int expires) |
123 | { | 123 | { |
124 | if (expires == 0) { | 124 | if (expires == 0) |
125 | if (timer_pending(&tp->timer) && del_timer(&tp->timer)) | 125 | del_timer(&tp->timer); |
126 | raw3270_put_view(&tp->view); | 126 | else |
127 | return; | 127 | mod_timer(&tp->timer, jiffies + expires); |
128 | } | ||
129 | if (timer_pending(&tp->timer) && | ||
130 | mod_timer(&tp->timer, jiffies + expires)) | ||
131 | return; | ||
132 | raw3270_get_view(&tp->view); | ||
133 | tp->timer.function = (void (*)(unsigned long)) tty3270_update; | ||
134 | tp->timer.data = (unsigned long) tp; | ||
135 | tp->timer.expires = jiffies + expires; | ||
136 | add_timer(&tp->timer); | ||
137 | } | 128 | } |
138 | 129 | ||
139 | /* | 130 | /* |
@@ -337,7 +328,6 @@ tty3270_write_callback(struct raw3270_request *rq, void *data) | |||
337 | tp = (struct tty3270 *) rq->view; | 328 | tp = (struct tty3270 *) rq->view; |
338 | if (rq->rc != 0) { | 329 | if (rq->rc != 0) { |
339 | /* Write wasn't successfull. Refresh all. */ | 330 | /* Write wasn't successfull. Refresh all. */ |
340 | tty3270_rebuild_update(tp); | ||
341 | tp->update_flags = TTY_UPDATE_ALL; | 331 | tp->update_flags = TTY_UPDATE_ALL; |
342 | tty3270_set_timer(tp, 1); | 332 | tty3270_set_timer(tp, 1); |
343 | } | 333 | } |
@@ -366,6 +356,12 @@ tty3270_update(struct tty3270 *tp) | |||
366 | 356 | ||
367 | spin_lock(&tp->view.lock); | 357 | spin_lock(&tp->view.lock); |
368 | updated = 0; | 358 | updated = 0; |
359 | if (tp->update_flags & TTY_UPDATE_ALL) { | ||
360 | tty3270_rebuild_update(tp); | ||
361 | tty3270_update_status(tp); | ||
362 | tp->update_flags = TTY_UPDATE_ERASE | TTY_UPDATE_LIST | | ||
363 | TTY_UPDATE_INPUT | TTY_UPDATE_STATUS; | ||
364 | } | ||
369 | if (tp->update_flags & TTY_UPDATE_ERASE) { | 365 | if (tp->update_flags & TTY_UPDATE_ERASE) { |
370 | /* Use erase write alternate to erase display. */ | 366 | /* Use erase write alternate to erase display. */ |
371 | raw3270_request_set_cmd(wrq, TC_EWRITEA); | 367 | raw3270_request_set_cmd(wrq, TC_EWRITEA); |
@@ -425,7 +421,6 @@ tty3270_update(struct tty3270 *tp) | |||
425 | xchg(&tp->write, wrq); | 421 | xchg(&tp->write, wrq); |
426 | } | 422 | } |
427 | spin_unlock(&tp->view.lock); | 423 | spin_unlock(&tp->view.lock); |
428 | raw3270_put_view(&tp->view); | ||
429 | } | 424 | } |
430 | 425 | ||
431 | /* | 426 | /* |
@@ -570,7 +565,6 @@ tty3270_read_tasklet(struct raw3270_request *rrq) | |||
570 | tty3270_set_timer(tp, 1); | 565 | tty3270_set_timer(tp, 1); |
571 | } else if (tp->input->string[0] == 0x6d) { | 566 | } else if (tp->input->string[0] == 0x6d) { |
572 | /* Display has been cleared. Redraw. */ | 567 | /* Display has been cleared. Redraw. */ |
573 | tty3270_rebuild_update(tp); | ||
574 | tp->update_flags = TTY_UPDATE_ALL; | 568 | tp->update_flags = TTY_UPDATE_ALL; |
575 | tty3270_set_timer(tp, 1); | 569 | tty3270_set_timer(tp, 1); |
576 | } | 570 | } |
@@ -641,22 +635,20 @@ static int | |||
641 | tty3270_activate(struct raw3270_view *view) | 635 | tty3270_activate(struct raw3270_view *view) |
642 | { | 636 | { |
643 | struct tty3270 *tp; | 637 | struct tty3270 *tp; |
644 | unsigned long flags; | ||
645 | 638 | ||
646 | tp = (struct tty3270 *) view; | 639 | tp = (struct tty3270 *) view; |
647 | spin_lock_irqsave(&tp->view.lock, flags); | ||
648 | tp->nr_up = 0; | ||
649 | tty3270_rebuild_update(tp); | ||
650 | tty3270_update_status(tp); | ||
651 | tp->update_flags = TTY_UPDATE_ALL; | 640 | tp->update_flags = TTY_UPDATE_ALL; |
652 | tty3270_set_timer(tp, 1); | 641 | tty3270_set_timer(tp, 1); |
653 | spin_unlock_irqrestore(&tp->view.lock, flags); | ||
654 | return 0; | 642 | return 0; |
655 | } | 643 | } |
656 | 644 | ||
657 | static void | 645 | static void |
658 | tty3270_deactivate(struct raw3270_view *view) | 646 | tty3270_deactivate(struct raw3270_view *view) |
659 | { | 647 | { |
648 | struct tty3270 *tp; | ||
649 | |||
650 | tp = (struct tty3270 *) view; | ||
651 | del_timer(&tp->timer); | ||
660 | } | 652 | } |
661 | 653 | ||
662 | static int | 654 | static int |
@@ -743,6 +735,7 @@ tty3270_free_view(struct tty3270 *tp) | |||
743 | { | 735 | { |
744 | int pages; | 736 | int pages; |
745 | 737 | ||
738 | del_timer_sync(&tp->timer); | ||
746 | kbd_free(tp->kbd); | 739 | kbd_free(tp->kbd); |
747 | raw3270_request_free(tp->kreset); | 740 | raw3270_request_free(tp->kreset); |
748 | raw3270_request_free(tp->read); | 741 | raw3270_request_free(tp->read); |
@@ -889,7 +882,8 @@ tty3270_open(struct tty_struct *tty, struct file * filp) | |||
889 | INIT_LIST_HEAD(&tp->update); | 882 | INIT_LIST_HEAD(&tp->update); |
890 | INIT_LIST_HEAD(&tp->rcl_lines); | 883 | INIT_LIST_HEAD(&tp->rcl_lines); |
891 | tp->rcl_max = 20; | 884 | tp->rcl_max = 20; |
892 | init_timer(&tp->timer); | 885 | setup_timer(&tp->timer, (void (*)(unsigned long)) tty3270_update, |
886 | (unsigned long) tp); | ||
893 | tasklet_init(&tp->readlet, | 887 | tasklet_init(&tp->readlet, |
894 | (void (*)(unsigned long)) tty3270_read_tasklet, | 888 | (void (*)(unsigned long)) tty3270_read_tasklet, |
895 | (unsigned long) tp->read); | 889 | (unsigned long) tp->read); |
@@ -1754,14 +1748,6 @@ static const struct tty_operations tty3270_ops = { | |||
1754 | .set_termios = tty3270_set_termios | 1748 | .set_termios = tty3270_set_termios |
1755 | }; | 1749 | }; |
1756 | 1750 | ||
1757 | static void tty3270_notifier(int index, int active) | ||
1758 | { | ||
1759 | if (active) | ||
1760 | tty_register_device(tty3270_driver, index, NULL); | ||
1761 | else | ||
1762 | tty_unregister_device(tty3270_driver, index); | ||
1763 | } | ||
1764 | |||
1765 | /* | 1751 | /* |
1766 | * 3270 tty registration code called from tty_init(). | 1752 | * 3270 tty registration code called from tty_init(). |
1767 | * Most kernel services (incl. kmalloc) are available at this poimt. | 1753 | * Most kernel services (incl. kmalloc) are available at this poimt. |
@@ -1796,12 +1782,6 @@ static int __init tty3270_init(void) | |||
1796 | return ret; | 1782 | return ret; |
1797 | } | 1783 | } |
1798 | tty3270_driver = driver; | 1784 | tty3270_driver = driver; |
1799 | ret = raw3270_register_notifier(tty3270_notifier); | ||
1800 | if (ret) { | ||
1801 | put_tty_driver(driver); | ||
1802 | return ret; | ||
1803 | |||
1804 | } | ||
1805 | return 0; | 1785 | return 0; |
1806 | } | 1786 | } |
1807 | 1787 | ||
@@ -1810,7 +1790,6 @@ tty3270_exit(void) | |||
1810 | { | 1790 | { |
1811 | struct tty_driver *driver; | 1791 | struct tty_driver *driver; |
1812 | 1792 | ||
1813 | raw3270_unregister_notifier(tty3270_notifier); | ||
1814 | driver = tty3270_driver; | 1793 | driver = tty3270_driver; |
1815 | tty3270_driver = NULL; | 1794 | tty3270_driver = NULL; |
1816 | tty_unregister_driver(driver); | 1795 | tty_unregister_driver(driver); |
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c index 2aebb9823044..5ec7789bd9d8 100644 --- a/drivers/s390/cio/cio.c +++ b/drivers/s390/cio/cio.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #define KMSG_COMPONENT "cio" | 12 | #define KMSG_COMPONENT "cio" |
13 | #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt | 13 | #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
14 | 14 | ||
15 | #include <linux/ftrace.h> | ||
15 | #include <linux/module.h> | 16 | #include <linux/module.h> |
16 | #include <linux/init.h> | 17 | #include <linux/init.h> |
17 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
@@ -28,7 +29,7 @@ | |||
28 | #include <asm/chpid.h> | 29 | #include <asm/chpid.h> |
29 | #include <asm/airq.h> | 30 | #include <asm/airq.h> |
30 | #include <asm/isc.h> | 31 | #include <asm/isc.h> |
31 | #include <asm/cpu.h> | 32 | #include <asm/cputime.h> |
32 | #include <asm/fcx.h> | 33 | #include <asm/fcx.h> |
33 | #include <asm/nmi.h> | 34 | #include <asm/nmi.h> |
34 | #include <asm/crw.h> | 35 | #include <asm/crw.h> |
@@ -626,8 +627,7 @@ out: | |||
626 | * handlers). | 627 | * handlers). |
627 | * | 628 | * |
628 | */ | 629 | */ |
629 | void | 630 | void __irq_entry do_IRQ(struct pt_regs *regs) |
630 | do_IRQ (struct pt_regs *regs) | ||
631 | { | 631 | { |
632 | struct tpi_info *tpi_info; | 632 | struct tpi_info *tpi_info; |
633 | struct subchannel *sch; | 633 | struct subchannel *sch; |
diff --git a/drivers/s390/cio/device_ops.c b/drivers/s390/cio/device_ops.c index 151754d54745..bf0a24af39a0 100644 --- a/drivers/s390/cio/device_ops.c +++ b/drivers/s390/cio/device_ops.c | |||
@@ -114,7 +114,7 @@ int ccw_device_clear(struct ccw_device *cdev, unsigned long intparm) | |||
114 | struct subchannel *sch; | 114 | struct subchannel *sch; |
115 | int ret; | 115 | int ret; |
116 | 116 | ||
117 | if (!cdev) | 117 | if (!cdev || !cdev->dev.parent) |
118 | return -ENODEV; | 118 | return -ENODEV; |
119 | if (cdev->private->state == DEV_STATE_NOT_OPER) | 119 | if (cdev->private->state == DEV_STATE_NOT_OPER) |
120 | return -ENODEV; | 120 | return -ENODEV; |
@@ -122,8 +122,6 @@ int ccw_device_clear(struct ccw_device *cdev, unsigned long intparm) | |||
122 | cdev->private->state != DEV_STATE_W4SENSE) | 122 | cdev->private->state != DEV_STATE_W4SENSE) |
123 | return -EINVAL; | 123 | return -EINVAL; |
124 | sch = to_subchannel(cdev->dev.parent); | 124 | sch = to_subchannel(cdev->dev.parent); |
125 | if (!sch) | ||
126 | return -ENODEV; | ||
127 | ret = cio_clear(sch); | 125 | ret = cio_clear(sch); |
128 | if (ret == 0) | 126 | if (ret == 0) |
129 | cdev->private->intparm = intparm; | 127 | cdev->private->intparm = intparm; |
@@ -161,11 +159,9 @@ int ccw_device_start_key(struct ccw_device *cdev, struct ccw1 *cpa, | |||
161 | struct subchannel *sch; | 159 | struct subchannel *sch; |
162 | int ret; | 160 | int ret; |
163 | 161 | ||
164 | if (!cdev) | 162 | if (!cdev || !cdev->dev.parent) |
165 | return -ENODEV; | 163 | return -ENODEV; |
166 | sch = to_subchannel(cdev->dev.parent); | 164 | sch = to_subchannel(cdev->dev.parent); |
167 | if (!sch) | ||
168 | return -ENODEV; | ||
169 | if (cdev->private->state == DEV_STATE_NOT_OPER) | 165 | if (cdev->private->state == DEV_STATE_NOT_OPER) |
170 | return -ENODEV; | 166 | return -ENODEV; |
171 | if (cdev->private->state == DEV_STATE_VERIFY || | 167 | if (cdev->private->state == DEV_STATE_VERIFY || |
@@ -339,7 +335,7 @@ int ccw_device_halt(struct ccw_device *cdev, unsigned long intparm) | |||
339 | struct subchannel *sch; | 335 | struct subchannel *sch; |
340 | int ret; | 336 | int ret; |
341 | 337 | ||
342 | if (!cdev) | 338 | if (!cdev || !cdev->dev.parent) |
343 | return -ENODEV; | 339 | return -ENODEV; |
344 | if (cdev->private->state == DEV_STATE_NOT_OPER) | 340 | if (cdev->private->state == DEV_STATE_NOT_OPER) |
345 | return -ENODEV; | 341 | return -ENODEV; |
@@ -347,8 +343,6 @@ int ccw_device_halt(struct ccw_device *cdev, unsigned long intparm) | |||
347 | cdev->private->state != DEV_STATE_W4SENSE) | 343 | cdev->private->state != DEV_STATE_W4SENSE) |
348 | return -EINVAL; | 344 | return -EINVAL; |
349 | sch = to_subchannel(cdev->dev.parent); | 345 | sch = to_subchannel(cdev->dev.parent); |
350 | if (!sch) | ||
351 | return -ENODEV; | ||
352 | ret = cio_halt(sch); | 346 | ret = cio_halt(sch); |
353 | if (ret == 0) | 347 | if (ret == 0) |
354 | cdev->private->intparm = intparm; | 348 | cdev->private->intparm = intparm; |
@@ -372,11 +366,9 @@ int ccw_device_resume(struct ccw_device *cdev) | |||
372 | { | 366 | { |
373 | struct subchannel *sch; | 367 | struct subchannel *sch; |
374 | 368 | ||
375 | if (!cdev) | 369 | if (!cdev || !cdev->dev.parent) |
376 | return -ENODEV; | 370 | return -ENODEV; |
377 | sch = to_subchannel(cdev->dev.parent); | 371 | sch = to_subchannel(cdev->dev.parent); |
378 | if (!sch) | ||
379 | return -ENODEV; | ||
380 | if (cdev->private->state == DEV_STATE_NOT_OPER) | 372 | if (cdev->private->state == DEV_STATE_NOT_OPER) |
381 | return -ENODEV; | 373 | return -ENODEV; |
382 | if (cdev->private->state != DEV_STATE_ONLINE || | 374 | if (cdev->private->state != DEV_STATE_ONLINE || |
@@ -471,11 +463,11 @@ __u8 ccw_device_get_path_mask(struct ccw_device *cdev) | |||
471 | { | 463 | { |
472 | struct subchannel *sch; | 464 | struct subchannel *sch; |
473 | 465 | ||
474 | sch = to_subchannel(cdev->dev.parent); | 466 | if (!cdev->dev.parent) |
475 | if (!sch) | ||
476 | return 0; | 467 | return 0; |
477 | else | 468 | |
478 | return sch->lpm; | 469 | sch = to_subchannel(cdev->dev.parent); |
470 | return sch->lpm; | ||
479 | } | 471 | } |
480 | 472 | ||
481 | /* | 473 | /* |
diff --git a/drivers/s390/cio/qdio_main.c b/drivers/s390/cio/qdio_main.c index accd957454e7..d79cf5bf0e62 100644 --- a/drivers/s390/cio/qdio_main.c +++ b/drivers/s390/cio/qdio_main.c | |||
@@ -881,42 +881,26 @@ no_handler: | |||
881 | qdio_set_state(irq_ptr, QDIO_IRQ_STATE_STOPPED); | 881 | qdio_set_state(irq_ptr, QDIO_IRQ_STATE_STOPPED); |
882 | } | 882 | } |
883 | 883 | ||
884 | static int qdio_establish_check_errors(struct ccw_device *cdev, int cstat, | 884 | static void qdio_establish_handle_irq(struct ccw_device *cdev, int cstat, |
885 | int dstat) | 885 | int dstat) |
886 | { | 886 | { |
887 | struct qdio_irq *irq_ptr = cdev->private->qdio_data; | 887 | struct qdio_irq *irq_ptr = cdev->private->qdio_data; |
888 | 888 | ||
889 | if (cstat || (dstat & ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END))) { | 889 | DBF_DEV_EVENT(DBF_INFO, irq_ptr, "qest irq"); |
890 | DBF_ERROR("EQ:ck con"); | ||
891 | goto error; | ||
892 | } | ||
893 | 890 | ||
894 | if (!(dstat & DEV_STAT_DEV_END)) { | 891 | if (cstat) |
895 | DBF_ERROR("EQ:no dev"); | ||
896 | goto error; | 892 | goto error; |
897 | } | 893 | if (dstat & ~(DEV_STAT_DEV_END | DEV_STAT_CHN_END)) |
898 | |||
899 | if (dstat & ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END)) { | ||
900 | DBF_ERROR("EQ: bad io"); | ||
901 | goto error; | 894 | goto error; |
902 | } | 895 | if (!(dstat & DEV_STAT_DEV_END)) |
903 | return 0; | 896 | goto error; |
897 | qdio_set_state(irq_ptr, QDIO_IRQ_STATE_ESTABLISHED); | ||
898 | return; | ||
899 | |||
904 | error: | 900 | error: |
905 | DBF_ERROR("%4x EQ:error", irq_ptr->schid.sch_no); | 901 | DBF_ERROR("%4x EQ:error", irq_ptr->schid.sch_no); |
906 | DBF_ERROR("ds: %2x cs:%2x", dstat, cstat); | 902 | DBF_ERROR("ds: %2x cs:%2x", dstat, cstat); |
907 | |||
908 | qdio_set_state(irq_ptr, QDIO_IRQ_STATE_ERR); | 903 | qdio_set_state(irq_ptr, QDIO_IRQ_STATE_ERR); |
909 | return 1; | ||
910 | } | ||
911 | |||
912 | static void qdio_establish_handle_irq(struct ccw_device *cdev, int cstat, | ||
913 | int dstat) | ||
914 | { | ||
915 | struct qdio_irq *irq_ptr = cdev->private->qdio_data; | ||
916 | |||
917 | DBF_DEV_EVENT(DBF_INFO, irq_ptr, "qest irq"); | ||
918 | if (!qdio_establish_check_errors(cdev, cstat, dstat)) | ||
919 | qdio_set_state(irq_ptr, QDIO_IRQ_STATE_ESTABLISHED); | ||
920 | } | 904 | } |
921 | 905 | ||
922 | /* qdio interrupt handler */ | 906 | /* qdio interrupt handler */ |
@@ -946,7 +930,6 @@ void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm, | |||
946 | } | 930 | } |
947 | } | 931 | } |
948 | qdio_irq_check_sense(irq_ptr, irb); | 932 | qdio_irq_check_sense(irq_ptr, irb); |
949 | |||
950 | cstat = irb->scsw.cmd.cstat; | 933 | cstat = irb->scsw.cmd.cstat; |
951 | dstat = irb->scsw.cmd.dstat; | 934 | dstat = irb->scsw.cmd.dstat; |
952 | 935 | ||
@@ -954,22 +937,19 @@ void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm, | |||
954 | case QDIO_IRQ_STATE_INACTIVE: | 937 | case QDIO_IRQ_STATE_INACTIVE: |
955 | qdio_establish_handle_irq(cdev, cstat, dstat); | 938 | qdio_establish_handle_irq(cdev, cstat, dstat); |
956 | break; | 939 | break; |
957 | |||
958 | case QDIO_IRQ_STATE_CLEANUP: | 940 | case QDIO_IRQ_STATE_CLEANUP: |
959 | qdio_set_state(irq_ptr, QDIO_IRQ_STATE_INACTIVE); | 941 | qdio_set_state(irq_ptr, QDIO_IRQ_STATE_INACTIVE); |
960 | break; | 942 | break; |
961 | |||
962 | case QDIO_IRQ_STATE_ESTABLISHED: | 943 | case QDIO_IRQ_STATE_ESTABLISHED: |
963 | case QDIO_IRQ_STATE_ACTIVE: | 944 | case QDIO_IRQ_STATE_ACTIVE: |
964 | if (cstat & SCHN_STAT_PCI) { | 945 | if (cstat & SCHN_STAT_PCI) { |
965 | qdio_int_handler_pci(irq_ptr); | 946 | qdio_int_handler_pci(irq_ptr); |
966 | return; | 947 | return; |
967 | } | 948 | } |
968 | if ((cstat & ~SCHN_STAT_PCI) || dstat) { | 949 | if (cstat || dstat) |
969 | qdio_handle_activate_check(cdev, intparm, cstat, | 950 | qdio_handle_activate_check(cdev, intparm, cstat, |
970 | dstat); | 951 | dstat); |
971 | break; | 952 | break; |
972 | } | ||
973 | default: | 953 | default: |
974 | WARN_ON(1); | 954 | WARN_ON(1); |
975 | } | 955 | } |
@@ -1514,7 +1494,7 @@ int do_QDIO(struct ccw_device *cdev, unsigned int callflags, | |||
1514 | 1494 | ||
1515 | if ((bufnr > QDIO_MAX_BUFFERS_PER_Q) || | 1495 | if ((bufnr > QDIO_MAX_BUFFERS_PER_Q) || |
1516 | (count > QDIO_MAX_BUFFERS_PER_Q) || | 1496 | (count > QDIO_MAX_BUFFERS_PER_Q) || |
1517 | (q_nr > QDIO_MAX_QUEUES_PER_IRQ)) | 1497 | (q_nr >= QDIO_MAX_QUEUES_PER_IRQ)) |
1518 | return -EINVAL; | 1498 | return -EINVAL; |
1519 | 1499 | ||
1520 | if (!count) | 1500 | if (!count) |
diff --git a/drivers/s390/cio/qdio_perf.c b/drivers/s390/cio/qdio_perf.c index 136d0f0b1e93..eff943923c6f 100644 --- a/drivers/s390/cio/qdio_perf.c +++ b/drivers/s390/cio/qdio_perf.c | |||
@@ -25,18 +25,6 @@ struct qdio_perf_stats perf_stats; | |||
25 | static struct proc_dir_entry *qdio_perf_pde; | 25 | static struct proc_dir_entry *qdio_perf_pde; |
26 | #endif | 26 | #endif |
27 | 27 | ||
28 | inline void qdio_perf_stat_inc(atomic_long_t *count) | ||
29 | { | ||
30 | if (qdio_performance_stats) | ||
31 | atomic_long_inc(count); | ||
32 | } | ||
33 | |||
34 | inline void qdio_perf_stat_dec(atomic_long_t *count) | ||
35 | { | ||
36 | if (qdio_performance_stats) | ||
37 | atomic_long_dec(count); | ||
38 | } | ||
39 | |||
40 | /* | 28 | /* |
41 | * procfs functions | 29 | * procfs functions |
42 | */ | 30 | */ |
diff --git a/drivers/s390/cio/qdio_perf.h b/drivers/s390/cio/qdio_perf.h index 7821ac4fa517..ff4504ce1e3c 100644 --- a/drivers/s390/cio/qdio_perf.h +++ b/drivers/s390/cio/qdio_perf.h | |||
@@ -9,7 +9,6 @@ | |||
9 | #define QDIO_PERF_H | 9 | #define QDIO_PERF_H |
10 | 10 | ||
11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
12 | #include <linux/device.h> | ||
13 | #include <asm/atomic.h> | 12 | #include <asm/atomic.h> |
14 | 13 | ||
15 | struct qdio_perf_stats { | 14 | struct qdio_perf_stats { |
@@ -50,10 +49,13 @@ struct qdio_perf_stats { | |||
50 | extern struct qdio_perf_stats perf_stats; | 49 | extern struct qdio_perf_stats perf_stats; |
51 | extern int qdio_performance_stats; | 50 | extern int qdio_performance_stats; |
52 | 51 | ||
52 | static inline void qdio_perf_stat_inc(atomic_long_t *count) | ||
53 | { | ||
54 | if (qdio_performance_stats) | ||
55 | atomic_long_inc(count); | ||
56 | } | ||
57 | |||
53 | int qdio_setup_perf_stats(void); | 58 | int qdio_setup_perf_stats(void); |
54 | void qdio_remove_perf_stats(void); | 59 | void qdio_remove_perf_stats(void); |
55 | 60 | ||
56 | extern void qdio_perf_stat_inc(atomic_long_t *count); | ||
57 | extern void qdio_perf_stat_dec(atomic_long_t *count); | ||
58 | |||
59 | #endif | 61 | #endif |
diff --git a/drivers/s390/kvm/kvm_virtio.c b/drivers/s390/kvm/kvm_virtio.c index cbc8566fab70..e38e5d306faf 100644 --- a/drivers/s390/kvm/kvm_virtio.c +++ b/drivers/s390/kvm/kvm_virtio.c | |||
@@ -173,8 +173,9 @@ static void kvm_notify(struct virtqueue *vq) | |||
173 | * this device and sets it up. | 173 | * this device and sets it up. |
174 | */ | 174 | */ |
175 | static struct virtqueue *kvm_find_vq(struct virtio_device *vdev, | 175 | static struct virtqueue *kvm_find_vq(struct virtio_device *vdev, |
176 | unsigned index, | 176 | unsigned index, |
177 | void (*callback)(struct virtqueue *vq)) | 177 | void (*callback)(struct virtqueue *vq), |
178 | const char *name) | ||
178 | { | 179 | { |
179 | struct kvm_device *kdev = to_kvmdev(vdev); | 180 | struct kvm_device *kdev = to_kvmdev(vdev); |
180 | struct kvm_vqconfig *config; | 181 | struct kvm_vqconfig *config; |
@@ -194,7 +195,7 @@ static struct virtqueue *kvm_find_vq(struct virtio_device *vdev, | |||
194 | 195 | ||
195 | vq = vring_new_virtqueue(config->num, KVM_S390_VIRTIO_RING_ALIGN, | 196 | vq = vring_new_virtqueue(config->num, KVM_S390_VIRTIO_RING_ALIGN, |
196 | vdev, (void *) config->address, | 197 | vdev, (void *) config->address, |
197 | kvm_notify, callback); | 198 | kvm_notify, callback, name); |
198 | if (!vq) { | 199 | if (!vq) { |
199 | err = -ENOMEM; | 200 | err = -ENOMEM; |
200 | goto unmap; | 201 | goto unmap; |
@@ -226,6 +227,38 @@ static void kvm_del_vq(struct virtqueue *vq) | |||
226 | KVM_S390_VIRTIO_RING_ALIGN)); | 227 | KVM_S390_VIRTIO_RING_ALIGN)); |
227 | } | 228 | } |
228 | 229 | ||
230 | static void kvm_del_vqs(struct virtio_device *vdev) | ||
231 | { | ||
232 | struct virtqueue *vq, *n; | ||
233 | |||
234 | list_for_each_entry_safe(vq, n, &vdev->vqs, list) | ||
235 | kvm_del_vq(vq); | ||
236 | } | ||
237 | |||
238 | static int kvm_find_vqs(struct virtio_device *vdev, unsigned nvqs, | ||
239 | struct virtqueue *vqs[], | ||
240 | vq_callback_t *callbacks[], | ||
241 | const char *names[]) | ||
242 | { | ||
243 | struct kvm_device *kdev = to_kvmdev(vdev); | ||
244 | int i; | ||
245 | |||
246 | /* We must have this many virtqueues. */ | ||
247 | if (nvqs > kdev->desc->num_vq) | ||
248 | return -ENOENT; | ||
249 | |||
250 | for (i = 0; i < nvqs; ++i) { | ||
251 | vqs[i] = kvm_find_vq(vdev, i, callbacks[i], names[i]); | ||
252 | if (IS_ERR(vqs[i])) | ||
253 | goto error; | ||
254 | } | ||
255 | return 0; | ||
256 | |||
257 | error: | ||
258 | kvm_del_vqs(vdev); | ||
259 | return PTR_ERR(vqs[i]); | ||
260 | } | ||
261 | |||
229 | /* | 262 | /* |
230 | * The config ops structure as defined by virtio config | 263 | * The config ops structure as defined by virtio config |
231 | */ | 264 | */ |
@@ -237,8 +270,8 @@ static struct virtio_config_ops kvm_vq_configspace_ops = { | |||
237 | .get_status = kvm_get_status, | 270 | .get_status = kvm_get_status, |
238 | .set_status = kvm_set_status, | 271 | .set_status = kvm_set_status, |
239 | .reset = kvm_reset, | 272 | .reset = kvm_reset, |
240 | .find_vq = kvm_find_vq, | 273 | .find_vqs = kvm_find_vqs, |
241 | .del_vq = kvm_del_vq, | 274 | .del_vqs = kvm_del_vqs, |
242 | }; | 275 | }; |
243 | 276 | ||
244 | /* | 277 | /* |
diff --git a/drivers/s390/net/Kconfig b/drivers/s390/net/Kconfig index a7745c82b4ae..cb909a5b5047 100644 --- a/drivers/s390/net/Kconfig +++ b/drivers/s390/net/Kconfig | |||
@@ -8,7 +8,7 @@ config LCS | |||
8 | Select this option if you want to use LCS networking on IBM System z. | 8 | Select this option if you want to use LCS networking on IBM System z. |
9 | This device driver supports Token Ring (IEEE 802.5), | 9 | This device driver supports Token Ring (IEEE 802.5), |
10 | FDDI (IEEE 802.7) and Ethernet. | 10 | FDDI (IEEE 802.7) and Ethernet. |
11 | To compile as a module, choose M. The module name is lcs.ko. | 11 | To compile as a module, choose M. The module name is lcs. |
12 | If you do not know what it is, it's safe to choose Y. | 12 | If you do not know what it is, it's safe to choose Y. |
13 | 13 | ||
14 | config CTCM | 14 | config CTCM |
@@ -21,7 +21,7 @@ config CTCM | |||
21 | It also supports virtual CTCs when running under VM. | 21 | It also supports virtual CTCs when running under VM. |
22 | This driver also supports channel-to-channel MPC SNA devices. | 22 | This driver also supports channel-to-channel MPC SNA devices. |
23 | MPC is an SNA protocol device used by Communication Server for Linux. | 23 | MPC is an SNA protocol device used by Communication Server for Linux. |
24 | To compile as a module, choose M. The module name is ctcm.ko. | 24 | To compile as a module, choose M. The module name is ctcm. |
25 | To compile into the kernel, choose Y. | 25 | To compile into the kernel, choose Y. |
26 | If you do not need any channel-to-channel connection, choose N. | 26 | If you do not need any channel-to-channel connection, choose N. |
27 | 27 | ||
@@ -34,7 +34,7 @@ config NETIUCV | |||
34 | link between VM guests. Using ifconfig a point-to-point connection | 34 | link between VM guests. Using ifconfig a point-to-point connection |
35 | can be established to the Linux on IBM System z | 35 | can be established to the Linux on IBM System z |
36 | running on the other VM guest. To compile as a module, choose M. | 36 | running on the other VM guest. To compile as a module, choose M. |
37 | The module name is netiucv.ko. If unsure, choose Y. | 37 | The module name is netiucv. If unsure, choose Y. |
38 | 38 | ||
39 | config SMSGIUCV | 39 | config SMSGIUCV |
40 | tristate "IUCV special message support (VM only)" | 40 | tristate "IUCV special message support (VM only)" |
@@ -50,7 +50,7 @@ config CLAW | |||
50 | This driver supports channel attached CLAW devices. | 50 | This driver supports channel attached CLAW devices. |
51 | CLAW is Common Link Access for Workstation. Common devices | 51 | CLAW is Common Link Access for Workstation. Common devices |
52 | that use CLAW are RS/6000s, Cisco Routers (CIP) and 3172 devices. | 52 | that use CLAW are RS/6000s, Cisco Routers (CIP) and 3172 devices. |
53 | To compile as a module, choose M. The module name is claw.ko. | 53 | To compile as a module, choose M. The module name is claw. |
54 | To compile into the kernel, choose Y. | 54 | To compile into the kernel, choose Y. |
55 | 55 | ||
56 | config QETH | 56 | config QETH |
@@ -65,14 +65,14 @@ config QETH | |||
65 | <http://www.ibm.com/developerworks/linux/linux390> | 65 | <http://www.ibm.com/developerworks/linux/linux390> |
66 | 66 | ||
67 | To compile this driver as a module, choose M. | 67 | To compile this driver as a module, choose M. |
68 | The module name is qeth.ko. | 68 | The module name is qeth. |
69 | 69 | ||
70 | config QETH_L2 | 70 | config QETH_L2 |
71 | tristate "qeth layer 2 device support" | 71 | tristate "qeth layer 2 device support" |
72 | depends on QETH | 72 | depends on QETH |
73 | help | 73 | help |
74 | Select this option to be able to run qeth devices in layer 2 mode. | 74 | Select this option to be able to run qeth devices in layer 2 mode. |
75 | To compile as a module, choose M. The module name is qeth_l2.ko. | 75 | To compile as a module, choose M. The module name is qeth_l2. |
76 | If unsure, choose y. | 76 | If unsure, choose y. |
77 | 77 | ||
78 | config QETH_L3 | 78 | config QETH_L3 |
@@ -80,7 +80,7 @@ config QETH_L3 | |||
80 | depends on QETH | 80 | depends on QETH |
81 | help | 81 | help |
82 | Select this option to be able to run qeth devices in layer 3 mode. | 82 | Select this option to be able to run qeth devices in layer 3 mode. |
83 | To compile as a module choose M. The module name is qeth_l3.ko. | 83 | To compile as a module choose M. The module name is qeth_l3. |
84 | If unsure, choose Y. | 84 | If unsure, choose Y. |
85 | 85 | ||
86 | config QETH_IPV6 | 86 | config QETH_IPV6 |
diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c index 733fe3bf6285..b2fe5cdbcaee 100644 --- a/drivers/s390/scsi/zfcp_ccw.c +++ b/drivers/s390/scsi/zfcp_ccw.c | |||
@@ -11,6 +11,24 @@ | |||
11 | 11 | ||
12 | #include "zfcp_ext.h" | 12 | #include "zfcp_ext.h" |
13 | 13 | ||
14 | #define ZFCP_MODEL_PRIV 0x4 | ||
15 | |||
16 | static struct ccw_device_id zfcp_ccw_device_id[] = { | ||
17 | { CCW_DEVICE_DEVTYPE(0x1731, 0x3, 0x1732, 0x3) }, | ||
18 | { CCW_DEVICE_DEVTYPE(0x1731, 0x3, 0x1732, ZFCP_MODEL_PRIV) }, | ||
19 | {}, | ||
20 | }; | ||
21 | MODULE_DEVICE_TABLE(ccw, zfcp_ccw_device_id); | ||
22 | |||
23 | /** | ||
24 | * zfcp_ccw_priv_sch - check if subchannel is privileged | ||
25 | * @adapter: Adapter/Subchannel to check | ||
26 | */ | ||
27 | int zfcp_ccw_priv_sch(struct zfcp_adapter *adapter) | ||
28 | { | ||
29 | return adapter->ccw_device->id.dev_model == ZFCP_MODEL_PRIV; | ||
30 | } | ||
31 | |||
14 | /** | 32 | /** |
15 | * zfcp_ccw_probe - probe function of zfcp driver | 33 | * zfcp_ccw_probe - probe function of zfcp driver |
16 | * @ccw_device: pointer to belonging ccw device | 34 | * @ccw_device: pointer to belonging ccw device |
@@ -176,8 +194,8 @@ static int zfcp_ccw_notify(struct ccw_device *ccw_device, int event) | |||
176 | "ccnoti4", NULL); | 194 | "ccnoti4", NULL); |
177 | break; | 195 | break; |
178 | case CIO_BOXED: | 196 | case CIO_BOXED: |
179 | dev_warn(&adapter->ccw_device->dev, | 197 | dev_warn(&adapter->ccw_device->dev, "The FCP device " |
180 | "The ccw device did not respond in time.\n"); | 198 | "did not respond within the specified time\n"); |
181 | zfcp_erp_adapter_shutdown(adapter, 0, "ccnoti5", NULL); | 199 | zfcp_erp_adapter_shutdown(adapter, 0, "ccnoti5", NULL); |
182 | break; | 200 | break; |
183 | } | 201 | } |
@@ -199,14 +217,6 @@ static void zfcp_ccw_shutdown(struct ccw_device *cdev) | |||
199 | up(&zfcp_data.config_sema); | 217 | up(&zfcp_data.config_sema); |
200 | } | 218 | } |
201 | 219 | ||
202 | static struct ccw_device_id zfcp_ccw_device_id[] = { | ||
203 | { CCW_DEVICE_DEVTYPE(0x1731, 0x3, 0x1732, 0x3) }, | ||
204 | { CCW_DEVICE_DEVTYPE(0x1731, 0x3, 0x1732, 0x4) }, /* priv. */ | ||
205 | {}, | ||
206 | }; | ||
207 | |||
208 | MODULE_DEVICE_TABLE(ccw, zfcp_ccw_device_id); | ||
209 | |||
210 | static struct ccw_driver zfcp_ccw_driver = { | 220 | static struct ccw_driver zfcp_ccw_driver = { |
211 | .owner = THIS_MODULE, | 221 | .owner = THIS_MODULE, |
212 | .name = "zfcp", | 222 | .name = "zfcp", |
diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index 0a1a5dd8d018..b99b87ce5a39 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c | |||
@@ -163,7 +163,7 @@ void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *fsf_req) | |||
163 | } | 163 | } |
164 | 164 | ||
165 | response->fsf_command = fsf_req->fsf_command; | 165 | response->fsf_command = fsf_req->fsf_command; |
166 | response->fsf_reqid = (unsigned long)fsf_req; | 166 | response->fsf_reqid = fsf_req->req_id; |
167 | response->fsf_seqno = fsf_req->seq_no; | 167 | response->fsf_seqno = fsf_req->seq_no; |
168 | response->fsf_issued = fsf_req->issued; | 168 | response->fsf_issued = fsf_req->issued; |
169 | response->fsf_prot_status = qtcb->prefix.prot_status; | 169 | response->fsf_prot_status = qtcb->prefix.prot_status; |
@@ -737,7 +737,7 @@ void zfcp_san_dbf_event_ct_request(struct zfcp_fsf_req *fsf_req) | |||
737 | spin_lock_irqsave(&adapter->san_dbf_lock, flags); | 737 | spin_lock_irqsave(&adapter->san_dbf_lock, flags); |
738 | memset(r, 0, sizeof(*r)); | 738 | memset(r, 0, sizeof(*r)); |
739 | strncpy(r->tag, "octc", ZFCP_DBF_TAG_SIZE); | 739 | strncpy(r->tag, "octc", ZFCP_DBF_TAG_SIZE); |
740 | r->fsf_reqid = (unsigned long)fsf_req; | 740 | r->fsf_reqid = fsf_req->req_id; |
741 | r->fsf_seqno = fsf_req->seq_no; | 741 | r->fsf_seqno = fsf_req->seq_no; |
742 | r->s_id = fc_host_port_id(adapter->scsi_host); | 742 | r->s_id = fc_host_port_id(adapter->scsi_host); |
743 | r->d_id = wka_port->d_id; | 743 | r->d_id = wka_port->d_id; |
@@ -773,7 +773,7 @@ void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *fsf_req) | |||
773 | spin_lock_irqsave(&adapter->san_dbf_lock, flags); | 773 | spin_lock_irqsave(&adapter->san_dbf_lock, flags); |
774 | memset(r, 0, sizeof(*r)); | 774 | memset(r, 0, sizeof(*r)); |
775 | strncpy(r->tag, "rctc", ZFCP_DBF_TAG_SIZE); | 775 | strncpy(r->tag, "rctc", ZFCP_DBF_TAG_SIZE); |
776 | r->fsf_reqid = (unsigned long)fsf_req; | 776 | r->fsf_reqid = fsf_req->req_id; |
777 | r->fsf_seqno = fsf_req->seq_no; | 777 | r->fsf_seqno = fsf_req->seq_no; |
778 | r->s_id = wka_port->d_id; | 778 | r->s_id = wka_port->d_id; |
779 | r->d_id = fc_host_port_id(adapter->scsi_host); | 779 | r->d_id = fc_host_port_id(adapter->scsi_host); |
@@ -803,7 +803,7 @@ static void zfcp_san_dbf_event_els(const char *tag, int level, | |||
803 | spin_lock_irqsave(&adapter->san_dbf_lock, flags); | 803 | spin_lock_irqsave(&adapter->san_dbf_lock, flags); |
804 | memset(rec, 0, sizeof(*rec)); | 804 | memset(rec, 0, sizeof(*rec)); |
805 | strncpy(rec->tag, tag, ZFCP_DBF_TAG_SIZE); | 805 | strncpy(rec->tag, tag, ZFCP_DBF_TAG_SIZE); |
806 | rec->fsf_reqid = (unsigned long)fsf_req; | 806 | rec->fsf_reqid = fsf_req->req_id; |
807 | rec->fsf_seqno = fsf_req->seq_no; | 807 | rec->fsf_seqno = fsf_req->seq_no; |
808 | rec->s_id = s_id; | 808 | rec->s_id = s_id; |
809 | rec->d_id = d_id; | 809 | rec->d_id = d_id; |
@@ -965,7 +965,7 @@ static void zfcp_scsi_dbf_event(const char *tag, const char *tag2, int level, | |||
965 | ZFCP_DBF_SCSI_FCP_SNS_INFO); | 965 | ZFCP_DBF_SCSI_FCP_SNS_INFO); |
966 | } | 966 | } |
967 | 967 | ||
968 | rec->fsf_reqid = (unsigned long)fsf_req; | 968 | rec->fsf_reqid = fsf_req->req_id; |
969 | rec->fsf_seqno = fsf_req->seq_no; | 969 | rec->fsf_seqno = fsf_req->seq_no; |
970 | rec->fsf_issued = fsf_req->issued; | 970 | rec->fsf_issued = fsf_req->issued; |
971 | } | 971 | } |
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index 4c362a9069f0..2074d45dbf6c 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h | |||
@@ -47,13 +47,6 @@ | |||
47 | 47 | ||
48 | /********************* CIO/QDIO SPECIFIC DEFINES *****************************/ | 48 | /********************* CIO/QDIO SPECIFIC DEFINES *****************************/ |
49 | 49 | ||
50 | /* Adapter Identification Parameters */ | ||
51 | #define ZFCP_CONTROL_UNIT_TYPE 0x1731 | ||
52 | #define ZFCP_CONTROL_UNIT_MODEL 0x03 | ||
53 | #define ZFCP_DEVICE_TYPE 0x1732 | ||
54 | #define ZFCP_DEVICE_MODEL 0x03 | ||
55 | #define ZFCP_DEVICE_MODEL_PRIV 0x04 | ||
56 | |||
57 | /* DMQ bug workaround: don't use last SBALE */ | 50 | /* DMQ bug workaround: don't use last SBALE */ |
58 | #define ZFCP_MAX_SBALES_PER_SBAL (QDIO_MAX_ELEMENTS_PER_BUFFER - 1) | 51 | #define ZFCP_MAX_SBALES_PER_SBAL (QDIO_MAX_ELEMENTS_PER_BUFFER - 1) |
59 | 52 | ||
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index fdc9b4352a64..e50ea465bc2b 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c | |||
@@ -880,6 +880,7 @@ static int zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *act) | |||
880 | zfcp_port_put(port); | 880 | zfcp_port_put(port); |
881 | return ZFCP_ERP_CONTINUES; | 881 | return ZFCP_ERP_CONTINUES; |
882 | } | 882 | } |
883 | /* fall through */ | ||
883 | case ZFCP_ERP_STEP_NAMESERVER_LOOKUP: | 884 | case ZFCP_ERP_STEP_NAMESERVER_LOOKUP: |
884 | if (!port->d_id) | 885 | if (!port->d_id) |
885 | return ZFCP_ERP_FAILED; | 886 | return ZFCP_ERP_FAILED; |
@@ -894,8 +895,13 @@ static int zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *act) | |||
894 | act->step = ZFCP_ERP_STEP_PORT_CLOSING; | 895 | act->step = ZFCP_ERP_STEP_PORT_CLOSING; |
895 | return ZFCP_ERP_CONTINUES; | 896 | return ZFCP_ERP_CONTINUES; |
896 | } | 897 | } |
897 | /* fall through otherwise */ | ||
898 | } | 898 | } |
899 | if (port->d_id && !(p_status & ZFCP_STATUS_COMMON_NOESC)) { | ||
900 | port->d_id = 0; | ||
901 | _zfcp_erp_port_reopen(port, 0, "erpsoc1", NULL); | ||
902 | return ZFCP_ERP_EXIT; | ||
903 | } | ||
904 | /* fall through otherwise */ | ||
899 | } | 905 | } |
900 | return ZFCP_ERP_FAILED; | 906 | return ZFCP_ERP_FAILED; |
901 | } | 907 | } |
diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h index 2e31b536548c..120a9a1c81f7 100644 --- a/drivers/s390/scsi/zfcp_ext.h +++ b/drivers/s390/scsi/zfcp_ext.h | |||
@@ -27,6 +27,7 @@ extern int zfcp_sg_setup_table(struct scatterlist *, int); | |||
27 | 27 | ||
28 | /* zfcp_ccw.c */ | 28 | /* zfcp_ccw.c */ |
29 | extern int zfcp_ccw_register(void); | 29 | extern int zfcp_ccw_register(void); |
30 | extern int zfcp_ccw_priv_sch(struct zfcp_adapter *); | ||
30 | extern struct zfcp_adapter *zfcp_get_adapter_by_busid(char *); | 31 | extern struct zfcp_adapter *zfcp_get_adapter_by_busid(char *); |
31 | 32 | ||
32 | /* zfcp_cfdc.c */ | 33 | /* zfcp_cfdc.c */ |
diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c index 19ae0842047c..35493a82d2a8 100644 --- a/drivers/s390/scsi/zfcp_fc.c +++ b/drivers/s390/scsi/zfcp_fc.c | |||
@@ -116,7 +116,7 @@ static void zfcp_wka_port_put(struct zfcp_wka_port *wka_port) | |||
116 | { | 116 | { |
117 | if (atomic_dec_return(&wka_port->refcount) != 0) | 117 | if (atomic_dec_return(&wka_port->refcount) != 0) |
118 | return; | 118 | return; |
119 | /* wait 10 miliseconds, other reqs might pop in */ | 119 | /* wait 10 milliseconds, other reqs might pop in */ |
120 | schedule_delayed_work(&wka_port->work, HZ / 100); | 120 | schedule_delayed_work(&wka_port->work, HZ / 100); |
121 | } | 121 | } |
122 | 122 | ||
@@ -150,9 +150,14 @@ static void _zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req, u32 range, | |||
150 | struct zfcp_port *port; | 150 | struct zfcp_port *port; |
151 | 151 | ||
152 | read_lock_irqsave(&zfcp_data.config_lock, flags); | 152 | read_lock_irqsave(&zfcp_data.config_lock, flags); |
153 | list_for_each_entry(port, &fsf_req->adapter->port_list_head, list) | 153 | list_for_each_entry(port, &fsf_req->adapter->port_list_head, list) { |
154 | if ((port->d_id & range) == (elem->nport_did & range)) | 154 | if ((port->d_id & range) == (elem->nport_did & range)) |
155 | zfcp_test_link(port); | 155 | zfcp_test_link(port); |
156 | if (!port->d_id) | ||
157 | zfcp_erp_port_reopen(port, | ||
158 | ZFCP_STATUS_COMMON_ERP_FAILED, | ||
159 | "fcrscn1", NULL); | ||
160 | } | ||
156 | 161 | ||
157 | read_unlock_irqrestore(&zfcp_data.config_lock, flags); | 162 | read_unlock_irqrestore(&zfcp_data.config_lock, flags); |
158 | } | 163 | } |
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 74dee32afba8..e6dae3744e79 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -526,6 +526,7 @@ static int zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *req) | |||
526 | break; | 526 | break; |
527 | case FSF_TOPO_AL: | 527 | case FSF_TOPO_AL: |
528 | fc_host_port_type(shost) = FC_PORTTYPE_NLPORT; | 528 | fc_host_port_type(shost) = FC_PORTTYPE_NLPORT; |
529 | /* fall through */ | ||
529 | default: | 530 | default: |
530 | dev_err(&adapter->ccw_device->dev, | 531 | dev_err(&adapter->ccw_device->dev, |
531 | "Unknown or unsupported arbitrated loop " | 532 | "Unknown or unsupported arbitrated loop " |
@@ -897,6 +898,7 @@ static void zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *req) | |||
897 | switch (fsq->word[0]) { | 898 | switch (fsq->word[0]) { |
898 | case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: | 899 | case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: |
899 | zfcp_test_link(unit->port); | 900 | zfcp_test_link(unit->port); |
901 | /* fall through */ | ||
900 | case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: | 902 | case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: |
901 | req->status |= ZFCP_STATUS_FSFREQ_ERROR; | 903 | req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
902 | break; | 904 | break; |
@@ -993,6 +995,7 @@ static void zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *req) | |||
993 | break; | 995 | break; |
994 | case FSF_PORT_HANDLE_NOT_VALID: | 996 | case FSF_PORT_HANDLE_NOT_VALID: |
995 | zfcp_erp_adapter_reopen(adapter, 0, "fsscth1", req); | 997 | zfcp_erp_adapter_reopen(adapter, 0, "fsscth1", req); |
998 | /* fall through */ | ||
996 | case FSF_GENERIC_COMMAND_REJECTED: | 999 | case FSF_GENERIC_COMMAND_REJECTED: |
997 | case FSF_PAYLOAD_SIZE_MISMATCH: | 1000 | case FSF_PAYLOAD_SIZE_MISMATCH: |
998 | case FSF_REQUEST_SIZE_TOO_LARGE: | 1001 | case FSF_REQUEST_SIZE_TOO_LARGE: |
@@ -1399,7 +1402,7 @@ static void zfcp_fsf_open_port_handler(struct zfcp_fsf_req *req) | |||
1399 | struct fsf_plogi *plogi; | 1402 | struct fsf_plogi *plogi; |
1400 | 1403 | ||
1401 | if (req->status & ZFCP_STATUS_FSFREQ_ERROR) | 1404 | if (req->status & ZFCP_STATUS_FSFREQ_ERROR) |
1402 | return; | 1405 | goto out; |
1403 | 1406 | ||
1404 | switch (header->fsf_status) { | 1407 | switch (header->fsf_status) { |
1405 | case FSF_PORT_ALREADY_OPEN: | 1408 | case FSF_PORT_ALREADY_OPEN: |
@@ -1461,6 +1464,9 @@ static void zfcp_fsf_open_port_handler(struct zfcp_fsf_req *req) | |||
1461 | req->status |= ZFCP_STATUS_FSFREQ_ERROR; | 1464 | req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
1462 | break; | 1465 | break; |
1463 | } | 1466 | } |
1467 | |||
1468 | out: | ||
1469 | zfcp_port_put(port); | ||
1464 | } | 1470 | } |
1465 | 1471 | ||
1466 | /** | 1472 | /** |
@@ -1473,6 +1479,7 @@ int zfcp_fsf_open_port(struct zfcp_erp_action *erp_action) | |||
1473 | struct qdio_buffer_element *sbale; | 1479 | struct qdio_buffer_element *sbale; |
1474 | struct zfcp_adapter *adapter = erp_action->adapter; | 1480 | struct zfcp_adapter *adapter = erp_action->adapter; |
1475 | struct zfcp_fsf_req *req; | 1481 | struct zfcp_fsf_req *req; |
1482 | struct zfcp_port *port = erp_action->port; | ||
1476 | int retval = -EIO; | 1483 | int retval = -EIO; |
1477 | 1484 | ||
1478 | spin_lock_bh(&adapter->req_q_lock); | 1485 | spin_lock_bh(&adapter->req_q_lock); |
@@ -1493,16 +1500,18 @@ int zfcp_fsf_open_port(struct zfcp_erp_action *erp_action) | |||
1493 | sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY; | 1500 | sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY; |
1494 | 1501 | ||
1495 | req->handler = zfcp_fsf_open_port_handler; | 1502 | req->handler = zfcp_fsf_open_port_handler; |
1496 | req->qtcb->bottom.support.d_id = erp_action->port->d_id; | 1503 | req->qtcb->bottom.support.d_id = port->d_id; |
1497 | req->data = erp_action->port; | 1504 | req->data = port; |
1498 | req->erp_action = erp_action; | 1505 | req->erp_action = erp_action; |
1499 | erp_action->fsf_req = req; | 1506 | erp_action->fsf_req = req; |
1507 | zfcp_port_get(port); | ||
1500 | 1508 | ||
1501 | zfcp_fsf_start_erp_timer(req); | 1509 | zfcp_fsf_start_erp_timer(req); |
1502 | retval = zfcp_fsf_req_send(req); | 1510 | retval = zfcp_fsf_req_send(req); |
1503 | if (retval) { | 1511 | if (retval) { |
1504 | zfcp_fsf_req_free(req); | 1512 | zfcp_fsf_req_free(req); |
1505 | erp_action->fsf_req = NULL; | 1513 | erp_action->fsf_req = NULL; |
1514 | zfcp_port_put(port); | ||
1506 | } | 1515 | } |
1507 | out: | 1516 | out: |
1508 | spin_unlock_bh(&adapter->req_q_lock); | 1517 | spin_unlock_bh(&adapter->req_q_lock); |
@@ -1590,8 +1599,10 @@ static void zfcp_fsf_open_wka_port_handler(struct zfcp_fsf_req *req) | |||
1590 | case FSF_MAXIMUM_NUMBER_OF_PORTS_EXCEEDED: | 1599 | case FSF_MAXIMUM_NUMBER_OF_PORTS_EXCEEDED: |
1591 | dev_warn(&req->adapter->ccw_device->dev, | 1600 | dev_warn(&req->adapter->ccw_device->dev, |
1592 | "Opening WKA port 0x%x failed\n", wka_port->d_id); | 1601 | "Opening WKA port 0x%x failed\n", wka_port->d_id); |
1602 | /* fall through */ | ||
1593 | case FSF_ADAPTER_STATUS_AVAILABLE: | 1603 | case FSF_ADAPTER_STATUS_AVAILABLE: |
1594 | req->status |= ZFCP_STATUS_FSFREQ_ERROR; | 1604 | req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
1605 | /* fall through */ | ||
1595 | case FSF_ACCESS_DENIED: | 1606 | case FSF_ACCESS_DENIED: |
1596 | wka_port->status = ZFCP_WKA_PORT_OFFLINE; | 1607 | wka_port->status = ZFCP_WKA_PORT_OFFLINE; |
1597 | break; | 1608 | break; |
@@ -1876,7 +1887,7 @@ static void zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *req) | |||
1876 | 1887 | ||
1877 | if (!(adapter->connection_features & FSF_FEATURE_NPIV_MODE) && | 1888 | if (!(adapter->connection_features & FSF_FEATURE_NPIV_MODE) && |
1878 | (adapter->adapter_features & FSF_FEATURE_LUN_SHARING) && | 1889 | (adapter->adapter_features & FSF_FEATURE_LUN_SHARING) && |
1879 | (adapter->ccw_device->id.dev_model != ZFCP_DEVICE_MODEL_PRIV)) { | 1890 | !zfcp_ccw_priv_sch(adapter)) { |
1880 | exclusive = (bottom->lun_access_info & | 1891 | exclusive = (bottom->lun_access_info & |
1881 | FSF_UNIT_ACCESS_EXCLUSIVE); | 1892 | FSF_UNIT_ACCESS_EXCLUSIVE); |
1882 | readwrite = (bottom->lun_access_info & | 1893 | readwrite = (bottom->lun_access_info & |
@@ -2314,7 +2325,7 @@ int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *unit, | |||
2314 | { | 2325 | { |
2315 | struct zfcp_fsf_req *req; | 2326 | struct zfcp_fsf_req *req; |
2316 | struct fcp_cmnd_iu *fcp_cmnd_iu; | 2327 | struct fcp_cmnd_iu *fcp_cmnd_iu; |
2317 | unsigned int sbtype; | 2328 | unsigned int sbtype = SBAL_FLAGS0_TYPE_READ; |
2318 | int real_bytes, retval = -EIO; | 2329 | int real_bytes, retval = -EIO; |
2319 | struct zfcp_adapter *adapter = unit->port->adapter; | 2330 | struct zfcp_adapter *adapter = unit->port->adapter; |
2320 | 2331 | ||
@@ -2356,11 +2367,9 @@ int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *unit, | |||
2356 | switch (scsi_cmnd->sc_data_direction) { | 2367 | switch (scsi_cmnd->sc_data_direction) { |
2357 | case DMA_NONE: | 2368 | case DMA_NONE: |
2358 | req->qtcb->bottom.io.data_direction = FSF_DATADIR_CMND; | 2369 | req->qtcb->bottom.io.data_direction = FSF_DATADIR_CMND; |
2359 | sbtype = SBAL_FLAGS0_TYPE_READ; | ||
2360 | break; | 2370 | break; |
2361 | case DMA_FROM_DEVICE: | 2371 | case DMA_FROM_DEVICE: |
2362 | req->qtcb->bottom.io.data_direction = FSF_DATADIR_READ; | 2372 | req->qtcb->bottom.io.data_direction = FSF_DATADIR_READ; |
2363 | sbtype = SBAL_FLAGS0_TYPE_READ; | ||
2364 | fcp_cmnd_iu->rddata = 1; | 2373 | fcp_cmnd_iu->rddata = 1; |
2365 | break; | 2374 | break; |
2366 | case DMA_TO_DEVICE: | 2375 | case DMA_TO_DEVICE: |
@@ -2369,8 +2378,6 @@ int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *unit, | |||
2369 | fcp_cmnd_iu->wddata = 1; | 2378 | fcp_cmnd_iu->wddata = 1; |
2370 | break; | 2379 | break; |
2371 | case DMA_BIDIRECTIONAL: | 2380 | case DMA_BIDIRECTIONAL: |
2372 | default: | ||
2373 | retval = -EIO; | ||
2374 | goto failed_scsi_cmnd; | 2381 | goto failed_scsi_cmnd; |
2375 | } | 2382 | } |
2376 | 2383 | ||
@@ -2394,9 +2401,7 @@ int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *unit, | |||
2394 | scsi_sglist(scsi_cmnd), | 2401 | scsi_sglist(scsi_cmnd), |
2395 | FSF_MAX_SBALS_PER_REQ); | 2402 | FSF_MAX_SBALS_PER_REQ); |
2396 | if (unlikely(real_bytes < 0)) { | 2403 | if (unlikely(real_bytes < 0)) { |
2397 | if (req->sbal_number < FSF_MAX_SBALS_PER_REQ) | 2404 | if (req->sbal_number >= FSF_MAX_SBALS_PER_REQ) { |
2398 | retval = -EIO; | ||
2399 | else { | ||
2400 | dev_err(&adapter->ccw_device->dev, | 2405 | dev_err(&adapter->ccw_device->dev, |
2401 | "Oversize data package, unit 0x%016Lx " | 2406 | "Oversize data package, unit 0x%016Lx " |
2402 | "on port 0x%016Lx closed\n", | 2407 | "on port 0x%016Lx closed\n", |
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index e8fbeaeb5fbf..7d0da230eb63 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c | |||
@@ -12,6 +12,10 @@ | |||
12 | #include "zfcp_ext.h" | 12 | #include "zfcp_ext.h" |
13 | #include <asm/atomic.h> | 13 | #include <asm/atomic.h> |
14 | 14 | ||
15 | static unsigned int default_depth = 32; | ||
16 | module_param_named(queue_depth, default_depth, uint, 0600); | ||
17 | MODULE_PARM_DESC(queue_depth, "Default queue depth for new SCSI devices"); | ||
18 | |||
15 | /* Find start of Sense Information in FCP response unit*/ | 19 | /* Find start of Sense Information in FCP response unit*/ |
16 | char *zfcp_get_fcp_sns_info_ptr(struct fcp_rsp_iu *fcp_rsp_iu) | 20 | char *zfcp_get_fcp_sns_info_ptr(struct fcp_rsp_iu *fcp_rsp_iu) |
17 | { | 21 | { |
@@ -24,6 +28,12 @@ char *zfcp_get_fcp_sns_info_ptr(struct fcp_rsp_iu *fcp_rsp_iu) | |||
24 | return fcp_sns_info_ptr; | 28 | return fcp_sns_info_ptr; |
25 | } | 29 | } |
26 | 30 | ||
31 | static int zfcp_scsi_change_queue_depth(struct scsi_device *sdev, int depth) | ||
32 | { | ||
33 | scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), depth); | ||
34 | return sdev->queue_depth; | ||
35 | } | ||
36 | |||
27 | static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt) | 37 | static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt) |
28 | { | 38 | { |
29 | struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata; | 39 | struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata; |
@@ -34,7 +44,7 @@ static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt) | |||
34 | static int zfcp_scsi_slave_configure(struct scsi_device *sdp) | 44 | static int zfcp_scsi_slave_configure(struct scsi_device *sdp) |
35 | { | 45 | { |
36 | if (sdp->tagged_supported) | 46 | if (sdp->tagged_supported) |
37 | scsi_adjust_queue_depth(sdp, MSG_SIMPLE_TAG, 32); | 47 | scsi_adjust_queue_depth(sdp, MSG_SIMPLE_TAG, default_depth); |
38 | else | 48 | else |
39 | scsi_adjust_queue_depth(sdp, 0, 1); | 49 | scsi_adjust_queue_depth(sdp, 0, 1); |
40 | return 0; | 50 | return 0; |
@@ -647,6 +657,7 @@ struct zfcp_data zfcp_data = { | |||
647 | .name = "zfcp", | 657 | .name = "zfcp", |
648 | .module = THIS_MODULE, | 658 | .module = THIS_MODULE, |
649 | .proc_name = "zfcp", | 659 | .proc_name = "zfcp", |
660 | .change_queue_depth = zfcp_scsi_change_queue_depth, | ||
650 | .slave_alloc = zfcp_scsi_slave_alloc, | 661 | .slave_alloc = zfcp_scsi_slave_alloc, |
651 | .slave_configure = zfcp_scsi_slave_configure, | 662 | .slave_configure = zfcp_scsi_slave_configure, |
652 | .slave_destroy = zfcp_scsi_slave_destroy, | 663 | .slave_destroy = zfcp_scsi_slave_destroy, |