The result from ->get_cd() may be incorrect as the card detect debouncing isn't managed correctly. Let's fix it.
Unified · Split
| @@ -152,6 +152,8 @@ static int sdhci_o2_get_cd(struct mmc_host *mmc) · 151 unmodified lines | ||
| 152 | 152 | |
| 153 | 153 | if (!(sdhci_readw(host, O2_PLL_DLL_WDT_CONTROL1) & O2_PLL_LOCK_STATUS)) |
| 154 | 154 | sdhci_o2_enable_internal_clock(host); |
| 155 | + else | |
| 156 | + sdhci_o2_wait_card_detect_stable(host); | |
| 155 | 157 | |
| 156 | 158 | return !!(sdhci_readl(host, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT); |
| 157 | 159 | } |