Commit 8e86fbab authored by Russell King's avatar Russell King

[MMC] MMCI: data FSM handling updates

- Use mmci_stop_host() to ensure that the data FSM is shut down and
  any driver held data is properly released.
- FIFO size is 64 bytes not 16.
parent a0309bbd
......@@ -43,10 +43,9 @@ static void
mmci_request_end(struct mmci_host *host, struct mmc_request *mrq)
{
writel(0, host->base + MMCICOMMAND);
host->mrq = NULL;
host->cmd = NULL;
host->data = NULL;
host->buffer = NULL;
if (mrq->data)
mrq->data->bytes_xfered = host->data_xfered;
......@@ -60,6 +59,13 @@ mmci_request_end(struct mmci_host *host, struct mmc_request *mrq)
spin_lock(&host->lock);
}
static void mmci_stop_data(struct mmci_host *host)
{
writel(0, host->base + MMCIDATACTRL);
host->data = NULL;
host->buffer = NULL;
}
static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
{
unsigned int datactrl, timeout, irqmask;
......@@ -147,7 +153,8 @@ mmci_data_irq(struct mmci_host *host, struct mmc_data *data,
status |= MCI_DATAEND;
}
if (status & MCI_DATAEND) {
host->data = NULL;
mmci_stop_data(host);
if (!data->stop) {
mmci_request_end(host, data->mrq);
} else {
......
......@@ -109,7 +109,10 @@
MCI_CMDRESPENDMASK|MCI_CMDSENTMASK|MCI_DATAENDMASK| \
MCI_DATABLOCKENDMASK)
#define MCI_FIFOSIZE 16
/*
* The size of the FIFO in bytes.
*/
#define MCI_FIFOSIZE (16*4)
#define MCI_FIFOHALFSIZE (MCI_FIFOSIZE / 2)
......@@ -139,5 +142,3 @@ struct mmci_host {
void *buffer;
unsigned int size;
};
#define to_mmci_host(mmc) container_of(mmc, struct mmci_host, mmc)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment