From: Pete Zaitcev Date: Sat, 19 Apr 2008 21:35:30 +0000 (-0700) Subject: ub: Tune retries X-Git-Tag: v2.6.26-rc1~11^2~24 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=82fe26ba7a21d9bcc77e6142c941683eede32940;p=linux-2.6-omap-h63xx.git ub: Tune retries Make ub to fail faster in hopeless cases. Signed-off-by: Pete Zaitcev Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/block/ub.c b/drivers/block/ub.c index b87ad77e5bb..5c6a6e89d2f 100644 --- a/drivers/block/ub.c +++ b/drivers/block/ub.c @@ -792,10 +792,6 @@ static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd) scsi_status = 0; } else { if (cmd->act_len != cmd->len) { - if ((cmd->key == MEDIUM_ERROR || - cmd->key == UNIT_ATTENTION) && - ub_rw_cmd_retry(sc, lun, urq, cmd) == 0) - return; scsi_status = SAM_STAT_CHECK_CONDITION; } else { scsi_status = 0; @@ -811,7 +807,10 @@ static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd) else scsi_status = DID_ERROR << 16; } else { - if (cmd->error == -EIO) { + if (cmd->error == -EIO && + (cmd->key == 0 || + cmd->key == MEDIUM_ERROR || + cmd->key == UNIT_ATTENTION)) { if (ub_rw_cmd_retry(sc, lun, urq, cmd) == 0) return; }