[MIPS] Change libgcc-style functions from lib-y to obj-y
[linux-drm-fsl-dcu.git] / drivers / scsi / scsi_error.c
index 7a1a1bb1341e76f2e267f260a8cd0d47677e3131..e8350c562d24c0a4598d7a4c0e4066c1b4911d35 100644 (file)
@@ -38,7 +38,6 @@
 #include "scsi_logging.h"
 
 #define SENSE_TIMEOUT          (10*HZ)
-#define START_UNIT_TIMEOUT     (30*HZ)
 
 /*
  * These should *probably* be handled by the host itself.
@@ -725,7 +724,7 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd,
         */
        if (copy_sense) {
                if (!SCSI_SENSE_VALID(scmd)) {
-                       memcpy(scmd->sense_buffer, scmd->request_buffer,
+                       memcpy(scmd->sense_buffer, page_address(sgl.page),
                               sizeof(scmd->sense_buffer));
                }
                __free_page(sgl.page);
@@ -932,10 +931,12 @@ static int scsi_eh_try_stu(struct scsi_cmnd *scmd)
        static unsigned char stu_command[6] = {START_STOP, 0, 0, 0, 1, 0};
 
        if (scmd->device->allow_restart) {
-               int rtn;
+               int i, rtn = NEEDS_RETRY;
+
+               for (i = 0; rtn == NEEDS_RETRY && i < 2; i++)
+                       rtn = scsi_send_eh_cmnd(scmd, stu_command, 6,
+                                               scmd->device->timeout, 0);
 
-               rtn = scsi_send_eh_cmnd(scmd, stu_command, 6,
-                                       START_UNIT_TIMEOUT, 0);
                if (rtn == SUCCESS)
                        return 0;
        }