aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char/tape_3590.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/char/tape_3590.c')
-rw-r--r--drivers/s390/char/tape_3590.c364
1 files changed, 179 insertions, 185 deletions
diff --git a/drivers/s390/char/tape_3590.c b/drivers/s390/char/tape_3590.c
index 71605a179d65..5a5bb97a081a 100644
--- a/drivers/s390/char/tape_3590.c
+++ b/drivers/s390/char/tape_3590.c
@@ -8,12 +8,15 @@
8 * Martin Schwidefsky <schwidefsky@de.ibm.com> 8 * Martin Schwidefsky <schwidefsky@de.ibm.com>
9 */ 9 */
10 10
11#define KMSG_COMPONENT "tape"
12
11#include <linux/module.h> 13#include <linux/module.h>
12#include <linux/init.h> 14#include <linux/init.h>
13#include <linux/bio.h> 15#include <linux/bio.h>
14#include <asm/ebcdic.h> 16#include <asm/ebcdic.h>
15 17
16#define TAPE_DBF_AREA tape_3590_dbf 18#define TAPE_DBF_AREA tape_3590_dbf
19#define BUFSIZE 512 /* size of buffers for dynamic generated messages */
17 20
18#include "tape.h" 21#include "tape.h"
19#include "tape_std.h" 22#include "tape_std.h"
@@ -36,7 +39,7 @@ EXPORT_SYMBOL(TAPE_DBF_AREA);
36 * - Read Alternate: implemented 39 * - Read Alternate: implemented
37 *******************************************************************/ 40 *******************************************************************/
38 41
39#define PRINTK_HEADER "TAPE_3590: " 42#define KMSG_COMPONENT "tape"
40 43
41static const char *tape_3590_msg[TAPE_3590_MAX_MSG] = { 44static const char *tape_3590_msg[TAPE_3590_MAX_MSG] = {
42 [0x00] = "", 45 [0x00] = "",
@@ -726,7 +729,7 @@ static void tape_3590_med_state_set(struct tape_device *device,
726 } 729 }
727 c_info->medium_status |= TAPE390_MEDIUM_LOADED_MASK; 730 c_info->medium_status |= TAPE390_MEDIUM_LOADED_MASK;
728 if (sense->flags & MSENSE_CRYPT_MASK) { 731 if (sense->flags & MSENSE_CRYPT_MASK) {
729 PRINT_INFO("Medium is encrypted (%04x)\n", sense->flags); 732 DBF_EVENT(6, "Medium is encrypted (%04x)\n", sense->flags);
730 c_info->medium_status |= TAPE390_MEDIUM_ENCRYPTED_MASK; 733 c_info->medium_status |= TAPE390_MEDIUM_ENCRYPTED_MASK;
731 } else { 734 } else {
732 DBF_EVENT(6, "Medium is not encrypted %04x\n", sense->flags); 735 DBF_EVENT(6, "Medium is not encrypted %04x\n", sense->flags);
@@ -847,8 +850,7 @@ tape_3590_unsolicited_irq(struct tape_device *device, struct irb *irb)
847 tape_3590_schedule_work(device, TO_READ_ATTMSG); 850 tape_3590_schedule_work(device, TO_READ_ATTMSG);
848 } else { 851 } else {
849 DBF_EVENT(3, "unsol.irq! dev end: %08x\n", device->cdev_id); 852 DBF_EVENT(3, "unsol.irq! dev end: %08x\n", device->cdev_id);
850 PRINT_WARN("Unsolicited IRQ (Device End) caught.\n"); 853 tape_dump_sense_dbf(device, NULL, irb);
851 tape_dump_sense(device, NULL, irb);
852 } 854 }
853 /* check medium state */ 855 /* check medium state */
854 tape_3590_schedule_work(device, TO_MSEN); 856 tape_3590_schedule_work(device, TO_MSEN);
@@ -876,8 +878,6 @@ tape_3590_erp_basic(struct tape_device *device, struct tape_request *request,
876 case SENSE_BRA_DRE: 878 case SENSE_BRA_DRE:
877 return tape_3590_erp_failed(device, request, irb, rc); 879 return tape_3590_erp_failed(device, request, irb, rc);
878 default: 880 default:
879 PRINT_ERR("Unknown BRA %x - This should not happen!\n",
880 sense->bra);
881 BUG(); 881 BUG();
882 return TAPE_IO_STOP; 882 return TAPE_IO_STOP;
883 } 883 }
@@ -910,7 +910,8 @@ tape_3590_erp_swap(struct tape_device *device, struct tape_request *request,
910 * should proceed with the new tape... this 910 * should proceed with the new tape... this
911 * should probably be done in user space! 911 * should probably be done in user space!
912 */ 912 */
913 PRINT_WARN("(%s): Swap Tape Device!\n", dev_name(&device->cdev->dev)); 913 dev_warn (&device->cdev->dev, "The tape medium must be loaded into a "
914 "different tape unit\n");
914 return tape_3590_erp_basic(device, request, irb, -EIO); 915 return tape_3590_erp_basic(device, request, irb, -EIO);
915} 916}
916 917
@@ -985,8 +986,6 @@ tape_3590_erp_read_opposite(struct tape_device *device,
985 return tape_3590_erp_failed(device, request, irb, -EIO); 986 return tape_3590_erp_failed(device, request, irb, -EIO);
986 break; 987 break;
987 default: 988 default:
988 PRINT_WARN("read_opposite_recovery_called_with_op: %s\n",
989 tape_op_verbose[request->op]);
990 return tape_3590_erp_failed(device, request, irb, -EIO); 989 return tape_3590_erp_failed(device, request, irb, -EIO);
991 } 990 }
992} 991}
@@ -998,50 +997,61 @@ static void
998tape_3590_print_mim_msg_f0(struct tape_device *device, struct irb *irb) 997tape_3590_print_mim_msg_f0(struct tape_device *device, struct irb *irb)
999{ 998{
1000 struct tape_3590_sense *sense; 999 struct tape_3590_sense *sense;
1000 char *exception, *service;
1001
1002 exception = kmalloc(BUFSIZE, GFP_ATOMIC);
1003 service = kmalloc(BUFSIZE, GFP_ATOMIC);
1004
1005 if (!exception || !service)
1006 goto out_nomem;
1001 1007
1002 sense = (struct tape_3590_sense *) irb->ecw; 1008 sense = (struct tape_3590_sense *) irb->ecw;
1003 /* Exception Message */ 1009 /* Exception Message */
1004 switch (sense->fmt.f70.emc) { 1010 switch (sense->fmt.f70.emc) {
1005 case 0x02: 1011 case 0x02:
1006 PRINT_WARN("(%s): Data degraded\n", 1012 snprintf(exception, BUFSIZE, "Data degraded");
1007 dev_name(&device->cdev->dev));
1008 break; 1013 break;
1009 case 0x03: 1014 case 0x03:
1010 PRINT_WARN("(%s): Data degraded in partion %i\n", 1015 snprintf(exception, BUFSIZE, "Data degraded in partion %i",
1011 dev_name(&device->cdev->dev), sense->fmt.f70.mp); 1016 sense->fmt.f70.mp);
1012 break; 1017 break;
1013 case 0x04: 1018 case 0x04:
1014 PRINT_WARN("(%s): Medium degraded\n", 1019 snprintf(exception, BUFSIZE, "Medium degraded");
1015 dev_name(&device->cdev->dev));
1016 break; 1020 break;
1017 case 0x05: 1021 case 0x05:
1018 PRINT_WARN("(%s): Medium degraded in partition %i\n", 1022 snprintf(exception, BUFSIZE, "Medium degraded in partition %i",
1019 dev_name(&device->cdev->dev), sense->fmt.f70.mp); 1023 sense->fmt.f70.mp);
1020 break; 1024 break;
1021 case 0x06: 1025 case 0x06:
1022 PRINT_WARN("(%s): Block 0 Error\n", 1026 snprintf(exception, BUFSIZE, "Block 0 Error");
1023 dev_name(&device->cdev->dev));
1024 break; 1027 break;
1025 case 0x07: 1028 case 0x07:
1026 PRINT_WARN("(%s): Medium Exception 0x%02x\n", 1029 snprintf(exception, BUFSIZE, "Medium Exception 0x%02x",
1027 dev_name(&device->cdev->dev), sense->fmt.f70.md); 1030 sense->fmt.f70.md);
1028 break; 1031 break;
1029 default: 1032 default:
1030 PRINT_WARN("(%s): MIM ExMsg: 0x%02x\n", 1033 snprintf(exception, BUFSIZE, "0x%02x",
1031 dev_name(&device->cdev->dev), sense->fmt.f70.emc); 1034 sense->fmt.f70.emc);
1032 break; 1035 break;
1033 } 1036 }
1034 /* Service Message */ 1037 /* Service Message */
1035 switch (sense->fmt.f70.smc) { 1038 switch (sense->fmt.f70.smc) {
1036 case 0x02: 1039 case 0x02:
1037 PRINT_WARN("(%s): Reference Media maintenance procedure %i\n", 1040 snprintf(service, BUFSIZE, "Reference Media maintenance "
1038 dev_name(&device->cdev->dev), sense->fmt.f70.md); 1041 "procedure %i", sense->fmt.f70.md);
1039 break; 1042 break;
1040 default: 1043 default:
1041 PRINT_WARN("(%s): MIM ServiceMsg: 0x%02x\n", 1044 snprintf(service, BUFSIZE, "0x%02x",
1042 dev_name(&device->cdev->dev), sense->fmt.f70.smc); 1045 sense->fmt.f70.smc);
1043 break; 1046 break;
1044 } 1047 }
1048
1049 dev_warn (&device->cdev->dev, "Tape media information: exception %s, "
1050 "service %s\n", exception, service);
1051
1052out_nomem:
1053 kfree(exception);
1054 kfree(service);
1045} 1055}
1046 1056
1047/* 1057/*
@@ -1051,108 +1061,108 @@ static void
1051tape_3590_print_io_sim_msg_f1(struct tape_device *device, struct irb *irb) 1061tape_3590_print_io_sim_msg_f1(struct tape_device *device, struct irb *irb)
1052{ 1062{
1053 struct tape_3590_sense *sense; 1063 struct tape_3590_sense *sense;
1064 char *exception, *service;
1065
1066 exception = kmalloc(BUFSIZE, GFP_ATOMIC);
1067 service = kmalloc(BUFSIZE, GFP_ATOMIC);
1068
1069 if (!exception || !service)
1070 goto out_nomem;
1054 1071
1055 sense = (struct tape_3590_sense *) irb->ecw; 1072 sense = (struct tape_3590_sense *) irb->ecw;
1056 /* Exception Message */ 1073 /* Exception Message */
1057 switch (sense->fmt.f71.emc) { 1074 switch (sense->fmt.f71.emc) {
1058 case 0x01: 1075 case 0x01:
1059 PRINT_WARN("(%s): Effect of failure is unknown\n", 1076 snprintf(exception, BUFSIZE, "Effect of failure is unknown");
1060 dev_name(&device->cdev->dev));
1061 break; 1077 break;
1062 case 0x02: 1078 case 0x02:
1063 PRINT_WARN("(%s): CU Exception - no performance impact\n", 1079 snprintf(exception, BUFSIZE, "CU Exception - no performance "
1064 dev_name(&device->cdev->dev)); 1080 "impact");
1065 break; 1081 break;
1066 case 0x03: 1082 case 0x03:
1067 PRINT_WARN("(%s): CU Exception on channel interface 0x%02x\n", 1083 snprintf(exception, BUFSIZE, "CU Exception on channel "
1068 dev_name(&device->cdev->dev), sense->fmt.f71.md[0]); 1084 "interface 0x%02x", sense->fmt.f71.md[0]);
1069 break; 1085 break;
1070 case 0x04: 1086 case 0x04:
1071 PRINT_WARN("(%s): CU Exception on device path 0x%02x\n", 1087 snprintf(exception, BUFSIZE, "CU Exception on device path "
1072 dev_name(&device->cdev->dev), sense->fmt.f71.md[0]); 1088 "0x%02x", sense->fmt.f71.md[0]);
1073 break; 1089 break;
1074 case 0x05: 1090 case 0x05:
1075 PRINT_WARN("(%s): CU Exception on library path 0x%02x\n", 1091 snprintf(exception, BUFSIZE, "CU Exception on library path "
1076 dev_name(&device->cdev->dev), sense->fmt.f71.md[0]); 1092 "0x%02x", sense->fmt.f71.md[0]);
1077 break; 1093 break;
1078 case 0x06: 1094 case 0x06:
1079 PRINT_WARN("(%s): CU Exception on node 0x%02x\n", 1095 snprintf(exception, BUFSIZE, "CU Exception on node 0x%02x",
1080 dev_name(&device->cdev->dev), sense->fmt.f71.md[0]); 1096 sense->fmt.f71.md[0]);
1081 break; 1097 break;
1082 case 0x07: 1098 case 0x07:
1083 PRINT_WARN("(%s): CU Exception on partition 0x%02x\n", 1099 snprintf(exception, BUFSIZE, "CU Exception on partition "
1084 dev_name(&device->cdev->dev), sense->fmt.f71.md[0]); 1100 "0x%02x", sense->fmt.f71.md[0]);
1085 break; 1101 break;
1086 default: 1102 default:
1087 PRINT_WARN("(%s): SIM ExMsg: 0x%02x\n", 1103 snprintf(exception, BUFSIZE, "0x%02x",
1088 dev_name(&device->cdev->dev), sense->fmt.f71.emc); 1104 sense->fmt.f71.emc);
1089 } 1105 }
1090 /* Service Message */ 1106 /* Service Message */
1091 switch (sense->fmt.f71.smc) { 1107 switch (sense->fmt.f71.smc) {
1092 case 0x01: 1108 case 0x01:
1093 PRINT_WARN("(%s): Repair impact is unknown\n", 1109 snprintf(service, BUFSIZE, "Repair impact is unknown");
1094 dev_name(&device->cdev->dev));
1095 break; 1110 break;
1096 case 0x02: 1111 case 0x02:
1097 PRINT_WARN("(%s): Repair will not impact cu performance\n", 1112 snprintf(service, BUFSIZE, "Repair will not impact cu "
1098 dev_name(&device->cdev->dev)); 1113 "performance");
1099 break; 1114 break;
1100 case 0x03: 1115 case 0x03:
1101 if (sense->fmt.f71.mdf == 0) 1116 if (sense->fmt.f71.mdf == 0)
1102 PRINT_WARN("(%s): Repair will disable node " 1117 snprintf(service, BUFSIZE, "Repair will disable node "
1103 "0x%x on CU\n", 1118 "0x%x on CU", sense->fmt.f71.md[1]);
1104 dev_name(&device->cdev->dev),
1105 sense->fmt.f71.md[1]);
1106 else 1119 else
1107 PRINT_WARN("(%s): Repair will disable nodes " 1120 snprintf(service, BUFSIZE, "Repair will disable "
1108 "(0x%x-0x%x) on CU\n", 1121 "nodes (0x%x-0x%x) on CU", sense->fmt.f71.md[1],
1109 dev_name(&device->cdev->dev), 1122 sense->fmt.f71.md[2]);
1110 sense->fmt.f71.md[1], sense->fmt.f71.md[2]);
1111 break; 1123 break;
1112 case 0x04: 1124 case 0x04:
1113 if (sense->fmt.f71.mdf == 0) 1125 if (sense->fmt.f71.mdf == 0)
1114 PRINT_WARN("(%s): Repair will disable cannel path " 1126 snprintf(service, BUFSIZE, "Repair will disable "
1115 "0x%x on CU\n", 1127 "channel path 0x%x on CU",
1116 dev_name(&device->cdev->dev), 1128 sense->fmt.f71.md[1]);
1117 sense->fmt.f71.md[1]);
1118 else 1129 else
1119 PRINT_WARN("(%s): Repair will disable cannel paths " 1130 snprintf(service, BUFSIZE, "Repair will disable cannel"
1120 "(0x%x-0x%x) on CU\n", 1131 " paths (0x%x-0x%x) on CU",
1121 dev_name(&device->cdev->dev), 1132 sense->fmt.f71.md[1], sense->fmt.f71.md[2]);
1122 sense->fmt.f71.md[1], sense->fmt.f71.md[2]);
1123 break; 1133 break;
1124 case 0x05: 1134 case 0x05:
1125 if (sense->fmt.f71.mdf == 0) 1135 if (sense->fmt.f71.mdf == 0)
1126 PRINT_WARN("(%s): Repair will disable device path " 1136 snprintf(service, BUFSIZE, "Repair will disable device"
1127 "0x%x on CU\n", 1137 " path 0x%x on CU", sense->fmt.f71.md[1]);
1128 dev_name(&device->cdev->dev),
1129 sense->fmt.f71.md[1]);
1130 else 1138 else
1131 PRINT_WARN("(%s): Repair will disable device paths " 1139 snprintf(service, BUFSIZE, "Repair will disable device"
1132 "(0x%x-0x%x) on CU\n", 1140 " paths (0x%x-0x%x) on CU",
1133 dev_name(&device->cdev->dev), 1141 sense->fmt.f71.md[1], sense->fmt.f71.md[2]);
1134 sense->fmt.f71.md[1], sense->fmt.f71.md[2]);
1135 break; 1142 break;
1136 case 0x06: 1143 case 0x06:
1137 if (sense->fmt.f71.mdf == 0) 1144 if (sense->fmt.f71.mdf == 0)
1138 PRINT_WARN("(%s): Repair will disable library path " 1145 snprintf(service, BUFSIZE, "Repair will disable "
1139 "0x%x on CU\n", 1146 "library path 0x%x on CU",
1140 dev_name(&device->cdev->dev), 1147 sense->fmt.f71.md[1]);
1141 sense->fmt.f71.md[1]);
1142 else 1148 else
1143 PRINT_WARN("(%s): Repair will disable library paths " 1149 snprintf(service, BUFSIZE, "Repair will disable "
1144 "(0x%x-0x%x) on CU\n", 1150 "library paths (0x%x-0x%x) on CU",
1145 dev_name(&device->cdev->dev), 1151 sense->fmt.f71.md[1], sense->fmt.f71.md[2]);
1146 sense->fmt.f71.md[1], sense->fmt.f71.md[2]);
1147 break; 1152 break;
1148 case 0x07: 1153 case 0x07:
1149 PRINT_WARN("(%s): Repair will disable access to CU\n", 1154 snprintf(service, BUFSIZE, "Repair will disable access to CU");
1150 dev_name(&device->cdev->dev));
1151 break; 1155 break;
1152 default: 1156 default:
1153 PRINT_WARN("(%s): SIM ServiceMsg: 0x%02x\n", 1157 snprintf(service, BUFSIZE, "0x%02x",
1154 dev_name(&device->cdev->dev), sense->fmt.f71.smc); 1158 sense->fmt.f71.smc);
1155 } 1159 }
1160
1161 dev_warn (&device->cdev->dev, "I/O subsystem information: exception"
1162 " %s, service %s\n", exception, service);
1163out_nomem:
1164 kfree(exception);
1165 kfree(service);
1156} 1166}
1157 1167
1158/* 1168/*
@@ -1162,111 +1172,109 @@ static void
1162tape_3590_print_dev_sim_msg_f2(struct tape_device *device, struct irb *irb) 1172tape_3590_print_dev_sim_msg_f2(struct tape_device *device, struct irb *irb)
1163{ 1173{
1164 struct tape_3590_sense *sense; 1174 struct tape_3590_sense *sense;
1175 char *exception, *service;
1176
1177 exception = kmalloc(BUFSIZE, GFP_ATOMIC);
1178 service = kmalloc(BUFSIZE, GFP_ATOMIC);
1179
1180 if (!exception || !service)
1181 goto out_nomem;
1165 1182
1166 sense = (struct tape_3590_sense *) irb->ecw; 1183 sense = (struct tape_3590_sense *) irb->ecw;
1167 /* Exception Message */ 1184 /* Exception Message */
1168 switch (sense->fmt.f71.emc) { 1185 switch (sense->fmt.f71.emc) {
1169 case 0x01: 1186 case 0x01:
1170 PRINT_WARN("(%s): Effect of failure is unknown\n", 1187 snprintf(exception, BUFSIZE, "Effect of failure is unknown");
1171 dev_name(&device->cdev->dev));
1172 break; 1188 break;
1173 case 0x02: 1189 case 0x02:
1174 PRINT_WARN("(%s): DV Exception - no performance impact\n", 1190 snprintf(exception, BUFSIZE, "DV Exception - no performance"
1175 dev_name(&device->cdev->dev)); 1191 " impact");
1176 break; 1192 break;
1177 case 0x03: 1193 case 0x03:
1178 PRINT_WARN("(%s): DV Exception on channel interface 0x%02x\n", 1194 snprintf(exception, BUFSIZE, "DV Exception on channel "
1179 dev_name(&device->cdev->dev), sense->fmt.f71.md[0]); 1195 "interface 0x%02x", sense->fmt.f71.md[0]);
1180 break; 1196 break;
1181 case 0x04: 1197 case 0x04:
1182 PRINT_WARN("(%s): DV Exception on loader 0x%02x\n", 1198 snprintf(exception, BUFSIZE, "DV Exception on loader 0x%02x",
1183 dev_name(&device->cdev->dev), sense->fmt.f71.md[0]); 1199 sense->fmt.f71.md[0]);
1184 break; 1200 break;
1185 case 0x05: 1201 case 0x05:
1186 PRINT_WARN("(%s): DV Exception on message display 0x%02x\n", 1202 snprintf(exception, BUFSIZE, "DV Exception on message display"
1187 dev_name(&device->cdev->dev), sense->fmt.f71.md[0]); 1203 " 0x%02x", sense->fmt.f71.md[0]);
1188 break; 1204 break;
1189 case 0x06: 1205 case 0x06:
1190 PRINT_WARN("(%s): DV Exception in tape path\n", 1206 snprintf(exception, BUFSIZE, "DV Exception in tape path");
1191 dev_name(&device->cdev->dev));
1192 break; 1207 break;
1193 case 0x07: 1208 case 0x07:
1194 PRINT_WARN("(%s): DV Exception in drive\n", 1209 snprintf(exception, BUFSIZE, "DV Exception in drive");
1195 dev_name(&device->cdev->dev));
1196 break; 1210 break;
1197 default: 1211 default:
1198 PRINT_WARN("(%s): DSIM ExMsg: 0x%02x\n", 1212 snprintf(exception, BUFSIZE, "0x%02x",
1199 dev_name(&device->cdev->dev), sense->fmt.f71.emc); 1213 sense->fmt.f71.emc);
1200 } 1214 }
1201 /* Service Message */ 1215 /* Service Message */
1202 switch (sense->fmt.f71.smc) { 1216 switch (sense->fmt.f71.smc) {
1203 case 0x01: 1217 case 0x01:
1204 PRINT_WARN("(%s): Repair impact is unknown\n", 1218 snprintf(service, BUFSIZE, "Repair impact is unknown");
1205 dev_name(&device->cdev->dev));
1206 break; 1219 break;
1207 case 0x02: 1220 case 0x02:
1208 PRINT_WARN("(%s): Repair will not impact device performance\n", 1221 snprintf(service, BUFSIZE, "Repair will not impact device "
1209 dev_name(&device->cdev->dev)); 1222 "performance");
1210 break; 1223 break;
1211 case 0x03: 1224 case 0x03:
1212 if (sense->fmt.f71.mdf == 0) 1225 if (sense->fmt.f71.mdf == 0)
1213 PRINT_WARN("(%s): Repair will disable channel path " 1226 snprintf(service, BUFSIZE, "Repair will disable "
1214 "0x%x on DV\n", 1227 "channel path 0x%x on DV",
1215 dev_name(&device->cdev->dev), 1228 sense->fmt.f71.md[1]);
1216 sense->fmt.f71.md[1]);
1217 else 1229 else
1218 PRINT_WARN("(%s): Repair will disable channel path " 1230 snprintf(service, BUFSIZE, "Repair will disable "
1219 "(0x%x-0x%x) on DV\n", 1231 "channel path (0x%x-0x%x) on DV",
1220 dev_name(&device->cdev->dev), 1232 sense->fmt.f71.md[1], sense->fmt.f71.md[2]);
1221 sense->fmt.f71.md[1], sense->fmt.f71.md[2]);
1222 break; 1233 break;
1223 case 0x04: 1234 case 0x04:
1224 if (sense->fmt.f71.mdf == 0) 1235 if (sense->fmt.f71.mdf == 0)
1225 PRINT_WARN("(%s): Repair will disable interface 0x%x " 1236 snprintf(service, BUFSIZE, "Repair will disable "
1226 "on DV\n", 1237 "interface 0x%x on DV", sense->fmt.f71.md[1]);
1227 dev_name(&device->cdev->dev),
1228 sense->fmt.f71.md[1]);
1229 else 1238 else
1230 PRINT_WARN("(%s): Repair will disable interfaces " 1239 snprintf(service, BUFSIZE, "Repair will disable "
1231 "(0x%x-0x%x) on DV\n", 1240 "interfaces (0x%x-0x%x) on DV",
1232 dev_name(&device->cdev->dev), 1241 sense->fmt.f71.md[1], sense->fmt.f71.md[2]);
1233 sense->fmt.f71.md[1], sense->fmt.f71.md[2]);
1234 break; 1242 break;
1235 case 0x05: 1243 case 0x05:
1236 if (sense->fmt.f71.mdf == 0) 1244 if (sense->fmt.f71.mdf == 0)
1237 PRINT_WARN("(%s): Repair will disable loader 0x%x " 1245 snprintf(service, BUFSIZE, "Repair will disable loader"
1238 "on DV\n", 1246 " 0x%x on DV", sense->fmt.f71.md[1]);
1239 dev_name(&device->cdev->dev),
1240 sense->fmt.f71.md[1]);
1241 else 1247 else
1242 PRINT_WARN("(%s): Repair will disable loader " 1248 snprintf(service, BUFSIZE, "Repair will disable loader"
1243 "(0x%x-0x%x) on DV\n", 1249 " (0x%x-0x%x) on DV",
1244 dev_name(&device->cdev->dev), 1250 sense->fmt.f71.md[1], sense->fmt.f71.md[2]);
1245 sense->fmt.f71.md[1], sense->fmt.f71.md[2]);
1246 break; 1251 break;
1247 case 0x07: 1252 case 0x07:
1248 PRINT_WARN("(%s): Repair will disable access to DV\n", 1253 snprintf(service, BUFSIZE, "Repair will disable access to DV");
1249 dev_name(&device->cdev->dev));
1250 break; 1254 break;
1251 case 0x08: 1255 case 0x08:
1252 if (sense->fmt.f71.mdf == 0) 1256 if (sense->fmt.f71.mdf == 0)
1253 PRINT_WARN("(%s): Repair will disable message " 1257 snprintf(service, BUFSIZE, "Repair will disable "
1254 "display 0x%x on DV\n", 1258 "message display 0x%x on DV",
1255 dev_name(&device->cdev->dev), 1259 sense->fmt.f71.md[1]);
1256 sense->fmt.f71.md[1]);
1257 else 1260 else
1258 PRINT_WARN("(%s): Repair will disable message " 1261 snprintf(service, BUFSIZE, "Repair will disable "
1259 "displays (0x%x-0x%x) on DV\n", 1262 "message displays (0x%x-0x%x) on DV",
1260 dev_name(&device->cdev->dev), 1263 sense->fmt.f71.md[1], sense->fmt.f71.md[2]);
1261 sense->fmt.f71.md[1], sense->fmt.f71.md[2]);
1262 break; 1264 break;
1263 case 0x09: 1265 case 0x09:
1264 PRINT_WARN("(%s): Clean DV\n", dev_name(&device->cdev->dev)); 1266 snprintf(service, BUFSIZE, "Clean DV");
1265 break; 1267 break;
1266 default: 1268 default:
1267 PRINT_WARN("(%s): DSIM ServiceMsg: 0x%02x\n", 1269 snprintf(service, BUFSIZE, "0x%02x",
1268 dev_name(&device->cdev->dev), sense->fmt.f71.smc); 1270 sense->fmt.f71.smc);
1269 } 1271 }
1272
1273 dev_warn (&device->cdev->dev, "Device subsystem information: exception"
1274 " %s, service %s\n", exception, service);
1275out_nomem:
1276 kfree(exception);
1277 kfree(service);
1270} 1278}
1271 1279
1272/* 1280/*
@@ -1282,46 +1290,44 @@ tape_3590_print_era_msg(struct tape_device *device, struct irb *irb)
1282 return; 1290 return;
1283 if ((sense->mc > 0) && (sense->mc < TAPE_3590_MAX_MSG)) { 1291 if ((sense->mc > 0) && (sense->mc < TAPE_3590_MAX_MSG)) {
1284 if (tape_3590_msg[sense->mc] != NULL) 1292 if (tape_3590_msg[sense->mc] != NULL)
1285 PRINT_WARN("(%s): %s\n", dev_name(&device->cdev->dev), 1293 dev_warn (&device->cdev->dev, "The tape unit has "
1286 tape_3590_msg[sense->mc]); 1294 "issued sense message %s\n",
1287 else { 1295 tape_3590_msg[sense->mc]);
1288 PRINT_WARN("(%s): Message Code 0x%x\n", 1296 else
1289 dev_name(&device->cdev->dev), sense->mc); 1297 dev_warn (&device->cdev->dev, "The tape unit has "
1290 } 1298 "issued an unknown sense message code 0x%x\n",
1299 sense->mc);
1291 return; 1300 return;
1292 } 1301 }
1293 if (sense->mc == 0xf0) { 1302 if (sense->mc == 0xf0) {
1294 /* Standard Media Information Message */ 1303 /* Standard Media Information Message */
1295 PRINT_WARN("(%s): MIM SEV=%i, MC=%02x, ES=%x/%x, " 1304 dev_warn (&device->cdev->dev, "MIM SEV=%i, MC=%02x, ES=%x/%x, "
1296 "RC=%02x-%04x-%02x\n", dev_name(&device->cdev->dev), 1305 "RC=%02x-%04x-%02x\n", sense->fmt.f70.sev, sense->mc,
1297 sense->fmt.f70.sev, sense->mc, 1306 sense->fmt.f70.emc, sense->fmt.f70.smc,
1298 sense->fmt.f70.emc, sense->fmt.f70.smc, 1307 sense->fmt.f70.refcode, sense->fmt.f70.mid,
1299 sense->fmt.f70.refcode, sense->fmt.f70.mid, 1308 sense->fmt.f70.fid);
1300 sense->fmt.f70.fid);
1301 tape_3590_print_mim_msg_f0(device, irb); 1309 tape_3590_print_mim_msg_f0(device, irb);
1302 return; 1310 return;
1303 } 1311 }
1304 if (sense->mc == 0xf1) { 1312 if (sense->mc == 0xf1) {
1305 /* Standard I/O Subsystem Service Information Message */ 1313 /* Standard I/O Subsystem Service Information Message */
1306 PRINT_WARN("(%s): IOSIM SEV=%i, DEVTYPE=3590/%02x, " 1314 dev_warn (&device->cdev->dev, "IOSIM SEV=%i, DEVTYPE=3590/%02x,"
1307 "MC=%02x, ES=%x/%x, REF=0x%04x-0x%04x-0x%04x\n", 1315 " MC=%02x, ES=%x/%x, REF=0x%04x-0x%04x-0x%04x\n",
1308 dev_name(&device->cdev->dev), sense->fmt.f71.sev, 1316 sense->fmt.f71.sev, device->cdev->id.dev_model,
1309 device->cdev->id.dev_model, 1317 sense->mc, sense->fmt.f71.emc, sense->fmt.f71.smc,
1310 sense->mc, sense->fmt.f71.emc, 1318 sense->fmt.f71.refcode1, sense->fmt.f71.refcode2,
1311 sense->fmt.f71.smc, sense->fmt.f71.refcode1, 1319 sense->fmt.f71.refcode3);
1312 sense->fmt.f71.refcode2, sense->fmt.f71.refcode3);
1313 tape_3590_print_io_sim_msg_f1(device, irb); 1320 tape_3590_print_io_sim_msg_f1(device, irb);
1314 return; 1321 return;
1315 } 1322 }
1316 if (sense->mc == 0xf2) { 1323 if (sense->mc == 0xf2) {
1317 /* Standard Device Service Information Message */ 1324 /* Standard Device Service Information Message */
1318 PRINT_WARN("(%s): DEVSIM SEV=%i, DEVTYPE=3590/%02x, " 1325 dev_warn (&device->cdev->dev, "DEVSIM SEV=%i, DEVTYPE=3590/%02x"
1319 "MC=%02x, ES=%x/%x, REF=0x%04x-0x%04x-0x%04x\n", 1326 ", MC=%02x, ES=%x/%x, REF=0x%04x-0x%04x-0x%04x\n",
1320 dev_name(&device->cdev->dev), sense->fmt.f71.sev, 1327 sense->fmt.f71.sev, device->cdev->id.dev_model,
1321 device->cdev->id.dev_model, 1328 sense->mc, sense->fmt.f71.emc, sense->fmt.f71.smc,
1322 sense->mc, sense->fmt.f71.emc, 1329 sense->fmt.f71.refcode1, sense->fmt.f71.refcode2,
1323 sense->fmt.f71.smc, sense->fmt.f71.refcode1, 1330 sense->fmt.f71.refcode3);
1324 sense->fmt.f71.refcode2, sense->fmt.f71.refcode3);
1325 tape_3590_print_dev_sim_msg_f2(device, irb); 1331 tape_3590_print_dev_sim_msg_f2(device, irb);
1326 return; 1332 return;
1327 } 1333 }
@@ -1329,8 +1335,8 @@ tape_3590_print_era_msg(struct tape_device *device, struct irb *irb)
1329 /* Standard Library Service Information Message */ 1335 /* Standard Library Service Information Message */
1330 return; 1336 return;
1331 } 1337 }
1332 PRINT_WARN("(%s): Device Message(%x)\n", 1338 dev_warn (&device->cdev->dev, "The tape unit has issued an unknown "
1333 dev_name(&device->cdev->dev), sense->mc); 1339 "sense message code %x\n", sense->mc);
1334} 1340}
1335 1341
1336static int tape_3590_crypt_error(struct tape_device *device, 1342static int tape_3590_crypt_error(struct tape_device *device,
@@ -1355,9 +1361,8 @@ static int tape_3590_crypt_error(struct tape_device *device,
1355 /* No connection to EKM */ 1361 /* No connection to EKM */
1356 return tape_3590_erp_basic(device, request, irb, -ENOTCONN); 1362 return tape_3590_erp_basic(device, request, irb, -ENOTCONN);
1357 1363
1358 PRINT_ERR("(%s): Unable to get encryption key from EKM\n", bus_id); 1364 dev_err (&device->cdev->dev, "The tape unit failed to obtain the "
1359 PRINT_ERR("(%s): CU=%02X DRIVE=%06X EKM=%02X:%04X\n", bus_id, cu_rc, 1365 "encryption key from EKM\n");
1360 drv_rc, ekm_rc1, ekm_rc2);
1361 1366
1362 return tape_3590_erp_basic(device, request, irb, -ENOKEY); 1367 return tape_3590_erp_basic(device, request, irb, -ENOKEY);
1363} 1368}
@@ -1443,8 +1448,6 @@ tape_3590_unit_check(struct tape_device *device, struct tape_request *request,
1443 * print additional msg since default msg 1448 * print additional msg since default msg
1444 * "device intervention" is not very meaningfull 1449 * "device intervention" is not very meaningfull
1445 */ 1450 */
1446 PRINT_WARN("(%s): Tape operation when medium not loaded\n",
1447 dev_name(&device->cdev->dev));
1448 tape_med_state_set(device, MS_UNLOADED); 1451 tape_med_state_set(device, MS_UNLOADED);
1449 tape_3590_schedule_work(device, TO_CRYPT_OFF); 1452 tape_3590_schedule_work(device, TO_CRYPT_OFF);
1450 return tape_3590_erp_basic(device, request, irb, -ENOMEDIUM); 1453 return tape_3590_erp_basic(device, request, irb, -ENOMEDIUM);
@@ -1490,19 +1493,13 @@ tape_3590_unit_check(struct tape_device *device, struct tape_request *request,
1490 return tape_3590_erp_basic(device, request, irb, -ENOMEDIUM); 1493 return tape_3590_erp_basic(device, request, irb, -ENOMEDIUM);
1491 1494
1492 case 0x6020: 1495 case 0x6020:
1493 PRINT_WARN("(%s): Cartridge of wrong type ?\n",
1494 dev_name(&device->cdev->dev));
1495 return tape_3590_erp_basic(device, request, irb, -EMEDIUMTYPE); 1496 return tape_3590_erp_basic(device, request, irb, -EMEDIUMTYPE);
1496 1497
1497 case 0x8011: 1498 case 0x8011:
1498 PRINT_WARN("(%s): Another host has reserved the tape device\n",
1499 dev_name(&device->cdev->dev));
1500 return tape_3590_erp_basic(device, request, irb, -EPERM); 1499 return tape_3590_erp_basic(device, request, irb, -EPERM);
1501 case 0x8013: 1500 case 0x8013:
1502 PRINT_WARN("(%s): Another host has privileged access to the " 1501 dev_warn (&device->cdev->dev, "A different host has privileged"
1503 "tape device\n", dev_name(&device->cdev->dev)); 1502 " access to the tape unit\n");
1504 PRINT_WARN("(%s): To solve the problem unload the current "
1505 "cartridge!\n", dev_name(&device->cdev->dev));
1506 return tape_3590_erp_basic(device, request, irb, -EPERM); 1503 return tape_3590_erp_basic(device, request, irb, -EPERM);
1507 default: 1504 default:
1508 return tape_3590_erp_basic(device, request, irb, -EIO); 1505 return tape_3590_erp_basic(device, request, irb, -EIO);
@@ -1552,9 +1549,7 @@ tape_3590_irq(struct tape_device *device, struct tape_request *request,
1552 } 1549 }
1553 1550
1554 DBF_EVENT(6, "xunknownirq\n"); 1551 DBF_EVENT(6, "xunknownirq\n");
1555 PRINT_ERR("Unexpected interrupt.\n"); 1552 tape_dump_sense_dbf(device, request, irb);
1556 PRINT_ERR("Current op is: %s", tape_op_verbose[request->op]);
1557 tape_dump_sense(device, request, irb);
1558 return TAPE_IO_STOP; 1553 return TAPE_IO_STOP;
1559} 1554}
1560 1555
@@ -1609,7 +1604,6 @@ tape_3590_setup_device(struct tape_device *device)
1609 if (rc) 1604 if (rc)
1610 goto fail_rdc_data; 1605 goto fail_rdc_data;
1611 if (rdc_data->data[31] == 0x13) { 1606 if (rdc_data->data[31] == 0x13) {
1612 PRINT_INFO("Device has crypto support\n");
1613 data->crypt_info.capability |= TAPE390_CRYPT_SUPPORTED_MASK; 1607 data->crypt_info.capability |= TAPE390_CRYPT_SUPPORTED_MASK;
1614 tape_3592_disable_crypt(device); 1608 tape_3592_disable_crypt(device);
1615 } else { 1609 } else {