mmc: remove useless pcl to udbg when routine card from mmc bus probe.
authorlintao <lintao@rock-chips.com>
Tue, 28 Oct 2014 00:47:12 +0000 (08:47 +0800)
committerlintao <lintao@rock-chips.com>
Tue, 28 Oct 2014 03:19:58 +0000 (11:19 +0800)
When kernel booting for the first time, pcl may cause incorrect
state for bus timing which cause detect failure from bus porbe, and been
recoginzed well from driver probe. Check cd state, and avoid this action.
.
[    5.112563] dwmmc_rockchip 10214000.rksdmmc: data_over interrupt timeout!
[    5.112704] mmc1: error -84 whilst initialising SD card
...
[    5.201691] mmc1: new high speed SDHC card at address 0007
[    5.202583] mmcblk1: mmc1:0007 SD32G 29.3 GiB

Tested-and-acked-by: heyun <heyun@rock-chips.com>
Signed-off-by: lintao <lintao@rock-chips.com>
drivers/mmc/host/rk_sdmmc.c

index 30b22095fd30c3cf417f237a95ca3391dff6b335..0733a1d875149a3a57a7817f047acd250110f5f6 100755 (executable)
@@ -3332,9 +3332,10 @@ static void dw_mci_init_pinctrl(struct dw_mci *host)
                         dev_warn(host->dev, "%s: No udbg pinctrl found!\n",
                                         mmc_hostname(host->mmc));
                 } else {
-                        if (pinctrl_select_state(host->pinctrl, host->pins_udbg) < 0)
-                                dev_err(host->dev, "%s: Udbg pinctrl setting failed!\n",
-                                        mmc_hostname(host->mmc));
+                        if (!dw_mci_get_cd(host->mmc))
+                               if (pinctrl_select_state(host->pinctrl, host->pins_udbg) < 0)
+                                       dev_err(host->dev, "%s: Udbg pinctrl setting failed!\n",
+                                               mmc_hostname(host->mmc));
                 }
         }
 }