[TEST] New Raspberry Pi SD card driver

Can you tell us what’s the exact syntax for overclocking sdhost in config.txt?

Overclocking info here: Overclocking - Page 39 - Raspberry Pi Forums

Thank you! :slight_smile:
I’ll give it a go…

For now:

Stock driver:

Block Size 4k Write 0.556641 Rewrite 0.798828 Read 3.95605 Reread 3.94141 Random Read 3.84375 Random Write 0.529297
Block Size 512k Write 13.3008 Rewrite 10.1299 Read 18.3818 Reread 18.3545 Random Read 18.0508 Random Write 4.22168

sdhost driver:

Block Size 4k Write 0.577148 Rewrite 0.837891 Read 3.99121 Reread 3.99023 Random Read 3.80078 Random Write 0.527344
Block Size 512k Write 19.3174 Rewrite 14.8604 Read 22.0576 Reread 22.0605 Random Read 22.0059 Random Write 11.5205

mSDcard is a Sony 16GB SR-160X (not more info that I can gather from it…)

…and it’s stable as far as I could test it…

After 13 hours of straight usage and 16 hours overall, I still haven’t had any issues with the 100 sdhost overclock.

With the old driver I got:
Block Size 4k Write 1.33887 Rewrite 1.74316 Read 4.85449 Reread 4.89453 Random Read 4.09961 Random Write 1.04883
Block Size 512k Write 8.52246 Rewrite 8.20508 Read 18.041 Reread 17.8818 Random Read 17.8506 Random Write 5.67871

Changing to new driver it hangs at boot screen.
Samsung EVO 16 MB-MP16D/EU

MB-MP16D
MBMPAGVDDDGW-P
DHQJ413GA444

I will try to format and retry as I was getting random crashes with the old driver.

After reinstalling and updating the result was:

Block Size 4k Write 1.72754 Rewrite 1.30566 Read 5.02637 Reread 5.06738 Random Read 4.49609 Random Write 0.926758
Block Size 512k Write 7.55469 Rewrite 6.74512 Read 17.709 Reread 17.8896 Random Read 17.9248 Random Write 6.88184

And after upgrading it works and the results are now:

Block Size 4k Write 2.03906 Rewrite 2.17871 Read 5.75879 Reread 5.74414 Random Read 5.06738 Random Write 1.27148
Block Size 512k Write 5.26953 Rewrite 5.45996 Read 20.916 Reread 20.9199 Random Read 20.833 Random Write 5.06934

So it seems the SD was corrupt, I will try to recover my old configuration and report if needed.

EDIT1:
Ok after some configuration I just rebooted into the same problem.

I will use SDFormat, repeat the process and report

EDIT2:
Before reformatting I tried disabling the new driver and everything works without errors and the system boots :smile:
Anyway I will try to format and see if there is any difference.

Thanks for testing - from that screen shot it looks like you are experiencing a similar compatibility issue as JGrana - it’s quite possible that you are seeing file system corruption from the sdhost driver using this card so I would suggest that you hold off using this driver for now, but check in here from time to time to see if a new version of the driver is released with any fixes that may warrant re-testing it on your card.

I’ve found the cause of @JGrana’s problem - a timeout value which was insufficient for high capacity cards in some circumstances. Having a good source of errors has also made it possible to improve the error recovery.

I’ve been trying to understand a PIO problem before enabling PIO for small transfers, but I can make an interim release that still uses DMA for all transfers but should work on all cards. Either way, I’ll announce the new release here.

Nice job Phil. I am ready to do testing when you are ready!

Excellent job here. Thanks for the boost!

Here are my results:

RPi_2

sandisk extreme U1 16GB

before:

Block Size 4k Write 1.95605 Rewrite 2.06152 Read 7.46875 Reread 7.5332 Random Read 7.43066 Random Write 1.81543
Block Size 512k Write 14.21 Rewrite 16.4697 Read 18.7207 Reread 18.7148 Random Read 18.7188 Random Write 15.9961

after:

Block Size 4k Write 2.16016 Rewrite 2.24512 Read 8.11816 Reread 8.25098 Random Read 8.25391 Random Write 1.93848
Block Size 512k Write 18.0566 Rewrite 20.5439 Read 22.3574 Reread 22.3594 Random Read 22.3428 Random Write 19.9971

sandisk ultra class 10 48MB/s

before:

Block Size 4k Write 1.63574 Rewrite 2.00391 Read 6.87207 Reread 6.81934 Random Read 6.1084 Random Write 0.80957
Block Size 512k Write 7.50586 Rewrite 10.1006 Read 18.6885 Reread 18.2949 Random Read 18.6777 Random Write 5.25098

after:

Block Size 4k Write 1.52246 Rewrite 1.97852 Read 7.46191 Reread 7.53223 Random Read 6.83398 Random Write 0.777344
Block Size 512k Write 7.45508 Rewrite 9.36133 Read 22.293 Reread 22.1631 Random Read 22.2764 Random Write 5.44824

RPi_1 (iozone wasn’t found in the repos. Couldn’t install it)

sandisk extreme 8GB 30MB/s

before:

Timing buffered disk reads: 58 MB in 3.06 seconds = 18.98 MB/sec

after:

Timing buffered disk reads: 64 MB in 3.02 seconds = 21.21 MB/sec

My updates are now in the kernel source tree, so they should make it into a build soon.

Thank you Phil,

I am currently on holiday, so I’m relying on remote build slaves to compile OSMC at the moment. Ironically, and quite humourously, one of our slaves was running the experimental driver and had issues during compiling. This means that we won’t be able to introduce an updated version of the kernel with Phil’s changes until tomorrow.

The new driver also features the ability to handle high overclock and steps them back until a stable one is found. It would be good if users could try high (perhaps ridiculous) overclocks to verify that the integrity of the filesystem is preserved and that the automatic negotiation of good SD card speed is handled correctly.

I will update the original post with the new links when they are available and will let you know when further changes are available for testing.

S

Please backup first or test on a clean install as this is pretty experimental. You should see messages in “dmesg” log when the overclock is reduced due to errors:

[    1.553644] mmc0: reducing overclock due to errors
[    1.631084] mmc0: overclocking to 83333333Hz
1 Like

Hi everyone,

I have updated the original post here:

If you copy and paste the command in the post it will update your system to the latest kernel which includes @pelwell’s latest driver

Cheers

Sam

Been running new sd driver since you released it, no problems at all. But I only use SD for boot-partition, running from USB stick

My advice would be to go easy on the overclocking and the fallback feature - @popcornmix has already seen some less-than-ideal results on a 32GB Samsung card. At this stage it is more important that the driver behaves correctly for a wide variety of cards at 50MHz, but I am still interested in the results of any testing you do (even overclocked).

And as Sam said, make sure you are backed up first.

1 Like

You can backup and restore OSMC via My OSMC

Sam

Is that just basic Samsung because I have had my 32gb Samsung EVO over clocked to 100 for 5 or 6 days and haven’t had any problems.

Possibly similar to my 32GB Samsung card (non-EVO) benchmarked above.

I was running mine on the original sdhost driver without overclocking and had an issue a day or so ago where the system basically froze in the middle of kernel compile - ironically it was trying to compile the kernel with the updated sdhost driver when it froze. :smile:

Nothing was logged on the console, I could still ping it, but I couldn’t log in via ssh or local console or reboot. As it was a remote build via jenkins I was able to see in the jenkins log that the file system had suddenly gone read only in the middle of the build - which is highly unusual.

You can see this right near the end of this build log where it says Input/Output error followed by read only file system:

http://jenkins.osmc.tv/job/rbp2-kernel-osmc/28/console

After a reboot it was fine again and there was no sign of corruption. That install on that card has now been updated to the kernel with the newer sdhost driver so we will see if there are any further problems.

I had the Lexar card that had numerous errors. Phil mentioned he tracked down the issue and put a fix into this version.

I’m happy to report it has been running for ~3 hours now. I created a large swapfile (~1M) then deleted. No messages in dmesg, running clean as a whistle.

I will see how it is in a few days.

Nice job Phil!