Skip to contentSkip to conversation

mmc: sdhci-cadence: Fix a loop in sdhci_cdns_set_tune_val()

PATCH In review Dan Carpenter 2 participants 2 messages Apr 24, 2018 – Apr 25, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: sdhci-cadence: Fix a loop in sdhci_cdns_set_tune_val()

We were supposed to go through this loop twice but there is a missing if statement so it only loops once.

Fixes 213fae74318b ("mmc: sdhci-cadence: send tune request twice to work around errata")
drivers/mmc/host/sdhci-cadence.c +2 -2
index bc30d1637246..7a343b87b5e5 100644
@@ -274,8 +274,8 @@ static int sdhci_cdns_set_tune_val(struct sdhci_host *host, unsigned int val)
 		ret = readl_poll_timeout(reg, tmp,
 					 !(tmp & SDHCI_CDNS_HRS06_TUNE_UP),
 					 0, 1);
-
-		return ret;
+		if (ret)
+			return ret;
 	}
 
 	return 0;
#1 lore raw

2018-04-24 22:26 GMT+09:00 Dan Carpenter <[email protected]>:

Quoted 5 lines

We were supposed to go through this loop twice but there is a missing if statement so it only loops once.

Fixes 213fae74318b ("mmc: sdhci-cadence: send tune request twice to work around errata")

Thanks for the fix, but
an equivalent patch had already been applied.

https://patchwork.kernel.org/patch/10351215/

Quoted 19 lines
drivers/mmc/host/sdhci-cadence.c +2 -3
index bc30d1637246..7a343b87b5e5 100644
@@ -274,8 +274,8 @@ static int sdhci_cdns_set_tune_val(struct sdhci_host *host, unsigned int val)
                ret = readl_poll_timeout(reg, tmp,
                                         !(tmp & SDHCI_CDNS_HRS06_TUNE_UP),
                                         0, 1);
-
-               return ret;
+               if (ret)
+                       return ret;
        }
 
        return 0;
--

To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Best Regards
Masahiro Yamada