diff options
author | David S. Miller <davem@davemloft.net> | 2009-03-19 02:53:57 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-19 02:53:57 -0400 |
commit | 0702b30dd821ac8a4103ddbe545518713fdca9be (patch) | |
tree | 8ce0c9f5e58c5ccb99870505eecd139986caa05e /drivers/block/xsysace.c | |
parent | 192d7a4667c6d11d1a174ec4cad9a3c5d5f9043c (diff) | |
parent | a1e4ee22863d41a6fbb24310d7951836cb6dafe7 (diff) |
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Diffstat (limited to 'drivers/block/xsysace.c')
-rw-r--r-- | drivers/block/xsysace.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c index 381d686fc1a3..119be3442f28 100644 --- a/drivers/block/xsysace.c +++ b/drivers/block/xsysace.c | |||
@@ -489,6 +489,28 @@ static void ace_fsm_dostate(struct ace_device *ace) | |||
489 | ace->fsm_state, ace->id_req_count); | 489 | ace->fsm_state, ace->id_req_count); |
490 | #endif | 490 | #endif |
491 | 491 | ||
492 | /* Verify that there is actually a CF in the slot. If not, then | ||
493 | * bail out back to the idle state and wake up all the waiters */ | ||
494 | status = ace_in32(ace, ACE_STATUS); | ||
495 | if ((status & ACE_STATUS_CFDETECT) == 0) { | ||
496 | ace->fsm_state = ACE_FSM_STATE_IDLE; | ||
497 | ace->media_change = 1; | ||
498 | set_capacity(ace->gd, 0); | ||
499 | dev_info(ace->dev, "No CF in slot\n"); | ||
500 | |||
501 | /* Drop all pending requests */ | ||
502 | while ((req = elv_next_request(ace->queue)) != NULL) | ||
503 | end_request(req, 0); | ||
504 | |||
505 | /* Drop back to IDLE state and notify waiters */ | ||
506 | ace->fsm_state = ACE_FSM_STATE_IDLE; | ||
507 | ace->id_result = -EIO; | ||
508 | while (ace->id_req_count) { | ||
509 | complete(&ace->id_completion); | ||
510 | ace->id_req_count--; | ||
511 | } | ||
512 | } | ||
513 | |||
492 | switch (ace->fsm_state) { | 514 | switch (ace->fsm_state) { |
493 | case ACE_FSM_STATE_IDLE: | 515 | case ACE_FSM_STATE_IDLE: |
494 | /* See if there is anything to do */ | 516 | /* See if there is anything to do */ |