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.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 2bf1ee2b47b6..113c02dbb2df 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -434,8 +434,7 @@ static void scsi_eh_times_out(struct scsi_cmnd *scmd)
434 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: scmd:%p\n", __FUNCTION__, 434 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: scmd:%p\n", __FUNCTION__,
435 scmd)); 435 scmd));
436 436
437 if (scmd->device->host->eh_action) 437 up(scmd->device->host->eh_action);
438 up(scmd->device->host->eh_action);
439} 438}
440 439
441/** 440/**
@@ -457,8 +456,7 @@ static void scsi_eh_done(struct scsi_cmnd *scmd)
457 SCSI_LOG_ERROR_RECOVERY(3, printk("%s scmd: %p result: %x\n", 456 SCSI_LOG_ERROR_RECOVERY(3, printk("%s scmd: %p result: %x\n",
458 __FUNCTION__, scmd, scmd->result)); 457 __FUNCTION__, scmd, scmd->result));
459 458
460 if (scmd->device->host->eh_action) 459 up(scmd->device->host->eh_action);
461 up(scmd->device->host->eh_action);
462 } 460 }
463} 461}
464 462
@@ -770,6 +768,7 @@ static int scsi_eh_tur(struct scsi_cmnd *scmd)
770{ 768{
771 static unsigned char tur_command[6] = {TEST_UNIT_READY, 0, 0, 0, 0, 0}; 769 static unsigned char tur_command[6] = {TEST_UNIT_READY, 0, 0, 0, 0, 0};
772 int retry_cnt = 1, rtn; 770 int retry_cnt = 1, rtn;
771 int saved_result;
773 772
774retry_tur: 773retry_tur:
775 memcpy(scmd->cmnd, tur_command, sizeof(tur_command)); 774 memcpy(scmd->cmnd, tur_command, sizeof(tur_command));
@@ -780,6 +779,7 @@ retry_tur:
780 */ 779 */
781 memset(scmd->sense_buffer, 0, sizeof(scmd->sense_buffer)); 780 memset(scmd->sense_buffer, 0, sizeof(scmd->sense_buffer));
782 781
782 saved_result = scmd->result;
783 scmd->request_buffer = NULL; 783 scmd->request_buffer = NULL;
784 scmd->request_bufflen = 0; 784 scmd->request_bufflen = 0;
785 scmd->use_sg = 0; 785 scmd->use_sg = 0;
@@ -794,6 +794,7 @@ retry_tur:
794 * the original request, so let's restore the original data. (db) 794 * the original request, so let's restore the original data. (db)
795 */ 795 */
796 scsi_setup_cmd_retry(scmd); 796 scsi_setup_cmd_retry(scmd);
797 scmd->result = saved_result;
797 798
798 /* 799 /*
799 * hey, we are done. let's look to see what happened. 800 * hey, we are done. let's look to see what happened.
@@ -896,6 +897,7 @@ static int scsi_eh_try_stu(struct scsi_cmnd *scmd)
896{ 897{
897 static unsigned char stu_command[6] = {START_STOP, 0, 0, 0, 1, 0}; 898 static unsigned char stu_command[6] = {START_STOP, 0, 0, 0, 1, 0};
898 int rtn; 899 int rtn;
900 int saved_result;
899 901
900 if (!scmd->device->allow_restart) 902 if (!scmd->device->allow_restart)
901 return 1; 903 return 1;
@@ -908,6 +910,7 @@ static int scsi_eh_try_stu(struct scsi_cmnd *scmd)
908 */ 910 */
909 memset(scmd->sense_buffer, 0, sizeof(scmd->sense_buffer)); 911 memset(scmd->sense_buffer, 0, sizeof(scmd->sense_buffer));
910 912
913 saved_result = scmd->result;
911 scmd->request_buffer = NULL; 914 scmd->request_buffer = NULL;
912 scmd->request_bufflen = 0; 915 scmd->request_bufflen = 0;
913 scmd->use_sg = 0; 916 scmd->use_sg = 0;
@@ -922,6 +925,7 @@ static int scsi_eh_try_stu(struct scsi_cmnd *scmd)
922 * the original request, so let's restore the original data. (db) 925 * the original request, so let's restore the original data. (db)
923 */ 926 */
924 scsi_setup_cmd_retry(scmd); 927 scsi_setup_cmd_retry(scmd);
928 scmd->result = saved_result;
925 929
926 /* 930 /*
927 * hey, we are done. let's look to see what happened. 931 * hey, we are done. let's look to see what happened.
@@ -1561,6 +1565,11 @@ static void scsi_eh_flush_done_q(struct list_head *done_q)
1561 scmd)); 1565 scmd));
1562 scsi_queue_insert(scmd, SCSI_MLQUEUE_EH_RETRY); 1566 scsi_queue_insert(scmd, SCSI_MLQUEUE_EH_RETRY);
1563 } else { 1567 } else {
1568 /*
1569 * If just we got sense for the device (called
1570 * scsi_eh_get_sense), scmd->result is already
1571 * set, do not set DRIVER_TIMEOUT.
1572 */
1564 if (!scmd->result) 1573 if (!scmd->result)
1565 scmd->result |= (DRIVER_TIMEOUT << 24); 1574 scmd->result |= (DRIVER_TIMEOUT << 24);
1566 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: flush finish" 1575 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: flush finish"
@@ -1870,7 +1879,6 @@ scsi_reset_provider(struct scsi_device *dev, int flag)
1870 rtn = FAILED; 1879 rtn = FAILED;
1871 } 1880 }
1872 1881
1873 scsi_delete_timer(scmd);
1874 scsi_next_command(scmd); 1882 scsi_next_command(scmd);
1875 return rtn; 1883 return rtn;
1876} 1884}