diff options
-rw-r--r-- | drivers/scsi/scsi.c | 47 | ||||
-rw-r--r-- | drivers/scsi/scsi_lib.c | 4 | ||||
-rw-r--r-- | include/scsi/scsi_device.h | 8 |
3 files changed, 24 insertions, 35 deletions
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 1c89ee3e69ba..4c1e31334765 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c | |||
@@ -344,7 +344,6 @@ void scsi_destroy_command_freelist(struct Scsi_Host *shost) | |||
344 | void scsi_log_send(struct scsi_cmnd *cmd) | 344 | void scsi_log_send(struct scsi_cmnd *cmd) |
345 | { | 345 | { |
346 | unsigned int level; | 346 | unsigned int level; |
347 | struct scsi_device *sdev; | ||
348 | 347 | ||
349 | /* | 348 | /* |
350 | * If ML QUEUE log level is greater than or equal to: | 349 | * If ML QUEUE log level is greater than or equal to: |
@@ -361,22 +360,17 @@ void scsi_log_send(struct scsi_cmnd *cmd) | |||
361 | level = SCSI_LOG_LEVEL(SCSI_LOG_MLQUEUE_SHIFT, | 360 | level = SCSI_LOG_LEVEL(SCSI_LOG_MLQUEUE_SHIFT, |
362 | SCSI_LOG_MLQUEUE_BITS); | 361 | SCSI_LOG_MLQUEUE_BITS); |
363 | if (level > 1) { | 362 | if (level > 1) { |
364 | sdev = cmd->device; | 363 | scmd_printk(KERN_INFO, cmd, "Send: "); |
365 | sdev_printk(KERN_INFO, sdev, "send "); | ||
366 | if (level > 2) | 364 | if (level > 2) |
367 | printk("0x%p ", cmd); | 365 | printk("0x%p ", cmd); |
368 | /* | 366 | printk("\n"); |
369 | * spaces to match disposition and cmd->result | ||
370 | * output in scsi_log_completion. | ||
371 | */ | ||
372 | printk(" "); | ||
373 | scsi_print_command(cmd); | 367 | scsi_print_command(cmd); |
374 | if (level > 3) { | 368 | if (level > 3) { |
375 | printk(KERN_INFO "buffer = 0x%p, bufflen = %d," | 369 | printk(KERN_INFO "buffer = 0x%p, bufflen = %d," |
376 | " done = 0x%p, queuecommand 0x%p\n", | 370 | " done = 0x%p, queuecommand 0x%p\n", |
377 | cmd->request_buffer, cmd->request_bufflen, | 371 | cmd->request_buffer, cmd->request_bufflen, |
378 | cmd->done, | 372 | cmd->done, |
379 | sdev->host->hostt->queuecommand); | 373 | cmd->device->host->hostt->queuecommand); |
380 | 374 | ||
381 | } | 375 | } |
382 | } | 376 | } |
@@ -386,7 +380,6 @@ void scsi_log_send(struct scsi_cmnd *cmd) | |||
386 | void scsi_log_completion(struct scsi_cmnd *cmd, int disposition) | 380 | void scsi_log_completion(struct scsi_cmnd *cmd, int disposition) |
387 | { | 381 | { |
388 | unsigned int level; | 382 | unsigned int level; |
389 | struct scsi_device *sdev; | ||
390 | 383 | ||
391 | /* | 384 | /* |
392 | * If ML COMPLETE log level is greater than or equal to: | 385 | * If ML COMPLETE log level is greater than or equal to: |
@@ -405,8 +398,7 @@ void scsi_log_completion(struct scsi_cmnd *cmd, int disposition) | |||
405 | SCSI_LOG_MLCOMPLETE_BITS); | 398 | SCSI_LOG_MLCOMPLETE_BITS); |
406 | if (((level > 0) && (cmd->result || disposition != SUCCESS)) || | 399 | if (((level > 0) && (cmd->result || disposition != SUCCESS)) || |
407 | (level > 1)) { | 400 | (level > 1)) { |
408 | sdev = cmd->device; | 401 | scmd_printk(KERN_INFO, cmd, "Done: "); |
409 | sdev_printk(KERN_INFO, sdev, "done "); | ||
410 | if (level > 2) | 402 | if (level > 2) |
411 | printk("0x%p ", cmd); | 403 | printk("0x%p ", cmd); |
412 | /* | 404 | /* |
@@ -415,40 +407,35 @@ void scsi_log_completion(struct scsi_cmnd *cmd, int disposition) | |||
415 | */ | 407 | */ |
416 | switch (disposition) { | 408 | switch (disposition) { |
417 | case SUCCESS: | 409 | case SUCCESS: |
418 | printk("SUCCESS"); | 410 | printk("SUCCESS\n"); |
419 | break; | 411 | break; |
420 | case NEEDS_RETRY: | 412 | case NEEDS_RETRY: |
421 | printk("RETRY "); | 413 | printk("RETRY\n"); |
422 | break; | 414 | break; |
423 | case ADD_TO_MLQUEUE: | 415 | case ADD_TO_MLQUEUE: |
424 | printk("MLQUEUE"); | 416 | printk("MLQUEUE\n"); |
425 | break; | 417 | break; |
426 | case FAILED: | 418 | case FAILED: |
427 | printk("FAILED "); | 419 | printk("FAILED\n"); |
428 | break; | 420 | break; |
429 | case TIMEOUT_ERROR: | 421 | case TIMEOUT_ERROR: |
430 | /* | 422 | /* |
431 | * If called via scsi_times_out. | 423 | * If called via scsi_times_out. |
432 | */ | 424 | */ |
433 | printk("TIMEOUT"); | 425 | printk("TIMEOUT\n"); |
434 | break; | 426 | break; |
435 | default: | 427 | default: |
436 | printk("UNKNOWN"); | 428 | printk("UNKNOWN\n"); |
437 | } | 429 | } |
438 | printk(" %8x ", cmd->result); | 430 | scsi_print_result(cmd); |
439 | scsi_print_command(cmd); | 431 | scsi_print_command(cmd); |
440 | if (status_byte(cmd->result) & CHECK_CONDITION) { | 432 | if (status_byte(cmd->result) & CHECK_CONDITION) |
441 | /* | ||
442 | * XXX The scsi_print_sense formatting/prefix | ||
443 | * doesn't match this function. | ||
444 | */ | ||
445 | scsi_print_sense("", cmd); | 433 | scsi_print_sense("", cmd); |
446 | } | 434 | if (level > 3) |
447 | if (level > 3) { | 435 | scmd_printk(KERN_INFO, cmd, |
448 | printk(KERN_INFO "scsi host busy %d failed %d\n", | 436 | "scsi host busy %d failed %d\n", |
449 | sdev->host->host_busy, | 437 | cmd->device->host->host_busy, |
450 | sdev->host->host_failed); | 438 | cmd->device->host->host_failed); |
451 | } | ||
452 | } | 439 | } |
453 | } | 440 | } |
454 | } | 441 | } |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 9f7482d0b594..5f955707d902 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -968,9 +968,7 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) | |||
968 | } | 968 | } |
969 | if (result) { | 969 | if (result) { |
970 | if (!(req->cmd_flags & REQ_QUIET)) { | 970 | if (!(req->cmd_flags & REQ_QUIET)) { |
971 | scmd_printk(KERN_INFO, cmd, | 971 | scsi_print_result(cmd); |
972 | "SCSI error: return code = 0x%08x\n", | ||
973 | result); | ||
974 | if (driver_byte(result) & DRIVER_SENSE) | 972 | if (driver_byte(result) & DRIVER_SENSE) |
975 | scsi_print_sense("", cmd); | 973 | scsi_print_sense("", cmd); |
976 | } | 974 | } |
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 9dd37e2f5a84..c86e6ce143df 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/list.h> | 5 | #include <linux/list.h> |
6 | #include <linux/spinlock.h> | 6 | #include <linux/spinlock.h> |
7 | #include <linux/workqueue.h> | 7 | #include <linux/workqueue.h> |
8 | #include <linux/blkdev.h> | ||
8 | #include <asm/atomic.h> | 9 | #include <asm/atomic.h> |
9 | 10 | ||
10 | struct request_queue; | 11 | struct request_queue; |
@@ -154,8 +155,11 @@ struct scsi_device { | |||
154 | #define sdev_printk(prefix, sdev, fmt, a...) \ | 155 | #define sdev_printk(prefix, sdev, fmt, a...) \ |
155 | dev_printk(prefix, &(sdev)->sdev_gendev, fmt, ##a) | 156 | dev_printk(prefix, &(sdev)->sdev_gendev, fmt, ##a) |
156 | 157 | ||
157 | #define scmd_printk(prefix, scmd, fmt, a...) \ | 158 | #define scmd_printk(prefix, scmd, fmt, a...) \ |
158 | dev_printk(prefix, &(scmd)->device->sdev_gendev, fmt, ##a) | 159 | (scmd)->request->rq_disk ? \ |
160 | sdev_printk(prefix, (scmd)->device, "[%s] " fmt, \ | ||
161 | (scmd)->request->rq_disk->disk_name, ##a) : \ | ||
162 | sdev_printk(prefix, (scmd)->device, fmt, ##a) | ||
159 | 163 | ||
160 | enum scsi_target_state { | 164 | enum scsi_target_state { |
161 | STARGET_RUNNING = 1, | 165 | STARGET_RUNNING = 1, |