diff mbox series

[2/4] mmc: sdhci-omap: Add variable to indicate host is tuning

Message ID 20181119111618.2745-3-faiz_abbas@ti.com (mailing list archive)
State New, archived
Headers show
Series Tuning Fixes for sdhci-omap | expand

Commit Message

Faiz Abbas Nov. 19, 2018, 11:16 a.m. UTC
Add a variable in sdhc_omap_host to indicate whether a tuning
operation is ongoing.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
---
 drivers/mmc/host/sdhci-omap.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Ulf Hansson Nov. 19, 2018, 1:18 p.m. UTC | #1
On 19 November 2018 at 12:16, Faiz Abbas <faiz_abbas@ti.com> wrote:
> Add a variable in sdhc_omap_host to indicate whether a tuning
> operation is ongoing.
>
> Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>

Please squash this into patch3 as it seems a bit silly to keep this a
separate change.

Kind regards
Uffe

> ---
>  drivers/mmc/host/sdhci-omap.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c
> index 87138067e334..cfffcf58be3f 100644
> --- a/drivers/mmc/host/sdhci-omap.c
> +++ b/drivers/mmc/host/sdhci-omap.c
> @@ -115,6 +115,7 @@ struct sdhci_omap_host {
>
>         struct pinctrl          *pinctrl;
>         struct pinctrl_state    **pinctrl_state;
> +       bool                    is_tuning;
>  };
>
>  static void sdhci_omap_start_clock(struct sdhci_omap_host *omap_host);
> @@ -318,6 +319,8 @@ static int sdhci_omap_execute_tuning(struct mmc_host *mmc, u32 opcode)
>          */
>         host->ier &= ~SDHCI_INT_DATA_CRC;
>
> +       omap_host->is_tuning = true;
> +
>         while (phase_delay <= MAX_PHASE_DELAY) {
>                 sdhci_omap_set_dll(omap_host, phase_delay);
>
> @@ -355,9 +358,12 @@ static int sdhci_omap_execute_tuning(struct mmc_host *mmc, u32 opcode)
>         phase_delay = max_window + 4 * (max_len >> 1);
>         sdhci_omap_set_dll(omap_host, phase_delay);
>
> +       omap_host->is_tuning = false;
> +
>         goto ret;
>
>  tuning_error:
> +       omap_host->is_tuning = false;
>         dev_err(dev, "Tuning failed\n");
>         sdhci_omap_disable_tuning(omap_host);
>
> --
> 2.19.1
>
Faiz Abbas Nov. 20, 2018, 12:58 p.m. UTC | #2
Hi Uffe,

On 19/11/18 6:48 PM, Ulf Hansson wrote:
> On 19 November 2018 at 12:16, Faiz Abbas <faiz_abbas@ti.com> wrote:
>> Add a variable in sdhc_omap_host to indicate whether a tuning
>> operation is ongoing.
>>
>> Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
> 
> Please squash this into patch3 as it seems a bit silly to keep this a
> separate change.
> 

Ok. Squashing 2 and 3.

Thanks,
Faiz
diff mbox series

Patch

diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c
index 87138067e334..cfffcf58be3f 100644
--- a/drivers/mmc/host/sdhci-omap.c
+++ b/drivers/mmc/host/sdhci-omap.c
@@ -115,6 +115,7 @@  struct sdhci_omap_host {
 
 	struct pinctrl		*pinctrl;
 	struct pinctrl_state	**pinctrl_state;
+	bool			is_tuning;
 };
 
 static void sdhci_omap_start_clock(struct sdhci_omap_host *omap_host);
@@ -318,6 +319,8 @@  static int sdhci_omap_execute_tuning(struct mmc_host *mmc, u32 opcode)
 	 */
 	host->ier &= ~SDHCI_INT_DATA_CRC;
 
+	omap_host->is_tuning = true;
+
 	while (phase_delay <= MAX_PHASE_DELAY) {
 		sdhci_omap_set_dll(omap_host, phase_delay);
 
@@ -355,9 +358,12 @@  static int sdhci_omap_execute_tuning(struct mmc_host *mmc, u32 opcode)
 	phase_delay = max_window + 4 * (max_len >> 1);
 	sdhci_omap_set_dll(omap_host, phase_delay);
 
+	omap_host->is_tuning = false;
+
 	goto ret;
 
 tuning_error:
+	omap_host->is_tuning = false;
 	dev_err(dev, "Tuning failed\n");
 	sdhci_omap_disable_tuning(omap_host);