Merge branch 'for_paulus' of master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc
[pandora-kernel.git] / drivers / scsi / scsi_error.c
index 9cf0206..1c75646 100644 (file)
@@ -581,8 +581,7 @@ static int scsi_request_sense(struct scsi_cmnd *scmd)
  *    keep a list of pending commands for final completion, and once we
  *    are ready to leave error handling we handle completion for real.
  **/
-static void scsi_eh_finish_cmd(struct scsi_cmnd *scmd,
-                              struct list_head *done_q)
+void scsi_eh_finish_cmd(struct scsi_cmnd *scmd, struct list_head *done_q)
 {
        scmd->device->host->host_failed--;
        scmd->eh_eflags = 0;
@@ -594,6 +593,7 @@ static void scsi_eh_finish_cmd(struct scsi_cmnd *scmd,
        scsi_setup_cmd_retry(scmd);
        list_move_tail(&scmd->eh_entry, done_q);
 }
+EXPORT_SYMBOL(scsi_eh_finish_cmd);
 
 /**
  * scsi_eh_get_sense - Get device sense data.
@@ -1305,7 +1305,7 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd)
         * the request was not marked fast fail.  Note that above,
         * even if the request is marked fast fail, we still requeue
         * for queue congestion conditions (QUEUE_FULL or BUSY) */
-       if ((++scmd->retries) < scmd->allowed 
+       if ((++scmd->retries) <= scmd->allowed
            && !blk_noretry_request(scmd->request)) {
                return NEEDS_RETRY;
        } else {
@@ -1422,7 +1422,7 @@ static void scsi_eh_ready_devs(struct Scsi_Host *shost,
  * @done_q:    list_head of processed commands.
  *
  **/
-static void scsi_eh_flush_done_q(struct list_head *done_q)
+void scsi_eh_flush_done_q(struct list_head *done_q)
 {
        struct scsi_cmnd *scmd, *next;
 
@@ -1430,7 +1430,7 @@ static void scsi_eh_flush_done_q(struct list_head *done_q)
                list_del_init(&scmd->eh_entry);
                if (scsi_device_online(scmd->device) &&
                    !blk_noretry_request(scmd->request) &&
-                   (++scmd->retries < scmd->allowed)) {
+                   (++scmd->retries <= scmd->allowed)) {
                        SCSI_LOG_ERROR_RECOVERY(3, printk("%s: flush"
                                                          " retry cmd: %p\n",
                                                          current->comm,
@@ -1451,6 +1451,7 @@ static void scsi_eh_flush_done_q(struct list_head *done_q)
                }
        }
 }
+EXPORT_SYMBOL(scsi_eh_flush_done_q);
 
 /**
  * scsi_unjam_host - Attempt to fix a host which has a cmd that failed.
@@ -1536,8 +1537,8 @@ int scsi_error_handler(void *data)
                 * what we need to do to get it up and online again (if we can).
                 * If we fail, we end up taking the thing offline.
                 */
-               if (shost->hostt->eh_strategy_handler) 
-                       shost->hostt->eh_strategy_handler(shost);
+               if (shost->transportt->eh_strategy_handler)
+                       shost->transportt->eh_strategy_handler(shost);
                else
                        scsi_unjam_host(shost);