mmc: omap: handle controller errors properly
authorGrazvydas Ignotas <notasas@gmail.com>
Mon, 19 Mar 2012 17:52:13 +0000 (19:52 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 25 Mar 2012 20:15:16 +0000 (23:15 +0300)
commita52c41f587a71d530de089513c0739a48cbe964b
tree78b5c552aa88e542e1db420b09c378444c013851
parentc5bbadd2add548db8ee9297ef29517de411f69c0
mmc: omap: handle controller errors properly

According to OMAP3 TRM, when the controller reports certain errors,
driver must perform a software reset. This is done by setting a bit
in SYSCTL and waiting it to clear:
- SRC on command timeout (CTO)
- SRD on data errors (DTO, DCRC and DEB)

This fixes a problem seen on OMAP3 pandora board with some cards
that won't work with a message printed multiple times:
  timedout waiting on cmd inhibit to clear

Code loosely based on Linux omap_hsmmc driver.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
drivers/mmc/omap_hsmmc.c