Commit 843760c5 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'mmc-fixes-for-3.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc

Pull MMC fixes from Chris Ball:

 - omap_hsmmc: Using AUTO_CMD12 (enabled by default in 3.5-rc1) has
   been found to cause data corruption on the BeagleBoard, but no
   other OMAP boards so far.  Revert the patch until there's a root
   cause explanation that makes sense, at which point we might
   decide to use a blacklist or whitelist.

 - mmc_block: Fix incorrect data timeouts for the case of multiblock
   (ACMD22) writes for block-addressed cards.

* tag 'mmc-fixes-for-3.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc:
  Revert "mmc: omap_hsmmc: Enable Auto CMD12"
  mmc: block: fix the data timeout issue with ACMD22
parents e04fb020 fe852273
...@@ -554,7 +554,6 @@ static u32 mmc_sd_num_wr_blocks(struct mmc_card *card) ...@@ -554,7 +554,6 @@ static u32 mmc_sd_num_wr_blocks(struct mmc_card *card)
struct mmc_request mrq = {NULL}; struct mmc_request mrq = {NULL};
struct mmc_command cmd = {0}; struct mmc_command cmd = {0};
struct mmc_data data = {0}; struct mmc_data data = {0};
unsigned int timeout_us;
struct scatterlist sg; struct scatterlist sg;
...@@ -574,23 +573,12 @@ static u32 mmc_sd_num_wr_blocks(struct mmc_card *card) ...@@ -574,23 +573,12 @@ static u32 mmc_sd_num_wr_blocks(struct mmc_card *card)
cmd.arg = 0; cmd.arg = 0;
cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_ADTC; cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_ADTC;
data.timeout_ns = card->csd.tacc_ns * 100;
data.timeout_clks = card->csd.tacc_clks * 100;
timeout_us = data.timeout_ns / 1000;
timeout_us += data.timeout_clks * 1000 /
(card->host->ios.clock / 1000);
if (timeout_us > 100000) {
data.timeout_ns = 100000000;
data.timeout_clks = 0;
}
data.blksz = 4; data.blksz = 4;
data.blocks = 1; data.blocks = 1;
data.flags = MMC_DATA_READ; data.flags = MMC_DATA_READ;
data.sg = &sg; data.sg = &sg;
data.sg_len = 1; data.sg_len = 1;
mmc_set_data_timeout(&data, card);
mrq.cmd = &cmd; mrq.cmd = &cmd;
mrq.data = &data; mrq.data = &data;
......
...@@ -85,7 +85,6 @@ ...@@ -85,7 +85,6 @@
#define BRR_ENABLE (1 << 5) #define BRR_ENABLE (1 << 5)
#define DTO_ENABLE (1 << 20) #define DTO_ENABLE (1 << 20)
#define INIT_STREAM (1 << 1) #define INIT_STREAM (1 << 1)
#define ACEN_ACMD12 (1 << 2)
#define DP_SELECT (1 << 21) #define DP_SELECT (1 << 21)
#define DDIR (1 << 4) #define DDIR (1 << 4)
#define DMA_EN 0x1 #define DMA_EN 0x1
...@@ -117,7 +116,6 @@ ...@@ -117,7 +116,6 @@
#define OMAP_MMC_MAX_CLOCK 52000000 #define OMAP_MMC_MAX_CLOCK 52000000
#define DRIVER_NAME "omap_hsmmc" #define DRIVER_NAME "omap_hsmmc"
#define AUTO_CMD12 (1 << 0) /* Auto CMD12 support */
/* /*
* One controller can have multiple slots, like on some omap boards using * One controller can have multiple slots, like on some omap boards using
* omap.c controller driver. Luckily this is not currently done on any known * omap.c controller driver. Luckily this is not currently done on any known
...@@ -177,7 +175,6 @@ struct omap_hsmmc_host { ...@@ -177,7 +175,6 @@ struct omap_hsmmc_host {
int reqs_blocked; int reqs_blocked;
int use_reg; int use_reg;
int req_in_progress; int req_in_progress;
unsigned int flags;
struct omap_hsmmc_next next_data; struct omap_hsmmc_next next_data;
struct omap_mmc_platform_data *pdata; struct omap_mmc_platform_data *pdata;
...@@ -773,8 +770,6 @@ omap_hsmmc_start_command(struct omap_hsmmc_host *host, struct mmc_command *cmd, ...@@ -773,8 +770,6 @@ omap_hsmmc_start_command(struct omap_hsmmc_host *host, struct mmc_command *cmd,
cmdtype = 0x3; cmdtype = 0x3;
cmdreg = (cmd->opcode << 24) | (resptype << 16) | (cmdtype << 22); cmdreg = (cmd->opcode << 24) | (resptype << 16) | (cmdtype << 22);
if ((host->flags & AUTO_CMD12) && mmc_op_multi(cmd->opcode))
cmdreg |= ACEN_ACMD12;
if (data) { if (data) {
cmdreg |= DP_SELECT | MSBS | BCE; cmdreg |= DP_SELECT | MSBS | BCE;
...@@ -847,14 +842,11 @@ omap_hsmmc_xfer_done(struct omap_hsmmc_host *host, struct mmc_data *data) ...@@ -847,14 +842,11 @@ omap_hsmmc_xfer_done(struct omap_hsmmc_host *host, struct mmc_data *data)
else else
data->bytes_xfered = 0; data->bytes_xfered = 0;
if (data->stop && ((!(host->flags & AUTO_CMD12)) || data->error)) { if (!data->stop) {
omap_hsmmc_start_command(host, data->stop, NULL);
} else {
if (data->stop)
data->stop->resp[0] = OMAP_HSMMC_READ(host->base,
RSP76);
omap_hsmmc_request_done(host, data->mrq); omap_hsmmc_request_done(host, data->mrq);
return;
} }
omap_hsmmc_start_command(host, data->stop, NULL);
} }
/* /*
...@@ -1859,7 +1851,6 @@ static int __devinit omap_hsmmc_probe(struct platform_device *pdev) ...@@ -1859,7 +1851,6 @@ static int __devinit omap_hsmmc_probe(struct platform_device *pdev)
host->mapbase = res->start + pdata->reg_offset; host->mapbase = res->start + pdata->reg_offset;
host->base = ioremap(host->mapbase, SZ_4K); host->base = ioremap(host->mapbase, SZ_4K);
host->power_mode = MMC_POWER_OFF; host->power_mode = MMC_POWER_OFF;
host->flags = AUTO_CMD12;
host->next_data.cookie = 1; host->next_data.cookie = 1;
platform_set_drvdata(pdev, host); platform_set_drvdata(pdev, host);
......
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