On Mon, Jan 2, 2012 at 6:19 PM, Pavel Řezníček<cigydd@xxxxxxxxx> wrote:
OK, the SD-card may really be broken, that's right. I have to go for one and buy it (or via an e-shop) as soon as I have the time. Or, I may test this old one for bad blocks.
Check your dmesg on N900, if you see some errors like this:
[33713.501464] mmcblk1: error -110 sending read/write command,
response 0x900, card status 0xe00
[33713.501495] mmcblk1: error -110 transferring data, sector 27271168,
nr 8, card status 0xc00
[33713.570129] end_request: I/O error, dev mmcblk1, sector 27271169
[33713.570159] Buffer I/O error on device mmcblk1p4, logical block 0
[33713.570159] lost page write due to I/O error on mmcblk1p4
[33754.895355] mmcblk1: error -110 transferring data, sector 30941184,
nr 16, card status 0xc00
[33754.895690] end_request: I/O error, dev mmcblk1, sector 30941185
[33754.895721] Buffer I/O error on device mmcblk1p4, logical block 458752
[33754.895751] lost page write due to I/O error on mmcblk1p4
[33754.895812] end_request: I/O error, dev mmcblk1, sector 30941192
[33754.895843] Buffer I/O error on device mmcblk1p4, logical block 458753
[33754.895843] lost page write due to I/O error on mmcblk1p4
[33755.504272] mmcblk1: error -110 transferring data, sector 31203328,
nr 16, card status 0xc00
means your card is incompatible with N900's MMC driver and you are
most likely suffering data corruption. In my experience, class 6 and
higher do not work properly in N900. Notice that other phones built on
similar hardware have the same problem.
But, good news, I made a fix to allow these cards to function without
corruption. To apply this fix in your own kernel sources, edit
drivers/mmc/host/omap_hsmmc.c replace the set_data_timeout function
with this one:
static void set_data_timeout(struct omap_hsmmc_host *host,
unsigned int timeout_ns,
unsigned int timeout_clks)
{
uint32_t reg;
reg = OMAP_HSMMC_READ(host->base, SYSCTL);
reg&= ~DTO_MASK;
reg |= DTO<< DTO_SHIFT;
OMAP_HSMMC_WRITE(host->base, SYSCTL, reg);
}
The fix was included in latest power kernel 49, and in fact they
included my fix in CyanogenMod since they have some Android phones
based on same hardware as N900 such as Motorola Milestone, and they
suffer the same SD card incompatibilities as N900. :)
If you use the stock Nokia kernel and don't want to compile your own,
let me know and I can provide a prebuilt module that you can replace
on your phone. (at your own risk... if you do it wrong, you will
probably create infinite reboot loop and have to flash. You have been
warned! It works for me.)
However, most of these fast cards have terrible small read/write I/O
performance. They are great if you want to use it in a camera for
saving single large file or video recording, but bad a computer
filesystem.
Sandisk is the king of fast small I/O. My class 2 sandisk 16GB card is
about 10 times faster than class 10 A-Data card for small I/O. And of
course the Sandisk work with no errors or corruption on unmodified
N900, which is important. Plus, since Sandisk has a lower class
rating, they are actually cheaper. :) I recently bought 32GB Sandisk
class 4 for $30 USD from Amazon. Some of class 10 cards are $100.
My personal collection of good and bad microSD cards on N900:
Good (works on unmodded N900):
Nokia 1GB that came with N900
Sandisk 16GB class 2
Sandisk 32GB class 4
Bad (corruption on unmodded N900):
Transcend 8GB class 6
A-Data 16GB class 10
A-Data 32GB class 6
Lexar 32GB class 10
Also be careful that many fake Sandisk and Kingston cards out there. I
only buy mine from Amazon, sold by Amazon. Too many from other sellers
and ebay, chinese sites, etc. are counterfeit. Lots of reports of
"this card works" in talk.maemo.org and other forums, but just because
the card is recognized and you can use it doesn't mean it works
properly or is good performance... many people suffer random
corruption or SD card goes read-only one day and they don't know this
is the cause.
Hope that helps!
Paul