aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/block/dasd.c45
-rw-r--r--drivers/s390/block/dasd_proc.c17
-rw-r--r--drivers/s390/char/keyboard.c2
-rw-r--r--drivers/s390/char/tape_block.c4
-rw-r--r--drivers/s390/char/tape_core.c10
-rw-r--r--drivers/s390/cio/blacklist.c4
-rw-r--r--drivers/s390/cio/cio.c2
-rw-r--r--drivers/s390/cio/cio_debug.h22
8 files changed, 67 insertions, 39 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index 0a9f12c4e911..a3bfebcf31ef 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -1257,25 +1257,28 @@ __dasd_start_head(struct dasd_device * device)
1257 if (list_empty(&device->ccw_queue)) 1257 if (list_empty(&device->ccw_queue))
1258 return; 1258 return;
1259 cqr = list_entry(device->ccw_queue.next, struct dasd_ccw_req, list); 1259 cqr = list_entry(device->ccw_queue.next, struct dasd_ccw_req, list);
1260 /* check FAILFAST */ 1260 if (cqr->status != DASD_CQR_QUEUED)
1261 return;
1262 /* Non-temporary stop condition will trigger fail fast */
1261 if (device->stopped & ~DASD_STOPPED_PENDING && 1263 if (device->stopped & ~DASD_STOPPED_PENDING &&
1262 test_bit(DASD_CQR_FLAGS_FAILFAST, &cqr->flags) && 1264 test_bit(DASD_CQR_FLAGS_FAILFAST, &cqr->flags) &&
1263 (!dasd_eer_enabled(device))) { 1265 (!dasd_eer_enabled(device))) {
1264 cqr->status = DASD_CQR_FAILED; 1266 cqr->status = DASD_CQR_FAILED;
1265 dasd_schedule_bh(device); 1267 dasd_schedule_bh(device);
1268 return;
1266 } 1269 }
1267 if ((cqr->status == DASD_CQR_QUEUED) && 1270 /* Don't try to start requests if device is stopped */
1268 (!device->stopped)) { 1271 if (device->stopped)
1269 /* try to start the first I/O that can be started */ 1272 return;
1270 rc = device->discipline->start_IO(cqr); 1273
1271 if (rc == 0) 1274 rc = device->discipline->start_IO(cqr);
1272 dasd_set_timer(device, cqr->expires); 1275 if (rc == 0)
1273 else if (rc == -EACCES) { 1276 dasd_set_timer(device, cqr->expires);
1274 dasd_schedule_bh(device); 1277 else if (rc == -EACCES) {
1275 } else 1278 dasd_schedule_bh(device);
1276 /* Hmpf, try again in 1/2 sec */ 1279 } else
1277 dasd_set_timer(device, 50); 1280 /* Hmpf, try again in 1/2 sec */
1278 } 1281 dasd_set_timer(device, 50);
1279} 1282}
1280 1283
1281/* 1284/*
@@ -1968,7 +1971,7 @@ int
1968dasd_generic_set_offline (struct ccw_device *cdev) 1971dasd_generic_set_offline (struct ccw_device *cdev)
1969{ 1972{
1970 struct dasd_device *device; 1973 struct dasd_device *device;
1971 int max_count; 1974 int max_count, open_count;
1972 1975
1973 device = dasd_device_from_cdev(cdev); 1976 device = dasd_device_from_cdev(cdev);
1974 if (IS_ERR(device)) 1977 if (IS_ERR(device))
@@ -1985,10 +1988,16 @@ dasd_generic_set_offline (struct ccw_device *cdev)
1985 * in the other openers. 1988 * in the other openers.
1986 */ 1989 */
1987 max_count = device->bdev ? 0 : -1; 1990 max_count = device->bdev ? 0 : -1;
1988 if (atomic_read(&device->open_count) > max_count) { 1991 open_count = (int) atomic_read(&device->open_count);
1989 printk (KERN_WARNING "Can't offline dasd device with open" 1992 if (open_count > max_count) {
1990 " count = %i.\n", 1993 if (open_count > 0)
1991 atomic_read(&device->open_count)); 1994 printk (KERN_WARNING "Can't offline dasd device with "
1995 "open count = %i.\n",
1996 open_count);
1997 else
1998 printk (KERN_WARNING "%s",
1999 "Can't offline dasd device due to internal "
2000 "use\n");
1992 clear_bit(DASD_FLAG_OFFLINE, &device->flags); 2001 clear_bit(DASD_FLAG_OFFLINE, &device->flags);
1993 dasd_put_device(device); 2002 dasd_put_device(device);
1994 return -EBUSY; 2003 return -EBUSY;
diff --git a/drivers/s390/block/dasd_proc.c b/drivers/s390/block/dasd_proc.c
index 1aa3c261718a..ad23aede356c 100644
--- a/drivers/s390/block/dasd_proc.c
+++ b/drivers/s390/block/dasd_proc.c
@@ -294,23 +294,40 @@ out_error:
294#endif /* CONFIG_DASD_PROFILE */ 294#endif /* CONFIG_DASD_PROFILE */
295} 295}
296 296
297/*
298 * Create dasd proc-fs entries.
299 * In case creation failed, cleanup and return -ENOENT.
300 */
297int 301int
298dasd_proc_init(void) 302dasd_proc_init(void)
299{ 303{
300 dasd_proc_root_entry = proc_mkdir("dasd", &proc_root); 304 dasd_proc_root_entry = proc_mkdir("dasd", &proc_root);
305 if (!dasd_proc_root_entry)
306 goto out_nodasd;
301 dasd_proc_root_entry->owner = THIS_MODULE; 307 dasd_proc_root_entry->owner = THIS_MODULE;
302 dasd_devices_entry = create_proc_entry("devices", 308 dasd_devices_entry = create_proc_entry("devices",
303 S_IFREG | S_IRUGO | S_IWUSR, 309 S_IFREG | S_IRUGO | S_IWUSR,
304 dasd_proc_root_entry); 310 dasd_proc_root_entry);
311 if (!dasd_devices_entry)
312 goto out_nodevices;
305 dasd_devices_entry->proc_fops = &dasd_devices_file_ops; 313 dasd_devices_entry->proc_fops = &dasd_devices_file_ops;
306 dasd_devices_entry->owner = THIS_MODULE; 314 dasd_devices_entry->owner = THIS_MODULE;
307 dasd_statistics_entry = create_proc_entry("statistics", 315 dasd_statistics_entry = create_proc_entry("statistics",
308 S_IFREG | S_IRUGO | S_IWUSR, 316 S_IFREG | S_IRUGO | S_IWUSR,
309 dasd_proc_root_entry); 317 dasd_proc_root_entry);
318 if (!dasd_statistics_entry)
319 goto out_nostatistics;
310 dasd_statistics_entry->read_proc = dasd_statistics_read; 320 dasd_statistics_entry->read_proc = dasd_statistics_read;
311 dasd_statistics_entry->write_proc = dasd_statistics_write; 321 dasd_statistics_entry->write_proc = dasd_statistics_write;
312 dasd_statistics_entry->owner = THIS_MODULE; 322 dasd_statistics_entry->owner = THIS_MODULE;
313 return 0; 323 return 0;
324
325 out_nostatistics:
326 remove_proc_entry("devices", dasd_proc_root_entry);
327 out_nodevices:
328 remove_proc_entry("dasd", &proc_root);
329 out_nodasd:
330 return -ENOENT;
314} 331}
315 332
316void 333void
diff --git a/drivers/s390/char/keyboard.c b/drivers/s390/char/keyboard.c
index 6badd8403409..d4d2ff0a9da2 100644
--- a/drivers/s390/char/keyboard.c
+++ b/drivers/s390/char/keyboard.c
@@ -54,7 +54,7 @@ kbd_alloc(void) {
54 if (!kbd) 54 if (!kbd)
55 goto out; 55 goto out;
56 kbd->key_maps = kzalloc(sizeof(key_maps), GFP_KERNEL); 56 kbd->key_maps = kzalloc(sizeof(key_maps), GFP_KERNEL);
57 if (!key_maps) 57 if (!kbd->key_maps)
58 goto out_kbd; 58 goto out_kbd;
59 for (i = 0; i < ARRAY_SIZE(key_maps); i++) { 59 for (i = 0; i < ARRAY_SIZE(key_maps); i++) {
60 if (key_maps[i]) { 60 if (key_maps[i]) {
diff --git a/drivers/s390/char/tape_block.c b/drivers/s390/char/tape_block.c
index 5c65cf3e5cc0..b70d92690242 100644
--- a/drivers/s390/char/tape_block.c
+++ b/drivers/s390/char/tape_block.c
@@ -432,8 +432,8 @@ tapeblock_ioctl(
432) { 432) {
433 int rc; 433 int rc;
434 int minor; 434 int minor;
435 struct gendisk *disk = inode->i_bdev->bd_disk; 435 struct gendisk *disk;
436 struct tape_device *device = disk->private_data; 436 struct tape_device *device;
437 437
438 rc = 0; 438 rc = 0;
439 disk = inode->i_bdev->bd_disk; 439 disk = inode->i_bdev->bd_disk;
diff --git a/drivers/s390/char/tape_core.c b/drivers/s390/char/tape_core.c
index 389ee2c0f443..e6e4086d3224 100644
--- a/drivers/s390/char/tape_core.c
+++ b/drivers/s390/char/tape_core.c
@@ -210,18 +210,14 @@ tape_state_set(struct tape_device *device, enum tape_state newstate)
210 return; 210 return;
211 } 211 }
212 DBF_EVENT(4, "ts. dev: %x\n", device->first_minor); 212 DBF_EVENT(4, "ts. dev: %x\n", device->first_minor);
213 if (device->tape_state < TO_SIZE && device->tape_state >= 0) 213 DBF_EVENT(4, "old ts:\t\n");
214 str = tape_state_verbose[device->tape_state]; 214 if (device->tape_state < TS_SIZE && device->tape_state >=0 )
215 else
216 str = "UNKNOWN TS";
217 DBF_EVENT(4, "old ts: %s\n", str);
218 if (device->tape_state < TO_SIZE && device->tape_state >=0 )
219 str = tape_state_verbose[device->tape_state]; 215 str = tape_state_verbose[device->tape_state];
220 else 216 else
221 str = "UNKNOWN TS"; 217 str = "UNKNOWN TS";
222 DBF_EVENT(4, "%s\n", str); 218 DBF_EVENT(4, "%s\n", str);
223 DBF_EVENT(4, "new ts:\t\n"); 219 DBF_EVENT(4, "new ts:\t\n");
224 if (newstate < TO_SIZE && newstate >= 0) 220 if (newstate < TS_SIZE && newstate >= 0)
225 str = tape_state_verbose[newstate]; 221 str = tape_state_verbose[newstate];
226 else 222 else
227 str = "UNKNOWN TS"; 223 str = "UNKNOWN TS";
diff --git a/drivers/s390/cio/blacklist.c b/drivers/s390/cio/blacklist.c
index cb8e2e672b68..0960bef7b199 100644
--- a/drivers/s390/cio/blacklist.c
+++ b/drivers/s390/cio/blacklist.c
@@ -414,11 +414,11 @@ cio_ignore_proc_init (void)
414 entry = create_proc_entry ("cio_ignore", S_IFREG | S_IRUGO | S_IWUSR, 414 entry = create_proc_entry ("cio_ignore", S_IFREG | S_IRUGO | S_IWUSR,
415 &proc_root); 415 &proc_root);
416 if (!entry) 416 if (!entry)
417 return 0; 417 return -ENOENT;
418 418
419 entry->proc_fops = &cio_ignore_proc_fops; 419 entry->proc_fops = &cio_ignore_proc_fops;
420 420
421 return 1; 421 return 0;
422} 422}
423 423
424__initcall (cio_ignore_proc_init); 424__initcall (cio_ignore_proc_init);
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c
index cbb86fa5f293..5b20d8c9c025 100644
--- a/drivers/s390/cio/cio.c
+++ b/drivers/s390/cio/cio.c
@@ -67,7 +67,7 @@ cio_debug_init (void)
67 goto out_unregister; 67 goto out_unregister;
68 debug_register_view (cio_debug_msg_id, &debug_sprintf_view); 68 debug_register_view (cio_debug_msg_id, &debug_sprintf_view);
69 debug_set_level (cio_debug_msg_id, 2); 69 debug_set_level (cio_debug_msg_id, 2);
70 cio_debug_trace_id = debug_register ("cio_trace", 16, 4, 8); 70 cio_debug_trace_id = debug_register ("cio_trace", 16, 4, 16);
71 if (!cio_debug_trace_id) 71 if (!cio_debug_trace_id)
72 goto out_unregister; 72 goto out_unregister;
73 debug_register_view (cio_debug_trace_id, &debug_hex_ascii_view); 73 debug_register_view (cio_debug_trace_id, &debug_hex_ascii_view);
diff --git a/drivers/s390/cio/cio_debug.h b/drivers/s390/cio/cio_debug.h
index 6af8b27d366b..f88844adae1b 100644
--- a/drivers/s390/cio/cio_debug.h
+++ b/drivers/s390/cio/cio_debug.h
@@ -3,6 +3,11 @@
3 3
4#include <asm/debug.h> 4#include <asm/debug.h>
5 5
6/* for use of debug feature */
7extern debug_info_t *cio_debug_msg_id;
8extern debug_info_t *cio_debug_trace_id;
9extern debug_info_t *cio_debug_crw_id;
10
6#define CIO_TRACE_EVENT(imp, txt) do { \ 11#define CIO_TRACE_EVENT(imp, txt) do { \
7 debug_text_event(cio_debug_trace_id, imp, txt); \ 12 debug_text_event(cio_debug_trace_id, imp, txt); \
8 } while (0) 13 } while (0)
@@ -15,18 +20,19 @@
15 debug_sprintf_event(cio_debug_crw_id, imp , ##args); \ 20 debug_sprintf_event(cio_debug_crw_id, imp , ##args); \
16 } while (0) 21 } while (0)
17 22
18#define CIO_HEX_EVENT(imp, args...) do { \ 23static inline void
19 debug_event(cio_debug_trace_id, imp, ##args); \ 24CIO_HEX_EVENT(int level, void *data, int length)
20 } while (0) 25{
26 while (length > 0) {
27 debug_event(cio_debug_trace_id, level, data, length);
28 length -= cio_debug_trace_id->buf_size;
29 data += cio_debug_trace_id->buf_size;
30 }
31}
21 32
22#define CIO_DEBUG(printk_level,event_level,msg...) ({ \ 33#define CIO_DEBUG(printk_level,event_level,msg...) ({ \
23 if (cio_show_msg) printk(printk_level msg); \ 34 if (cio_show_msg) printk(printk_level msg); \
24 CIO_MSG_EVENT (event_level, msg); \ 35 CIO_MSG_EVENT (event_level, msg); \
25}) 36})
26 37
27/* for use of debug feature */
28extern debug_info_t *cio_debug_msg_id;
29extern debug_info_t *cio_debug_trace_id;
30extern debug_info_t *cio_debug_crw_id;
31
32#endif 38#endif