Active Topics

 


Reply
Thread Tools
Posts: 139 | Thanked: 97 times | Joined on Nov 2010 @ United States
#1
Hello everyone,

Stlpaul
and I have got certain class 10 microSD cards that were formerly not working properly with Maemo to work properly.
In particular, this thread's issues are addressed: http://talk.maemo.org/showthread.php?t=70974

I have been using this patch for over a week now, without any stability issues (I have swap on microSD).

Installation Instructions:

You can replace your current kernel module (backup up the old one first), and try the fix at your OWN RISK. The kernel module goes in your appropriate /lib/modules/ folder.

Here is the patched kernel for the power-kernel (v46)

http://forge.localcoast.net/clients/.../omap_hsmmc.ko

Or, if you want to change the kernel and recompile it yourself..

Look in drivers/mmc/host/omap_hsmmc.c and find the set_data_timeout function() function, and add
Code:
dto = 14;
before the line that reads:
Code:
reg &= ~DTO_MASK;
Notice: I hereby disclaim and damage(s), or issue(s) caused by the use of these/this modfied file(s). Only make these changes if you already have an issue, and are looking to fix it. Be sure to backup all user data before making changes.

Notice: This fix does not apply to NITDroid and any other kernel(s) or operating system(s) you may be using outside of Maemo. Additional software platforms may require a similar change(s) to be made to achieve the desired result.

Please let me know how it works for you!

Good luck.

Last edited by AndrewX192; 2011-11-12 at 17:37. Reason: Removing the stock kernel patch that was causing boot looping
 

The Following 24 Users Say Thank You to AndrewX192 For This Useful Post:
Posts: 2,225 | Thanked: 3,822 times | Joined on Jun 2010 @ Florida
#2
You can, once this is tested long enough to be sure it doesn't screw up other stuff, submit this to pali, as he has become the power-kernel maintainer and can make this patch a normal part of the power-kernel.
 

The Following 2 Users Say Thank You to Mentalist Traceur For This Useful Post:
JohnLF's Avatar
Posts: 551 | Thanked: 507 times | Joined on Feb 2010 @ North West England
#3
Would be interesting to know if it affects other MicroSD cards at all - speedwise that is.
__________________
My websites: -
http://www.lefebvre.org.uk
http://www.lefebvre.ltd.uk
 
Posts: 1,141 | Thanked: 781 times | Joined on Dec 2009 @ Magical Unicorn Land
#4
Thanks for posting, I've been meaning to create a thread about it but have been extremely busy lately.

14 (0xA) is the standard DTO setting for SD cards. The omap_hsmmc driver tries to use some logic to dynamically change DTO based on the card timings but apparently this logic is buggy, or perhaps certain cards return bad timing information when the driver requests it. It affects all devices which use this driver, not just the N900, and other devices with other drivers too. The suggestion to use DTO=14 came from Texas Instruments, so it should be safe for all. Forcing DTO to 14 is the fix/workaround for all kinds of SD drivers. Apparently it is quite a common problem.

The set_data_timeout function can actually be reduced quite a bit, inserting the dto=14 line ultimately has the same effect, but really all of the stuff related to the DTO calculation in that function can be removed. I don't have access to my computer right now but I can post the one I've been using when I get home.

This fixes the cards that suffer corruption and constant -110 errors in dmesg (this is a timeout error, because the DTO was set incorrectly by the driver). The same cards that work perfectly fine in other devices, USB card readers, etc.

I've been using this fix with both affected and unaffected cards for a couple weeks and have seen no problems either way. Since it worked for AndrewX192 also I think it should be safe for human consumption.

I tried to apply the same fix to the latest Nitdroid kernel but haven't been able to get it working so far. I very likely could just be doing it wrong. It could also be getting confused by my existing nitdroid installation which runs on my other SD card. I haven't had time to really try much more with it yet.
 

The Following 11 Users Say Thank You to stlpaul For This Useful Post:
Posts: 1,680 | Thanked: 3,685 times | Joined on Jan 2011
#5
As this is compatible with power46, does that mean it is safe to use with power47?

I assume that because the wifi injection driver works (compiled for 46, works with 47) this will also work with 47.

I would just try however I don't want to risk ANOTHER £30 class 10 SD card by doing something obviously dumb.
__________________
N900: One of God's own prototypes. A high-powered mutant of some kind never even considered for mass production. Too weird to live, and too rare to die.
 

The Following User Says Thank You to vi_ For This Useful Post:
Posts: 1,141 | Thanked: 781 times | Joined on Dec 2009 @ Magical Unicorn Land
#6
Originally Posted by vi_ View Post
As this is compatible with power46, does that mean it is safe to use with power47?

I assume that because the wifi injection driver works (compiled for 46, works with 47) this will also work with 47.

I would just try however I don't want to risk ANOTHER £30 class 10 SD card by doing something obviously dumb.
It should, I doubt this module changed at all between power46 and power47. The risk of damaging your SD card would with the unmodified kernel, not the modified one!

If you want to be careful, when I get home I'll pull Pali's kernel and build it with this patch and upload the compiled module for you after I've made sure it works on my N900.
 

The Following 3 Users Say Thank You to stlpaul For This Useful Post:
Posts: 284 | Thanked: 320 times | Joined on May 2010 @ Peterborough, UK
#7
It's odd, because my N900 with HW 2101 was absolutely fine with my class 10 SD card. However, once Nokia Care had replaced it with HW 2204, I started getting these errors. It's been sent back again now due to other problems, but I'll definitely be applying this patch to kernel-bfs ready for when it's returned to me

PS I've tidied up the code and made a diff which can be applied in the build process - had to make it a .txt to attach it though.
Attached Files
File Type: txt class10sd_dto14_fix.diff.txt (995 Bytes, 1035 views)

Last edited by Tigerite; 2011-05-05 at 20:23.
 

The Following 2 Users Say Thank You to Tigerite For This Useful Post:
Posts: 2,225 | Thanked: 3,822 times | Joined on Jun 2010 @ Florida
#8
I'm still of the opinion that the ideal thing to do would be to shove this into the default power kernel, when it's ready. Well, the most ideal is making the DTO logic try to get the right number, then use a heuristic to default to 14 if it starts to experience symptoms of errors. Perhaps, if possible, see if there's some way to check the device for errors without damaging any data. But that's a long term hope.
 
Posts: 1,141 | Thanked: 781 times | Joined on Dec 2009 @ Magical Unicorn Land
#9
Originally Posted by Tigerite View Post
It's odd, because my N900 with HW 2101 was absolutely fine with my class 10 SD card. However, once Nokia Care had replaced it with HW 2204, I started getting these errors. It's been sent back again now due to other problems, but I'll definitely be applying this patch to kernel-bfs ready for when it's returned to me

PS I've tidied up the code and made a diff which can be applied in the build process - had to make it a .txt to attach it though.
Thanks, that's basically what mine looks like, but I even removed the dto variable entirely and just used the DTO macro instead (it is already defined as 0xa early in the file)

BTW my N900 is rev 2101...
 
Posts: 1,141 | Thanked: 781 times | Joined on Dec 2009 @ Magical Unicorn Land
#10
Here is the module compiled as part of power47, it works for me.
Attached Files
File Type: zip sdfix-power47.zip (8.4 KB, 323 views)
 

The Following 9 Users Say Thank You to stlpaul For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 17:16.