linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
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: Wed, 19 Jan 2011 20:51:58 +0000	[thread overview]
Message-ID: <20110119205158.GC6335@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <AANLkTineFJhqMcJbg1YQbPymT537Ef=jVgXLC5uw7DOt@mail.gmail.com>

On Wed, Jan 19, 2011 at 09:34:49PM +0100, Linus Walleij wrote:
> 2011/1/18 Russell King - ARM Linux <linux@arm.linux.org.uk>:
> 
> > 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.
> 
> Hmm... the FIFOCNT is just the FIFO.

No, FIFOCNT.

 The MCIFifoCnt register contains the remaining number of words to be
 written to or read from the FIFO. The FIFO counter loads the value from
 the data length register (see Data length register, MCIDataLength on page
 3-11) when the Enable bit is set in the data control register. If the data
 length is not word aligned (multiple of 4), the remaining 1 to 3 bytes are
 regarded as a word. Table 3-19 shows the bit assignment of the MCIFifoCnt
 register.

static int mmci_pio_read(struct mmci_host *host, char *buffer, unsigned int remain)
{
        do {
                int count = host_remain - (readl(base + MMCIFIFOCNT) << 2);

                if (count > remain)
                        count = remain;

                if (count <= 0)
                        break;

                readsl(base + MMCIFIFO, ptr, count >> 2);

We use FIFOCNT to work out how many bytes are needing to be transferred
from the FIFO on PIO reads.

  reply	other threads:[~2011-01-19 20:51 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
2011-01-19 20:34       ` Linus Walleij
2011-01-19 20:51         ` Russell King - ARM Linux [this message]
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=20110119205158.GC6335@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).