public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] mmc: msm_sdhci: Set mmc->dev pointer in msm_sdc_probe()
@ 2016-06-26 20:43 Mateusz Kulikowski
  2016-06-29  3:27 ` Simon Glass
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mateusz Kulikowski @ 2016-06-26 20:43 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
---
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(-)

diff --git a/drivers/mmc/msm_sdhci.c b/drivers/mmc/msm_sdhci.c
index 64bbf0c..96dcdbe 100644
--- a/drivers/mmc/msm_sdhci.c
+++ b/drivers/mmc/msm_sdhci.c
@@ -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)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] mmc: msm_sdhci: Set mmc->dev pointer in msm_sdc_probe()
  2016-06-26 20:43 [U-Boot] [PATCH] mmc: msm_sdhci: Set mmc->dev pointer in msm_sdc_probe() Mateusz Kulikowski
@ 2016-06-29  3:27 ` Simon Glass
  2016-07-05 20:38 ` Mateusz Kulikowski
  2016-07-08 13:57 ` [U-Boot] " Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Glass @ 2016-06-29  3:27 UTC (permalink / raw)
  To: u-boot

On 26 June 2016 at 13:43, Mateusz Kulikowski
<mateusz.kulikowski@gmail.com> wrote:
> 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.
>
> Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
> ---
> 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(-)

Acked-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] mmc: msm_sdhci: Set mmc->dev pointer in msm_sdc_probe()
  2016-06-26 20:43 [U-Boot] [PATCH] mmc: msm_sdhci: Set mmc->dev pointer in msm_sdc_probe() Mateusz Kulikowski
  2016-06-29  3:27 ` Simon Glass
@ 2016-07-05 20:38 ` Mateusz Kulikowski
  2016-07-08 13:57 ` [U-Boot] " Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Mateusz Kulikowski @ 2016-07-05 20:38 UTC (permalink / raw)
  To: u-boot

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

Mateusz
On 26.06.2016 22:43, Mateusz Kulikowski wrote:
> 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.
> 
> Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
> ---
> 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(-)
> 
> diff --git a/drivers/mmc/msm_sdhci.c b/drivers/mmc/msm_sdhci.c
> index 64bbf0c..96dcdbe 100644
> --- a/drivers/mmc/msm_sdhci.c
> +++ b/drivers/mmc/msm_sdhci.c
> @@ -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)
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] mmc: msm_sdhci: Set mmc->dev pointer in msm_sdc_probe()
  2016-06-26 20:43 [U-Boot] [PATCH] mmc: msm_sdhci: Set mmc->dev pointer in msm_sdc_probe() Mateusz Kulikowski
  2016-06-29  3:27 ` Simon Glass
  2016-07-05 20:38 ` Mateusz Kulikowski
@ 2016-07-08 13:57 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2016-07-08 13:57 UTC (permalink / raw)
  To: u-boot

On Sun, Jun 26, 2016 at 10:43:55PM +0200, Mateusz Kulikowski wrote:

> 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.
> 
> Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
> Acked-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
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>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-07-08 13:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-26 20:43 [U-Boot] [PATCH] mmc: msm_sdhci: Set mmc->dev pointer in msm_sdc_probe() Mateusz Kulikowski
2016-06-29  3:27 ` Simon Glass
2016-07-05 20:38 ` Mateusz Kulikowski
2016-07-08 13:57 ` [U-Boot] " Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox