Skip to contentSkip to conversation

mmc:sdhci-pci-o2micro:fix card detect issue because card detect debouncing isn't done

PATCH In review Chevron Li 2 participants 2 messages Jun 2, 2022 – Jun 7, 2022

Subsystems (2)
lore
Share & tools
lore

Chevron Li

author
#0 lore raw

PATCH 1/1 mmc:sdhci-pci-o2micro:fix card detect issue because card detect debouncing isn't done

get_cd result is uncorrect during card detect debouncing we need to wait card detect stable before return get_cd result

---
change in V1:
add wait card detect stable logical before return card detect result.

---
 drivers/mmc/host/sdhci-pci-o2micro.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mmc/host/sdhci-pci-o2micro.c +2 -0
index 92c20cb8074a..0d4d343dbb77 100644
@@ -152,6 +152,8 @@ static int sdhci_o2_get_cd(struct mmc_host *mmc)
 
 	if (!(sdhci_readw(host, O2_PLL_DLL_WDT_CONTROL1) & O2_PLL_LOCK_STATUS))
 		sdhci_o2_enable_internal_clock(host);
+	else
+		sdhci_o2_wait_card_detect_stable(host);
 
 	return !!(sdhci_readl(host, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT);
 }

base-commit: d1dc87763f406d4e67caf16dbe438a5647692395

Signature · 1 line
2.32.0
#1 lore raw
Quoted 5 lines · Chevron Li

get_cd result is uncorrect during card detect debouncing we need to wait card detect stable before return get_cd result

Applied for fixes, by adding a fixes+stable tag, thanks!

Kind regards
Uffe

Quoted 25 lines

---
change in V1:
add wait card detect stable logical before return card detect result.

---
 drivers/mmc/host/sdhci-pci-o2micro.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mmc/host/sdhci-pci-o2micro.c +2 -0
index 92c20cb8074a..0d4d343dbb77 100644
@@ -152,6 +152,8 @@ static int sdhci_o2_get_cd(struct mmc_host *mmc)
 
        if (!(sdhci_readw(host, O2_PLL_DLL_WDT_CONTROL1) & O2_PLL_LOCK_STATUS))
                sdhci_o2_enable_internal_clock(host);
+       else
+               sdhci_o2_wait_card_detect_stable(host);
 
        return !!(sdhci_readl(host, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT);
 }

base-commit: d1dc87763f406d4e67caf16dbe438a5647692395 --
2.32.0