ipq806x: Send STOP_TRANSMISSION command after DATA_TIMEOUT error

The Device will accept the requested number of data blocks, terminate
the transaction and return to transfer state. Stop command is not
required at the end of this type of multiple blocks write unless
terminated with an error.  This change will send the
STOP_TRANIMISSION command if the command failed.

Change-Id: I9bd419ab8931d80a4a2eeba9f5bd42222257a824
Signed-off-by: Vinoth Gnanasekaran <vgnana@codeaurora.org>
This commit is contained in:
Vinoth Gnanasekaran 2018-11-07 16:50:43 +05:30
parent cfccc0b8a7
commit cd6a575b7d

View file

@ -184,6 +184,7 @@ static ulong mmc_write_blocks(struct mmc *mmc, lbaint_t start,
struct mmc_cmd cmd;
struct mmc_data data;
int timeout = 1000;
int ret = blkcnt;
if ((start + blkcnt) > mmc->block_dev.lba) {
printf("MMC: block number 0x" LBAF " exceeds max(0x" LBAF ")\n",
@ -212,7 +213,7 @@ static ulong mmc_write_blocks(struct mmc *mmc, lbaint_t start,
if (mmc_send_cmd(mmc, &cmd, &data)) {
printf("mmc write failed\n");
return 0;
ret = 0;
}
/* SPI multiblock writes terminate using a special
@ -232,7 +233,7 @@ static ulong mmc_write_blocks(struct mmc *mmc, lbaint_t start,
if (mmc_send_status(mmc, timeout))
return 0;
return blkcnt;
return ret;
}
ulong mmc_bwrite(int dev_num, lbaint_t start, lbaint_t blkcnt, const void *src)