diff mbox series

mmc: sdhci: do not enable card detect interrupt for gpio cd type

Message ID 1545201350-8298-1-git-send-email-haibo.chen@nxp.com (mailing list archive)
State New, archived
Headers show
Series mmc: sdhci: do not enable card detect interrupt for gpio cd type | expand

Commit Message

Bough Chen Dec. 19, 2018, 6:28 a.m. UTC
Except SDHCI_QUIRK_BROKEN_CARD_DETECTION and MMC_CAP_NONREMOVABLE,
we also do not need to handle controller native card detect interrupt
for gpio cd type.
If we wrong enabled the card detect interrupt for gpio case,
it will cause a lot of unexpected card detect interrupts during data
transfer which should not happen.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
---
 drivers/mmc/host/sdhci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Adrian Hunter Dec. 27, 2018, 7:34 a.m. UTC | #1
On 19/12/18 8:28 AM, BOUGH CHEN wrote:
> Except SDHCI_QUIRK_BROKEN_CARD_DETECTION and MMC_CAP_NONREMOVABLE,
> we also do not need to handle controller native card detect interrupt
> for gpio cd type.
> If we wrong enabled the card detect interrupt for gpio case,
> it will cause a lot of unexpected card detect interrupts during data
> transfer which should not happen.

That sounds like sdhci card detection is broken, in which case, could you
use SDHCI_QUIRK_BROKEN_CARD_DETECTION?

> 
> Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
> ---
>  drivers/mmc/host/sdhci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 5de845b..67e43ec 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -156,7 +156,7 @@ static void sdhci_set_card_detection(struct sdhci_host *host, bool enable)
>  	u32 present;
>  
>  	if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) ||
> -	    !mmc_card_is_removable(host->mmc))
> +	    !mmc_card_is_removable(host->mmc) || mmc_can_gpio_cd(host->mmc))
>  		return;
>  
>  	if (enable) {
>
diff mbox series

Patch

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 5de845b..67e43ec 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -156,7 +156,7 @@  static void sdhci_set_card_detection(struct sdhci_host *host, bool enable)
 	u32 present;
 
 	if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) ||
-	    !mmc_card_is_removable(host->mmc))
+	    !mmc_card_is_removable(host->mmc) || mmc_can_gpio_cd(host->mmc))
 		return;
 
 	if (enable) {