Skip to contentSkip to conversation

mmc: sdhci: fix __sdhci_adma_write_desc

PATCH In review Jisheng Zhang 3 participants 3 messages Sep 17, 2018

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

PATCH 1/1 mmc: sdhci: fix __sdhci_adma_write_desc

If hosts provides ops->adma_write_desc, we should not fall back to the general sdhci_adma_write_desc().

---

Hi Ulf, Adrian,

When I introduced .adma_write_desc, I made a mistake since v4 -- if the host provide ops->adma_write_desc, we should just call it and don't fall back to the general sdhci_adma_write_desc(). Before v4, the adma_write_desc return int, since v4 there's no return value, so when I prepared the v4, I just removed return, this is where the mistake is from. I dunno how to handle this case, fold the patch into previous commit or apply it as a separate patch?

I'm very sorry for this. In fact, Adrian caught another similar bug during review.

Sorry about the inconvenience,
Jisheng

 drivers/mmc/host/sdhci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci.c +2 -2
index 0dda6f4b6a24..99bdae53fa2e 100644
@@ -649,8 +649,8 @@ static inline void __sdhci_adma_write_desc(struct sdhci_host *host,
 {
 	if (host->ops->adma_write_desc)
 		host->ops->adma_write_desc(host, desc, addr, len, cmd);
-
-	sdhci_adma_write_desc(host, desc, addr, len, cmd);
+	else
+		sdhci_adma_write_desc(host, desc, addr, len, cmd);
 }
 
 static void sdhci_adma_mark_end(void *desc)
Signature · 1 line
2.19.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Jisheng Zhang

If hosts provides ops->adma_write_desc, we should not fall back to the general sdhci_adma_write_desc().

---

Quoted 8 lines

Hi Ulf, Adrian,

When I introduced .adma_write_desc, I made a mistake since v4 -- if the host provide ops->adma_write_desc, we should just call it and don't fall back to the general sdhci_adma_write_desc(). Before v4, the adma_write_desc return int, since v4 there's no return value, so when I prepared the v4, I just removed return, this is where the mistake is from. I dunno how to handle this case, fold the patch into previous commit or apply it as a separate patch?

Up to Ulf, but in any case:

Quoted 26 lines

I'm very sorry for this. In fact, Adrian caught another similar bug during review.

Sorry about the inconvenience,
Jisheng

 drivers/mmc/host/sdhci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci.c +2 -2
index 0dda6f4b6a24..99bdae53fa2e 100644
@@ -649,8 +649,8 @@ static inline void __sdhci_adma_write_desc(struct sdhci_host *host,
 {
 	if (host->ops->adma_write_desc)
 		host->ops->adma_write_desc(host, desc, addr, len, cmd);
-
-	sdhci_adma_write_desc(host, desc, addr, len, cmd);
+	else
+		sdhci_adma_write_desc(host, desc, addr, len, cmd);
 }
 
 static void sdhci_adma_mark_end(void *desc)
#2 lore raw
In reply to Jisheng Zhang
Quoted 15 lines · Jisheng Zhang

If hosts provides ops->adma_write_desc, we should not fall back to the general sdhci_adma_write_desc().

---

Hi Ulf, Adrian,

When I introduced .adma_write_desc, I made a mistake since v4 -- if the host provide ops->adma_write_desc, we should just call it and don't fall back to the general sdhci_adma_write_desc(). Before v4, the adma_write_desc return int, since v4 there's no return value, so when I prepared the v4, I just removed return, this is where the mistake is from. I dunno how to handle this case, fold the patch into previous commit or apply it as a separate patch?

Quoted 5 lines

I'm very sorry for this. In fact, Adrian caught another similar bug during review.

Sorry about the inconvenience,
Jisheng

No worries, mistakes happens - the important thing is that we fix them!

Thanks for providing the information above.

I have applied this as is for next.

Kind regards
Uffe

Quoted 22 lines
 drivers/mmc/host/sdhci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci.c +2 -3
index 0dda6f4b6a24..99bdae53fa2e 100644
@@ -649,8 +649,8 @@ static inline void __sdhci_adma_write_desc(struct sdhci_host *host,
 {
        if (host->ops->adma_write_desc)
                host->ops->adma_write_desc(host, desc, addr, len, cmd);
-
-       sdhci_adma_write_desc(host, desc, addr, len, cmd);
+       else
+               sdhci_adma_write_desc(host, desc, addr, len, cmd);
 }
 
 static void sdhci_adma_mark_end(void *desc)
--

2.19.0