aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/constants.c14
-rw-r--r--drivers/scsi/scsi_lib.c10
2 files changed, 19 insertions, 5 deletions
diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c
index 7bdeed1c5a56..024553f9c247 100644
--- a/drivers/scsi/constants.c
+++ b/drivers/scsi/constants.c
@@ -1235,6 +1235,20 @@ scsi_print_sense_hdr(const char *name, struct scsi_sense_hdr *sshdr)
1235} 1235}
1236EXPORT_SYMBOL(scsi_print_sense_hdr); 1236EXPORT_SYMBOL(scsi_print_sense_hdr);
1237 1237
1238/*
1239 * Print normalized SCSI sense header with device information and a prefix.
1240 */
1241void
1242scsi_cmd_print_sense_hdr(struct scsi_cmnd *scmd, const char *desc,
1243 struct scsi_sense_hdr *sshdr)
1244{
1245 scmd_printk(KERN_INFO, scmd, "%s: ", desc);
1246 scsi_show_sense_hdr(sshdr);
1247 scmd_printk(KERN_INFO, scmd, "%s: ", desc);
1248 scsi_show_extd_sense(sshdr->asc, sshdr->ascq);
1249}
1250EXPORT_SYMBOL(scsi_cmd_print_sense_hdr);
1251
1238static void 1252static void
1239scsi_decode_sense_buffer(const unsigned char *sense_buffer, int sense_len, 1253scsi_decode_sense_buffer(const unsigned char *sense_buffer, int sense_len,
1240 struct scsi_sense_hdr *sshdr) 1254 struct scsi_sense_hdr *sshdr)
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 94d82cb96626..86fd3abe731a 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -944,11 +944,11 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
944 break; 944 break;
945 } 945 }
946 } 946 }
947 if (!(req->cmd_flags & REQ_QUIET)) { 947 if (!(req->cmd_flags & REQ_QUIET))
948 scmd_printk(KERN_INFO, cmd, 948 scsi_cmd_print_sense_hdr(cmd,
949 "Device not ready: "); 949 "Device not ready",
950 scsi_print_sense_hdr("", &sshdr); 950 &sshdr);
951 } 951
952 scsi_end_request(cmd, 0, this_count, 1); 952 scsi_end_request(cmd, 0, this_count, 1);
953 return; 953 return;
954 case VOLUME_OVERFLOW: 954 case VOLUME_OVERFLOW: