All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vagrant Cascadian <vagrant@debian.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/1] mmc: avoid division by zero in meson_mmc_config_clock
Date: Sat, 17 Mar 2018 17:03:49 -0700	[thread overview]
Message-ID: <87muz6i716.fsf@aikidev.net> (raw)
In-Reply-To: <20180317224936.2040-1-xypron.glpk@gmx.de>

On 2018-03-17, Heinrich Schuchardt wrote:
> The Odroid C2 fails to read from mmc with U-Boot v2018.03.
> The change avoids a division by zero.
>
> The fix was suggested by Jaehoon in
> https://lists.denx.de/pipermail/u-boot/2018-January/318577.html

Thanks!

Works for me with odroid-c2 on u-boot 2018.03.

Without the patch, mmc access immediately hangs the board.

Tested-by: Vagrant Cascadian <vagrant@debian.org>


live well,
  vagrant

> Reported-by: Vagrant Cascadian <vagrant@debian.org>
> Suggested-by: Jaehoon Chung <jh80.chung@samsung.com>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
> Resent due to missing cc u-boot at lists.denx.de.
> ---
>  drivers/mmc/meson_gx_mmc.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/mmc/meson_gx_mmc.c b/drivers/mmc/meson_gx_mmc.c
> index a2cd5d3a44..454593eec4 100644
> --- a/drivers/mmc/meson_gx_mmc.c
> +++ b/drivers/mmc/meson_gx_mmc.c
> @@ -35,6 +35,9 @@ static void meson_mmc_config_clock(struct mmc *mmc)
>  	uint32_t meson_mmc_clk = 0;
>  	unsigned int clk, clk_src, clk_div;
>  
> +	if (!mmc->clock)
> +		return;
> +
>  	/* 1GHz / CLK_MAX_DIV = 15,9 MHz */
>  	if (mmc->clock > 16000000) {
>  		clk = SD_EMMC_CLKSRC_DIV2;
> -- 
> 2.14.2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180317/7e04eb22/attachment.sig>

  reply	other threads:[~2018-03-18  0:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-17 22:49 [U-Boot] [PATCH 1/1] mmc: avoid division by zero in meson_mmc_config_clock Heinrich Schuchardt
2018-03-18  0:03 ` Vagrant Cascadian [this message]
2018-03-24 14:57   ` Heinrich Schuchardt
2018-04-10 16:01     ` [U-Boot] [PATCH 1/1] mmc: avoid division by zero in meson_mmc_config_clock - Please, consider for v2018.05-rc2 Heinrich Schuchardt
2018-04-11 14:39       ` Neil Armstrong
2018-04-11 14:39         ` Neil Armstrong
2018-04-23 14:29         ` Fwd: " Neil Armstrong
2018-04-23 14:29           ` [U-Boot] Fwd: " Neil Armstrong
2018-04-23 20:17 ` [U-Boot] [U-Boot, 1/1] mmc: avoid division by zero in meson_mmc_config_clock Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87muz6i716.fsf@aikidev.net \
    --to=vagrant@debian.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.