wifi: SDIO use flags to detect card-in or card-remove.If
tagged up wifi and off, then go into deep suspend and resume, we
do not judge if wifi is on or off, this will crash pm.resume for
drivers cannot access register without hclk_mmc.
[ 357.835059] 1192..dw_mci_set_ios: no card. [mmc1]
[ 358.322686] dwmmc_rockchip
ff0d0000.rksdmmc: Timeout resetting block (ctrl reset 0x1)
[ 358.322792] dpm_run_callback(): platform_pm_resume+0x0/0x54 returns -19
[ 358.322813] PM: Device
ff0d0000.rksdmmc failed to resume: error -19
Fix it by default return success state to pm.resume if wifi off in SDIO slot
do {
ctrl = mci_readl(host, CTRL);
if (!(ctrl & reset))
- return true;
+ return true;
} while (time_before(jiffies, timeout));
dev_err(host->dev,
"Timeout resetting block (ctrl reset %#x)\n",
ctrl & reset);
-
+
return false;
}
{
int i, ret;
u32 regs;
+ struct dw_mci_slot *slot;
+
+ if (host->mmc->restrict_caps & RESTRICT_CARD_TYPE_SDIO){
+ slot = mmc_priv(host->mmc);
+ if(!test_bit(DW_MMC_CARD_PRESENT, &slot->flags))
+ return 0;
+ }
+
if (host->vmmc) {
ret = regulator_enable(host->vmmc);
if (ret) {
return ret;
}
}
-
+
if (!dw_mci_ctrl_all_reset(host)) {
ret = -ENODEV;
return ret;