aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_error.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/scsi_error.c')
-rw-r--r--drivers/scsi/scsi_error.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 006a95916f72..880051c89bde 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -139,7 +139,7 @@ void scsi_add_timer(struct scsi_cmnd *scmd, int timeout,
139 scmd->eh_timeout.function = (void (*)(unsigned long)) complete; 139 scmd->eh_timeout.function = (void (*)(unsigned long)) complete;
140 140
141 SCSI_LOG_ERROR_RECOVERY(5, printk("%s: scmd: %p, time:" 141 SCSI_LOG_ERROR_RECOVERY(5, printk("%s: scmd: %p, time:"
142 " %d, (%p)\n", __FUNCTION__, 142 " %d, (%p)\n", __func__,
143 scmd, timeout, complete)); 143 scmd, timeout, complete));
144 144
145 add_timer(&scmd->eh_timeout); 145 add_timer(&scmd->eh_timeout);
@@ -163,7 +163,7 @@ int scsi_delete_timer(struct scsi_cmnd *scmd)
163 rtn = del_timer(&scmd->eh_timeout); 163 rtn = del_timer(&scmd->eh_timeout);
164 164
165 SCSI_LOG_ERROR_RECOVERY(5, printk("%s: scmd: %p," 165 SCSI_LOG_ERROR_RECOVERY(5, printk("%s: scmd: %p,"
166 " rtn: %d\n", __FUNCTION__, 166 " rtn: %d\n", __func__,
167 scmd, rtn)); 167 scmd, rtn));
168 168
169 scmd->eh_timeout.data = (unsigned long)NULL; 169 scmd->eh_timeout.data = (unsigned long)NULL;
@@ -233,7 +233,7 @@ int scsi_block_when_processing_errors(struct scsi_device *sdev)
233 233
234 online = scsi_device_online(sdev); 234 online = scsi_device_online(sdev);
235 235
236 SCSI_LOG_ERROR_RECOVERY(5, printk("%s: rtn: %d\n", __FUNCTION__, 236 SCSI_LOG_ERROR_RECOVERY(5, printk("%s: rtn: %d\n", __func__,
237 online)); 237 online));
238 238
239 return online; 239 return online;
@@ -271,7 +271,7 @@ static inline void scsi_eh_prt_fail_stats(struct Scsi_Host *shost,
271 SCSI_LOG_ERROR_RECOVERY(3, 271 SCSI_LOG_ERROR_RECOVERY(3,
272 sdev_printk(KERN_INFO, sdev, 272 sdev_printk(KERN_INFO, sdev,
273 "%s: cmds failed: %d, cancel: %d\n", 273 "%s: cmds failed: %d, cancel: %d\n",
274 __FUNCTION__, cmd_failed, 274 __func__, cmd_failed,
275 cmd_cancel)); 275 cmd_cancel));
276 cmd_cancel = 0; 276 cmd_cancel = 0;
277 cmd_failed = 0; 277 cmd_failed = 0;
@@ -344,6 +344,9 @@ static int scsi_check_sense(struct scsi_cmnd *scmd)
344 return /* soft_error */ SUCCESS; 344 return /* soft_error */ SUCCESS;
345 345
346 case ABORTED_COMMAND: 346 case ABORTED_COMMAND:
347 if (sshdr.asc == 0x10) /* DIF */
348 return SUCCESS;
349
347 return NEEDS_RETRY; 350 return NEEDS_RETRY;
348 case NOT_READY: 351 case NOT_READY:
349 case UNIT_ATTENTION: 352 case UNIT_ATTENTION:
@@ -470,7 +473,7 @@ static void scsi_eh_done(struct scsi_cmnd *scmd)
470 473
471 SCSI_LOG_ERROR_RECOVERY(3, 474 SCSI_LOG_ERROR_RECOVERY(3,
472 printk("%s scmd: %p result: %x\n", 475 printk("%s scmd: %p result: %x\n",
473 __FUNCTION__, scmd, scmd->result)); 476 __func__, scmd, scmd->result));
474 477
475 eh_action = scmd->device->host->eh_action; 478 eh_action = scmd->device->host->eh_action;
476 if (eh_action) 479 if (eh_action)
@@ -487,7 +490,7 @@ static int scsi_try_host_reset(struct scsi_cmnd *scmd)
487 int rtn; 490 int rtn;
488 491
489 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: Snd Host RST\n", 492 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: Snd Host RST\n",
490 __FUNCTION__)); 493 __func__));
491 494
492 if (!scmd->device->host->hostt->eh_host_reset_handler) 495 if (!scmd->device->host->hostt->eh_host_reset_handler)
493 return FAILED; 496 return FAILED;
@@ -516,7 +519,7 @@ static int scsi_try_bus_reset(struct scsi_cmnd *scmd)
516 int rtn; 519 int rtn;
517 520
518 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: Snd Bus RST\n", 521 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: Snd Bus RST\n",
519 __FUNCTION__)); 522 __func__));
520 523
521 if (!scmd->device->host->hostt->eh_bus_reset_handler) 524 if (!scmd->device->host->hostt->eh_bus_reset_handler)
522 return FAILED; 525 return FAILED;
@@ -664,7 +667,10 @@ void scsi_eh_prep_cmnd(struct scsi_cmnd *scmd, struct scsi_eh_save *ses,
664 ses->sdb = scmd->sdb; 667 ses->sdb = scmd->sdb;
665 ses->next_rq = scmd->request->next_rq; 668 ses->next_rq = scmd->request->next_rq;
666 ses->result = scmd->result; 669 ses->result = scmd->result;
670 ses->underflow = scmd->underflow;
671 ses->prot_op = scmd->prot_op;
667 672
673 scmd->prot_op = SCSI_PROT_NORMAL;
668 scmd->cmnd = ses->eh_cmnd; 674 scmd->cmnd = ses->eh_cmnd;
669 memset(scmd->cmnd, 0, BLK_MAX_CDB); 675 memset(scmd->cmnd, 0, BLK_MAX_CDB);
670 memset(&scmd->sdb, 0, sizeof(scmd->sdb)); 676 memset(&scmd->sdb, 0, sizeof(scmd->sdb));
@@ -722,6 +728,8 @@ void scsi_eh_restore_cmnd(struct scsi_cmnd* scmd, struct scsi_eh_save *ses)
722 scmd->sdb = ses->sdb; 728 scmd->sdb = ses->sdb;
723 scmd->request->next_rq = ses->next_rq; 729 scmd->request->next_rq = ses->next_rq;
724 scmd->result = ses->result; 730 scmd->result = ses->result;
731 scmd->underflow = ses->underflow;
732 scmd->prot_op = ses->prot_op;
725} 733}
726EXPORT_SYMBOL(scsi_eh_restore_cmnd); 734EXPORT_SYMBOL(scsi_eh_restore_cmnd);
727 735
@@ -766,7 +774,7 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd,
766 774
767 SCSI_LOG_ERROR_RECOVERY(3, 775 SCSI_LOG_ERROR_RECOVERY(3,
768 printk("%s: scmd: %p, timeleft: %ld\n", 776 printk("%s: scmd: %p, timeleft: %ld\n",
769 __FUNCTION__, scmd, timeleft)); 777 __func__, scmd, timeleft));
770 778
771 /* 779 /*
772 * If there is time left scsi_eh_done got called, and we will 780 * If there is time left scsi_eh_done got called, and we will
@@ -778,7 +786,7 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd,
778 rtn = scsi_eh_completed_normally(scmd); 786 rtn = scsi_eh_completed_normally(scmd);
779 SCSI_LOG_ERROR_RECOVERY(3, 787 SCSI_LOG_ERROR_RECOVERY(3,
780 printk("%s: scsi_eh_completed_normally %x\n", 788 printk("%s: scsi_eh_completed_normally %x\n",
781 __FUNCTION__, rtn)); 789 __func__, rtn));
782 790
783 switch (rtn) { 791 switch (rtn) {
784 case SUCCESS: 792 case SUCCESS:
@@ -913,7 +921,7 @@ retry_tur:
913 rtn = scsi_send_eh_cmnd(scmd, tur_command, 6, SENSE_TIMEOUT, 0); 921 rtn = scsi_send_eh_cmnd(scmd, tur_command, 6, SENSE_TIMEOUT, 0);
914 922
915 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: scmd %p rtn %x\n", 923 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: scmd %p rtn %x\n",
916 __FUNCTION__, scmd, rtn)); 924 __func__, scmd, rtn));
917 925
918 switch (rtn) { 926 switch (rtn) {
919 case NEEDS_RETRY: 927 case NEEDS_RETRY:
@@ -1296,7 +1304,7 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd)
1296 if (!scsi_device_online(scmd->device)) { 1304 if (!scsi_device_online(scmd->device)) {
1297 SCSI_LOG_ERROR_RECOVERY(5, printk("%s: device offline - report" 1305 SCSI_LOG_ERROR_RECOVERY(5, printk("%s: device offline - report"
1298 " as SUCCESS\n", 1306 " as SUCCESS\n",
1299 __FUNCTION__)); 1307 __func__));
1300 return SUCCESS; 1308 return SUCCESS;
1301 } 1309 }
1302 1310
@@ -1511,7 +1519,7 @@ static void scsi_restart_operations(struct Scsi_Host *shost)
1511 * ioctls to queued block devices. 1519 * ioctls to queued block devices.
1512 */ 1520 */
1513 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: waking up host to restart\n", 1521 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: waking up host to restart\n",
1514 __FUNCTION__)); 1522 __func__));
1515 1523
1516 spin_lock_irqsave(shost->host_lock, flags); 1524 spin_lock_irqsave(shost->host_lock, flags);
1517 if (scsi_host_set_state(shost, SHOST_RUNNING)) 1525 if (scsi_host_set_state(shost, SHOST_RUNNING))
@@ -1835,7 +1843,7 @@ scsi_reset_provider(struct scsi_device *dev, int flag)
1835 */ 1843 */
1836 SCSI_LOG_ERROR_RECOVERY(3, 1844 SCSI_LOG_ERROR_RECOVERY(3,
1837 printk("%s: waking up host to restart after TMF\n", 1845 printk("%s: waking up host to restart after TMF\n",
1838 __FUNCTION__)); 1846 __func__));
1839 1847
1840 wake_up(&shost->host_wait); 1848 wake_up(&shost->host_wait);
1841 1849