* Waiting while MMC busy
@ 2009-01-08 14:11 Adrian Hunter
0 siblings, 0 replies; only message in thread
From: Adrian Hunter @ 2009-01-08 14:11 UTC (permalink / raw)
To: Madhusudhan Chikkature, Syed Mohammed Khasim, Mohit Jalori
Cc: Lavinen Jarkko (Nokia-M/Helsinki), linux-omap Mailing List
Hi
At present, the omap_hsmmc driver completes a write request while
the card is still busy. The mmc_block driver caters for this by
waiting while the card is busy, but it does so by repeated requesting
the card status until the state is not "programming" and the
READ_FOR_DATA bit is set. e.g. the code from the block driver
driver/mmc/card/block.c:
static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
{
...
if (!mmc_host_is_spi(card->host) && rq_data_dir(req) != READ) {
do {
int err;
cmd.opcode = MMC_SEND_STATUS;
cmd.arg = card->rca << 16;
cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
err = mmc_wait_for_cmd(card->host, &cmd, 5);
if (err) {
printk(KERN_ERR "%s: error %d requesting status\n",
req->rq_disk->disk_name, err);
goto cmd_err;
}
/*
* Some cards mishandle the status bits,
* so make sure to check both the busy
* indication and the card state.
*/
} while (!(cmd.resp[0] & R1_READY_FOR_DATA) ||
(R1_CURRENT_STATE(cmd.resp[0]) == 7));
We would much prefer to use an interrupt but we cannot see any suitable
interrupt bit in the OMAP HSMMC. When we look at MMCHS_PSTATE we see
that DLA, DATI and CMDI are zero even while dat0 is low (as seen from
DLEV bit 20).
We are considering using pad configuration to switch dat0 to gpio while
waiting because dat0 is held low when the card is busy and returns high
when it is ready. Then we can use a gpio interrupt.
Does anyone have any other ideas?
Regards
Adrian Hunter
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-01-08 14:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-08 14:11 Waiting while MMC busy Adrian Hunter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox