aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/scsi_error.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index cb789c35262c..113c02dbb2df 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -768,6 +768,7 @@ static int scsi_eh_tur(struct scsi_cmnd *scmd)
768{ 768{
769 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};
770 int retry_cnt = 1, rtn; 770 int retry_cnt = 1, rtn;
771 int saved_result;
771 772
772retry_tur: 773retry_tur:
773 memcpy(scmd->cmnd, tur_command, sizeof(tur_command)); 774 memcpy(scmd->cmnd, tur_command, sizeof(tur_command));
@@ -778,6 +779,7 @@ retry_tur:
778 */ 779 */
779 memset(scmd->sense_buffer, 0, sizeof(scmd->sense_buffer)); 780 memset(scmd->sense_buffer, 0, sizeof(scmd->sense_buffer));
780 781
782 saved_result = scmd->result;
781 scmd->request_buffer = NULL; 783 scmd->request_buffer = NULL;
782 scmd->request_bufflen = 0; 784 scmd->request_bufflen = 0;
783 scmd->use_sg = 0; 785 scmd->use_sg = 0;
@@ -792,6 +794,7 @@ retry_tur:
792 * the original request, so let's restore the original data. (db) 794 * the original request, so let's restore the original data. (db)
793 */ 795 */
794 scsi_setup_cmd_retry(scmd); 796 scsi_setup_cmd_retry(scmd);
797 scmd->result = saved_result;
795 798
796 /* 799 /*
797 * hey, we are done. let's look to see what happened. 800 * hey, we are done. let's look to see what happened.
@@ -894,6 +897,7 @@ static int scsi_eh_try_stu(struct scsi_cmnd *scmd)
894{ 897{
895 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};
896 int rtn; 899 int rtn;
900 int saved_result;
897 901
898 if (!scmd->device->allow_restart) 902 if (!scmd->device->allow_restart)
899 return 1; 903 return 1;
@@ -906,6 +910,7 @@ static int scsi_eh_try_stu(struct scsi_cmnd *scmd)
906 */ 910 */
907 memset(scmd->sense_buffer, 0, sizeof(scmd->sense_buffer)); 911 memset(scmd->sense_buffer, 0, sizeof(scmd->sense_buffer));
908 912
913 saved_result = scmd->result;
909 scmd->request_buffer = NULL; 914 scmd->request_buffer = NULL;
910 scmd->request_bufflen = 0; 915 scmd->request_bufflen = 0;
911 scmd->use_sg = 0; 916 scmd->use_sg = 0;
@@ -920,6 +925,7 @@ static int scsi_eh_try_stu(struct scsi_cmnd *scmd)
920 * the original request, so let's restore the original data. (db) 925 * the original request, so let's restore the original data. (db)
921 */ 926 */
922 scsi_setup_cmd_retry(scmd); 927 scsi_setup_cmd_retry(scmd);
928 scmd->result = saved_result;
923 929
924 /* 930 /*
925 * hey, we are done. let's look to see what happened. 931 * hey, we are done. let's look to see what happened.
@@ -1559,6 +1565,11 @@ static void scsi_eh_flush_done_q(struct list_head *done_q)
1559 scmd)); 1565 scmd));
1560 scsi_queue_insert(scmd, SCSI_MLQUEUE_EH_RETRY); 1566 scsi_queue_insert(scmd, SCSI_MLQUEUE_EH_RETRY);
1561 } 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 */
1562 if (!scmd->result) 1573 if (!scmd->result)
1563 scmd->result |= (DRIVER_TIMEOUT << 24); 1574 scmd->result |= (DRIVER_TIMEOUT << 24);
1564 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: flush finish" 1575 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: flush finish"