[TEST] New Raspberry Pi SD card driver

Hi,

We would like testers for a new SD card driver for Raspberry Pi. This new driver fixes some compatibility issues with particular cards and can offer some modest speed improvements. In order for this driver to become the default, we would like to establish a larger testing base to confirm that it does not cause any regressions.

To grab the new driver, SSH in to your Raspberry Pi and run the following command:

wget http://paste.osmc.io/raw/avutetufuf -O- | sudo sh

Your system will reboot automatically and load the new SD card driver.

Thanks to Phil Elwell at Raspberry Pi for his work on this driver and Dom (for his usual help).

Please try the driver and let us know how it works out. If you do have any issues, please let us know:

  • The SD card you are using
  • The model of Raspberry Pi you are using
  • What the last actions you performed before you encountered a problem were
  • If obtainable, dmesg output. You can automatically upload this to the OSMC Pastebin with the following command:

dmesg | paste-log

The new driver features the ability to set overclocks (discussed further in this thread). Please ensure you backup before overclocking. @popcornmix has some comments:

Thanks in advance,

Sam

2 Likes

Iā€™ll try in my OSMC installation.

already, i have tested this sd driver overlay in my RASPBIAN installation, and it works ok. Before that, i had corruption issues in my Samsung Evo (8GB SDHC Class 10 - MB-MP08DA/EU) and this overlay solved it. I havent noticed any performance advantage.

do you need any particular test? or do I ā€œworkā€ normally with OSMC?

1 Like

I will try this out too.

(I originally ignored this post because I thought ā€œ[TEST]ā€ meant it was a test post, not a request for testers. Probably just me not being familiar with the forum conventions, but just thought Iā€™d mention in case this is new and a more clear label could be used.)

I just did the install. System crashed in a few minutes. Unresponsive, TV screen black.
I did a power cycle, OSMC came on. I quickly sshā€™d in and watched dmesg.

Hmm, bad stuff!!!:

Is there any way to go to the old kernel? My RPI2 wonā€™t stay up more then a few minutes.
Memory card is a Lexar 32GB microsd HC Class 10.

Here is the last dmesg output before crash:

[  104.494448] mmc0: Unexpected interrupt 0x00000080.
[  104.494469] sdhost-bcm2835: =========== REGISTER DUMP (mmc0)===========
[  104.494476] sdhost-bcm2835: SDCMD  0x0000080c
[  104.494482] sdhost-bcm2835: SDARG  0x00000000
[  104.494488] sdhost-bcm2835: SDTOUT 0x00f00000
[  104.494494] sdhost-bcm2835: SDCDIV 0x00000008
[  104.494500] sdhost-bcm2835: SDRSP0 0x00000c00
[  104.494506] sdhost-bcm2835: SDRSP1 0x00000c0e
[  104.494513] sdhost-bcm2835: SDRSP2 0x7fffffff
[  104.494519] sdhost-bcm2835: SDRSP3 0x0002400c
[  104.494525] sdhost-bcm2835: SDHSTS 0x00000000
[  104.494531] sdhost-bcm2835: SDVDD  0x00000001
[  104.494537] sdhost-bcm2835: SDEDM  0x00010801
[  104.494543] sdhost-bcm2835: SDHCFG 0x0000040e
[  104.494549] sdhost-bcm2835: SDHBCT 0x00000006
[  104.494555] sdhost-bcm2835: SDHBLC 0x00000030
[  104.514790] mmcblk0: error -84 sending stop command, original cmd response 0x900, card status 0x900
[  114.540747] mmc0: Timeout waiting for hardware interrupt.
[  114.540770] sdhost-bcm2835: =========== REGISTER DUMP (mmc0)===========
[  114.540778] sdhost-bcm2835: SDCMD  0x00000099
[  114.540784] sdhost-bcm2835: SDARG  0x01cbaeb0
[  114.540791] sdhost-bcm2835: SDTOUT 0x00f00000
[  114.540797] sdhost-bcm2835: SDCDIV 0x00000008
[  114.540803] sdhost-bcm2835: SDRSP0 0x00000900
[  114.540810] sdhost-bcm2835: SDRSP1 0x00001918
[  114.540816] sdhost-bcm2835: SDRSP2 0xffffffff
[  114.540822] sdhost-bcm2835: SDRSP3 0x0002400f
[  114.540828] sdhost-bcm2835: SDHSTS 0x00000000
[  114.540834] sdhost-bcm2835: SDVDD  0x00000001
[  114.540840] sdhost-bcm2835: SDEDM  0x00010800
[  114.540846] sdhost-bcm2835: SDHCFG 0x0000040e
[  114.540852] sdhost-bcm2835: SDHBCT 0x00000200
[  114.540858] sdhost-bcm2835: SDHBLC 0x00000008
[  114.769227] mmcblk0: error -110 transferring data, sector 30125744, nr 8, cmd response 0x900, card status 0xc00
[  124.780780] mmc0: Timeout waiting for hardware interrupt.
[  124.780802] sdhost-bcm2835: =========== REGISTER DUMP (mmc0)===========
[  124.780811] sdhost-bcm2835: SDCMD  0x00000056
[  124.780817] sdhost-bcm2835: SDARG  0x00000000
[  124.780823] sdhost-bcm2835: SDTOUT 0x00f00000
[  124.780829] sdhost-bcm2835: SDCDIV 0x00000008
[  124.780835] sdhost-bcm2835: SDRSP0 0x00000920
[  124.780841] sdhost-bcm2835: SDRSP1 0x0000160a
[  124.780847] sdhost-bcm2835: SDRSP2 0xffffffff
[  124.780853] sdhost-bcm2835: SDRSP3 0x0002480c
[  124.780859] sdhost-bcm2835: SDHSTS 0x00000000
[  124.780864] sdhost-bcm2835: SDVDD  0x00000001
[  124.780870] sdhost-bcm2835: SDEDM  0x00010800
[  124.780876] sdhost-bcm2835: SDHCFG 0x0000040e
[  124.780882] sdhost-bcm2835: SDHBCT 0x00000004
[  124.780888] sdhost-bcm2835: SDHBLC 0x00000001
[  124.821109] blk_update_request: I/O error, dev mmcblk0, sector 30125744
[  124.821218] Aborting journal on device mmcblk0p2-8.
[  145.080847] sdhost-bcm2835: =========== REGISTER DUMP (mmc0)===========
[  145.080857] sdhost-bcm2835: SDCMD  0x00000056
[  145.080863] sdhost-bcm2835: SDARG  0x00000000
[  145.080870] sdhost-bcm2835: SDTOUT 0x00f00000
[  145.080876] sdhost-bcm2835: SDCDIV 0x00000008
[  145.080882] sdhost-bcm2835: SDRSP0 0x00000920
[  145.080888] sdhost-bcm2835: SDRSP1 0x0000160a
[  145.080894] sdhost-bcm2835: SDRSP2 0xffffffff
[  145.080900] sdhost-bcm2835: SDRSP3 0x0002480c
[  145.080906] sdhost-bcm2835: SDHSTS 0x00000000
[  145.080912] sdhost-bcm2835: SDVDD  0x00000001
[  145.080918] sdhost-bcm2835: SDEDM  0x00010800
[  145.080924] sdhost-bcm2835: SDHCFG 0x0000040e
[  145.080930] sdhost-bcm2835: SDHBCT 0x00000004
[  145.080936] sdhost-bcm2835: SDHBLC 0x00000001
[  145.121202] blk_update_request: I/O error, dev mmcblk0, sector 30124032
[  145.121252] Buffer I/O error on dev mmcblk0p2, logical block 3702784, lost sync page write
[  145.121293] JBD2: Error -5 detected when updating journal superblock for mmcblk0p2-8.
[  155.140864] mmc0: Timeout waiting for hardware interrupt.
[  155.140885] sdhost-bcm2835: =========== REGISTER DUMP (mmc0)===========
[  155.140892] sdhost-bcm2835: SDCMD  0x00000099
[  155.140899] sdhost-bcm2835: SDARG  0x0007a800
[  155.140905] sdhost-bcm2835: SDTOUT 0x00f00000
[  155.140911] sdhost-bcm2835: SDCDIV 0x00000008
[  155.140917] sdhost-bcm2835: SDRSP0 0x00000900
[  155.140923] sdhost-bcm2835: SDRSP1 0x00001918
[  155.140930] sdhost-bcm2835: SDRSP2 0x3fffffff
[  155.140936] sdhost-bcm2835: SDRSP3 0x00000000
[  155.140943] sdhost-bcm2835: SDHSTS 0x00000000
[  155.140949] sdhost-bcm2835: SDVDD  0x00000001
[  155.140954] sdhost-bcm2835: SDEDM  0x00010800
[  155.140960] sdhost-bcm2835: SDHCFG 0x0000040e
[  155.140966] sdhost-bcm2835: SDHBCT 0x00000200
[  155.140973] sdhost-bcm2835: SDHBLC 0x00000008
[  155.181310] mmcblk0: error -110 transferring data, sector 501760, nr 8, cmd response 0x900, card status 0xc00
[  165.200887] mmc0: Timeout waiting for hardware interrupt.
[  165.200908] sdhost-bcm2835: =========== REGISTER DUMP (mmc0)===========
[  165.200916] sdhost-bcm2835: SDCMD  0x00000056
[  165.200922] sdhost-bcm2835: SDARG  0x00000000
[  165.200929] sdhost-bcm2835: SDTOUT 0x00f00000
[  165.200935] sdhost-bcm2835: SDCDIV 0x00000008
[  165.200941] sdhost-bcm2835: SDRSP0 0x00000920
[  165.200947] sdhost-bcm2835: SDRSP1 0x0000160a
[  165.200953] sdhost-bcm2835: SDRSP2 0xffffffff
[  165.200959] sdhost-bcm2835: SDRSP3 0x0002480c
[  165.200965] sdhost-bcm2835: SDHSTS 0x00000000
[  165.200971] sdhost-bcm2835: SDVDD  0x00000001
[  165.200977] sdhost-bcm2835: SDEDM  0x00010800
[  165.200983] sdhost-bcm2835: SDHCFG 0x0000040e
[  165.200989] sdhost-bcm2835: SDHBCT 0x00000004
[  165.200995] sdhost-bcm2835: SDHBLC 0x00000001
[  165.241270] blk_update_request: I/O error, dev mmcblk0, sector 501760
[  165.241318] Buffer I/O error on dev mmcblk0p2, logical block 0, lost sync page write
[  165.241362] EXT4-fs error (device mmcblk0p2): ext4_journal_check_start:56: Detected aborted journal
[  165.241384] EXT4-fs (mmcblk0p2): Remounting filesystem read-only
[  165.241397] EXT4-fs (mmcblk0p2): previous I/O error to superblock detected
[  175.260923] mmc0: Timeout waiting for hardware interrupt.
[  175.260945] sdhost-bcm2835: =========== REGISTER DUMP (mmc0)===========
[  175.260953] sdhost-bcm2835: SDCMD  0x00000099
[  175.260960] sdhost-bcm2835: SDARG  0x0007a800
[  175.260966] sdhost-bcm2835: SDTOUT 0x00f00000
[  175.260972] sdhost-bcm2835: SDCDIV 0x00000008
[  175.260978] sdhost-bcm2835: SDRSP0 0x00000900
[  175.260984] sdhost-bcm2835: SDRSP1 0x00001918
[  175.260991] sdhost-bcm2835: SDRSP2 0xffffffff
[  175.260996] sdhost-bcm2835: SDRSP3 0x0002400f
[  175.261003] sdhost-bcm2835: SDHSTS 0x00000000
[  175.261009] sdhost-bcm2835: SDVDD  0x00000001
[  175.261015] sdhost-bcm2835: SDEDM  0x00010800
[  175.261021] sdhost-bcm2835: SDHCFG 0x0000040e
[  175.261027] sdhost-bcm2835: SDHBCT 0x00000200
[  175.261033] sdhost-bcm2835: SDHBLC 0x00000008
[  175.487941] mmcblk0: error -110 transferring data, sector 501760, nr 8, cmd response 0x900, card status 0xc00
[  185.500947] mmc0: Timeout waiting for hardware interrupt.
[  185.500968] sdhost-bcm2835: =========== REGISTER DUMP (mmc0)===========
[  185.500976] sdhost-bcm2835: SDCMD  0x00000056
[  185.500982] sdhost-bcm2835: SDARG  0x00000000
[  185.500989] sdhost-bcm2835: SDTOUT 0x00f00000
[  185.500994] sdhost-bcm2835: SDCDIV 0x00000008
[  185.501000] sdhost-bcm2835: SDRSP0 0x00000920
[  185.501006] sdhost-bcm2835: SDRSP1 0x0000160a
[  185.501013] sdhost-bcm2835: SDRSP2 0xffffffff
[  185.501018] sdhost-bcm2835: SDRSP3 0x0002480c
[  185.501024] sdhost-bcm2835: SDHSTS 0x00000000
[  185.501030] sdhost-bcm2835: SDVDD  0x00000001
[  185.501036] sdhost-bcm2835: SDEDM  0x00010800
[  185.501042] sdhost-bcm2835: SDHCFG 0x0000040e
[  185.501048] sdhost-bcm2835: SDHBCT 0x00000004
[  185.501054] sdhost-bcm2835: SDHBLC 0x00000001
[  185.541202] blk_update_request: I/O error, dev mmcblk0, sector 501760
[  185.541226] Buffer I/O error on dev mmcblk0p2, logical block 0, lost sync page write
[  221.621044] mmc0: Timeout waiting for hardware interrupt.
[  221.621068] sdhost-bcm2835: =========== REGISTER DUMP (mmc0)===========
[  221.621075] sdhost-bcm2835: SDCMD  0x00000052
[  221.621081] sdhost-bcm2835: SDARG  0x000c6198
[  221.621087] sdhost-bcm2835: SDTOUT 0x00f00000
[  221.621094] sdhost-bcm2835: SDCDIV 0x00000008
[  221.621100] sdhost-bcm2835: SDRSP0 0x00000900
[  221.621106] sdhost-bcm2835: SDRSP1 0x00001269
[  221.621113] sdhost-bcm2835: SDRSP2 0xffffffff
[  221.621118] sdhost-bcm2835: SDRSP3 0x0002400f
[  221.621124] sdhost-bcm2835: SDHSTS 0x00000000
[  221.621130] sdhost-bcm2835: SDVDD  0x00000001
[  221.621137] sdhost-bcm2835: SDEDM  0x00010800
[  221.621143] sdhost-bcm2835: SDHCFG 0x0000040e
[  221.621149] sdhost-bcm2835: SDHBCT 0x00000200
[  221.621154] sdhost-bcm2835: SDHBLC 0x00000008
[  221.661451] mmcblk0: error -110 transferring data, sector 811416, nr 8, cmd response 0x900, card status 0xb00
[  221.661467] mmcblk0: retrying using single block read

Hi

Thanks for reporting this. This is a testing thread so we did expect some breakage.

You do not need to revert the kernel. Insert the SD card in to your PC or Mac. You will see a file called config.txt. Remove the following line

dtoverlay=sdhost

Should boot again

Sam

Thanks Sam. I mounted the SD card, did an fsck on the 2 partitions then removed the dtoverlay=sdhost.

The RPI2 has now been running fine for roughly 10 mins. dmesg shows no sd issues.
All good.

Good luck!

Can you provide the model number off the back of the card (you might need a magnifying glass :slight_smile: ) and possibly a photo of the front of the card ?

Indeed - I did need a magnify glass! In fact, I took a macro-photo of the back thinking there was no info. Then noticed on the photo faint markings. So, I took another photo and by angling the card got the info.
Hope this help!

sdhost overlay activated:

[ 1.385495] DMA channels allocated for the SDHost driver
[ 1.440726] Load BCM2835 SDHost driver

iā€™ll report any problemsā€¦

i suggest to backup SD card before activate de new SD driver.

My system seems to be running normally:

Raspberry Pi 2
SanDisk Ultra PLUS
16 GB capacity
MicroSD HC UHS speed class 1 (10 MB/s)

All running fine here with a Kingston 2GB card (sorry no details on hand).
Only is that I get a unclean filesystem warning but assume that was already before the new driver and due to shutdown sequenz

[ 9.730550] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

Thanks for this driver I like the results of a nice speed boost.

32 GB Samsung EVO card
Old driver: Block Size 4k Write 1.27637 Rewrite 2.68652 Read 7.23047 Reread 7.48535 Random Read 7.10352 Random Write 2.85352
New Driver: Block Size 4k Write 1.16113 Rewrite 3.05273 Read 8.45703 Reread 8.46777 Random Read 8.44531 Random Write 2.91895

Old driver: Block Size 512k Write 17.2607 Rewrite 17.4854 Read 18.5693 Reread 18.5615 Random Read 18.5498 Random Write 17.5684
New Driver: Block Size 512k Write 18.9219 Rewrite 19.0361 Read 22.3799 Reread 22.3604 Random Read 22.3584 Random Write 20.3086

I wouldnā€™t worry about that error - youā€™ll always see this error for the fat partition even on a fresh install.

What tool are you using to measure your results ?

With a simple sudo hdparm -t /dev/mmcblk0p2 on my Pi 2 on a 32GB Samsung card I see an increase from 18.9MB/sec (block read) to about 22.5MB/sec. Seems a bit snappier through the menus to me too, but thatā€™s subjectiveā€¦

Thanks for providing the model number of the card - thatā€™s very helpful, and hopefully will help allow compatibility with this card to be fixed.

Here is the command I made that I even modify the output to be a bit more human readable by converting to MB/s

iozone is just in the repo so just apt-get it.

iozone -e -I -a -s 50M -r 4k -r 512k -i 0 -i 1 -i 2 | tail -4 | head -2 | awk ā€˜{print ā€œBlock Size " $2"kā€, "Write " $3/1024, "Rewrite " $4/1024, "Read " $5/1024, "Reread " $6/1024, "Random Read " $7/1024, "Random Write "$8/1024}ā€™

Here are my Samsung 32GB results.

mmc:

Block Size 4k Write 2.29102 Rewrite 2.8252 Read 7.29297 Reread 7.40527 Random Read 7.39746 Random Write 2.47461
Block Size 512k Write 17.1533 Rewrite 17.4443 Read 18.4639 Reread 18.459 Random Read 18.4766 Random Write 17.3936

sdhost:

Block Size 4k Write 1.61719 Rewrite 1.85742 Read 7.53418 Reread 7.47656 Random Read 7.47266 Random Write 2.47559
Block Size 512k Write 19.7803 Rewrite 20.1445 Read 22.001 Reread 21.9912 Random Read 21.9961 Random Write 20.334

Whatā€™s interesting is 4K random write seems quite a bit slower with sdhost even though most other figures are faster.

Itā€™s interesting to compare them side by side. Yours generally edges my EVO out in the writes but mine generally edges out the reads. I wonder for the difference what I would prefer in the long run the faster writes or the faster reads, probably the reads since it would make scrolling through the UI and having the fanart + posters loading a little bit more responsive.

Here is an 8GB Pi foundation noobs card. (different install of OSMC obviously)

mmc:

Block Size 4k Write 1.56152 Rewrite 1.52539 Read 6.25391 Reread 6.17676 Random Read 4.97461 Random Write 1.06738
Block Size 512k Write 3.61719 Rewrite 4.50781 Read 18.5166 Reread 18.4756 Random Read 18.4033 Random Write 4.91406

sdhost:

Block Size 4k Write 1.82617 Rewrite 1.7041 Read 6.1748 Reread 6.1875 Random Read 4.97363 Random Write 1.18359
Block Size 512k Write 4.30469 Rewrite 4.98828 Read 20.7617 Reread 20.6777 Random Read 20.6387 Random Write 4.92676