aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/xsysace.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/xsysace.c')
-rw-r--r--drivers/block/xsysace.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index 97c99b43f88..edf137b6c37 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -466,7 +466,8 @@ struct request *ace_get_next_request(struct request_queue * q)
466 while ((req = elv_next_request(q)) != NULL) { 466 while ((req = elv_next_request(q)) != NULL) {
467 if (blk_fs_request(req)) 467 if (blk_fs_request(req))
468 break; 468 break;
469 __blk_end_request_cur(req, -EIO); 469 blkdev_dequeue_request(req);
470 __blk_end_request_all(req, -EIO);
470 } 471 }
471 return req; 472 return req;
472} 473}
@@ -492,9 +493,15 @@ static void ace_fsm_dostate(struct ace_device *ace)
492 set_capacity(ace->gd, 0); 493 set_capacity(ace->gd, 0);
493 dev_info(ace->dev, "No CF in slot\n"); 494 dev_info(ace->dev, "No CF in slot\n");
494 495
495 /* Drop all pending requests */ 496 /* Drop all in-flight and pending requests */
496 while ((req = elv_next_request(ace->queue)) != NULL) 497 if (ace->req) {
497 __blk_end_request_cur(req, -EIO); 498 __blk_end_request_all(ace->req, -EIO);
499 ace->req = NULL;
500 }
501 while ((req = elv_next_request(ace->queue)) != NULL) {
502 blkdev_dequeue_request(req);
503 __blk_end_request_all(req, -EIO);
504 }
498 505
499 /* Drop back to IDLE state and notify waiters */ 506 /* Drop back to IDLE state and notify waiters */
500 ace->fsm_state = ACE_FSM_STATE_IDLE; 507 ace->fsm_state = ACE_FSM_STATE_IDLE;
@@ -642,6 +649,7 @@ static void ace_fsm_dostate(struct ace_device *ace)
642 ace->fsm_state = ACE_FSM_STATE_IDLE; 649 ace->fsm_state = ACE_FSM_STATE_IDLE;
643 break; 650 break;
644 } 651 }
652 blkdev_dequeue_request(req);
645 653
646 /* Okay, it's a data request, set it up for transfer */ 654 /* Okay, it's a data request, set it up for transfer */
647 dev_dbg(ace->dev, 655 dev_dbg(ace->dev,
@@ -718,8 +726,7 @@ static void ace_fsm_dostate(struct ace_device *ace)
718 } 726 }
719 727
720 /* bio finished; is there another one? */ 728 /* bio finished; is there another one? */
721 if (__blk_end_request(ace->req, 0, 729 if (__blk_end_request_cur(ace->req, 0)) {
722 blk_rq_cur_bytes(ace->req))) {
723 /* dev_dbg(ace->dev, "next block; h=%u c=%u\n", 730 /* dev_dbg(ace->dev, "next block; h=%u c=%u\n",
724 * blk_rq_sectors(ace->req), 731 * blk_rq_sectors(ace->req),
725 * blk_rq_cur_sectors(ace->req)); 732 * blk_rq_cur_sectors(ace->req));