aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/s390/block/dasd.c34
-rw-r--r--drivers/s390/block/dasd_diag.c1
-rw-r--r--drivers/s390/block/dasd_eckd.c44
-rw-r--r--drivers/s390/block/dasd_fba.c22
-rw-r--r--drivers/s390/block/dasd_int.h3
-rw-r--r--drivers/s390/block/dcssblk.c4
-rw-r--r--drivers/s390/char/con3270.c38
-rw-r--r--drivers/s390/char/tty3270.c57
-rw-r--r--drivers/s390/cio/cio.c6
-rw-r--r--drivers/s390/cio/device_ops.c24
-rw-r--r--drivers/s390/cio/qdio_main.c46
-rw-r--r--drivers/s390/cio/qdio_perf.c12
-rw-r--r--drivers/s390/cio/qdio_perf.h10
13 files changed, 135 insertions, 166 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index 27a1be0cd4d4..442bb98a2821 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -851,8 +851,10 @@ int dasd_start_IO(struct dasd_ccw_req *cqr)
851 851
852 /* Check the cqr */ 852 /* Check the cqr */
853 rc = dasd_check_cqr(cqr); 853 rc = dasd_check_cqr(cqr);
854 if (rc) 854 if (rc) {
855 cqr->intrc = rc;
855 return rc; 856 return rc;
857 }
856 device = (struct dasd_device *) cqr->startdev; 858 device = (struct dasd_device *) cqr->startdev;
857 if (cqr->retries < 0) { 859 if (cqr->retries < 0) {
858 /* internal error 14 - start_IO run out of retries */ 860 /* internal error 14 - start_IO run out of retries */
@@ -915,6 +917,7 @@ int dasd_start_IO(struct dasd_ccw_req *cqr)
915 BUG(); 917 BUG();
916 break; 918 break;
917 } 919 }
920 cqr->intrc = rc;
918 return rc; 921 return rc;
919} 922}
920 923
@@ -1454,8 +1457,12 @@ int dasd_sleep_on(struct dasd_ccw_req *cqr)
1454 dasd_add_request_tail(cqr); 1457 dasd_add_request_tail(cqr);
1455 wait_event(generic_waitq, _wait_for_wakeup(cqr)); 1458 wait_event(generic_waitq, _wait_for_wakeup(cqr));
1456 1459
1457 /* Request status is either done or failed. */ 1460 if (cqr->status == DASD_CQR_DONE)
1458 rc = (cqr->status == DASD_CQR_DONE) ? 0 : -EIO; 1461 rc = 0;
1462 else if (cqr->intrc)
1463 rc = cqr->intrc;
1464 else
1465 rc = -EIO;
1459 return rc; 1466 return rc;
1460} 1467}
1461 1468
@@ -1477,8 +1484,15 @@ int dasd_sleep_on_interruptible(struct dasd_ccw_req *cqr)
1477 dasd_cancel_req(cqr); 1484 dasd_cancel_req(cqr);
1478 /* wait (non-interruptible) for final status */ 1485 /* wait (non-interruptible) for final status */
1479 wait_event(generic_waitq, _wait_for_wakeup(cqr)); 1486 wait_event(generic_waitq, _wait_for_wakeup(cqr));
1487 cqr->intrc = rc;
1480 } 1488 }
1481 rc = (cqr->status == DASD_CQR_DONE) ? 0 : -EIO; 1489
1490 if (cqr->status == DASD_CQR_DONE)
1491 rc = 0;
1492 else if (cqr->intrc)
1493 rc = cqr->intrc;
1494 else
1495 rc = -EIO;
1482 return rc; 1496 return rc;
1483} 1497}
1484 1498
@@ -1523,8 +1537,12 @@ int dasd_sleep_on_immediatly(struct dasd_ccw_req *cqr)
1523 1537
1524 wait_event(generic_waitq, _wait_for_wakeup(cqr)); 1538 wait_event(generic_waitq, _wait_for_wakeup(cqr));
1525 1539
1526 /* Request status is either done or failed. */ 1540 if (cqr->status == DASD_CQR_DONE)
1527 rc = (cqr->status == DASD_CQR_DONE) ? 0 : -EIO; 1541 rc = 0;
1542 else if (cqr->intrc)
1543 rc = cqr->intrc;
1544 else
1545 rc = -EIO;
1528 return rc; 1546 return rc;
1529} 1547}
1530 1548
@@ -2427,12 +2445,12 @@ static struct dasd_ccw_req *dasd_generic_build_rdc(struct dasd_device *device,
2427 2445
2428 2446
2429int dasd_generic_read_dev_chars(struct dasd_device *device, char *magic, 2447int dasd_generic_read_dev_chars(struct dasd_device *device, char *magic,
2430 void **rdc_buffer, int rdc_buffer_size) 2448 void *rdc_buffer, int rdc_buffer_size)
2431{ 2449{
2432 int ret; 2450 int ret;
2433 struct dasd_ccw_req *cqr; 2451 struct dasd_ccw_req *cqr;
2434 2452
2435 cqr = dasd_generic_build_rdc(device, *rdc_buffer, rdc_buffer_size, 2453 cqr = dasd_generic_build_rdc(device, rdc_buffer, rdc_buffer_size,
2436 magic); 2454 magic);
2437 if (IS_ERR(cqr)) 2455 if (IS_ERR(cqr))
2438 return PTR_ERR(cqr); 2456 return PTR_ERR(cqr);
diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c
index 2efaddfae560..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
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index a41c94053e64..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;
@@ -2361,11 +2361,15 @@ static struct dasd_ccw_req *dasd_eckd_build_cp(struct dasd_device *startdev,
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;
@@ -3013,8 +3017,9 @@ static void dasd_eckd_dump_sense_ccw(struct dasd_device *device,
3013 " I/O status report for device %s:\n", 3017 " I/O status report for device %s:\n",
3014 dev_name(&device->cdev->dev)); 3018 dev_name(&device->cdev->dev));
3015 len += sprintf(page + len, KERN_ERR PRINTK_HEADER 3019 len += sprintf(page + len, KERN_ERR PRINTK_HEADER
3016 " in req: %p CS: 0x%02X DS: 0x%02X\n", req, 3020 " in req: %p CS: 0x%02X DS: 0x%02X CC: 0x%02X RC: %d\n",
3017 scsw_cstat(&irb->scsw), scsw_dstat(&irb->scsw)); 3021 req, scsw_cstat(&irb->scsw), scsw_dstat(&irb->scsw),
3022 scsw_cc(&irb->scsw), req->intrc);
3018 len += sprintf(page + len, KERN_ERR PRINTK_HEADER 3023 len += sprintf(page + len, KERN_ERR PRINTK_HEADER
3019 " device %s: Failing CCW: %p\n", 3024 " device %s: Failing CCW: %p\n",
3020 dev_name(&device->cdev->dev), 3025 dev_name(&device->cdev->dev),
@@ -3115,9 +3120,10 @@ static void dasd_eckd_dump_sense_tcw(struct dasd_device *device,
3115 " I/O status report for device %s:\n", 3120 " I/O status report for device %s:\n",
3116 dev_name(&device->cdev->dev)); 3121 dev_name(&device->cdev->dev));
3117 len += sprintf(page + len, KERN_ERR PRINTK_HEADER 3122 len += sprintf(page + len, KERN_ERR PRINTK_HEADER
3118 " in req: %p CS: 0x%02X DS: 0x%02X " 3123 " in req: %p CS: 0x%02X DS: 0x%02X CC: 0x%02X RC: %d "
3119 "fcxs: 0x%02X schxs: 0x%02X\n", req, 3124 "fcxs: 0x%02X schxs: 0x%02X\n", req,
3120 scsw_cstat(&irb->scsw), scsw_dstat(&irb->scsw), 3125 scsw_cstat(&irb->scsw), scsw_dstat(&irb->scsw),
3126 scsw_cc(&irb->scsw), req->intrc,
3121 irb->scsw.tm.fcxs, irb->scsw.tm.schxs); 3127 irb->scsw.tm.fcxs, irb->scsw.tm.schxs);
3122 len += sprintf(page + len, KERN_ERR PRINTK_HEADER 3128 len += sprintf(page + len, KERN_ERR PRINTK_HEADER
3123 " device %s: Failing TCW: %p\n", 3129 " device %s: Failing TCW: %p\n",
@@ -3273,8 +3279,14 @@ static struct dasd_discipline dasd_eckd_discipline = {
3273static int __init 3279static int __init
3274dasd_eckd_init(void) 3280dasd_eckd_init(void)
3275{ 3281{
3282 int ret;
3283
3276 ASCEBC(dasd_eckd_discipline.ebcname, 4); 3284 ASCEBC(dasd_eckd_discipline.ebcname, 4);
3277 return ccw_driver_register(&dasd_eckd_driver); 3285 ret = ccw_driver_register(&dasd_eckd_driver);
3286 if (!ret)
3287 wait_for_device_probe();
3288
3289 return ret;
3278} 3290}
3279 3291
3280static void __exit 3292static void __exit
diff --git a/drivers/s390/block/dasd_fba.c b/drivers/s390/block/dasd_fba.c
index 8912358daa2f..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",
@@ -604,8 +604,14 @@ static struct dasd_discipline dasd_fba_discipline = {
604static int __init 604static int __init
605dasd_fba_init(void) 605dasd_fba_init(void)
606{ 606{
607 int ret;
608
607 ASCEBC(dasd_fba_discipline.ebcname, 4); 609 ASCEBC(dasd_fba_discipline.ebcname, 4);
608 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;
609} 615}
610 616
611static void __exit 617static void __exit
diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h
index c1e487f774c6..f97ceb795078 100644
--- a/drivers/s390/block/dasd_int.h
+++ b/drivers/s390/block/dasd_int.h
@@ -173,6 +173,7 @@ struct dasd_ccw_req {
173 void *data; /* pointer to data area */ 173 void *data; /* pointer to data area */
174 174
175 /* these are important for recovering erroneous requests */ 175 /* these are important for recovering erroneous requests */
176 int intrc; /* internal error, e.g. from start_IO */
176 struct irb irb; /* device status in case of an error */ 177 struct irb irb; /* device status in case of an error */
177 struct dasd_ccw_req *refers; /* ERP-chain queueing. */ 178 struct dasd_ccw_req *refers; /* ERP-chain queueing. */
178 void *function; /* originating ERP action */ 179 void *function; /* originating ERP action */
@@ -578,7 +579,7 @@ int dasd_generic_set_offline (struct ccw_device *cdev);
578int dasd_generic_notify(struct ccw_device *, int); 579int dasd_generic_notify(struct ccw_device *, int);
579void dasd_generic_handle_state_change(struct dasd_device *); 580void dasd_generic_handle_state_change(struct dasd_device *);
580 581
581int dasd_generic_read_dev_chars(struct dasd_device *, char *, void **, int); 582int dasd_generic_read_dev_chars(struct dasd_device *, char *, void *, int);
582char *dasd_get_sense(struct irb *); 583char *dasd_get_sense(struct irb *);
583 584
584/* externals in dasd_devmap.c */ 585/* externals in dasd_devmap.c */
diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c
index a4c7ffcd9987..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 }
@@ -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/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
69static void con3270_update(struct con3270 *); 69static void con3270_update(struct con3270 *);
70 70
@@ -73,18 +73,10 @@ static void con3270_update(struct con3270 *);
73 */ 73 */
74static void con3270_set_timer(struct con3270 *cp, int expires) 74static 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)
382static int 379static int
383con3270_activate(struct raw3270_view *view) 380con3270_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
399static void 390static void
400con3270_deactivate(struct raw3270_view *view) 391con3270_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
411static int 399static 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/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
117static void tty3270_update(struct tty3270 *); 117static void tty3270_update(struct tty3270 *);
118 118
@@ -121,19 +121,10 @@ static void tty3270_update(struct tty3270 *);
121 */ 121 */
122static void tty3270_set_timer(struct tty3270 *tp, int expires) 122static 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
641tty3270_activate(struct raw3270_view *view) 635tty3270_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
657static void 645static void
658tty3270_deactivate(struct raw3270_view *view) 646tty3270_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
662static int 654static 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
1757static 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 */
629void 630void __irq_entry do_IRQ(struct pt_regs *regs)
630do_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
884static int qdio_establish_check_errors(struct ccw_device *cdev, int cstat, 884static 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
904error: 900error:
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
912static 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;
25static struct proc_dir_entry *qdio_perf_pde; 25static struct proc_dir_entry *qdio_perf_pde;
26#endif 26#endif
27 27
28inline void qdio_perf_stat_inc(atomic_long_t *count)
29{
30 if (qdio_performance_stats)
31 atomic_long_inc(count);
32}
33
34inline 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
15struct qdio_perf_stats { 14struct qdio_perf_stats {
@@ -50,10 +49,13 @@ struct qdio_perf_stats {
50extern struct qdio_perf_stats perf_stats; 49extern struct qdio_perf_stats perf_stats;
51extern int qdio_performance_stats; 50extern int qdio_performance_stats;
52 51
52static inline void qdio_perf_stat_inc(atomic_long_t *count)
53{
54 if (qdio_performance_stats)
55 atomic_long_inc(count);
56}
57
53int qdio_setup_perf_stats(void); 58int qdio_setup_perf_stats(void);
54void qdio_remove_perf_stats(void); 59void qdio_remove_perf_stats(void);
55 60
56extern void qdio_perf_stat_inc(atomic_long_t *count);
57extern void qdio_perf_stat_dec(atomic_long_t *count);
58
59#endif 61#endif