[PATCH] mmci: calculate remaining bytes at error correctly

Linus Walleij linus.walleij at linaro.org
Mon Jan 31 05:31:11 EST 2011

2011/1/31 Russell King - ARM Linux <linux at arm.linux.org.uk>:
>> > -       if (status & MCI_DATAEND) {
>> > +       if (status & MCI_DATAEND || data->error) {
>> >                mmci_stop_data(host);
>> The hardware always sets the MCI_DATAEND bit if there is
>> some error, so these flags always appear simultaneously, but
>> it doesn't hurt to take some extra precaution, so
> The hardware may do, but you won't see that here.  When we setup a
> transfer, we do this:
>        writel(readl(base + MMCIMASK0) & ~MCI_DATAENDMASK, base + MMCIMASK0);

Ah! I get it.

We've actually played around with that, having MCI_DATAEND on all the
time, it's not necessary any more since we're not using the blockend IRQ
and they cannot race, so we can take a little bit of quirking out of it.
But I'll get back on that issue.

Linus Walleij

More information about the linux-arm-kernel mailing list