summaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-03-18 13:16:30 +1100
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-03-18 13:16:30 +1100
commitc71327ad9f925a4ddbf24db80ce66165104c4ed0 (patch)
treea1560ddfb827d580843d2a32ba19fb0fc85490d8 /drivers/block
parentf507cd22035fdadd5dbb476dd05e9e7ee21c3b84 (diff)
parenta4bd6a93c3f14691c8a29e53eb04dc734b27f0db (diff)
Merge commit 'gcl/merge' into merge
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/xsysace.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index 381d686fc1a..119be3442f2 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -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 */