logo       

Re: PXA27x SD/MMC card CRC errors - only sometimes: msg#00026

handhelds.linux.kernel

Subject: Re: PXA27x SD/MMC card CRC errors - only sometimes

Richard Purdie wrote:
On Sat, 2005-12-17 at 13:12 -0700, Matthew Mastracci wrote:

I tried clocking it down below 19.5MHz (to avoid the PXA27x errata that indicates that some cards might be a problem at that speed), but that didn't seem to have any effect.

I have no answer but there are other people seeing issues. There was
mention of this on linus-arm-kernel:

http://lists.arm.linux.org.uk/pipermail/linux-arm-kernel/2005-December/032798.html

In the followup, I suggested trying lowering the clock speed which
helped but didn't cure the problem.

It looks like there are some bugs somewhere, perhaps in the timeout
handling of the pxa driver although there may be more than one issue
here.

It turns out that this 2GB SD card has a block_size of 10 bits (1024) and some part of the block read function is incorrectly setting one of the registers.

When I hardcoded the device's blocksize to 9 bits, everything started working as expected (though this is obviously not the correct fix):

static void mmc_decode_csd(struct mmc_card *card)
...
+ csd->capacity <<= (csd->read_blkbits - 9);
+ csd->read_blkbits = 9;

I think the problem is basically that mmc_block seems tailored towards 512-byte sector cards, even though it seems to use csd->read_blkbits in a number of places.

Should the mmc layer just always use a 512 byte sector? This would certainly solve this problem.

Matt.


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise