summaryrefslogtreecommitdiffstats
path: root/drivers/block/cciss.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/cciss.c')
-rw-r--r--drivers/block/cciss.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 8e1a4554951c..cd375503f7b0 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1864,8 +1864,7 @@ static void cciss_softirq_done(struct request *rq)
1864 /* set the residual count for pc requests */ 1864 /* set the residual count for pc requests */
1865 if (blk_rq_is_passthrough(rq)) 1865 if (blk_rq_is_passthrough(rq))
1866 scsi_req(rq)->resid_len = c->err_info->ResidualCnt; 1866 scsi_req(rq)->resid_len = c->err_info->ResidualCnt;
1867 1867 blk_end_request_all(rq, scsi_req(rq)->result ? -EIO : 0);
1868 blk_end_request_all(rq, (rq->errors == 0) ? 0 : -EIO);
1869 1868
1870 spin_lock_irqsave(&h->lock, flags); 1869 spin_lock_irqsave(&h->lock, flags);
1871 cmd_free(h, c); 1870 cmd_free(h, c);
@@ -3140,18 +3139,19 @@ static inline void complete_command(ctlr_info_t *h, CommandList_struct *cmd,
3140{ 3139{
3141 int retry_cmd = 0; 3140 int retry_cmd = 0;
3142 struct request *rq = cmd->rq; 3141 struct request *rq = cmd->rq;
3142 struct scsi_request *sreq = scsi_req(rq);
3143 3143
3144 rq->errors = 0; 3144 sreq->result = 0;
3145 3145
3146 if (timeout) 3146 if (timeout)
3147 rq->errors = make_status_bytes(0, 0, 0, DRIVER_TIMEOUT); 3147 sreq->result = make_status_bytes(0, 0, 0, DRIVER_TIMEOUT);
3148 3148
3149 if (cmd->err_info->CommandStatus == 0) /* no error has occurred */ 3149 if (cmd->err_info->CommandStatus == 0) /* no error has occurred */
3150 goto after_error_processing; 3150 goto after_error_processing;
3151 3151
3152 switch (cmd->err_info->CommandStatus) { 3152 switch (cmd->err_info->CommandStatus) {
3153 case CMD_TARGET_STATUS: 3153 case CMD_TARGET_STATUS:
3154 rq->errors = evaluate_target_status(h, cmd, &retry_cmd); 3154 sreq->result = evaluate_target_status(h, cmd, &retry_cmd);
3155 break; 3155 break;
3156 case CMD_DATA_UNDERRUN: 3156 case CMD_DATA_UNDERRUN:
3157 if (!blk_rq_is_passthrough(cmd->rq)) { 3157 if (!blk_rq_is_passthrough(cmd->rq)) {
@@ -3169,7 +3169,7 @@ static inline void complete_command(ctlr_info_t *h, CommandList_struct *cmd,
3169 case CMD_INVALID: 3169 case CMD_INVALID:
3170 dev_warn(&h->pdev->dev, "cciss: cmd %p is " 3170 dev_warn(&h->pdev->dev, "cciss: cmd %p is "
3171 "reported invalid\n", cmd); 3171 "reported invalid\n", cmd);
3172 rq->errors = make_status_bytes(SAM_STAT_GOOD, 3172 sreq->result = make_status_bytes(SAM_STAT_GOOD,
3173 cmd->err_info->CommandStatus, DRIVER_OK, 3173 cmd->err_info->CommandStatus, DRIVER_OK,
3174 blk_rq_is_passthrough(cmd->rq) ? 3174 blk_rq_is_passthrough(cmd->rq) ?
3175 DID_PASSTHROUGH : DID_ERROR); 3175 DID_PASSTHROUGH : DID_ERROR);
@@ -3177,7 +3177,7 @@ static inline void complete_command(ctlr_info_t *h, CommandList_struct *cmd,
3177 case CMD_PROTOCOL_ERR: 3177 case CMD_PROTOCOL_ERR:
3178 dev_warn(&h->pdev->dev, "cciss: cmd %p has " 3178 dev_warn(&h->pdev->dev, "cciss: cmd %p has "
3179 "protocol error\n", cmd); 3179 "protocol error\n", cmd);
3180 rq->errors = make_status_bytes(SAM_STAT_GOOD, 3180 sreq->result = make_status_bytes(SAM_STAT_GOOD,
3181 cmd->err_info->CommandStatus, DRIVER_OK, 3181 cmd->err_info->CommandStatus, DRIVER_OK,
3182 blk_rq_is_passthrough(cmd->rq) ? 3182 blk_rq_is_passthrough(cmd->rq) ?
3183 DID_PASSTHROUGH : DID_ERROR); 3183 DID_PASSTHROUGH : DID_ERROR);
@@ -3185,7 +3185,7 @@ static inline void complete_command(ctlr_info_t *h, CommandList_struct *cmd,
3185 case CMD_HARDWARE_ERR: 3185 case CMD_HARDWARE_ERR:
3186 dev_warn(&h->pdev->dev, "cciss: cmd %p had " 3186 dev_warn(&h->pdev->dev, "cciss: cmd %p had "
3187 " hardware error\n", cmd); 3187 " hardware error\n", cmd);
3188 rq->errors = make_status_bytes(SAM_STAT_GOOD, 3188 sreq->result = make_status_bytes(SAM_STAT_GOOD,
3189 cmd->err_info->CommandStatus, DRIVER_OK, 3189 cmd->err_info->CommandStatus, DRIVER_OK,
3190 blk_rq_is_passthrough(cmd->rq) ? 3190 blk_rq_is_passthrough(cmd->rq) ?
3191 DID_PASSTHROUGH : DID_ERROR); 3191 DID_PASSTHROUGH : DID_ERROR);
@@ -3193,7 +3193,7 @@ static inline void complete_command(ctlr_info_t *h, CommandList_struct *cmd,
3193 case CMD_CONNECTION_LOST: 3193 case CMD_CONNECTION_LOST:
3194 dev_warn(&h->pdev->dev, "cciss: cmd %p had " 3194 dev_warn(&h->pdev->dev, "cciss: cmd %p had "
3195 "connection lost\n", cmd); 3195 "connection lost\n", cmd);
3196 rq->errors = make_status_bytes(SAM_STAT_GOOD, 3196 sreq->result = make_status_bytes(SAM_STAT_GOOD,
3197 cmd->err_info->CommandStatus, DRIVER_OK, 3197 cmd->err_info->CommandStatus, DRIVER_OK,
3198 blk_rq_is_passthrough(cmd->rq) ? 3198 blk_rq_is_passthrough(cmd->rq) ?
3199 DID_PASSTHROUGH : DID_ERROR); 3199 DID_PASSTHROUGH : DID_ERROR);
@@ -3201,7 +3201,7 @@ static inline void complete_command(ctlr_info_t *h, CommandList_struct *cmd,
3201 case CMD_ABORTED: 3201 case CMD_ABORTED:
3202 dev_warn(&h->pdev->dev, "cciss: cmd %p was " 3202 dev_warn(&h->pdev->dev, "cciss: cmd %p was "
3203 "aborted\n", cmd); 3203 "aborted\n", cmd);
3204 rq->errors = make_status_bytes(SAM_STAT_GOOD, 3204 sreq->result = make_status_bytes(SAM_STAT_GOOD,
3205 cmd->err_info->CommandStatus, DRIVER_OK, 3205 cmd->err_info->CommandStatus, DRIVER_OK,
3206 blk_rq_is_passthrough(cmd->rq) ? 3206 blk_rq_is_passthrough(cmd->rq) ?
3207 DID_PASSTHROUGH : DID_ABORT); 3207 DID_PASSTHROUGH : DID_ABORT);
@@ -3209,7 +3209,7 @@ static inline void complete_command(ctlr_info_t *h, CommandList_struct *cmd,
3209 case CMD_ABORT_FAILED: 3209 case CMD_ABORT_FAILED:
3210 dev_warn(&h->pdev->dev, "cciss: cmd %p reports " 3210 dev_warn(&h->pdev->dev, "cciss: cmd %p reports "
3211 "abort failed\n", cmd); 3211 "abort failed\n", cmd);
3212 rq->errors = make_status_bytes(SAM_STAT_GOOD, 3212 sreq->result = make_status_bytes(SAM_STAT_GOOD,
3213 cmd->err_info->CommandStatus, DRIVER_OK, 3213 cmd->err_info->CommandStatus, DRIVER_OK,
3214 blk_rq_is_passthrough(cmd->rq) ? 3214 blk_rq_is_passthrough(cmd->rq) ?
3215 DID_PASSTHROUGH : DID_ERROR); 3215 DID_PASSTHROUGH : DID_ERROR);
@@ -3224,21 +3224,21 @@ static inline void complete_command(ctlr_info_t *h, CommandList_struct *cmd,
3224 } else 3224 } else
3225 dev_warn(&h->pdev->dev, 3225 dev_warn(&h->pdev->dev,
3226 "%p retried too many times\n", cmd); 3226 "%p retried too many times\n", cmd);
3227 rq->errors = make_status_bytes(SAM_STAT_GOOD, 3227 sreq->result = make_status_bytes(SAM_STAT_GOOD,
3228 cmd->err_info->CommandStatus, DRIVER_OK, 3228 cmd->err_info->CommandStatus, DRIVER_OK,
3229 blk_rq_is_passthrough(cmd->rq) ? 3229 blk_rq_is_passthrough(cmd->rq) ?
3230 DID_PASSTHROUGH : DID_ABORT); 3230 DID_PASSTHROUGH : DID_ABORT);
3231 break; 3231 break;
3232 case CMD_TIMEOUT: 3232 case CMD_TIMEOUT:
3233 dev_warn(&h->pdev->dev, "cmd %p timedout\n", cmd); 3233 dev_warn(&h->pdev->dev, "cmd %p timedout\n", cmd);
3234 rq->errors = make_status_bytes(SAM_STAT_GOOD, 3234 sreq->result = make_status_bytes(SAM_STAT_GOOD,
3235 cmd->err_info->CommandStatus, DRIVER_OK, 3235 cmd->err_info->CommandStatus, DRIVER_OK,
3236 blk_rq_is_passthrough(cmd->rq) ? 3236 blk_rq_is_passthrough(cmd->rq) ?
3237 DID_PASSTHROUGH : DID_ERROR); 3237 DID_PASSTHROUGH : DID_ERROR);
3238 break; 3238 break;
3239 case CMD_UNABORTABLE: 3239 case CMD_UNABORTABLE:
3240 dev_warn(&h->pdev->dev, "cmd %p unabortable\n", cmd); 3240 dev_warn(&h->pdev->dev, "cmd %p unabortable\n", cmd);
3241 rq->errors = make_status_bytes(SAM_STAT_GOOD, 3241 sreq->result = make_status_bytes(SAM_STAT_GOOD,
3242 cmd->err_info->CommandStatus, DRIVER_OK, 3242 cmd->err_info->CommandStatus, DRIVER_OK,
3243 blk_rq_is_passthrough(cmd->rq) ? 3243 blk_rq_is_passthrough(cmd->rq) ?
3244 DID_PASSTHROUGH : DID_ERROR); 3244 DID_PASSTHROUGH : DID_ERROR);
@@ -3247,7 +3247,7 @@ static inline void complete_command(ctlr_info_t *h, CommandList_struct *cmd,
3247 dev_warn(&h->pdev->dev, "cmd %p returned " 3247 dev_warn(&h->pdev->dev, "cmd %p returned "
3248 "unknown status %x\n", cmd, 3248 "unknown status %x\n", cmd,
3249 cmd->err_info->CommandStatus); 3249 cmd->err_info->CommandStatus);
3250 rq->errors = make_status_bytes(SAM_STAT_GOOD, 3250 sreq->result = make_status_bytes(SAM_STAT_GOOD,
3251 cmd->err_info->CommandStatus, DRIVER_OK, 3251 cmd->err_info->CommandStatus, DRIVER_OK,
3252 blk_rq_is_passthrough(cmd->rq) ? 3252 blk_rq_is_passthrough(cmd->rq) ?
3253 DID_PASSTHROUGH : DID_ERROR); 3253 DID_PASSTHROUGH : DID_ERROR);
@@ -3380,9 +3380,9 @@ static void do_cciss_request(struct request_queue *q)
3380 if (dma_mapping_error(&h->pdev->dev, temp64.val)) { 3380 if (dma_mapping_error(&h->pdev->dev, temp64.val)) {
3381 dev_warn(&h->pdev->dev, 3381 dev_warn(&h->pdev->dev,
3382 "%s: error mapping page for DMA\n", __func__); 3382 "%s: error mapping page for DMA\n", __func__);
3383 creq->errors = make_status_bytes(SAM_STAT_GOOD, 3383 scsi_req(creq)->result =
3384 0, DRIVER_OK, 3384 make_status_bytes(SAM_STAT_GOOD, 0, DRIVER_OK,
3385 DID_SOFT_ERROR); 3385 DID_SOFT_ERROR);
3386 cmd_free(h, c); 3386 cmd_free(h, c);
3387 return; 3387 return;
3388 } 3388 }
@@ -3395,9 +3395,9 @@ static void do_cciss_request(struct request_queue *q)
3395 if (cciss_map_sg_chain_block(h, c, h->cmd_sg_list[c->cmdindex], 3395 if (cciss_map_sg_chain_block(h, c, h->cmd_sg_list[c->cmdindex],
3396 (seg - (h->max_cmd_sgentries - 1)) * 3396 (seg - (h->max_cmd_sgentries - 1)) *
3397 sizeof(SGDescriptor_struct))) { 3397 sizeof(SGDescriptor_struct))) {
3398 creq->errors = make_status_bytes(SAM_STAT_GOOD, 3398 scsi_req(creq)->result =
3399 0, DRIVER_OK, 3399 make_status_bytes(SAM_STAT_GOOD, 0, DRIVER_OK,
3400 DID_SOFT_ERROR); 3400 DID_SOFT_ERROR);
3401 cmd_free(h, c); 3401 cmd_free(h, c);
3402 return; 3402 return;
3403 } 3403 }