* [PATCH] mci: mmci: Fix status flags check
@ 2015-08-07 8:39 Alexander Shiyan
2015-08-19 14:47 ` Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Shiyan @ 2015-08-07 8:39 UTC (permalink / raw)
To: barebox
Data transfer procedures should check _DATA_ flags instead of _CMD_.
---
drivers/mci/mmci.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/mci/mmci.c b/drivers/mci/mmci.c
index 608cac1..9d1e858 100644
--- a/drivers/mci/mmci.c
+++ b/drivers/mci/mmci.c
@@ -269,18 +269,18 @@ static int read_bytes(struct mci_host *mci, char *dest, unsigned int blkcount, u
xfercount -= len;
dest += len;
status = mmci_readl(host, MMCISTATUS);
- status_err = status & (MCI_CMDCRCFAIL | MCI_DATATIMEOUT |
- MCI_RXOVERRUN);
+ status_err = status & (MCI_DATACRCFAIL | MCI_DATATIMEOUT |
+ MCI_RXOVERRUN);
} while(xfercount && !status_err);
status_err = status &
- (MCI_CMDCRCFAIL | MCI_DATATIMEOUT | MCI_DATABLOCKEND |
+ (MCI_DATACRCFAIL | MCI_DATATIMEOUT | MCI_DATABLOCKEND |
MCI_RXOVERRUN);
while (!status_err) {
status = mmci_readl(host, MMCISTATUS);
status_err = status &
- (MCI_CMDCRCFAIL | MCI_DATATIMEOUT | MCI_DATABLOCKEND |
+ (MCI_DATACRCFAIL | MCI_DATATIMEOUT | MCI_DATABLOCKEND |
MCI_RXOVERRUN);
}
@@ -288,7 +288,7 @@ static int read_bytes(struct mci_host *mci, char *dest, unsigned int blkcount, u
dev_err(host->hw_dev, "Read data timed out, xfercount: %u, status: 0x%08X\n",
xfercount, status);
return -ETIMEDOUT;
- } else if (status & MCI_CMDCRCFAIL) {
+ } else if (status & MCI_DATACRCFAIL) {
dev_err(host->hw_dev, "Read data bytes CRC error: 0x%x\n", status);
return -EILSEQ;
} else if (status & MCI_RXOVERRUN) {
@@ -351,7 +351,7 @@ static int write_bytes(struct mci_host *mci, char *dest, unsigned int blkcount,
dev_dbg(host->hw_dev, "write_bytes: blkcount=%u blksize=%u\n", blkcount, blksize);
status = mmci_readl(host, MMCISTATUS);
- status_err = status & (MCI_CMDCRCFAIL | MCI_DATATIMEOUT);
+ status_err = status & (MCI_DATACRCFAIL | MCI_DATATIMEOUT);
do {
len = mmci_pio_write(host, dest, xfercount, status);
@@ -359,11 +359,11 @@ static int write_bytes(struct mci_host *mci, char *dest, unsigned int blkcount,
dest += len;
status = mmci_readl(host, MMCISTATUS);
- status_err = status & (MCI_CMDCRCFAIL | MCI_DATATIMEOUT);
+ status_err = status & (MCI_DATACRCFAIL | MCI_DATATIMEOUT);
} while (!status_err && xfercount);
status_err = status &
- (MCI_CMDCRCFAIL | MCI_DATATIMEOUT | MCI_DATABLOCKEND);
+ (MCI_DATACRCFAIL | MCI_DATATIMEOUT | MCI_DATABLOCKEND);
while (!status_err) {
status = mmci_readl(host, MMCISTATUS);
status_err = status &
@@ -374,7 +374,7 @@ static int write_bytes(struct mci_host *mci, char *dest, unsigned int blkcount,
dev_err(host->hw_dev, "Write data timed out, xfercount:%u,status:0x%08X\n",
xfercount, status);
return -ETIMEDOUT;
- } else if (status & MCI_CMDCRCFAIL) {
+ } else if (status & MCI_DATACRCFAIL) {
dev_err(host->hw_dev, "Write data CRC error\n");
return -EILSEQ;
}
--
2.3.6
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] mci: mmci: Fix status flags check
2015-08-07 8:39 [PATCH] mci: mmci: Fix status flags check Alexander Shiyan
@ 2015-08-19 14:47 ` Sascha Hauer
0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2015-08-19 14:47 UTC (permalink / raw)
To: Alexander Shiyan; +Cc: barebox
On Fri, Aug 07, 2015 at 11:39:55AM +0300, Alexander Shiyan wrote:
> Data transfer procedures should check _DATA_ flags instead of _CMD_.
> ---
> drivers/mci/mmci.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
Applied, thanks
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-08-19 14:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-07 8:39 [PATCH] mci: mmci: Fix status flags check Alexander Shiyan
2015-08-19 14:47 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox