aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/block/dasd.c6
-rw-r--r--drivers/s390/block/dasd_fba.c4
-rw-r--r--drivers/s390/char/tape.h7
-rw-r--r--drivers/s390/char/tape_core.c299
-rw-r--r--drivers/s390/char/vmcp.c6
-rw-r--r--drivers/s390/char/vmwatchdog.c6
-rw-r--r--drivers/s390/cio/chsc.c10
-rw-r--r--drivers/s390/cio/device_status.c5
-rw-r--r--drivers/s390/cio/qdio.c20
-rw-r--r--drivers/s390/net/qeth.h26
10 files changed, 221 insertions, 168 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index 6527ff6f4706..d5f53980749b 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.164 $ 10 * $Revision: 1.165 $
11 */ 11 */
12 12
13#include <linux/config.h> 13#include <linux/config.h>
@@ -1740,6 +1740,10 @@ dasd_exit(void)
1740 dasd_proc_exit(); 1740 dasd_proc_exit();
1741#endif 1741#endif
1742 dasd_ioctl_exit(); 1742 dasd_ioctl_exit();
1743 if (dasd_page_cache != NULL) {
1744 kmem_cache_destroy(dasd_page_cache);
1745 dasd_page_cache = NULL;
1746 }
1743 dasd_gendisk_exit(); 1747 dasd_gendisk_exit();
1744 dasd_devmap_exit(); 1748 dasd_devmap_exit();
1745 devfs_remove("dasd"); 1749 devfs_remove("dasd");
diff --git a/drivers/s390/block/dasd_fba.c b/drivers/s390/block/dasd_fba.c
index 7963ae343eef..28cb4613b7f5 100644
--- a/drivers/s390/block/dasd_fba.c
+++ b/drivers/s390/block/dasd_fba.c
@@ -4,7 +4,7 @@
4 * Bugreports.to..: <Linux390@de.ibm.com> 4 * Bugreports.to..: <Linux390@de.ibm.com>
5 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000 5 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
6 * 6 *
7 * $Revision: 1.39 $ 7 * $Revision: 1.40 $
8 */ 8 */
9 9
10#include <linux/config.h> 10#include <linux/config.h>
@@ -354,6 +354,8 @@ dasd_fba_build_cp(struct dasd_device * device, struct request *req)
354 } 354 }
355 cqr->device = device; 355 cqr->device = device;
356 cqr->expires = 5 * 60 * HZ; /* 5 minutes */ 356 cqr->expires = 5 * 60 * HZ; /* 5 minutes */
357 cqr->retries = 32;
358 cqr->buildclk = get_clock();
357 cqr->status = DASD_CQR_FILLED; 359 cqr->status = DASD_CQR_FILLED;
358 return cqr; 360 return cqr;
359} 361}
diff --git a/drivers/s390/char/tape.h b/drivers/s390/char/tape.h
index d04e6c2c3cc1..01d865d93791 100644
--- a/drivers/s390/char/tape.h
+++ b/drivers/s390/char/tape.h
@@ -3,10 +3,11 @@
3 * tape device driver for 3480/3490E/3590 tapes. 3 * tape device driver for 3480/3490E/3590 tapes.
4 * 4 *
5 * S390 and zSeries version 5 * S390 and zSeries version
6 * Copyright (C) 2001,2002 IBM Deutschland Entwicklung GmbH, IBM Corporation 6 * Copyright (C) 2001,2005 IBM Deutschland Entwicklung GmbH, IBM Corporation
7 * Author(s): Carsten Otte <cotte@de.ibm.com> 7 * Author(s): Carsten Otte <cotte@de.ibm.com>
8 * Tuan Ngo-Anh <ngoanh@de.ibm.com> 8 * Tuan Ngo-Anh <ngoanh@de.ibm.com>
9 * Martin Schwidefsky <schwidefsky@de.ibm.com> 9 * Martin Schwidefsky <schwidefsky@de.ibm.com>
10 * Stefan Bader <shbader@de.ibm.com>
10 */ 11 */
11 12
12#ifndef _TAPE_H 13#ifndef _TAPE_H
@@ -111,6 +112,7 @@ enum tape_request_status {
111 TAPE_REQUEST_QUEUED, /* request is queued to be processed */ 112 TAPE_REQUEST_QUEUED, /* request is queued to be processed */
112 TAPE_REQUEST_IN_IO, /* request is currently in IO */ 113 TAPE_REQUEST_IN_IO, /* request is currently in IO */
113 TAPE_REQUEST_DONE, /* request is completed. */ 114 TAPE_REQUEST_DONE, /* request is completed. */
115 TAPE_REQUEST_CANCEL, /* request should be canceled. */
114}; 116};
115 117
116/* Tape CCW request */ 118/* Tape CCW request */
@@ -237,6 +239,9 @@ struct tape_device {
237 /* Block dev frontend data */ 239 /* Block dev frontend data */
238 struct tape_blk_data blk_data; 240 struct tape_blk_data blk_data;
239#endif 241#endif
242
243 /* Function to start or stop the next request later. */
244 struct work_struct tape_dnr;
240}; 245};
241 246
242/* Externals from tape_core.c */ 247/* Externals from tape_core.c */
diff --git a/drivers/s390/char/tape_core.c b/drivers/s390/char/tape_core.c
index 0597aa0e27ee..6c52e8307dc5 100644
--- a/drivers/s390/char/tape_core.c
+++ b/drivers/s390/char/tape_core.c
@@ -3,11 +3,12 @@
3 * basic function of the tape device driver 3 * basic function of the tape device driver
4 * 4 *
5 * S390 and zSeries version 5 * S390 and zSeries version
6 * Copyright (C) 2001,2002 IBM Deutschland Entwicklung GmbH, IBM Corporation 6 * Copyright (C) 2001,2005 IBM Deutschland Entwicklung GmbH, IBM Corporation
7 * Author(s): Carsten Otte <cotte@de.ibm.com> 7 * Author(s): Carsten Otte <cotte@de.ibm.com>
8 * Michael Holzheu <holzheu@de.ibm.com> 8 * Michael Holzheu <holzheu@de.ibm.com>
9 * Tuan Ngo-Anh <ngoanh@de.ibm.com> 9 * Tuan Ngo-Anh <ngoanh@de.ibm.com>
10 * Martin Schwidefsky <schwidefsky@de.ibm.com> 10 * Martin Schwidefsky <schwidefsky@de.ibm.com>
11 * Stefan Bader <shbader@de.ibm.com>
11 */ 12 */
12 13
13#include <linux/config.h> 14#include <linux/config.h>
@@ -28,7 +29,7 @@
28#define PRINTK_HEADER "TAPE_CORE: " 29#define PRINTK_HEADER "TAPE_CORE: "
29 30
30static void __tape_do_irq (struct ccw_device *, unsigned long, struct irb *); 31static void __tape_do_irq (struct ccw_device *, unsigned long, struct irb *);
31static void __tape_remove_request(struct tape_device *, struct tape_request *); 32static void tape_delayed_next_request(void * data);
32 33
33/* 34/*
34 * One list to contain all tape devices of all disciplines, so 35 * One list to contain all tape devices of all disciplines, so
@@ -257,7 +258,7 @@ tape_med_state_set(struct tape_device *device, enum tape_medium_state newstate)
257 * Stop running ccw. Has to be called with the device lock held. 258 * Stop running ccw. Has to be called with the device lock held.
258 */ 259 */
259static inline int 260static inline int
260__tape_halt_io(struct tape_device *device, struct tape_request *request) 261__tape_cancel_io(struct tape_device *device, struct tape_request *request)
261{ 262{
262 int retries; 263 int retries;
263 int rc; 264 int rc;
@@ -270,20 +271,23 @@ __tape_halt_io(struct tape_device *device, struct tape_request *request)
270 for (retries = 0; retries < 5; retries++) { 271 for (retries = 0; retries < 5; retries++) {
271 rc = ccw_device_clear(device->cdev, (long) request); 272 rc = ccw_device_clear(device->cdev, (long) request);
272 273
273 if (rc == 0) { /* Termination successful */ 274 switch (rc) {
274 request->rc = -EIO; 275 case 0:
275 request->status = TAPE_REQUEST_DONE; 276 request->status = TAPE_REQUEST_DONE;
276 return 0; 277 return 0;
278 case -EBUSY:
279 request->status = TAPE_REQUEST_CANCEL;
280 schedule_work(&device->tape_dnr);
281 return 0;
282 case -ENODEV:
283 DBF_EXCEPTION(2, "device gone, retry\n");
284 break;
285 case -EIO:
286 DBF_EXCEPTION(2, "I/O error, retry\n");
287 break;
288 default:
289 BUG();
277 } 290 }
278
279 if (rc == -ENODEV)
280 DBF_EXCEPTION(2, "device gone, retry\n");
281 else if (rc == -EIO)
282 DBF_EXCEPTION(2, "I/O error, retry\n");
283 else if (rc == -EBUSY)
284 DBF_EXCEPTION(2, "device busy, retry late\n");
285 else
286 BUG();
287 } 291 }
288 292
289 return rc; 293 return rc;
@@ -473,6 +477,7 @@ tape_alloc_device(void)
473 *device->modeset_byte = 0; 477 *device->modeset_byte = 0;
474 device->first_minor = -1; 478 device->first_minor = -1;
475 atomic_set(&device->ref_count, 1); 479 atomic_set(&device->ref_count, 1);
480 INIT_WORK(&device->tape_dnr, tape_delayed_next_request, device);
476 481
477 return device; 482 return device;
478} 483}
@@ -708,54 +713,119 @@ tape_free_request (struct tape_request * request)
708 kfree(request); 713 kfree(request);
709} 714}
710 715
716static inline int
717__tape_start_io(struct tape_device *device, struct tape_request *request)
718{
719 int rc;
720
721#ifdef CONFIG_S390_TAPE_BLOCK
722 if (request->op == TO_BLOCK)
723 device->discipline->check_locate(device, request);
724#endif
725 rc = ccw_device_start(
726 device->cdev,
727 request->cpaddr,
728 (unsigned long) request,
729 0x00,
730 request->options
731 );
732 if (rc == 0) {
733 request->status = TAPE_REQUEST_IN_IO;
734 } else if (rc == -EBUSY) {
735 /* The common I/O subsystem is currently busy. Retry later. */
736 request->status = TAPE_REQUEST_QUEUED;
737 schedule_work(&device->tape_dnr);
738 rc = 0;
739 } else {
740 /* Start failed. Remove request and indicate failure. */
741 DBF_EVENT(1, "tape: start request failed with RC = %i\n", rc);
742 }
743 return rc;
744}
745
711static inline void 746static inline void
712__tape_do_io_list(struct tape_device *device) 747__tape_start_next_request(struct tape_device *device)
713{ 748{
714 struct list_head *l, *n; 749 struct list_head *l, *n;
715 struct tape_request *request; 750 struct tape_request *request;
716 int rc; 751 int rc;
717 752
718 DBF_LH(6, "__tape_do_io_list(%p)\n", device); 753 DBF_LH(6, "__tape_start_next_request(%p)\n", device);
719 /* 754 /*
720 * Try to start each request on request queue until one is 755 * Try to start each request on request queue until one is
721 * started successful. 756 * started successful.
722 */ 757 */
723 list_for_each_safe(l, n, &device->req_queue) { 758 list_for_each_safe(l, n, &device->req_queue) {
724 request = list_entry(l, struct tape_request, list); 759 request = list_entry(l, struct tape_request, list);
725#ifdef CONFIG_S390_TAPE_BLOCK 760
726 if (request->op == TO_BLOCK) 761 /*
727 device->discipline->check_locate(device, request); 762 * Avoid race condition if bottom-half was triggered more than
728#endif 763 * once.
729 rc = ccw_device_start(device->cdev, request->cpaddr, 764 */
730 (unsigned long) request, 0x00, 765 if (request->status == TAPE_REQUEST_IN_IO)
731 request->options); 766 return;
732 if (rc == 0) { 767
733 request->status = TAPE_REQUEST_IN_IO; 768 /*
734 break; 769 * We wanted to cancel the request but the common I/O layer
770 * was busy at that time. This can only happen if this
771 * function is called by delayed_next_request.
772 * Otherwise we start the next request on the queue.
773 */
774 if (request->status == TAPE_REQUEST_CANCEL) {
775 rc = __tape_cancel_io(device, request);
776 } else {
777 rc = __tape_start_io(device, request);
735 } 778 }
736 /* Start failed. Remove request and indicate failure. */ 779 if (rc == 0)
737 DBF_EVENT(1, "tape: DOIO failed with er = %i\n", rc); 780 return;
738 781
739 /* Set ending status and do callback. */ 782 /* Set ending status. */
740 request->rc = rc; 783 request->rc = rc;
741 request->status = TAPE_REQUEST_DONE; 784 request->status = TAPE_REQUEST_DONE;
742 __tape_remove_request(device, request); 785
786 /* Remove from request queue. */
787 list_del(&request->list);
788
789 /* Do callback. */
790 if (request->callback != NULL)
791 request->callback(request, request->callback_data);
743 } 792 }
744} 793}
745 794
746static void 795static void
747__tape_remove_request(struct tape_device *device, struct tape_request *request) 796tape_delayed_next_request(void *data)
748{ 797{
749 /* Remove from request queue. */ 798 struct tape_device * device;
750 list_del(&request->list);
751 799
752 /* Do callback. */ 800 device = (struct tape_device *) data;
753 if (request->callback != NULL) 801 DBF_LH(6, "tape_delayed_next_request(%p)\n", device);
754 request->callback(request, request->callback_data); 802 spin_lock_irq(get_ccwdev_lock(device->cdev));
803 __tape_start_next_request(device);
804 spin_unlock_irq(get_ccwdev_lock(device->cdev));
805}
806
807static inline void
808__tape_end_request(
809 struct tape_device * device,
810 struct tape_request * request,
811 int rc)
812{
813 DBF_LH(6, "__tape_end_request(%p, %p, %i)\n", device, request, rc);
814 if (request) {
815 request->rc = rc;
816 request->status = TAPE_REQUEST_DONE;
817
818 /* Remove from request queue. */
819 list_del(&request->list);
820
821 /* Do callback. */
822 if (request->callback != NULL)
823 request->callback(request, request->callback_data);
824 }
755 825
756 /* Start next request. */ 826 /* Start next request. */
757 if (!list_empty(&device->req_queue)) 827 if (!list_empty(&device->req_queue))
758 __tape_do_io_list(device); 828 __tape_start_next_request(device);
759} 829}
760 830
761/* 831/*
@@ -812,7 +882,7 @@ tape_dump_sense_dbf(struct tape_device *device, struct tape_request *request,
812 * the device lock held. 882 * the device lock held.
813 */ 883 */
814static inline int 884static inline int
815__tape_do_io(struct tape_device *device, struct tape_request *request) 885__tape_start_request(struct tape_device *device, struct tape_request *request)
816{ 886{
817 int rc; 887 int rc;
818 888
@@ -837,24 +907,16 @@ __tape_do_io(struct tape_device *device, struct tape_request *request)
837 907
838 if (list_empty(&device->req_queue)) { 908 if (list_empty(&device->req_queue)) {
839 /* No other requests are on the queue. Start this one. */ 909 /* No other requests are on the queue. Start this one. */
840#ifdef CONFIG_S390_TAPE_BLOCK 910 rc = __tape_start_io(device, request);
841 if (request->op == TO_BLOCK) 911 if (rc)
842 device->discipline->check_locate(device, request);
843#endif
844 rc = ccw_device_start(device->cdev, request->cpaddr,
845 (unsigned long) request, 0x00,
846 request->options);
847 if (rc) {
848 DBF_EVENT(1, "tape: DOIO failed with rc = %i\n", rc);
849 return rc; 912 return rc;
850 } 913
851 DBF_LH(5, "Request %p added for execution.\n", request); 914 DBF_LH(5, "Request %p added for execution.\n", request);
852 list_add(&request->list, &device->req_queue); 915 list_add(&request->list, &device->req_queue);
853 request->status = TAPE_REQUEST_IN_IO;
854 } else { 916 } else {
855 DBF_LH(5, "Request %p add to queue.\n", request); 917 DBF_LH(5, "Request %p add to queue.\n", request);
856 list_add_tail(&request->list, &device->req_queue);
857 request->status = TAPE_REQUEST_QUEUED; 918 request->status = TAPE_REQUEST_QUEUED;
919 list_add_tail(&request->list, &device->req_queue);
858 } 920 }
859 return 0; 921 return 0;
860} 922}
@@ -872,7 +934,7 @@ tape_do_io_async(struct tape_device *device, struct tape_request *request)
872 934
873 spin_lock_irq(get_ccwdev_lock(device->cdev)); 935 spin_lock_irq(get_ccwdev_lock(device->cdev));
874 /* Add request to request queue and try to start it. */ 936 /* Add request to request queue and try to start it. */
875 rc = __tape_do_io(device, request); 937 rc = __tape_start_request(device, request);
876 spin_unlock_irq(get_ccwdev_lock(device->cdev)); 938 spin_unlock_irq(get_ccwdev_lock(device->cdev));
877 return rc; 939 return rc;
878} 940}
@@ -901,7 +963,7 @@ tape_do_io(struct tape_device *device, struct tape_request *request)
901 request->callback = __tape_wake_up; 963 request->callback = __tape_wake_up;
902 request->callback_data = &wq; 964 request->callback_data = &wq;
903 /* Add request to request queue and try to start it. */ 965 /* Add request to request queue and try to start it. */
904 rc = __tape_do_io(device, request); 966 rc = __tape_start_request(device, request);
905 spin_unlock_irq(get_ccwdev_lock(device->cdev)); 967 spin_unlock_irq(get_ccwdev_lock(device->cdev));
906 if (rc) 968 if (rc)
907 return rc; 969 return rc;
@@ -935,7 +997,7 @@ tape_do_io_interruptible(struct tape_device *device,
935 /* Setup callback */ 997 /* Setup callback */
936 request->callback = __tape_wake_up_interruptible; 998 request->callback = __tape_wake_up_interruptible;
937 request->callback_data = &wq; 999 request->callback_data = &wq;
938 rc = __tape_do_io(device, request); 1000 rc = __tape_start_request(device, request);
939 spin_unlock_irq(get_ccwdev_lock(device->cdev)); 1001 spin_unlock_irq(get_ccwdev_lock(device->cdev));
940 if (rc) 1002 if (rc)
941 return rc; 1003 return rc;
@@ -944,36 +1006,27 @@ tape_do_io_interruptible(struct tape_device *device,
944 if (rc != -ERESTARTSYS) 1006 if (rc != -ERESTARTSYS)
945 /* Request finished normally. */ 1007 /* Request finished normally. */
946 return request->rc; 1008 return request->rc;
1009
947 /* Interrupted by a signal. We have to stop the current request. */ 1010 /* Interrupted by a signal. We have to stop the current request. */
948 spin_lock_irq(get_ccwdev_lock(device->cdev)); 1011 spin_lock_irq(get_ccwdev_lock(device->cdev));
949 rc = __tape_halt_io(device, request); 1012 rc = __tape_cancel_io(device, request);
1013 spin_unlock_irq(get_ccwdev_lock(device->cdev));
950 if (rc == 0) { 1014 if (rc == 0) {
1015 /* Wait for the interrupt that acknowledges the halt. */
1016 do {
1017 rc = wait_event_interruptible(
1018 wq,
1019 (request->callback == NULL)
1020 );
1021 } while (rc != -ERESTARTSYS);
1022
951 DBF_EVENT(3, "IO stopped on %08x\n", device->cdev_id); 1023 DBF_EVENT(3, "IO stopped on %08x\n", device->cdev_id);
952 rc = -ERESTARTSYS; 1024 rc = -ERESTARTSYS;
953 } 1025 }
954 spin_unlock_irq(get_ccwdev_lock(device->cdev));
955 return rc; 1026 return rc;
956} 1027}
957 1028
958/* 1029/*
959 * Handle requests that return an i/o error in the irb.
960 */
961static inline void
962tape_handle_killed_request(
963 struct tape_device *device,
964 struct tape_request *request)
965{
966 if(request != NULL) {
967 /* Set ending status. FIXME: Should the request be retried? */
968 request->rc = -EIO;
969 request->status = TAPE_REQUEST_DONE;
970 __tape_remove_request(device, request);
971 } else {
972 __tape_do_io_list(device);
973 }
974}
975
976/*
977 * Tape interrupt routine, called from the ccw_device layer 1030 * Tape interrupt routine, called from the ccw_device layer
978 */ 1031 */
979static void 1032static void
@@ -981,7 +1034,6 @@ __tape_do_irq (struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
981{ 1034{
982 struct tape_device *device; 1035 struct tape_device *device;
983 struct tape_request *request; 1036 struct tape_request *request;
984 int final;
985 int rc; 1037 int rc;
986 1038
987 device = (struct tape_device *) cdev->dev.driver_data; 1039 device = (struct tape_device *) cdev->dev.driver_data;
@@ -996,12 +1048,13 @@ __tape_do_irq (struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
996 1048
997 /* On special conditions irb is an error pointer */ 1049 /* On special conditions irb is an error pointer */
998 if (IS_ERR(irb)) { 1050 if (IS_ERR(irb)) {
1051 /* FIXME: What to do with the request? */
999 switch (PTR_ERR(irb)) { 1052 switch (PTR_ERR(irb)) {
1000 case -ETIMEDOUT: 1053 case -ETIMEDOUT:
1001 PRINT_WARN("(%s): Request timed out\n", 1054 PRINT_WARN("(%s): Request timed out\n",
1002 cdev->dev.bus_id); 1055 cdev->dev.bus_id);
1003 case -EIO: 1056 case -EIO:
1004 tape_handle_killed_request(device, request); 1057 __tape_end_request(device, request, -EIO);
1005 break; 1058 break;
1006 default: 1059 default:
1007 PRINT_ERR("(%s): Unexpected i/o error %li\n", 1060 PRINT_ERR("(%s): Unexpected i/o error %li\n",
@@ -1011,6 +1064,21 @@ __tape_do_irq (struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
1011 return; 1064 return;
1012 } 1065 }
1013 1066
1067 /*
1068 * If the condition code is not zero and the start function bit is
1069 * still set, this is an deferred error and the last start I/O did
1070 * not succeed. Restart the request now.
1071 */
1072 if (irb->scsw.cc != 0 && (irb->scsw.fctl & SCSW_FCTL_START_FUNC)) {
1073 PRINT_WARN("(%s): deferred cc=%i. restaring\n",
1074 cdev->dev.bus_id,
1075 irb->scsw.cc);
1076 rc = __tape_start_io(device, request);
1077 if (rc)
1078 __tape_end_request(device, request, rc);
1079 return;
1080 }
1081
1014 /* May be an unsolicited irq */ 1082 /* May be an unsolicited irq */
1015 if(request != NULL) 1083 if(request != NULL)
1016 request->rescnt = irb->scsw.count; 1084 request->rescnt = irb->scsw.count;
@@ -1042,7 +1110,7 @@ __tape_do_irq (struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
1042 * To detect these request the state will be set to TAPE_REQUEST_DONE. 1110 * To detect these request the state will be set to TAPE_REQUEST_DONE.
1043 */ 1111 */
1044 if(request != NULL && request->status == TAPE_REQUEST_DONE) { 1112 if(request != NULL && request->status == TAPE_REQUEST_DONE) {
1045 __tape_remove_request(device, request); 1113 __tape_end_request(device, request, -EIO);
1046 return; 1114 return;
1047 } 1115 }
1048 1116
@@ -1054,51 +1122,34 @@ __tape_do_irq (struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
1054 * rc == TAPE_IO_RETRY: request finished but needs another go. 1122 * rc == TAPE_IO_RETRY: request finished but needs another go.
1055 * rc == TAPE_IO_STOP: request needs to get terminated. 1123 * rc == TAPE_IO_STOP: request needs to get terminated.
1056 */ 1124 */
1057 final = 0;
1058 switch (rc) { 1125 switch (rc) {
1059 case TAPE_IO_SUCCESS: 1126 case TAPE_IO_SUCCESS:
1060 /* Upon normal completion the device _is_ online */ 1127 /* Upon normal completion the device _is_ online */
1061 device->tape_generic_status |= GMT_ONLINE(~0); 1128 device->tape_generic_status |= GMT_ONLINE(~0);
1062 final = 1; 1129 __tape_end_request(device, request, rc);
1063 break; 1130 break;
1064 case TAPE_IO_PENDING: 1131 case TAPE_IO_PENDING:
1065 break; 1132 break;
1066 case TAPE_IO_RETRY: 1133 case TAPE_IO_RETRY:
1067#ifdef CONFIG_S390_TAPE_BLOCK 1134 rc = __tape_start_io(device, request);
1068 if (request->op == TO_BLOCK) 1135 if (rc)
1069 device->discipline->check_locate(device, request); 1136 __tape_end_request(device, request, rc);
1070#endif 1137 break;
1071 rc = ccw_device_start(cdev, request->cpaddr, 1138 case TAPE_IO_STOP:
1072 (unsigned long) request, 0x00, 1139 rc = __tape_cancel_io(device, request);
1073 request->options); 1140 if (rc)
1074 if (rc) { 1141 __tape_end_request(device, request, rc);
1075 DBF_EVENT(1, "tape: DOIO failed with er = %i\n", rc); 1142 break;
1076 final = 1; 1143 default:
1077 } 1144 if (rc > 0) {
1078 break; 1145 DBF_EVENT(6, "xunknownrc\n");
1079 case TAPE_IO_STOP: 1146 PRINT_ERR("Invalid return code from discipline "
1080 __tape_halt_io(device, request); 1147 "interrupt function.\n");
1081 break; 1148 __tape_end_request(device, request, -EIO);
1082 default: 1149 } else {
1083 if (rc > 0) { 1150 __tape_end_request(device, request, rc);
1084 DBF_EVENT(6, "xunknownrc\n"); 1151 }
1085 PRINT_ERR("Invalid return code from discipline " 1152 break;
1086 "interrupt function.\n");
1087 rc = -EIO;
1088 }
1089 final = 1;
1090 break;
1091 }
1092 if (final) {
1093 /* May be an unsolicited irq */
1094 if(request != NULL) {
1095 /* Set ending status. */
1096 request->rc = rc;
1097 request->status = TAPE_REQUEST_DONE;
1098 __tape_remove_request(device, request);
1099 } else {
1100 __tape_do_io_list(device);
1101 }
1102 } 1153 }
1103} 1154}
1104 1155
@@ -1191,7 +1242,7 @@ tape_init (void)
1191#ifdef DBF_LIKE_HELL 1242#ifdef DBF_LIKE_HELL
1192 debug_set_level(TAPE_DBF_AREA, 6); 1243 debug_set_level(TAPE_DBF_AREA, 6);
1193#endif 1244#endif
1194 DBF_EVENT(3, "tape init: ($Revision: 1.51 $)\n"); 1245 DBF_EVENT(3, "tape init: ($Revision: 1.54 $)\n");
1195 tape_proc_init(); 1246 tape_proc_init();
1196 tapechar_init (); 1247 tapechar_init ();
1197 tapeblock_init (); 1248 tapeblock_init ();
@@ -1216,7 +1267,7 @@ tape_exit(void)
1216MODULE_AUTHOR("(C) 2001 IBM Deutschland Entwicklung GmbH by Carsten Otte and " 1267MODULE_AUTHOR("(C) 2001 IBM Deutschland Entwicklung GmbH by Carsten Otte and "
1217 "Michael Holzheu (cotte@de.ibm.com,holzheu@de.ibm.com)"); 1268 "Michael Holzheu (cotte@de.ibm.com,holzheu@de.ibm.com)");
1218MODULE_DESCRIPTION("Linux on zSeries channel attached " 1269MODULE_DESCRIPTION("Linux on zSeries channel attached "
1219 "tape device driver ($Revision: 1.51 $)"); 1270 "tape device driver ($Revision: 1.54 $)");
1220MODULE_LICENSE("GPL"); 1271MODULE_LICENSE("GPL");
1221 1272
1222module_init(tape_init); 1273module_init(tape_init);
diff --git a/drivers/s390/char/vmcp.c b/drivers/s390/char/vmcp.c
index 7f11a608a633..8990d8076e7d 100644
--- a/drivers/s390/char/vmcp.c
+++ b/drivers/s390/char/vmcp.c
@@ -115,9 +115,9 @@ vmcp_write(struct file *file, const char __user * buff, size_t count,
115 return -ENOMEM; 115 return -ENOMEM;
116 } 116 }
117 debug_text_event(vmcp_debug, 1, cmd); 117 debug_text_event(vmcp_debug, 1, cmd);
118 session->resp_size = cpcmd(cmd, session->response, 118 session->resp_size = __cpcmd(cmd, session->response,
119 session->bufsize, 119 session->bufsize,
120 &session->resp_code); 120 &session->resp_code);
121 up(&session->mutex); 121 up(&session->mutex);
122 kfree(cmd); 122 kfree(cmd);
123 *ppos = 0; /* reset the file pointer after a command */ 123 *ppos = 0; /* reset the file pointer after a command */
diff --git a/drivers/s390/char/vmwatchdog.c b/drivers/s390/char/vmwatchdog.c
index 22cf4fec8da9..5473c23fcb52 100644
--- a/drivers/s390/char/vmwatchdog.c
+++ b/drivers/s390/char/vmwatchdog.c
@@ -23,11 +23,7 @@
23static char vmwdt_cmd[MAX_CMDLEN] = "IPL"; 23static char vmwdt_cmd[MAX_CMDLEN] = "IPL";
24static int vmwdt_conceal; 24static int vmwdt_conceal;
25 25
26#ifdef CONFIG_WATCHDOG_NOWAYOUT 26static int vmwdt_nowayout = WATCHDOG_NOWAYOUT;
27static int vmwdt_nowayout = 1;
28#else
29static int vmwdt_nowayout = 0;
30#endif
31 27
32MODULE_LICENSE("GPL"); 28MODULE_LICENSE("GPL");
33MODULE_AUTHOR("Arnd Bergmann <arndb@de.ibm.com>"); 29MODULE_AUTHOR("Arnd Bergmann <arndb@de.ibm.com>");
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
index b86f94ecd874..fa3c23b80e3a 100644
--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * drivers/s390/cio/chsc.c 2 * drivers/s390/cio/chsc.c
3 * S/390 common I/O routines -- channel subsystem call 3 * S/390 common I/O routines -- channel subsystem call
4 * $Revision: 1.119 $ 4 * $Revision: 1.120 $
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
@@ -412,11 +412,7 @@ s390_process_res_acc (u8 chpid, __u16 fla, u32 fla_mask)
412 if (chp_mask == 0) { 412 if (chp_mask == 0) {
413 413
414 spin_unlock_irq(&sch->lock); 414 spin_unlock_irq(&sch->lock);
415 415 continue;
416 if (fla_mask != 0)
417 break;
418 else
419 continue;
420 } 416 }
421 old_lpm = sch->lpm; 417 old_lpm = sch->lpm;
422 sch->lpm = ((sch->schib.pmcw.pim & 418 sch->lpm = ((sch->schib.pmcw.pim &
@@ -430,7 +426,7 @@ s390_process_res_acc (u8 chpid, __u16 fla, u32 fla_mask)
430 426
431 spin_unlock_irq(&sch->lock); 427 spin_unlock_irq(&sch->lock);
432 put_device(&sch->dev); 428 put_device(&sch->dev);
433 if (fla_mask != 0) 429 if (fla_mask == 0xffff)
434 break; 430 break;
435 } 431 }
436 return rc; 432 return rc;
diff --git a/drivers/s390/cio/device_status.c b/drivers/s390/cio/device_status.c
index 4ab2e0d95009..12a24d4331a2 100644
--- a/drivers/s390/cio/device_status.c
+++ b/drivers/s390/cio/device_status.c
@@ -39,15 +39,14 @@ ccw_device_msg_control_check(struct ccw_device *cdev, struct irb *irb)
39 " ... device %04X on subchannel %04X, dev_stat " 39 " ... device %04X on subchannel %04X, dev_stat "
40 ": %02X sch_stat : %02X\n", 40 ": %02X sch_stat : %02X\n",
41 cdev->private->devno, cdev->private->irq, 41 cdev->private->devno, cdev->private->irq,
42 cdev->private->irb.scsw.dstat, 42 irb->scsw.dstat, irb->scsw.cstat);
43 cdev->private->irb.scsw.cstat);
44 43
45 if (irb->scsw.cc != 3) { 44 if (irb->scsw.cc != 3) {
46 char dbf_text[15]; 45 char dbf_text[15];
47 46
48 sprintf(dbf_text, "chk%x", cdev->private->irq); 47 sprintf(dbf_text, "chk%x", cdev->private->irq);
49 CIO_TRACE_EVENT(0, dbf_text); 48 CIO_TRACE_EVENT(0, dbf_text);
50 CIO_HEX_EVENT(0, &cdev->private->irb, sizeof (struct irb)); 49 CIO_HEX_EVENT(0, irb, sizeof (struct irb));
51 } 50 }
52} 51}
53 52
diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c
index 82194c4eadfb..d36258d6665f 100644
--- a/drivers/s390/cio/qdio.c
+++ b/drivers/s390/cio/qdio.c
@@ -432,7 +432,7 @@ tiqdio_clear_global_summary(void)
432 432
433/************************* OUTBOUND ROUTINES *******************************/ 433/************************* OUTBOUND ROUTINES *******************************/
434 434
435inline static int 435static inline int
436qdio_get_outbound_buffer_frontier(struct qdio_q *q) 436qdio_get_outbound_buffer_frontier(struct qdio_q *q)
437{ 437{
438 int f,f_mod_no; 438 int f,f_mod_no;
@@ -510,7 +510,7 @@ out:
510} 510}
511 511
512/* all buffers are processed */ 512/* all buffers are processed */
513inline static int 513static inline int
514qdio_is_outbound_q_done(struct qdio_q *q) 514qdio_is_outbound_q_done(struct qdio_q *q)
515{ 515{
516 int no_used; 516 int no_used;
@@ -532,7 +532,7 @@ qdio_is_outbound_q_done(struct qdio_q *q)
532 return (no_used==0); 532 return (no_used==0);
533} 533}
534 534
535inline static int 535static inline int
536qdio_has_outbound_q_moved(struct qdio_q *q) 536qdio_has_outbound_q_moved(struct qdio_q *q)
537{ 537{
538 int i; 538 int i;
@@ -552,7 +552,7 @@ qdio_has_outbound_q_moved(struct qdio_q *q)
552 } 552 }
553} 553}
554 554
555inline static void 555static inline void
556qdio_kick_outbound_q(struct qdio_q *q) 556qdio_kick_outbound_q(struct qdio_q *q)
557{ 557{
558 int result; 558 int result;
@@ -641,7 +641,7 @@ qdio_kick_outbound_q(struct qdio_q *q)
641 } 641 }
642} 642}
643 643
644inline static void 644static inline void
645qdio_kick_outbound_handler(struct qdio_q *q) 645qdio_kick_outbound_handler(struct qdio_q *q)
646{ 646{
647 int start, end, real_end, count; 647 int start, end, real_end, count;
@@ -740,7 +740,7 @@ qdio_outbound_processing(struct qdio_q *q)
740/************************* INBOUND ROUTINES *******************************/ 740/************************* INBOUND ROUTINES *******************************/
741 741
742 742
743inline static int 743static inline int
744qdio_get_inbound_buffer_frontier(struct qdio_q *q) 744qdio_get_inbound_buffer_frontier(struct qdio_q *q)
745{ 745{
746 int f,f_mod_no; 746 int f,f_mod_no;
@@ -865,7 +865,7 @@ out:
865 return q->first_to_check; 865 return q->first_to_check;
866} 866}
867 867
868inline static int 868static inline int
869qdio_has_inbound_q_moved(struct qdio_q *q) 869qdio_has_inbound_q_moved(struct qdio_q *q)
870{ 870{
871 int i; 871 int i;
@@ -898,7 +898,7 @@ qdio_has_inbound_q_moved(struct qdio_q *q)
898} 898}
899 899
900/* means, no more buffers to be filled */ 900/* means, no more buffers to be filled */
901inline static int 901static inline int
902tiqdio_is_inbound_q_done(struct qdio_q *q) 902tiqdio_is_inbound_q_done(struct qdio_q *q)
903{ 903{
904 int no_used; 904 int no_used;
@@ -951,7 +951,7 @@ tiqdio_is_inbound_q_done(struct qdio_q *q)
951 return 0; 951 return 0;
952} 952}
953 953
954inline static int 954static inline int
955qdio_is_inbound_q_done(struct qdio_q *q) 955qdio_is_inbound_q_done(struct qdio_q *q)
956{ 956{
957 int no_used; 957 int no_used;
@@ -1010,7 +1010,7 @@ qdio_is_inbound_q_done(struct qdio_q *q)
1010 } 1010 }
1011} 1011}
1012 1012
1013inline static void 1013static inline void
1014qdio_kick_inbound_handler(struct qdio_q *q) 1014qdio_kick_inbound_handler(struct qdio_q *q)
1015{ 1015{
1016 int count, start, end, real_end, i; 1016 int count, start, end, real_end, i;
diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h
index 008e0a5d2eb3..3a0285669adf 100644
--- a/drivers/s390/net/qeth.h
+++ b/drivers/s390/net/qeth.h
@@ -824,7 +824,7 @@ extern struct list_head qeth_notify_list;
824 824
825#define QETH_CARD_IFNAME(card) (((card)->dev)? (card)->dev->name : "") 825#define QETH_CARD_IFNAME(card) (((card)->dev)? (card)->dev->name : "")
826 826
827inline static __u8 827static inline __u8
828qeth_get_ipa_adp_type(enum qeth_link_types link_type) 828qeth_get_ipa_adp_type(enum qeth_link_types link_type)
829{ 829{
830 switch (link_type) { 830 switch (link_type) {
@@ -835,7 +835,7 @@ qeth_get_ipa_adp_type(enum qeth_link_types link_type)
835 } 835 }
836} 836}
837 837
838inline static int 838static inline int
839qeth_realloc_headroom(struct qeth_card *card, struct sk_buff **skb, int size) 839qeth_realloc_headroom(struct qeth_card *card, struct sk_buff **skb, int size)
840{ 840{
841 struct sk_buff *new_skb = NULL; 841 struct sk_buff *new_skb = NULL;
@@ -852,6 +852,7 @@ qeth_realloc_headroom(struct qeth_card *card, struct sk_buff **skb, int size)
852 } 852 }
853 return 0; 853 return 0;
854} 854}
855
855static inline struct sk_buff * 856static inline struct sk_buff *
856qeth_pskb_unshare(struct sk_buff *skb, int pri) 857qeth_pskb_unshare(struct sk_buff *skb, int pri)
857{ 858{
@@ -863,8 +864,7 @@ qeth_pskb_unshare(struct sk_buff *skb, int pri)
863 return nskb; 864 return nskb;
864} 865}
865 866
866 867static inline void *
867inline static void *
868qeth_push_skb(struct qeth_card *card, struct sk_buff **skb, int size) 868qeth_push_skb(struct qeth_card *card, struct sk_buff **skb, int size)
869{ 869{
870 void *hdr; 870 void *hdr;
@@ -887,7 +887,7 @@ qeth_push_skb(struct qeth_card *card, struct sk_buff **skb, int size)
887} 887}
888 888
889 889
890inline static int 890static inline int
891qeth_get_hlen(__u8 link_type) 891qeth_get_hlen(__u8 link_type)
892{ 892{
893#ifdef CONFIG_QETH_IPV6 893#ifdef CONFIG_QETH_IPV6
@@ -911,7 +911,7 @@ qeth_get_hlen(__u8 link_type)
911#endif /* CONFIG_QETH_IPV6 */ 911#endif /* CONFIG_QETH_IPV6 */
912} 912}
913 913
914inline static unsigned short 914static inline unsigned short
915qeth_get_netdev_flags(struct qeth_card *card) 915qeth_get_netdev_flags(struct qeth_card *card)
916{ 916{
917 if (card->options.layer2) 917 if (card->options.layer2)
@@ -929,7 +929,7 @@ qeth_get_netdev_flags(struct qeth_card *card)
929 } 929 }
930} 930}
931 931
932inline static int 932static inline int
933qeth_get_initial_mtu_for_card(struct qeth_card * card) 933qeth_get_initial_mtu_for_card(struct qeth_card * card)
934{ 934{
935 switch (card->info.type) { 935 switch (card->info.type) {
@@ -950,7 +950,7 @@ qeth_get_initial_mtu_for_card(struct qeth_card * card)
950 } 950 }
951} 951}
952 952
953inline static int 953static inline int
954qeth_get_max_mtu_for_card(int cardtype) 954qeth_get_max_mtu_for_card(int cardtype)
955{ 955{
956 switch (cardtype) { 956 switch (cardtype) {
@@ -965,7 +965,7 @@ qeth_get_max_mtu_for_card(int cardtype)
965 } 965 }
966} 966}
967 967
968inline static int 968static inline int
969qeth_get_mtu_out_of_mpc(int cardtype) 969qeth_get_mtu_out_of_mpc(int cardtype)
970{ 970{
971 switch (cardtype) { 971 switch (cardtype) {
@@ -976,7 +976,7 @@ qeth_get_mtu_out_of_mpc(int cardtype)
976 } 976 }
977} 977}
978 978
979inline static int 979static inline int
980qeth_get_mtu_outof_framesize(int framesize) 980qeth_get_mtu_outof_framesize(int framesize)
981{ 981{
982 switch (framesize) { 982 switch (framesize) {
@@ -993,7 +993,7 @@ qeth_get_mtu_outof_framesize(int framesize)
993 } 993 }
994} 994}
995 995
996inline static int 996static inline int
997qeth_mtu_is_valid(struct qeth_card * card, int mtu) 997qeth_mtu_is_valid(struct qeth_card * card, int mtu)
998{ 998{
999 switch (card->info.type) { 999 switch (card->info.type) {
@@ -1008,7 +1008,7 @@ qeth_mtu_is_valid(struct qeth_card * card, int mtu)
1008 } 1008 }
1009} 1009}
1010 1010
1011inline static int 1011static inline int
1012qeth_get_arphdr_type(int cardtype, int linktype) 1012qeth_get_arphdr_type(int cardtype, int linktype)
1013{ 1013{
1014 switch (cardtype) { 1014 switch (cardtype) {
@@ -1027,7 +1027,7 @@ qeth_get_arphdr_type(int cardtype, int linktype)
1027} 1027}
1028 1028
1029#ifdef CONFIG_QETH_PERF_STATS 1029#ifdef CONFIG_QETH_PERF_STATS
1030inline static int 1030static inline int
1031qeth_get_micros(void) 1031qeth_get_micros(void)
1032{ 1032{
1033 return (int) (get_clock() >> 12); 1033 return (int) (get_clock() >> 12);