mmc: core: need retune if error value is -EIO
authorxiaoyao <xiaoyao@rock-chips.com>
Thu, 4 Aug 2016 09:02:59 +0000 (17:02 +0800)
committerGerrit Code Review <gerrit@rock-chips.com>
Fri, 5 Aug 2016 02:24:45 +0000 (10:24 +0800)
commitc79f3694931e2ebdbd2fd05c38cd9861d1d6329a
treee9560da1f9769a27efa45c73a8883399c35b774c
parent454f1b61ddbf79e42b8351836ee52a7a20f61a17
mmc: core: need retune if error value is -EIO

We need to do retune if receiving -EIO, otherwise we
could see debug dump like:

[ 89.057226] bcmsdh_sdmmc: Failed to Read byte F1:@0x1001f=ff, Err: -5
[ 89.058811] bcmsdh_sdmmc: Failed to Read byte F1:@0x1001f=ff, Err: -5
[ 89.059415] bcmsdh_sdmmc: Failed to Read byte F1:@0x1000e=ff, Err: -84
[ 89.254248] dwmmc_rockchip fe310000.dwmmc: Successfully tuned phase to 199
[ 89.273912] dhd_set_suspend: Remove extra suspend setting
[ 89.274478] dhd_enable_packet_filter: enter, value = 0
64 bytes from 112.90.83.112: icmp_seq=24 ttl=53 time=1321 ms
64 bytes from 112.90.83.112: icmp_seq=25 ttl=53 time=319 ms
64 bytes from 112.90.83.112: icmp_seq=26 ttl=53 time=69.8 ms
64 bytes from 112.90.83.112: icmp_seq=27 ttl=53 time=37.5 ms
...

In this case we see dw_mmc finally enter retune process, but
if this patch is applied, we could save more time to make it
work. Also many host drivers will generate -EIO, so this patch
can also prevent them from failing to enter retune process.

Change-Id: Iba59817fc4677a52bacc857bc99088d1f7790450
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: xiaoyao <xiaoyao@rock-chips.com>
drivers/mmc/core/core.c