mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2025-12-10 07:44:53 +01:00
ipq806x: qca_mmc: capture the errors during write to fifo
This patch checks for the errors during the fifo write itself like in qca_pio_read function. Previously, error was checked only after the total xfer_size is written to the fifo and errors during the fifo write operation were ignored. Change-Id: I2a549b0032bfd774973773cc49b595c75682aac7 Signed-off-by: Balaji Prakash Jagadeesan <bjagadee@codeaurora.org>
This commit is contained in:
parent
19060d2532
commit
bd6ce22a08
1 changed files with 6 additions and 1 deletions
|
|
@ -152,6 +152,9 @@ qca_pio_write(qca_mmc *host, const char *buffer,
|
|||
do {
|
||||
status = readl(host->base + MMCISTATUS);
|
||||
|
||||
if (status & error)
|
||||
break;
|
||||
|
||||
bcnt = remain - count;
|
||||
|
||||
if (!bcnt)
|
||||
|
|
@ -175,6 +178,7 @@ qca_pio_write(qca_mmc *host, const char *buffer,
|
|||
status = readl(host->base + MMCISTATUS);
|
||||
|
||||
if (status & error) {
|
||||
printf("Error: %s, status=0x%x\n", __func__, status);
|
||||
count = status;
|
||||
break;
|
||||
}
|
||||
|
|
@ -210,7 +214,8 @@ qca_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
|
|||
if (data->flags & MMC_DATA_READ) {
|
||||
qca_pio_read(host, data->dest, xfer_size);
|
||||
} else {
|
||||
qca_pio_write(host, data->src, xfer_size);
|
||||
if (qca_pio_write(host, data->src, xfer_size) != xfer_size)
|
||||
status = -1;
|
||||
}
|
||||
writel(0, host->base + MMCIDATACTRL);
|
||||
qca_reg_wr_delay(host);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue