Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 132350
b: refs/heads/master
c: bfbd442
h: refs/heads/master
v: v3
  • Loading branch information
Grant Likely authored and Jens Axboe committed Mar 14, 2009
1 parent d06c314 commit 8f3a2cc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 059ea3318c8ede71851a52b4359fbf1ab0cec301
refs/heads/master: bfbd442f69ec9c58590ffc6e93ac8d6809caa48b
22 changes: 22 additions & 0 deletions trunk/drivers/block/xsysace.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,28 @@ static void ace_fsm_dostate(struct ace_device *ace)
ace->fsm_state, ace->id_req_count);
#endif

/* Verify that there is actually a CF in the slot. If not, then
* bail out back to the idle state and wake up all the waiters */
status = ace_in32(ace, ACE_STATUS);
if ((status & ACE_STATUS_CFDETECT) == 0) {
ace->fsm_state = ACE_FSM_STATE_IDLE;
ace->media_change = 1;
set_capacity(ace->gd, 0);
dev_info(ace->dev, "No CF in slot\n");

/* Drop all pending requests */
while ((req = elv_next_request(ace->queue)) != NULL)
end_request(req, 0);

/* Drop back to IDLE state and notify waiters */
ace->fsm_state = ACE_FSM_STATE_IDLE;
ace->id_result = -EIO;
while (ace->id_req_count) {
complete(&ace->id_completion);
ace->id_req_count--;
}
}

switch (ace->fsm_state) {
case ACE_FSM_STATE_IDLE:
/* See if there is anything to do */
Expand Down

0 comments on commit 8f3a2cc

Please sign in to comment.