aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/block/dasd.c21
-rw-r--r--drivers/s390/block/dasd_cmb.c19
-rw-r--r--drivers/s390/block/dasd_devmap.c59
-rw-r--r--drivers/s390/block/dasd_eckd.c5
-rw-r--r--drivers/s390/block/dasd_genhd.c10
-rw-r--r--drivers/s390/block/dasd_int.h7
-rw-r--r--drivers/s390/block/dasd_ioctl.c31
-rw-r--r--drivers/s390/block/dasd_proc.c8
-rw-r--r--drivers/s390/cio/airq.c4
-rw-r--r--drivers/s390/cio/cio.c4
-rw-r--r--drivers/s390/cio/device_ops.c6
-rw-r--r--drivers/s390/cio/qdio.h6
-rw-r--r--drivers/s390/crypto/z90main.c140
-rw-r--r--drivers/s390/net/smsgiucv.c19
-rw-r--r--drivers/s390/net/smsgiucv.h4
15 files changed, 176 insertions, 167 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index b755bac6ccbc..02cfe244e069 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -7,7 +7,7 @@
7 * Bugreports.to..: <Linux390@de.ibm.com> 7 * Bugreports.to..: <Linux390@de.ibm.com>
8 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001 8 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001
9 * 9 *
10 * $Revision: 1.158 $ 10 * $Revision: 1.161 $
11 */ 11 */
12 12
13#include <linux/config.h> 13#include <linux/config.h>
@@ -1131,13 +1131,17 @@ __dasd_process_blk_queue(struct dasd_device * device)
1131 request_queue_t *queue; 1131 request_queue_t *queue;
1132 struct request *req; 1132 struct request *req;
1133 struct dasd_ccw_req *cqr; 1133 struct dasd_ccw_req *cqr;
1134 int nr_queued; 1134 int nr_queued, feature_ro;
1135 1135
1136 queue = device->request_queue; 1136 queue = device->request_queue;
1137 /* No queue ? Then there is nothing to do. */ 1137 /* No queue ? Then there is nothing to do. */
1138 if (queue == NULL) 1138 if (queue == NULL)
1139 return; 1139 return;
1140 1140
1141 feature_ro = dasd_get_feature(device->cdev, DASD_FEATURE_READONLY);
1142 if (feature_ro < 0) /* no devmap */
1143 return;
1144
1141 /* 1145 /*
1142 * We requeue request from the block device queue to the ccw 1146 * We requeue request from the block device queue to the ccw
1143 * queue only in two states. In state DASD_STATE_READY the 1147 * queue only in two states. In state DASD_STATE_READY the
@@ -1157,8 +1161,8 @@ __dasd_process_blk_queue(struct dasd_device * device)
1157 elv_next_request(queue) && 1161 elv_next_request(queue) &&
1158 nr_queued < DASD_CHANQ_MAX_SIZE) { 1162 nr_queued < DASD_CHANQ_MAX_SIZE) {
1159 req = elv_next_request(queue); 1163 req = elv_next_request(queue);
1160 if (test_bit(DASD_FLAG_RO, &device->flags) && 1164
1161 rq_data_dir(req) == WRITE) { 1165 if (feature_ro && rq_data_dir(req) == WRITE) {
1162 DBF_DEV_EVENT(DBF_ERR, device, 1166 DBF_DEV_EVENT(DBF_ERR, device,
1163 "Rejecting write request %p", 1167 "Rejecting write request %p",
1164 req); 1168 req);
@@ -1631,6 +1635,7 @@ dasd_setup_queue(struct dasd_device * device)
1631 blk_queue_max_hw_segments(device->request_queue, -1L); 1635 blk_queue_max_hw_segments(device->request_queue, -1L);
1632 blk_queue_max_segment_size(device->request_queue, -1L); 1636 blk_queue_max_segment_size(device->request_queue, -1L);
1633 blk_queue_segment_boundary(device->request_queue, -1L); 1637 blk_queue_segment_boundary(device->request_queue, -1L);
1638 blk_queue_ordered(device->request_queue, 1);
1634} 1639}
1635 1640
1636/* 1641/*
@@ -1803,13 +1808,17 @@ dasd_generic_set_online (struct ccw_device *cdev,
1803 1808
1804{ 1809{
1805 struct dasd_device *device; 1810 struct dasd_device *device;
1806 int rc; 1811 int feature_diag, rc;
1812
1813 feature_diag = dasd_get_feature(cdev, DASD_FEATURE_USEDIAG);
1814 if (feature_diag < 0)
1815 return feature_diag;
1807 1816
1808 device = dasd_create_device(cdev); 1817 device = dasd_create_device(cdev);
1809 if (IS_ERR(device)) 1818 if (IS_ERR(device))
1810 return PTR_ERR(device); 1819 return PTR_ERR(device);
1811 1820
1812 if (test_bit(DASD_FLAG_USE_DIAG, &device->flags)) { 1821 if (feature_diag) {
1813 if (!dasd_diag_discipline_pointer) { 1822 if (!dasd_diag_discipline_pointer) {
1814 printk (KERN_WARNING 1823 printk (KERN_WARNING
1815 "dasd_generic couldn't online device %s " 1824 "dasd_generic couldn't online device %s "
diff --git a/drivers/s390/block/dasd_cmb.c b/drivers/s390/block/dasd_cmb.c
index ed1ab474c0c6..4f365bff275c 100644
--- a/drivers/s390/block/dasd_cmb.c
+++ b/drivers/s390/block/dasd_cmb.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/drivers/s390/block/dasd_cmb.c ($Revision: 1.6 $) 2 * linux/drivers/s390/block/dasd_cmb.c ($Revision: 1.9 $)
3 * 3 *
4 * Linux on zSeries Channel Measurement Facility support 4 * Linux on zSeries Channel Measurement Facility support
5 * (dasd device driver interface) 5 * (dasd device driver interface)
@@ -23,7 +23,6 @@
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 */ 24 */
25#include <linux/init.h> 25#include <linux/init.h>
26#include <linux/ioctl32.h>
27#include <linux/module.h> 26#include <linux/module.h>
28#include <asm/ccwdev.h> 27#include <asm/ccwdev.h>
29#include <asm/cmb.h> 28#include <asm/cmb.h>
@@ -84,27 +83,13 @@ dasd_ioctl_readall_cmb(struct block_device *bdev, int no, long args)
84static inline int 83static inline int
85ioctl_reg(unsigned int no, dasd_ioctl_fn_t handler) 84ioctl_reg(unsigned int no, dasd_ioctl_fn_t handler)
86{ 85{
87 int ret; 86 return dasd_ioctl_no_register(THIS_MODULE, no, handler);
88 ret = dasd_ioctl_no_register(THIS_MODULE, no, handler);
89#ifdef CONFIG_COMPAT
90 if (ret)
91 return ret;
92
93 ret = register_ioctl32_conversion(no, NULL);
94 if (ret)
95 dasd_ioctl_no_unregister(THIS_MODULE, no, handler);
96#endif
97 return ret;
98} 87}
99 88
100static inline void 89static inline void
101ioctl_unreg(unsigned int no, dasd_ioctl_fn_t handler) 90ioctl_unreg(unsigned int no, dasd_ioctl_fn_t handler)
102{ 91{
103 dasd_ioctl_no_unregister(THIS_MODULE, no, handler); 92 dasd_ioctl_no_unregister(THIS_MODULE, no, handler);
104#ifdef CONFIG_COMPAT
105 unregister_ioctl32_conversion(no);
106#endif
107
108} 93}
109 94
110static void 95static void
diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c
index ad1841a96c87..1aedc48e5f85 100644
--- a/drivers/s390/block/dasd_devmap.c
+++ b/drivers/s390/block/dasd_devmap.c
@@ -11,7 +11,7 @@
11 * functions may not be called from interrupt context. In particular 11 * functions may not be called from interrupt context. In particular
12 * dasd_get_device is a no-no from interrupt context. 12 * dasd_get_device is a no-no from interrupt context.
13 * 13 *
14 * $Revision: 1.37 $ 14 * $Revision: 1.40 $
15 */ 15 */
16 16
17#include <linux/config.h> 17#include <linux/config.h>
@@ -513,14 +513,6 @@ dasd_create_device(struct ccw_device *cdev)
513 if (!devmap->device) { 513 if (!devmap->device) {
514 devmap->device = device; 514 devmap->device = device;
515 device->devindex = devmap->devindex; 515 device->devindex = devmap->devindex;
516 if (devmap->features & DASD_FEATURE_READONLY)
517 set_bit(DASD_FLAG_RO, &device->flags);
518 else
519 clear_bit(DASD_FLAG_RO, &device->flags);
520 if (devmap->features & DASD_FEATURE_USEDIAG)
521 set_bit(DASD_FLAG_USE_DIAG, &device->flags);
522 else
523 clear_bit(DASD_FLAG_USE_DIAG, &device->flags);
524 get_device(&cdev->dev); 516 get_device(&cdev->dev);
525 device->cdev = cdev; 517 device->cdev = cdev;
526 rc = 0; 518 rc = 0;
@@ -651,14 +643,8 @@ dasd_ro_store(struct device *dev, const char *buf, size_t count)
651 devmap->features |= DASD_FEATURE_READONLY; 643 devmap->features |= DASD_FEATURE_READONLY;
652 else 644 else
653 devmap->features &= ~DASD_FEATURE_READONLY; 645 devmap->features &= ~DASD_FEATURE_READONLY;
654 if (devmap->device) { 646 if (devmap->device && devmap->device->gdp)
655 if (devmap->device->gdp) 647 set_disk_ro(devmap->device->gdp, ro_flag);
656 set_disk_ro(devmap->device->gdp, ro_flag);
657 if (ro_flag)
658 set_bit(DASD_FLAG_RO, &devmap->device->flags);
659 else
660 clear_bit(DASD_FLAG_RO, &devmap->device->flags);
661 }
662 spin_unlock(&dasd_devmap_lock); 648 spin_unlock(&dasd_devmap_lock);
663 return count; 649 return count;
664} 650}
@@ -739,6 +725,45 @@ static struct attribute_group dasd_attr_group = {
739 .attrs = dasd_attrs, 725 .attrs = dasd_attrs,
740}; 726};
741 727
728/*
729 * Return value of the specified feature.
730 */
731int
732dasd_get_feature(struct ccw_device *cdev, int feature)
733{
734 struct dasd_devmap *devmap;
735
736 devmap = dasd_find_busid(cdev->dev.bus_id);
737 if (IS_ERR(devmap))
738 return (int) PTR_ERR(devmap);
739
740 return ((devmap->features & feature) != 0);
741}
742
743/*
744 * Set / reset given feature.
745 * Flag indicates wether to set (!=0) or the reset (=0) the feature.
746 */
747int
748dasd_set_feature(struct ccw_device *cdev, int feature, int flag)
749{
750 struct dasd_devmap *devmap;
751
752 devmap = dasd_find_busid(cdev->dev.bus_id);
753 if (IS_ERR(devmap))
754 return (int) PTR_ERR(devmap);
755
756 spin_lock(&dasd_devmap_lock);
757 if (flag)
758 devmap->features |= feature;
759 else
760 devmap->features &= ~feature;
761
762 spin_unlock(&dasd_devmap_lock);
763 return 0;
764}
765
766
742int 767int
743dasd_add_sysfs_files(struct ccw_device *cdev) 768dasd_add_sysfs_files(struct ccw_device *cdev)
744{ 769{
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index 838aedf78a56..811060e10c00 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -7,7 +7,7 @@
7 * Bugreports.to..: <Linux390@de.ibm.com> 7 * Bugreports.to..: <Linux390@de.ibm.com>
8 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000 8 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
9 * 9 *
10 * $Revision: 1.69 $ 10 * $Revision: 1.71 $
11 */ 11 */
12 12
13#include <linux/config.h> 13#include <linux/config.h>
@@ -1101,7 +1101,8 @@ dasd_eckd_build_cp(struct dasd_device * device, struct request *req)
1101 if (dasd_eckd_cdl_special(blk_per_trk, recid)){ 1101 if (dasd_eckd_cdl_special(blk_per_trk, recid)){
1102 rcmd |= 0x8; 1102 rcmd |= 0x8;
1103 count = dasd_eckd_cdl_reclen(recid); 1103 count = dasd_eckd_cdl_reclen(recid);
1104 if (count < blksize) 1104 if (count < blksize &&
1105 rq_data_dir(req) == READ)
1105 memset(dst + count, 0xe5, 1106 memset(dst + count, 0xe5,
1106 blksize - count); 1107 blksize - count);
1107 } 1108 }
diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c
index 1d52db406b2e..96c49349701f 100644
--- a/drivers/s390/block/dasd_genhd.c
+++ b/drivers/s390/block/dasd_genhd.c
@@ -9,7 +9,7 @@
9 * 9 *
10 * gendisk related functions for the dasd driver. 10 * gendisk related functions for the dasd driver.
11 * 11 *
12 * $Revision: 1.48 $ 12 * $Revision: 1.50 $
13 */ 13 */
14 14
15#include <linux/config.h> 15#include <linux/config.h>
@@ -31,12 +31,16 @@ int
31dasd_gendisk_alloc(struct dasd_device *device) 31dasd_gendisk_alloc(struct dasd_device *device)
32{ 32{
33 struct gendisk *gdp; 33 struct gendisk *gdp;
34 int len; 34 int len, feature_ro;
35 35
36 /* Make sure the minor for this device exists. */ 36 /* Make sure the minor for this device exists. */
37 if (device->devindex >= DASD_PER_MAJOR) 37 if (device->devindex >= DASD_PER_MAJOR)
38 return -EBUSY; 38 return -EBUSY;
39 39
40 feature_ro = dasd_get_feature(device->cdev, DASD_FEATURE_READONLY);
41 if (feature_ro < 0)
42 return feature_ro;
43
40 gdp = alloc_disk(1 << DASD_PARTN_BITS); 44 gdp = alloc_disk(1 << DASD_PARTN_BITS);
41 if (!gdp) 45 if (!gdp)
42 return -ENOMEM; 46 return -ENOMEM;
@@ -71,7 +75,7 @@ dasd_gendisk_alloc(struct dasd_device *device)
71 75
72 sprintf(gdp->devfs_name, "dasd/%s", device->cdev->dev.bus_id); 76 sprintf(gdp->devfs_name, "dasd/%s", device->cdev->dev.bus_id);
73 77
74 if (test_bit(DASD_FLAG_RO, &device->flags)) 78 if (feature_ro)
75 set_disk_ro(gdp, 1); 79 set_disk_ro(gdp, 1);
76 gdp->private_data = device; 80 gdp->private_data = device;
77 gdp->queue = device->request_queue; 81 gdp->queue = device->request_queue;
diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h
index 4586e0ecc526..a9f38b235981 100644
--- a/drivers/s390/block/dasd_int.h
+++ b/drivers/s390/block/dasd_int.h
@@ -6,7 +6,7 @@
6 * Bugreports.to..: <Linux390@de.ibm.com> 6 * Bugreports.to..: <Linux390@de.ibm.com>
7 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000 7 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
8 * 8 *
9 * $Revision: 1.63 $ 9 * $Revision: 1.64 $
10 */ 10 */
11 11
12#ifndef DASD_INT_H 12#ifndef DASD_INT_H
@@ -329,8 +329,6 @@ struct dasd_device {
329#define DASD_STOPPED_DC_EIO 16 /* disconnected, return -EIO */ 329#define DASD_STOPPED_DC_EIO 16 /* disconnected, return -EIO */
330 330
331/* per device flags */ 331/* per device flags */
332#define DASD_FLAG_RO 0 /* device is read-only */
333#define DASD_FLAG_USE_DIAG 1 /* use diag disciplnie */
334#define DASD_FLAG_DSC_ERROR 2 /* return -EIO when disconnected */ 332#define DASD_FLAG_DSC_ERROR 2 /* return -EIO when disconnected */
335#define DASD_FLAG_OFFLINE 3 /* device is in offline processing */ 333#define DASD_FLAG_OFFLINE 3 /* device is in offline processing */
336 334
@@ -501,6 +499,9 @@ void dasd_devmap_exit(void);
501struct dasd_device *dasd_create_device(struct ccw_device *); 499struct dasd_device *dasd_create_device(struct ccw_device *);
502void dasd_delete_device(struct dasd_device *); 500void dasd_delete_device(struct dasd_device *);
503 501
502int dasd_get_feature(struct ccw_device *, int);
503int dasd_set_feature(struct ccw_device *, int, int);
504
504int dasd_add_sysfs_files(struct ccw_device *); 505int dasd_add_sysfs_files(struct ccw_device *);
505void dasd_remove_sysfs_files(struct ccw_device *); 506void dasd_remove_sysfs_files(struct ccw_device *);
506 507
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c
index f1892baa3b18..980c555aa538 100644
--- a/drivers/s390/block/dasd_ioctl.c
+++ b/drivers/s390/block/dasd_ioctl.c
@@ -7,6 +7,8 @@
7 * Bugreports.to..: <Linux390@de.ibm.com> 7 * Bugreports.to..: <Linux390@de.ibm.com>
8 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001 8 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001
9 * 9 *
10 * $Revision: 1.45 $
11 *
10 * i/o controls for the dasd driver. 12 * i/o controls for the dasd driver.
11 */ 13 */
12#include <linux/config.h> 14#include <linux/config.h>
@@ -294,6 +296,7 @@ dasd_ioctl_format(struct block_device *bdev, int no, long args)
294{ 296{
295 struct dasd_device *device; 297 struct dasd_device *device;
296 struct format_data_t fdata; 298 struct format_data_t fdata;
299 int feature_ro;
297 300
298 if (!capable(CAP_SYS_ADMIN)) 301 if (!capable(CAP_SYS_ADMIN))
299 return -EACCES; 302 return -EACCES;
@@ -304,7 +307,11 @@ dasd_ioctl_format(struct block_device *bdev, int no, long args)
304 307
305 if (device == NULL) 308 if (device == NULL)
306 return -ENODEV; 309 return -ENODEV;
307 if (test_bit(DASD_FLAG_RO, &device->flags)) 310
311 feature_ro = dasd_get_feature(device->cdev, DASD_FEATURE_READONLY);
312 if (feature_ro < 0)
313 return feature_ro;
314 if (feature_ro)
308 return -EROFS; 315 return -EROFS;
309 if (copy_from_user(&fdata, (void __user *) args, 316 if (copy_from_user(&fdata, (void __user *) args,
310 sizeof (struct format_data_t))) 317 sizeof (struct format_data_t)))
@@ -377,7 +384,7 @@ dasd_ioctl_information(struct block_device *bdev, int no, long args)
377 struct dasd_device *device; 384 struct dasd_device *device;
378 struct dasd_information2_t *dasd_info; 385 struct dasd_information2_t *dasd_info;
379 unsigned long flags; 386 unsigned long flags;
380 int rc; 387 int rc, feature_ro;
381 struct ccw_device *cdev; 388 struct ccw_device *cdev;
382 389
383 device = bdev->bd_disk->private_data; 390 device = bdev->bd_disk->private_data;
@@ -387,6 +394,10 @@ dasd_ioctl_information(struct block_device *bdev, int no, long args)
387 if (!device->discipline->fill_info) 394 if (!device->discipline->fill_info)
388 return -EINVAL; 395 return -EINVAL;
389 396
397 feature_ro = dasd_get_feature(device->cdev, DASD_FEATURE_READONLY);
398 if (feature_ro < 0)
399 return feature_ro;
400
390 dasd_info = kmalloc(sizeof(struct dasd_information2_t), GFP_KERNEL); 401 dasd_info = kmalloc(sizeof(struct dasd_information2_t), GFP_KERNEL);
391 if (dasd_info == NULL) 402 if (dasd_info == NULL)
392 return -ENOMEM; 403 return -ENOMEM;
@@ -415,9 +426,8 @@ dasd_ioctl_information(struct block_device *bdev, int no, long args)
415 if ((device->state < DASD_STATE_READY) || 426 if ((device->state < DASD_STATE_READY) ||
416 (dasd_check_blocksize(device->bp_block))) 427 (dasd_check_blocksize(device->bp_block)))
417 dasd_info->format = DASD_FORMAT_NONE; 428 dasd_info->format = DASD_FORMAT_NONE;
418 429
419 dasd_info->features |= test_bit(DASD_FLAG_RO, &device->flags) ? 430 dasd_info->features |= feature_ro;
420 DASD_FEATURE_READONLY : DASD_FEATURE_DEFAULT;
421 431
422 if (device->discipline) 432 if (device->discipline)
423 memcpy(dasd_info->type, device->discipline->name, 4); 433 memcpy(dasd_info->type, device->discipline->name, 4);
@@ -460,7 +470,7 @@ static int
460dasd_ioctl_set_ro(struct block_device *bdev, int no, long args) 470dasd_ioctl_set_ro(struct block_device *bdev, int no, long args)
461{ 471{
462 struct dasd_device *device; 472 struct dasd_device *device;
463 int intval; 473 int intval, rc;
464 474
465 if (!capable(CAP_SYS_ADMIN)) 475 if (!capable(CAP_SYS_ADMIN))
466 return -EACCES; 476 return -EACCES;
@@ -472,12 +482,11 @@ dasd_ioctl_set_ro(struct block_device *bdev, int no, long args)
472 device = bdev->bd_disk->private_data; 482 device = bdev->bd_disk->private_data;
473 if (device == NULL) 483 if (device == NULL)
474 return -ENODEV; 484 return -ENODEV;
485
475 set_disk_ro(bdev->bd_disk, intval); 486 set_disk_ro(bdev->bd_disk, intval);
476 if (intval) 487 rc = dasd_set_feature(device->cdev, DASD_FEATURE_READONLY, intval);
477 set_bit(DASD_FLAG_RO, &device->flags); 488
478 else 489 return rc;
479 clear_bit(DASD_FLAG_RO, &device->flags);
480 return 0;
481} 490}
482 491
483/* 492/*
diff --git a/drivers/s390/block/dasd_proc.c b/drivers/s390/block/dasd_proc.c
index 353d41118c62..d7f19745911f 100644
--- a/drivers/s390/block/dasd_proc.c
+++ b/drivers/s390/block/dasd_proc.c
@@ -9,7 +9,7 @@
9 * 9 *
10 * /proc interface for the dasd driver. 10 * /proc interface for the dasd driver.
11 * 11 *
12 * $Revision: 1.30 $ 12 * $Revision: 1.31 $
13 */ 13 */
14 14
15#include <linux/config.h> 15#include <linux/config.h>
@@ -54,6 +54,7 @@ dasd_devices_show(struct seq_file *m, void *v)
54{ 54{
55 struct dasd_device *device; 55 struct dasd_device *device;
56 char *substr; 56 char *substr;
57 int feature;
57 58
58 device = dasd_device_from_devindex((unsigned long) v - 1); 59 device = dasd_device_from_devindex((unsigned long) v - 1);
59 if (IS_ERR(device)) 60 if (IS_ERR(device))
@@ -77,7 +78,10 @@ dasd_devices_show(struct seq_file *m, void *v)
77 else 78 else
78 seq_printf(m, " is ????????"); 79 seq_printf(m, " is ????????");
79 /* Print devices features. */ 80 /* Print devices features. */
80 substr = test_bit(DASD_FLAG_RO, &device->flags) ? "(ro)" : " "; 81 feature = dasd_get_feature(device->cdev, DASD_FEATURE_READONLY);
82 if (feature < 0)
83 return 0;
84 substr = feature ? "(ro)" : " ";
81 seq_printf(m, "%4s: ", substr); 85 seq_printf(m, "%4s: ", substr);
82 /* Print device status information. */ 86 /* Print device status information. */
83 switch ((device != NULL) ? device->state : -1) { 87 switch ((device != NULL) ? device->state : -1) {
diff --git a/drivers/s390/cio/airq.c b/drivers/s390/cio/airq.c
index 3720e77b465f..83e6a060668e 100644
--- a/drivers/s390/cio/airq.c
+++ b/drivers/s390/cio/airq.c
@@ -45,7 +45,7 @@ s390_register_adapter_interrupt (adapter_int_handler_t handler)
45 else 45 else
46 ret = (cmpxchg(&adapter_handler, NULL, handler) ? -EBUSY : 0); 46 ret = (cmpxchg(&adapter_handler, NULL, handler) ? -EBUSY : 0);
47 if (!ret) 47 if (!ret)
48 synchronize_kernel(); 48 synchronize_sched(); /* Allow interrupts to complete. */
49 49
50 sprintf (dbf_txt, "ret:%d", ret); 50 sprintf (dbf_txt, "ret:%d", ret);
51 CIO_TRACE_EVENT (4, dbf_txt); 51 CIO_TRACE_EVENT (4, dbf_txt);
@@ -65,7 +65,7 @@ s390_unregister_adapter_interrupt (adapter_int_handler_t handler)
65 ret = -EINVAL; 65 ret = -EINVAL;
66 else { 66 else {
67 adapter_handler = NULL; 67 adapter_handler = NULL;
68 synchronize_kernel(); 68 synchronize_sched(); /* Allow interrupts to complete. */
69 ret = 0; 69 ret = 0;
70 } 70 }
71 sprintf (dbf_txt, "ret:%d", ret); 71 sprintf (dbf_txt, "ret:%d", ret);
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c
index 99ce5a567982..1d9b3f18d8de 100644
--- a/drivers/s390/cio/cio.c
+++ b/drivers/s390/cio/cio.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * drivers/s390/cio/cio.c 2 * drivers/s390/cio/cio.c
3 * S/390 common I/O routines -- low level i/o calls 3 * S/390 common I/O routines -- low level i/o calls
4 * $Revision: 1.131 $ 4 * $Revision: 1.133 $
5 * 5 *
6 * Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH, 6 * Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
7 * IBM Corporation 7 * IBM Corporation
@@ -228,7 +228,7 @@ cio_start_key (struct subchannel *sch, /* subchannel structure */
228int 228int
229cio_start (struct subchannel *sch, struct ccw1 *cpa, __u8 lpm) 229cio_start (struct subchannel *sch, struct ccw1 *cpa, __u8 lpm)
230{ 230{
231 return cio_start_key(sch, cpa, lpm, default_storage_key); 231 return cio_start_key(sch, cpa, lpm, PAGE_DEFAULT_KEY);
232} 232}
233 233
234/* 234/*
diff --git a/drivers/s390/cio/device_ops.c b/drivers/s390/cio/device_ops.c
index 11e260e0b9c9..02d01a0de16c 100644
--- a/drivers/s390/cio/device_ops.c
+++ b/drivers/s390/cio/device_ops.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * drivers/s390/cio/device_ops.c 2 * drivers/s390/cio/device_ops.c
3 * 3 *
4 * $Revision: 1.55 $ 4 * $Revision: 1.56 $
5 * 5 *
6 * Copyright (C) 2002 IBM Deutschland Entwicklung GmbH, 6 * Copyright (C) 2002 IBM Deutschland Entwicklung GmbH,
7 * IBM Corporation 7 * IBM Corporation
@@ -128,7 +128,7 @@ ccw_device_start(struct ccw_device *cdev, struct ccw1 *cpa,
128 unsigned long intparm, __u8 lpm, unsigned long flags) 128 unsigned long intparm, __u8 lpm, unsigned long flags)
129{ 129{
130 return ccw_device_start_key(cdev, cpa, intparm, lpm, 130 return ccw_device_start_key(cdev, cpa, intparm, lpm,
131 default_storage_key, flags); 131 PAGE_DEFAULT_KEY, flags);
132} 132}
133 133
134int 134int
@@ -137,7 +137,7 @@ ccw_device_start_timeout(struct ccw_device *cdev, struct ccw1 *cpa,
137 int expires) 137 int expires)
138{ 138{
139 return ccw_device_start_timeout_key(cdev, cpa, intparm, lpm, 139 return ccw_device_start_timeout_key(cdev, cpa, intparm, lpm,
140 default_storage_key, flags, 140 PAGE_DEFAULT_KEY, flags,
141 expires); 141 expires);
142} 142}
143 143
diff --git a/drivers/s390/cio/qdio.h b/drivers/s390/cio/qdio.h
index 9ad14db24143..b6daadac4e8b 100644
--- a/drivers/s390/cio/qdio.h
+++ b/drivers/s390/cio/qdio.h
@@ -1,7 +1,9 @@
1#ifndef _CIO_QDIO_H 1#ifndef _CIO_QDIO_H
2#define _CIO_QDIO_H 2#define _CIO_QDIO_H
3 3
4#define VERSION_CIO_QDIO_H "$Revision: 1.26 $" 4#include <asm/page.h>
5
6#define VERSION_CIO_QDIO_H "$Revision: 1.32 $"
5 7
6#ifdef CONFIG_QDIO_DEBUG 8#ifdef CONFIG_QDIO_DEBUG
7#define QDIO_VERBOSE_LEVEL 9 9#define QDIO_VERBOSE_LEVEL 9
@@ -42,7 +44,7 @@
42 44
43#define QDIO_Q_LAPS 5 45#define QDIO_Q_LAPS 5
44 46
45#define QDIO_STORAGE_KEY 0 47#define QDIO_STORAGE_KEY PAGE_DEFAULT_KEY
46 48
47#define L2_CACHELINE_SIZE 256 49#define L2_CACHELINE_SIZE 256
48#define INDICATORS_PER_CACHELINE (L2_CACHELINE_SIZE/sizeof(__u32)) 50#define INDICATORS_PER_CACHELINE (L2_CACHELINE_SIZE/sizeof(__u32))
diff --git a/drivers/s390/crypto/z90main.c b/drivers/s390/crypto/z90main.c
index a98c00c02559..9ec29bb41b28 100644
--- a/drivers/s390/crypto/z90main.c
+++ b/drivers/s390/crypto/z90main.c
@@ -385,8 +385,8 @@ static int z90crypt_release(struct inode *, struct file *);
385static ssize_t z90crypt_read(struct file *, char __user *, size_t, loff_t *); 385static ssize_t z90crypt_read(struct file *, char __user *, size_t, loff_t *);
386static ssize_t z90crypt_write(struct file *, const char __user *, 386static ssize_t z90crypt_write(struct file *, const char __user *,
387 size_t, loff_t *); 387 size_t, loff_t *);
388static int z90crypt_ioctl(struct inode *, struct file *, 388static long z90crypt_unlocked_ioctl(struct file *, unsigned int, unsigned long);
389 unsigned int, unsigned long); 389static long z90crypt_compat_ioctl(struct file *, unsigned int, unsigned long);
390 390
391static void z90crypt_reader_task(unsigned long); 391static void z90crypt_reader_task(unsigned long);
392static void z90crypt_schedule_reader_task(unsigned long); 392static void z90crypt_schedule_reader_task(unsigned long);
@@ -433,12 +433,15 @@ static atomic_t total_open;
433static atomic_t z90crypt_step; 433static atomic_t z90crypt_step;
434 434
435static struct file_operations z90crypt_fops = { 435static struct file_operations z90crypt_fops = {
436 .owner = THIS_MODULE, 436 .owner = THIS_MODULE,
437 .read = z90crypt_read, 437 .read = z90crypt_read,
438 .write = z90crypt_write, 438 .write = z90crypt_write,
439 .ioctl = z90crypt_ioctl, 439 .unlocked_ioctl = z90crypt_unlocked_ioctl,
440 .open = z90crypt_open, 440#ifdef CONFIG_COMPAT
441 .release = z90crypt_release 441 .compat_ioctl = z90crypt_compat_ioctl,
442#endif
443 .open = z90crypt_open,
444 .release = z90crypt_release
442}; 445};
443 446
444#ifndef Z90CRYPT_USE_HOTPLUG 447#ifndef Z90CRYPT_USE_HOTPLUG
@@ -474,14 +477,13 @@ struct ica_rsa_modexpo_32 { // For 32-bit callers
474 compat_uptr_t n_modulus; 477 compat_uptr_t n_modulus;
475}; 478};
476 479
477static int 480static long
478trans_modexpo32(unsigned int fd, unsigned int cmd, unsigned long arg, 481trans_modexpo32(struct file *filp, unsigned int cmd, unsigned long arg)
479 struct file *file)
480{ 482{
481 struct ica_rsa_modexpo_32 __user *mex32u = compat_ptr(arg); 483 struct ica_rsa_modexpo_32 __user *mex32u = compat_ptr(arg);
482 struct ica_rsa_modexpo_32 mex32k; 484 struct ica_rsa_modexpo_32 mex32k;
483 struct ica_rsa_modexpo __user *mex64; 485 struct ica_rsa_modexpo __user *mex64;
484 int ret = 0; 486 long ret = 0;
485 unsigned int i; 487 unsigned int i;
486 488
487 if (!access_ok(VERIFY_WRITE, mex32u, sizeof(struct ica_rsa_modexpo_32))) 489 if (!access_ok(VERIFY_WRITE, mex32u, sizeof(struct ica_rsa_modexpo_32)))
@@ -498,7 +500,7 @@ trans_modexpo32(unsigned int fd, unsigned int cmd, unsigned long arg,
498 __put_user(compat_ptr(mex32k.b_key), &mex64->b_key) || 500 __put_user(compat_ptr(mex32k.b_key), &mex64->b_key) ||
499 __put_user(compat_ptr(mex32k.n_modulus), &mex64->n_modulus)) 501 __put_user(compat_ptr(mex32k.n_modulus), &mex64->n_modulus))
500 return -EFAULT; 502 return -EFAULT;
501 ret = sys_ioctl(fd, cmd, (unsigned long)mex64); 503 ret = z90crypt_unlocked_ioctl(filp, cmd, (unsigned long)mex64);
502 if (!ret) 504 if (!ret)
503 if (__get_user(i, &mex64->outputdatalength) || 505 if (__get_user(i, &mex64->outputdatalength) ||
504 __put_user(i, &mex32u->outputdatalength)) 506 __put_user(i, &mex32u->outputdatalength))
@@ -518,14 +520,13 @@ struct ica_rsa_modexpo_crt_32 { // For 32-bit callers
518 compat_uptr_t u_mult_inv; 520 compat_uptr_t u_mult_inv;
519}; 521};
520 522
521static int 523static long
522trans_modexpo_crt32(unsigned int fd, unsigned int cmd, unsigned long arg, 524trans_modexpo_crt32(struct file *filp, unsigned int cmd, unsigned long arg)
523 struct file *file)
524{ 525{
525 struct ica_rsa_modexpo_crt_32 __user *crt32u = compat_ptr(arg); 526 struct ica_rsa_modexpo_crt_32 __user *crt32u = compat_ptr(arg);
526 struct ica_rsa_modexpo_crt_32 crt32k; 527 struct ica_rsa_modexpo_crt_32 crt32k;
527 struct ica_rsa_modexpo_crt __user *crt64; 528 struct ica_rsa_modexpo_crt __user *crt64;
528 int ret = 0; 529 long ret = 0;
529 unsigned int i; 530 unsigned int i;
530 531
531 if (!access_ok(VERIFY_WRITE, crt32u, 532 if (!access_ok(VERIFY_WRITE, crt32u,
@@ -546,9 +547,8 @@ trans_modexpo_crt32(unsigned int fd, unsigned int cmd, unsigned long arg,
546 __put_user(compat_ptr(crt32k.np_prime), &crt64->np_prime) || 547 __put_user(compat_ptr(crt32k.np_prime), &crt64->np_prime) ||
547 __put_user(compat_ptr(crt32k.nq_prime), &crt64->nq_prime) || 548 __put_user(compat_ptr(crt32k.nq_prime), &crt64->nq_prime) ||
548 __put_user(compat_ptr(crt32k.u_mult_inv), &crt64->u_mult_inv)) 549 __put_user(compat_ptr(crt32k.u_mult_inv), &crt64->u_mult_inv))
549 ret = -EFAULT; 550 return -EFAULT;
550 if (!ret) 551 ret = z90crypt_unlocked_ioctl(filp, cmd, (unsigned long)crt64);
551 ret = sys_ioctl(fd, cmd, (unsigned long)crt64);
552 if (!ret) 552 if (!ret)
553 if (__get_user(i, &crt64->outputdatalength) || 553 if (__get_user(i, &crt64->outputdatalength) ||
554 __put_user(i, &crt32u->outputdatalength)) 554 __put_user(i, &crt32u->outputdatalength))
@@ -556,66 +556,34 @@ trans_modexpo_crt32(unsigned int fd, unsigned int cmd, unsigned long arg,
556 return ret; 556 return ret;
557} 557}
558 558
559static int compatible_ioctls[] = { 559static long
560 ICAZ90STATUS, Z90QUIESCE, Z90STAT_TOTALCOUNT, Z90STAT_PCICACOUNT, 560z90crypt_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
561 Z90STAT_PCICCCOUNT, Z90STAT_PCIXCCCOUNT, Z90STAT_PCIXCCMCL2COUNT,
562 Z90STAT_PCIXCCMCL3COUNT, Z90STAT_CEX2CCOUNT, Z90STAT_REQUESTQ_COUNT,
563 Z90STAT_PENDINGQ_COUNT, Z90STAT_TOTALOPEN_COUNT, Z90STAT_DOMAIN_INDEX,
564 Z90STAT_STATUS_MASK, Z90STAT_QDEPTH_MASK, Z90STAT_PERDEV_REQCNT,
565};
566
567static void z90_unregister_ioctl32s(void)
568{
569 int i;
570
571 unregister_ioctl32_conversion(ICARSAMODEXPO);
572 unregister_ioctl32_conversion(ICARSACRT);
573
574 for(i = 0; i < ARRAY_SIZE(compatible_ioctls); i++)
575 unregister_ioctl32_conversion(compatible_ioctls[i]);
576}
577
578static int z90_register_ioctl32s(void)
579{
580 int result, i;
581
582 result = register_ioctl32_conversion(ICARSAMODEXPO, trans_modexpo32);
583 if (result == -EBUSY) {
584 unregister_ioctl32_conversion(ICARSAMODEXPO);
585 result = register_ioctl32_conversion(ICARSAMODEXPO,
586 trans_modexpo32);
587 }
588 if (result)
589 return result;
590 result = register_ioctl32_conversion(ICARSACRT, trans_modexpo_crt32);
591 if (result == -EBUSY) {
592 unregister_ioctl32_conversion(ICARSACRT);
593 result = register_ioctl32_conversion(ICARSACRT,
594 trans_modexpo_crt32);
595 }
596 if (result)
597 return result;
598
599 for(i = 0; i < ARRAY_SIZE(compatible_ioctls); i++) {
600 result = register_ioctl32_conversion(compatible_ioctls[i], 0);
601 if (result == -EBUSY) {
602 unregister_ioctl32_conversion(compatible_ioctls[i]);
603 result = register_ioctl32_conversion(
604 compatible_ioctls[i], 0);
605 }
606 if (result)
607 return result;
608 }
609 return 0;
610}
611#else // !CONFIG_COMPAT
612static inline void z90_unregister_ioctl32s(void)
613{
614}
615
616static inline int z90_register_ioctl32s(void)
617{ 561{
618 return 0; 562 switch (cmd) {
563 case ICAZ90STATUS:
564 case Z90QUIESCE:
565 case Z90STAT_TOTALCOUNT:
566 case Z90STAT_PCICACOUNT:
567 case Z90STAT_PCICCCOUNT:
568 case Z90STAT_PCIXCCCOUNT:
569 case Z90STAT_PCIXCCMCL2COUNT:
570 case Z90STAT_PCIXCCMCL3COUNT:
571 case Z90STAT_CEX2CCOUNT:
572 case Z90STAT_REQUESTQ_COUNT:
573 case Z90STAT_PENDINGQ_COUNT:
574 case Z90STAT_TOTALOPEN_COUNT:
575 case Z90STAT_DOMAIN_INDEX:
576 case Z90STAT_STATUS_MASK:
577 case Z90STAT_QDEPTH_MASK:
578 case Z90STAT_PERDEV_REQCNT:
579 return z90crypt_unlocked_ioctl(filp, cmd, arg);
580 case ICARSAMODEXPO:
581 return trans_modexpo32(filp, cmd, arg);
582 case ICARSACRT:
583 return trans_modexpo_crt32(filp, cmd, arg);
584 default:
585 return -ENOIOCTLCMD;
586 }
619} 587}
620#endif 588#endif
621 589
@@ -730,14 +698,9 @@ z90crypt_init_module(void)
730 reader_timer.expires = jiffies + (READERTIME * HZ / 1000); 698 reader_timer.expires = jiffies + (READERTIME * HZ / 1000);
731 add_timer(&reader_timer); 699 add_timer(&reader_timer);
732 700
733 if ((result = z90_register_ioctl32s()))
734 goto init_module_cleanup;
735
736 return 0; // success 701 return 0; // success
737 702
738init_module_cleanup: 703init_module_cleanup:
739 z90_unregister_ioctl32s();
740
741#ifndef Z90CRYPT_USE_HOTPLUG 704#ifndef Z90CRYPT_USE_HOTPLUG
742 if ((nresult = misc_deregister(&z90crypt_misc_device))) 705 if ((nresult = misc_deregister(&z90crypt_misc_device)))
743 PRINTK("misc_deregister failed with %d.\n", nresult); 706 PRINTK("misc_deregister failed with %d.\n", nresult);
@@ -763,8 +726,6 @@ z90crypt_cleanup_module(void)
763 726
764 PDEBUG("PID %d\n", PID()); 727 PDEBUG("PID %d\n", PID());
765 728
766 z90_unregister_ioctl32s();
767
768 remove_proc_entry("driver/z90crypt", 0); 729 remove_proc_entry("driver/z90crypt", 0);
769 730
770#ifndef Z90CRYPT_USE_HOTPLUG 731#ifndef Z90CRYPT_USE_HOTPLUG
@@ -800,7 +761,7 @@ z90crypt_cleanup_module(void)
800 * z90crypt_release 761 * z90crypt_release
801 * z90crypt_read 762 * z90crypt_read
802 * z90crypt_write 763 * z90crypt_write
803 * z90crypt_ioctl 764 * z90crypt_unlocked_ioctl
804 * z90crypt_status 765 * z90crypt_status
805 * z90crypt_status_write 766 * z90crypt_status_write
806 * disable_card 767 * disable_card
@@ -1804,9 +1765,8 @@ z90crypt_rsa(struct priv_data *private_data_p, pid_t pid,
1804 * This function is a little long, but it's really just one large switch 1765 * This function is a little long, but it's really just one large switch
1805 * statement. 1766 * statement.
1806 */ 1767 */
1807static int 1768static long
1808z90crypt_ioctl(struct inode *inode, struct file *filp, 1769z90crypt_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
1809 unsigned int cmd, unsigned long arg)
1810{ 1770{
1811 struct priv_data *private_data_p = filp->private_data; 1771 struct priv_data *private_data_p = filp->private_data;
1812 unsigned char *status; 1772 unsigned char *status;
diff --git a/drivers/s390/net/smsgiucv.c b/drivers/s390/net/smsgiucv.c
index a3d285859564..1e3f7f3c662f 100644
--- a/drivers/s390/net/smsgiucv.c
+++ b/drivers/s390/net/smsgiucv.c
@@ -32,7 +32,7 @@ struct smsg_callback {
32 struct list_head list; 32 struct list_head list;
33 char *prefix; 33 char *prefix;
34 int len; 34 int len;
35 void (*callback)(char *str); 35 void (*callback)(char *from, char *str);
36}; 36};
37 37
38MODULE_AUTHOR 38MODULE_AUTHOR
@@ -55,8 +55,9 @@ smsg_message_pending(iucv_MessagePending *eib, void *pgm_data)
55{ 55{
56 struct smsg_callback *cb; 56 struct smsg_callback *cb;
57 unsigned char *msg; 57 unsigned char *msg;
58 unsigned char sender[9];
58 unsigned short len; 59 unsigned short len;
59 int rc; 60 int rc, i;
60 61
61 len = eib->ln1msg2.ipbfln1f; 62 len = eib->ln1msg2.ipbfln1f;
62 msg = kmalloc(len + 1, GFP_ATOMIC|GFP_DMA); 63 msg = kmalloc(len + 1, GFP_ATOMIC|GFP_DMA);
@@ -69,10 +70,18 @@ smsg_message_pending(iucv_MessagePending *eib, void *pgm_data)
69 if (rc == 0) { 70 if (rc == 0) {
70 msg[len] = 0; 71 msg[len] = 0;
71 EBCASC(msg, len); 72 EBCASC(msg, len);
73 memcpy(sender, msg, 8);
74 sender[8] = 0;
75 /* Remove trailing whitespace from the sender name. */
76 for (i = 7; i >= 0; i--) {
77 if (sender[i] != ' ' && sender[i] != '\t')
78 break;
79 sender[i] = 0;
80 }
72 spin_lock(&smsg_list_lock); 81 spin_lock(&smsg_list_lock);
73 list_for_each_entry(cb, &smsg_list, list) 82 list_for_each_entry(cb, &smsg_list, list)
74 if (strncmp(msg + 8, cb->prefix, cb->len) == 0) { 83 if (strncmp(msg + 8, cb->prefix, cb->len) == 0) {
75 cb->callback(msg + 8); 84 cb->callback(sender, msg + 8);
76 break; 85 break;
77 } 86 }
78 spin_unlock(&smsg_list_lock); 87 spin_unlock(&smsg_list_lock);
@@ -91,7 +100,7 @@ static struct device_driver smsg_driver = {
91}; 100};
92 101
93int 102int
94smsg_register_callback(char *prefix, void (*callback)(char *str)) 103smsg_register_callback(char *prefix, void (*callback)(char *from, char *str))
95{ 104{
96 struct smsg_callback *cb; 105 struct smsg_callback *cb;
97 106
@@ -108,7 +117,7 @@ smsg_register_callback(char *prefix, void (*callback)(char *str))
108} 117}
109 118
110void 119void
111smsg_unregister_callback(char *prefix, void (*callback)(char *str)) 120smsg_unregister_callback(char *prefix, void (*callback)(char *from, char *str))
112{ 121{
113 struct smsg_callback *cb, *tmp; 122 struct smsg_callback *cb, *tmp;
114 123
diff --git a/drivers/s390/net/smsgiucv.h b/drivers/s390/net/smsgiucv.h
index 04cd87152964..67f5d4f8378d 100644
--- a/drivers/s390/net/smsgiucv.h
+++ b/drivers/s390/net/smsgiucv.h
@@ -5,6 +5,6 @@
5 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com) 5 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
6 */ 6 */
7 7
8int smsg_register_callback(char *, void (*)(char *)); 8int smsg_register_callback(char *, void (*)(char *, char *));
9void smsg_unregister_callback(char *, void (*)(char *)); 9void smsg_unregister_callback(char *, void (*)(char *, char *));
10 10