Skip to contentSkip to conversation

mmc: msm_sdhci: Set mmc->dev pointer in msm_sdc_probe()

PATCH In review Mateusz Kulikowski 3 participants 4 messages Jun 26, 2016 – Jul 8, 2016 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: msm_sdhci: Set mmc->dev pointer in msm_sdc_probe()

MMC core expects (now) valid mmc->dev pointer.
During conversion in commit cffe5d86 not every driver was updated.

This patch fixes crash while accessing MMC on
boards using Qualcomm SDHCI controller.

---
This patch fixes MMC support on dragonboard.

Without it attempts to access MMC caused null-pointer derefernece.

 drivers/mmc/msm_sdhci.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/mmc/msm_sdhci.c +6 -1
index 64bbf0c..96dcdbe 100644
@@ -136,7 +136,12 @@ static int msm_sdc_probe(struct udevice *dev)
 	host->version = sdhci_readw(host, SDHCI_HOST_VERSION);
 
 	/* automatically detect max and min speed */
-	return add_sdhci(host, 0, 0);
+	ret =  add_sdhci(host, 0, 0);
+	if (ret)
+		return ret;
+	host->mmc->dev = dev;
+
+	return 0;
 }
 
 static int msm_sdc_remove(struct udevice *dev)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 mmc: msm_sdhci: Set mmc->dev pointer in msm_sdc_probe()

Quoted 7 lines · Mateusz Kulikowski

MMC core expects (now) valid mmc->dev pointer.
During conversion in commit cffe5d86 not every driver was updated.

This patch fixes crash while accessing MMC on
boards using Qualcomm SDHCI controller.

Quoted 8 lines

---
This patch fixes MMC support on dragonboard.

Without it attempts to access MMC caused null-pointer derefernece.

 drivers/mmc/msm_sdhci.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
#2 lore raw

PATCH 1/1 mmc: msm_sdhci: Set mmc->dev pointer in msm_sdc_probe()

In reply to Mateusz Kulikowski

Friendly poke, I would really like to see that in 2016.07 release as MMC is currently not working for dragonboard :(

Mateusz

Quoted 35 lines · Mateusz Kulikowski

MMC core expects (now) valid mmc->dev pointer.
During conversion in commit cffe5d86 not every driver was updated.

This patch fixes crash while accessing MMC on
boards using Qualcomm SDHCI controller.

---
This patch fixes MMC support on dragonboard.

Without it attempts to access MMC caused null-pointer derefernece.

 drivers/mmc/msm_sdhci.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/mmc/msm_sdhci.c +6 -1
index 64bbf0c..96dcdbe 100644
@@ -136,7 +136,12 @@ static int msm_sdc_probe(struct udevice *dev)
 	host->version = sdhci_readw(host, SDHCI_HOST_VERSION);
 
 	/* automatically detect max and min speed */
-	return add_sdhci(host, 0, 0);
+	ret =  add_sdhci(host, 0, 0);
+	if (ret)
+		return ret;
+	host->mmc->dev = dev;
+
+	return 0;
 }
 
 static int msm_sdc_remove(struct udevice *dev)
#3 lore raw
In reply to Mateusz Kulikowski
Quoted 8 lines · Mateusz Kulikowski

MMC core expects (now) valid mmc->dev pointer.
During conversion in commit cffe5d86 not every driver was updated.

This patch fixes crash while accessing MMC on
boards using Qualcomm SDHCI controller.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160708/4dec60b4/attachment.sig>