diff options
author | Matteo Croce <rootkit85@yahoo.it> | 2008-06-26 13:02:02 +0000 |
---|---|---|
committer | Matteo Croce <rootkit85@yahoo.it> | 2008-06-26 13:02:02 +0000 |
commit | ac303986689be802a5438390624b96235d93714d (patch) | |
tree | f1aeb772994da02f8801bb8d3ad257a140ec5107 /target | |
parent | 4d6ec29824bda9b706d409ba214139f8e9ba9d07 (diff) | |
download | mtk-20170518-ac303986689be802a5438390624b96235d93714d.zip mtk-20170518-ac303986689be802a5438390624b96235d93714d.tar.gz mtk-20170518-ac303986689be802a5438390624b96235d93714d.tar.bz2 |
avr32: fix a bug in the MMC driver
SVN-Revision: 11580
Diffstat (limited to 'target')
-rw-r--r-- | target/linux/avr32/patches/120-fast_sd_cards_fix.patch | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/target/linux/avr32/patches/120-fast_sd_cards_fix.patch b/target/linux/avr32/patches/120-fast_sd_cards_fix.patch new file mode 100644 index 0000000..2d79b9d --- /dev/null +++ b/target/linux/avr32/patches/120-fast_sd_cards_fix.patch @@ -0,0 +1,43 @@ +--- a/drivers/mmc/host/atmel-mci.c ++++ b/drivers/mmc/host/atmel-mci.c +@@ -77,6 +77,7 @@ struct atmel_mci { + struct clk *mck; + struct platform_device *pdev; + ++ int pending_stop; + #ifdef CONFIG_DEBUG_FS + struct dentry *debugfs_root; + struct dentry *debugfs_regs; +@@ -866,6 +867,12 @@ static void atmci_tasklet_func(unsigned long priv) + data->bytes_xfered = data->blocks * data->blksz; + atmci_data_complete(host, data); + } ++ /* See if there is a pending STOP which can be sent */ ++ if (host->pending_stop && mci_cmd_is_complete(host)) { ++ host->pending_stop = 0; ++ if (mrq->stop && !mci_set_stop_sent_is_completed(host)) ++ send_stop_cmd(host->mmc, mrq->data, 0); ++ } + } + + static void atmci_cmd_interrupt(struct mmc_host *mmc, u32 status) +@@ -918,9 +925,16 @@ static void atmci_xfer_complete(struct dma_request *_req) + * drivers) or when interrupts are disabled for a long time. + */ + mci_set_dma_complete(host); +- if (data->stop && mci_cmd_is_complete(host) +- && !mci_set_stop_sent_is_completed(host)) +- send_stop_cmd(host->mmc, data, 0); ++ ++ if (data->stop) { ++ if (!mci_cmd_is_complete(host)) { ++ /* Just remember a STOP must be sent */ ++ host->pending_stop = 1; ++ } else if (!mci_set_stop_sent_is_completed(host)) { ++ send_stop_cmd(host->mmc, data, 0); ++ host->pending_stop = 0; ++ } ++ } + + /* + * Regardless of what the documentation says, we have to wait |