5leep.comxIf you’ve noticed that your phone is getting slower, getting hot, and sucking battery like a frat bro with an unlimited supply of Coors Lite, there may be a very non-obvious culprit. Your flash RAM card could be the problem.

Flash RAM has a finite life. Each location on the chip can only be written to so many times before it loses its ability to retain data. When that happens, the spot is supposed to be marked bad and not reused. However, experience has shown that this only happens on writes, and a write can be successful but not be reliably readable later. So, there may be bad blocks on your SD card that go unnoticed by the operating system until it attempts to write new data there.

The insidious side effect of this is that those read errors will cause many, many retries to access the marginal data block. The result is a series of what are called “wakelocks” that prevent the phone’s CPU from going into sleep mode. Particularly, the mmc0_detect, mmc1_detect, and mmc2_detect functions of the OS kernel will keep trying to access the card and keep your phone’s processor awake.How do you find this? Well, if you’re running an Android OS with root access (Nexus models, Cyanogenmod, etc.), a tool like Wakelock Detector will show you everything that’s waking up your phone. Just be sure to enable “Advanced Mode” in the settings to allow you to see kernel-level locks. If you’re stuck with a stock vendor- or carrier-supplied locked down OS, go to your system settings, and then Battery. Tap on the battery usage graph and look at the bar titled “Awake”. This shows how much time that your phone’s processor has been out of sleep (battery saving) mode. If that bar’s solid and not just a series of small dashes, then something’s keeping your phone awake. If no application shows as being a battery hog (high battery %), then you might want to suspect your flash memory.

The solution: If your phone doesn’t have a micro-SD slot and only has internal flash, you could be out of luck. Internal flash drives on phones are typically designed with higher reliability specs, but they will eventually wear out. Time for a new phone. If you have an add-on SD card installed, then do the following:

  1. Get a new memory card of the same or larger capacity (make sure it’s compatible with your device).
  2. Go to your system settings, then Storage, then Unmount SD Card. Or, shut off your phone.
  3. Remove the SD card. If necessary, put a micro-SD card into an adapter and insert it into a card reader on your PC.
  4. Open the detected card, highlight all of the directories listed, and copy them to a new folder on your hard disk.
  5. Insert the fresh new memory card into your phone and power on (or select Mount SD Card under your system storage settings).
  6. Select “Erase SD Card” (your option could say “Format…”) and confirm.
  7. Unmount the SD card (or power off the phone) and remove it.
  8. Eject the old SD card from your PC, remove the card from the adapter if you’re using one.
  9. Insert the new card into the adapter if necessary, and insert into PC’s card reader
  10. Open the detected card, and copy all of the contents of the backup folder you created in step 4.
  11. Eject the card, remove from adapter, reinstall into phone.
  12. Mount the SD card or power-cycle the phone.

If you were seeing excessive mmcX_detect wakelocks, they should decrease. If you don’t have diagnostic tools available for your phone OS, just keep an eye on your battery graph in system settings. If this fixes your battery burn, congrats!

1 Comment

  1. Using a bad memory card reader can screw up memory cards, such as SD cards. There is little sign that there is a problem, except that Windows is hesitant to recognize it.