All of lore.kernel.org
 help / color / mirror / Atom feed
From: khilman@baylibre.com (Kevin Hilman)
To: linus-amlogic@lists.infradead.org
Subject: [PATCH v3 10/10] mmc: meson-gx: replace magic timeout numbers with constants
Date: Mon, 27 Feb 2017 19:07:41 -0800	[thread overview]
Message-ID: <m2poi3108y.fsf@baylibre.com> (raw)
In-Reply-To: <8dadc1fd-2612-48d4-f265-95501c83a124@gmail.com> (Heiner Kallweit's message of "Sat, 18 Feb 2017 14:26:04 +0100")

Heiner Kallweit <hkallweit1@gmail.com> writes:

> Replace timeout magic numbers with proper constants.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Acked-by: Kevin Hilman <khilman@baylibre.com>

> ---
> v3:
> - added to patch series
> ---
>  drivers/mmc/host/meson-gx-mmc.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
> index 5281014e..f244fcf9 100644
> --- a/drivers/mmc/host/meson-gx-mmc.c
> +++ b/drivers/mmc/host/meson-gx-mmc.c
> @@ -116,6 +116,8 @@
>  
>  #define SD_EMMC_CFG_BLK_SIZE 512 /* internal buffer max: 512 bytes */
>  #define SD_EMMC_CFG_RESP_TIMEOUT 256 /* in clock cycles */
> +#define SD_EMMC_CMD_TIMEOUT 1024 /* in ms */
> +#define SD_EMMC_CMD_TIMEOUT_DATA 4096 /* in ms */
>  #define SD_EMMC_CFG_CMD_GAP 16 /* in clock cycles */
>  #define MUX_CLK_NUM_PARENTS 2
>  
> @@ -498,10 +500,10 @@ static void meson_mmc_start_cmd(struct mmc_host *mmc, struct mmc_command *cmd)
>  
>  		desc->cmd_data = host->bounce_dma_addr & CMD_DATA_MASK;
>  
> -		cmd_cfg_timeout = 12;
> +		cmd_cfg_timeout = ilog2(SD_EMMC_CMD_TIMEOUT_DATA);
>  	} else {
>  		desc->cmd_cfg &= ~CMD_CFG_DATA_IO;
> -		cmd_cfg_timeout = 10;
> +		cmd_cfg_timeout = ilog2(SD_EMMC_CMD_TIMEOUT);
>  	}
>  	desc->cmd_cfg |= (cmd_cfg_timeout & CMD_CFG_TIMEOUT_MASK) <<
>  		CMD_CFG_TIMEOUT_SHIFT;

WARNING: multiple messages have this Message-ID (diff)
From: Kevin Hilman <khilman@baylibre.com>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	linux-amlogic@lists.infradead.org
Subject: Re: [PATCH v3 10/10] mmc: meson-gx: replace magic timeout numbers with constants
Date: Mon, 27 Feb 2017 19:07:41 -0800	[thread overview]
Message-ID: <m2poi3108y.fsf@baylibre.com> (raw)
In-Reply-To: <8dadc1fd-2612-48d4-f265-95501c83a124@gmail.com> (Heiner Kallweit's message of "Sat, 18 Feb 2017 14:26:04 +0100")

Heiner Kallweit <hkallweit1@gmail.com> writes:

> Replace timeout magic numbers with proper constants.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Acked-by: Kevin Hilman <khilman@baylibre.com>

> ---
> v3:
> - added to patch series
> ---
>  drivers/mmc/host/meson-gx-mmc.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
> index 5281014e..f244fcf9 100644
> --- a/drivers/mmc/host/meson-gx-mmc.c
> +++ b/drivers/mmc/host/meson-gx-mmc.c
> @@ -116,6 +116,8 @@
>  
>  #define SD_EMMC_CFG_BLK_SIZE 512 /* internal buffer max: 512 bytes */
>  #define SD_EMMC_CFG_RESP_TIMEOUT 256 /* in clock cycles */
> +#define SD_EMMC_CMD_TIMEOUT 1024 /* in ms */
> +#define SD_EMMC_CMD_TIMEOUT_DATA 4096 /* in ms */
>  #define SD_EMMC_CFG_CMD_GAP 16 /* in clock cycles */
>  #define MUX_CLK_NUM_PARENTS 2
>  
> @@ -498,10 +500,10 @@ static void meson_mmc_start_cmd(struct mmc_host *mmc, struct mmc_command *cmd)
>  
>  		desc->cmd_data = host->bounce_dma_addr & CMD_DATA_MASK;
>  
> -		cmd_cfg_timeout = 12;
> +		cmd_cfg_timeout = ilog2(SD_EMMC_CMD_TIMEOUT_DATA);
>  	} else {
>  		desc->cmd_cfg &= ~CMD_CFG_DATA_IO;
> -		cmd_cfg_timeout = 10;
> +		cmd_cfg_timeout = ilog2(SD_EMMC_CMD_TIMEOUT);
>  	}
>  	desc->cmd_cfg |= (cmd_cfg_timeout & CMD_CFG_TIMEOUT_MASK) <<
>  		CMD_CFG_TIMEOUT_SHIFT;

  reply	other threads:[~2017-02-28  3:07 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-18 11:50 [PATCH v3 1/10] mmc: meson-gx: simplify bounce buffer setting in meson_mmc_start_cmd Heiner Kallweit
2017-02-18 11:50 ` Heiner Kallweit
2017-02-18 13:06 ` [PATCH v3 2/10] mmc: meson-gx: make two functions return void Heiner Kallweit
2017-02-18 13:06   ` Heiner Kallweit
2017-02-18 13:07 ` [PATCH v3 3/10] mmc: meson-gx: remove unused members irq, ocr_mask from struct meson_host Heiner Kallweit
2017-02-18 13:07   ` Heiner Kallweit
2017-02-18 13:08 ` [PATCH v3 4/10] mmc: meson-gx: remove unneeded variable in meson_mmc_clk_init Heiner Kallweit
2017-02-18 13:08   ` Heiner Kallweit
2017-02-18 13:09 ` [PATCH v3 5/10] mmc: meson-gx: remove member parent_mux from struct meson_host Heiner Kallweit
2017-02-18 13:09   ` Heiner Kallweit
2017-02-18 13:19 ` [PATCH v3 6/10] mmc: meson-gx: fix error path in meson_mmc_clk_init / meson_mmc_probe Heiner Kallweit
2017-02-18 13:19   ` Heiner Kallweit
2017-02-18 13:57   ` Michał Zegan
2017-02-18 13:57     ` Michał Zegan
2017-02-18 15:22     ` Heiner Kallweit
2017-02-18 15:22       ` Heiner Kallweit
2017-02-18 15:30       ` Michał Zegan
2017-02-18 15:30         ` Michał Zegan
2017-02-28  3:06   ` Kevin Hilman
2017-02-28  3:06     ` Kevin Hilman
2017-02-18 13:20 ` [PATCH v3 7/10] mmc: meson-gx: remove unneeded devm_kstrdup in meson_mmc_clk_init Heiner Kallweit
2017-02-18 13:20   ` Heiner Kallweit
2017-02-18 13:22 ` [PATCH v3 8/10] mmc: meson-gx: improve initial configuration Heiner Kallweit
2017-02-18 13:22   ` Heiner Kallweit
2017-02-18 13:23 ` [PATCH v3 9/10] mmc: meson-gx: remove member mrq from struct meson_host Heiner Kallweit
2017-02-18 13:23   ` Heiner Kallweit
2017-02-18 13:26 ` [PATCH v3 10/10] mmc: meson-gx: replace magic timeout numbers with constants Heiner Kallweit
2017-02-18 13:26   ` Heiner Kallweit
2017-02-28  3:07   ` Kevin Hilman [this message]
2017-02-28  3:07     ` Kevin Hilman
2017-03-01 18:09 ` [PATCH v3 1/10] mmc: meson-gx: simplify bounce buffer setting in meson_mmc_start_cmd Kevin Hilman
2017-03-01 18:09   ` Kevin Hilman
2017-03-01 20:20   ` Heiner Kallweit
2017-03-01 20:20     ` Heiner Kallweit
2017-03-03 18:17     ` Kevin Hilman
2017-03-03 18:17       ` Kevin Hilman

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=m2poi3108y.fsf@baylibre.com \
    --to=khilman@baylibre.com \
    --cc=linus-amlogic@lists.infradead.org \
    /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.