From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] mmci: fixup broken_blockend variant patch v2
Date: Tue, 18 Jan 2011 12:14:55 +0000 [thread overview]
Message-ID: <20110118121455.GB9719@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <4D346800.3070603@stericsson.com>
On Mon, Jan 17, 2011 at 05:02:08PM +0100, Linus Walleij wrote:
> Yes it is very different, see the log I sent in reply to Russells earlier
> mail. It's not just one blockend missing, sometimes it's two (on U300)
> and on Ux500 it's something like 5 out of 128 blockends that actually
> get fired, the rest are missing.
>
> Now the only variant actually using that interrupt is the original
> ARM version found in RealView & Versatile. I have run this code
> on the PB1176 but it wasn't missing any blockends. No errors.
>
> I tried to increase the clock speed to see if I could provoke the
> error in the RealView, but hit FIFO overflow (since these variants
> does not have hardware flow control) before I got to the speed
> where I presume the error could occur.
How reliable is the FIFOCNT register ?
What I'm wondering is whether we can get rid of the DATABLOCKEND
interrupts completely, and instead read the FIFOCNT register to
discover how many blocks have been successfully transferred. FIFOCNT
on read gives you the remaining number of words to be transferred into
the FIFO from the card, not the number of words still to be read by the
host CPU.
It's going to require some thought though, as I don't think you can use
the register to say X bytes, transferred, that means we got X bytes
successfully. If you have a data CRC error, you will have transferred
most, if not all of the block in error, so you'd need to wind back to
the start of the block. In theory, data CRC errors should cause the
card to stop transmission.
A data timeout (meaning a missing start condition) on the other hand
means the data block hasn't started to be transferred.
So, what I think's required (for read) is:
remain = readl(host->base + MMCIFIFOCNT) << 2;
success = data->blksz * data->blocks - remain;
if (status & MCI_DATACRCFAIL) {
/* round down to last block */
host->data_xfered = ((success / data->blksz) - 1) * data->blksz;
data->error = -EILSEQ;
} else if (status & MCI_DATATIMEOUT) {
host->data_xfered = success;
data->error = -ETIMEDOUT;
} else if (status & (MCI_TXUNDERRUN|MCI_RXOVERRUN)) {
host->data_xfered = success;
data->error = -EIO;
}
Not sure if that's valid for write atm.
next prev parent reply other threads:[~2011-01-18 12:14 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-17 14:37 [PATCH] mmci: fixup broken_blockend variant patch v2 Linus Walleij
2011-01-17 15:12 ` Rabin Vincent
2011-01-17 16:02 ` Linus Walleij
2011-01-18 12:14 ` Russell King - ARM Linux [this message]
2011-01-19 20:34 ` Linus Walleij
2011-01-19 20:51 ` Russell King - ARM Linux
2011-01-19 23:52 ` Linus Walleij
2011-01-21 12:53 ` Linus Walleij
2011-01-23 18:01 ` Russell King - ARM Linux
2011-01-23 21:40 ` Linus Walleij
2011-01-23 23:09 ` Russell King - ARM Linux
2011-01-24 8:18 ` Linus Walleij
2011-01-24 11:21 ` Russell King - ARM Linux
2011-01-24 14:29 ` Linus Walleij
2011-01-27 11:06 ` Russell King - ARM Linux
2011-01-27 14:16 ` Linus Walleij
2011-01-17 15:36 ` Rabin Vincent
2011-01-17 15:56 ` Linus Walleij
2011-01-17 16:56 ` Rabin Vincent
2011-01-18 15:01 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110118121455.GB9719@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).