diff mbox

mmc: tegra: Disable UHS-I modes for tegra114

Message ID 1456479257-12147-1-git-send-email-jonathanh@nvidia.com
State Accepted, archived
Headers show

Commit Message

Jon Hunter Feb. 26, 2016, 9:34 a.m. UTC
SD card support for Tegra114 started failing after commit a8e326a911d3
("mmc: tegra: implement module external clock change") was merged. This
commit was part of a series to enable UHS-I modes for Tegra. To
workaround this problem for now, disable UHS-I modes for Tegra114 by
separating the soc data structures for Tegra114 and Tegra124 so that
UHS-I is still enabled for Tegra124 but not Tegra114.

Fixes: a8e326a911d3 ("mmc: tegra: implement module external clock change")

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
 drivers/mmc/host/sdhci-tegra.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

Comments

Jon Hunter Feb. 26, 2016, 9:35 a.m. UTC | #1
Sorry forgot to mark this as V2!

On 26/02/16 09:34, Jon Hunter wrote:
> SD card support for Tegra114 started failing after commit a8e326a911d3
> ("mmc: tegra: implement module external clock change") was merged. This
> commit was part of a series to enable UHS-I modes for Tegra. To
> workaround this problem for now, disable UHS-I modes for Tegra114 by
> separating the soc data structures for Tegra114 and Tegra124 so that
> UHS-I is still enabled for Tegra124 but not Tegra114.
> 
> Fixes: a8e326a911d3 ("mmc: tegra: implement module external clock change")
> 
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> ---
>  drivers/mmc/host/sdhci-tegra.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
> index 83c4bf7bc16c..212d51f08939 100644
> --- a/drivers/mmc/host/sdhci-tegra.c
> +++ b/drivers/mmc/host/sdhci-tegra.c
> @@ -147,10 +147,16 @@ static void tegra_sdhci_reset(struct sdhci_host *host, u8 mask)
>  	/* Advertise UHS modes as supported by host */
>  	if (soc_data->nvquirks & NVQUIRK_ENABLE_SDR50)
>  		misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDR50;
> +	else
> +		misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR50;
>  	if (soc_data->nvquirks & NVQUIRK_ENABLE_DDR50)
>  		misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_DDR50;
> +	else
> +		misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_DDR50;
>  	if (soc_data->nvquirks & NVQUIRK_ENABLE_SDR104)
>  		misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDR104;
> +	else
> +		misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR104;
>  	sdhci_writel(host, misc_ctrl, SDHCI_TEGRA_VENDOR_MISC_CTRL);
>  
>  	clk_ctrl = sdhci_readl(host, SDHCI_TEGRA_VENDOR_CLOCK_CTRL);
> @@ -335,6 +341,10 @@ static const struct sdhci_pltfm_data sdhci_tegra114_pdata = {
>  
>  static const struct sdhci_tegra_soc_data soc_data_tegra114 = {
>  	.pdata = &sdhci_tegra114_pdata,
> +};
> +
> +static const struct sdhci_tegra_soc_data soc_data_tegra124 = {
> +	.pdata = &sdhci_tegra114_pdata,
>  	.nvquirks = NVQUIRK_ENABLE_SDR50 |
>  		    NVQUIRK_ENABLE_DDR50 |
>  		    NVQUIRK_ENABLE_SDR104,
> @@ -357,7 +367,7 @@ static const struct sdhci_tegra_soc_data soc_data_tegra210 = {
>  
>  static const struct of_device_id sdhci_tegra_dt_match[] = {
>  	{ .compatible = "nvidia,tegra210-sdhci", .data = &soc_data_tegra210 },
> -	{ .compatible = "nvidia,tegra124-sdhci", .data = &soc_data_tegra114 },
> +	{ .compatible = "nvidia,tegra124-sdhci", .data = &soc_data_tegra124 },
>  	{ .compatible = "nvidia,tegra114-sdhci", .data = &soc_data_tegra114 },
>  	{ .compatible = "nvidia,tegra30-sdhci", .data = &soc_data_tegra30 },
>  	{ .compatible = "nvidia,tegra20-sdhci", .data = &soc_data_tegra20 },
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Lucas Stach Feb. 26, 2016, 5:47 p.m. UTC | #2
Am Freitag, den 26.02.2016, 09:34 +0000 schrieb Jon Hunter:
> SD card support for Tegra114 started failing after commit
> a8e326a911d3
> ("mmc: tegra: implement module external clock change") was merged.
> This
> commit was part of a series to enable UHS-I modes for Tegra. To
> workaround this problem for now, disable UHS-I modes for Tegra114 by
> separating the soc data structures for Tegra114 and Tegra124 so that
> UHS-I is still enabled for Tegra124 but not Tegra114.
> 
> Fixes: a8e326a911d3 ("mmc: tegra: implement module external clock
> change")
> 
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>

This looks good to me now,

Reviewed-by: Lucas Stach <dev@lynxeye.de>

> ---
>  drivers/mmc/host/sdhci-tegra.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-
> tegra.c
> index 83c4bf7bc16c..212d51f08939 100644
> --- a/drivers/mmc/host/sdhci-tegra.c
> +++ b/drivers/mmc/host/sdhci-tegra.c
> @@ -147,10 +147,16 @@ static void tegra_sdhci_reset(struct sdhci_host
> *host, u8 mask)
>  	/* Advertise UHS modes as supported by host */
>  	if (soc_data->nvquirks & NVQUIRK_ENABLE_SDR50)
>  		misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDR50;
> +	else
> +		misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR50;
>  	if (soc_data->nvquirks & NVQUIRK_ENABLE_DDR50)
>  		misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_DDR50;
> +	else
> +		misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_DDR50;
>  	if (soc_data->nvquirks & NVQUIRK_ENABLE_SDR104)
>  		misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDR104;
> +	else
> +		misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR104;
>  	sdhci_writel(host, misc_ctrl, SDHCI_TEGRA_VENDOR_MISC_CTRL);
>  
>  	clk_ctrl = sdhci_readl(host, SDHCI_TEGRA_VENDOR_CLOCK_CTRL);
> @@ -335,6 +341,10 @@ static const struct sdhci_pltfm_data
> sdhci_tegra114_pdata = {
>  
>  static const struct sdhci_tegra_soc_data soc_data_tegra114 = {
>  	.pdata = &sdhci_tegra114_pdata,
> +};
> +
> +static const struct sdhci_tegra_soc_data soc_data_tegra124 = {
> +	.pdata = &sdhci_tegra114_pdata,
>  	.nvquirks = NVQUIRK_ENABLE_SDR50 |
>  		    NVQUIRK_ENABLE_DDR50 |
>  		    NVQUIRK_ENABLE_SDR104,
> @@ -357,7 +367,7 @@ static const struct sdhci_tegra_soc_data
> soc_data_tegra210 = {
>  
>  static const struct of_device_id sdhci_tegra_dt_match[] = {
>  	{ .compatible = "nvidia,tegra210-sdhci", .data =
> &soc_data_tegra210 },
> -	{ .compatible = "nvidia,tegra124-sdhci", .data =
> &soc_data_tegra114 },
> +	{ .compatible = "nvidia,tegra124-sdhci", .data =
> &soc_data_tegra124 },
>  	{ .compatible = "nvidia,tegra114-sdhci", .data =
> &soc_data_tegra114 },
>  	{ .compatible = "nvidia,tegra30-sdhci", .data =
> &soc_data_tegra30 },
>  	{ .compatible = "nvidia,tegra20-sdhci", .data =
> &soc_data_tegra20 },
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Thierry Reding Feb. 29, 2016, 6:43 a.m. UTC | #3
On Fri, Feb 26, 2016 at 09:34:17AM +0000, Jon Hunter wrote:
> SD card support for Tegra114 started failing after commit a8e326a911d3
> ("mmc: tegra: implement module external clock change") was merged. This
> commit was part of a series to enable UHS-I modes for Tegra. To
> workaround this problem for now, disable UHS-I modes for Tegra114 by
> separating the soc data structures for Tegra114 and Tegra124 so that
> UHS-I is still enabled for Tegra124 but not Tegra114.
> 
> Fixes: a8e326a911d3 ("mmc: tegra: implement module external clock change")
> 
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> ---
>  drivers/mmc/host/sdhci-tegra.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)

Acked-by: Thierry Reding <treding@nvidia.com>
Adrian Hunter March 2, 2016, 1:50 p.m. UTC | #4
On 29/02/16 08:43, Thierry Reding wrote:
> On Fri, Feb 26, 2016 at 09:34:17AM +0000, Jon Hunter wrote:
>> SD card support for Tegra114 started failing after commit a8e326a911d3
>> ("mmc: tegra: implement module external clock change") was merged. This
>> commit was part of a series to enable UHS-I modes for Tegra. To
>> workaround this problem for now, disable UHS-I modes for Tegra114 by
>> separating the soc data structures for Tegra114 and Tegra124 so that
>> UHS-I is still enabled for Tegra124 but not Tegra114.
>>
>> Fixes: a8e326a911d3 ("mmc: tegra: implement module external clock change")
>>
>> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
>> ---
>>  drivers/mmc/host/sdhci-tegra.c | 12 +++++++++++-
>>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> Acked-by: Thierry Reding <treding@nvidia.com>
> 

Acked-by: Adrian Hunter <adrian.hunter@intel.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ulf Hansson March 4, 2016, 9:41 a.m. UTC | #5
On 26 February 2016 at 10:34, Jon Hunter <jonathanh@nvidia.com> wrote:
> SD card support for Tegra114 started failing after commit a8e326a911d3
> ("mmc: tegra: implement module external clock change") was merged. This
> commit was part of a series to enable UHS-I modes for Tegra. To
> workaround this problem for now, disable UHS-I modes for Tegra114 by
> separating the soc data structures for Tegra114 and Tegra124 so that
> UHS-I is still enabled for Tegra124 but not Tegra114.
>
> Fixes: a8e326a911d3 ("mmc: tegra: implement module external clock change")
>
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>

Thanks, applied for fixes!

Kind regards
Uffe

> ---
>  drivers/mmc/host/sdhci-tegra.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
> index 83c4bf7bc16c..212d51f08939 100644
> --- a/drivers/mmc/host/sdhci-tegra.c
> +++ b/drivers/mmc/host/sdhci-tegra.c
> @@ -147,10 +147,16 @@ static void tegra_sdhci_reset(struct sdhci_host *host, u8 mask)
>         /* Advertise UHS modes as supported by host */
>         if (soc_data->nvquirks & NVQUIRK_ENABLE_SDR50)
>                 misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDR50;
> +       else
> +               misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR50;
>         if (soc_data->nvquirks & NVQUIRK_ENABLE_DDR50)
>                 misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_DDR50;
> +       else
> +               misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_DDR50;
>         if (soc_data->nvquirks & NVQUIRK_ENABLE_SDR104)
>                 misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDR104;
> +       else
> +               misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR104;
>         sdhci_writel(host, misc_ctrl, SDHCI_TEGRA_VENDOR_MISC_CTRL);
>
>         clk_ctrl = sdhci_readl(host, SDHCI_TEGRA_VENDOR_CLOCK_CTRL);
> @@ -335,6 +341,10 @@ static const struct sdhci_pltfm_data sdhci_tegra114_pdata = {
>
>  static const struct sdhci_tegra_soc_data soc_data_tegra114 = {
>         .pdata = &sdhci_tegra114_pdata,
> +};
> +
> +static const struct sdhci_tegra_soc_data soc_data_tegra124 = {
> +       .pdata = &sdhci_tegra114_pdata,
>         .nvquirks = NVQUIRK_ENABLE_SDR50 |
>                     NVQUIRK_ENABLE_DDR50 |
>                     NVQUIRK_ENABLE_SDR104,
> @@ -357,7 +367,7 @@ static const struct sdhci_tegra_soc_data soc_data_tegra210 = {
>
>  static const struct of_device_id sdhci_tegra_dt_match[] = {
>         { .compatible = "nvidia,tegra210-sdhci", .data = &soc_data_tegra210 },
> -       { .compatible = "nvidia,tegra124-sdhci", .data = &soc_data_tegra114 },
> +       { .compatible = "nvidia,tegra124-sdhci", .data = &soc_data_tegra124 },
>         { .compatible = "nvidia,tegra114-sdhci", .data = &soc_data_tegra114 },
>         { .compatible = "nvidia,tegra30-sdhci", .data = &soc_data_tegra30 },
>         { .compatible = "nvidia,tegra20-sdhci", .data = &soc_data_tegra20 },
> --
> 2.1.4
>
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ulf Hansson March 16, 2016, 12:32 p.m. UTC | #6
On 4 March 2016 at 10:41, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> On 26 February 2016 at 10:34, Jon Hunter <jonathanh@nvidia.com> wrote:
>> SD card support for Tegra114 started failing after commit a8e326a911d3
>> ("mmc: tegra: implement module external clock change") was merged. This
>> commit was part of a series to enable UHS-I modes for Tegra. To
>> workaround this problem for now, disable UHS-I modes for Tegra114 by
>> separating the soc data structures for Tegra114 and Tegra124 so that
>> UHS-I is still enabled for Tegra124 but not Tegra114.
>>
>> Fixes: a8e326a911d3 ("mmc: tegra: implement module external clock change")
>>
>> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
>
> Thanks, applied for fixes!

Unfortunate I failed to send this in a PR to Linus within the 4.5 rc
cycle, apologize for the inconvenience!
Instead I have this queued for 4.6 and I have added a stable tag to it.

[...]

Kind regards
Uffe
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index 83c4bf7bc16c..212d51f08939 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -147,10 +147,16 @@  static void tegra_sdhci_reset(struct sdhci_host *host, u8 mask)
 	/* Advertise UHS modes as supported by host */
 	if (soc_data->nvquirks & NVQUIRK_ENABLE_SDR50)
 		misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDR50;
+	else
+		misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR50;
 	if (soc_data->nvquirks & NVQUIRK_ENABLE_DDR50)
 		misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_DDR50;
+	else
+		misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_DDR50;
 	if (soc_data->nvquirks & NVQUIRK_ENABLE_SDR104)
 		misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDR104;
+	else
+		misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR104;
 	sdhci_writel(host, misc_ctrl, SDHCI_TEGRA_VENDOR_MISC_CTRL);
 
 	clk_ctrl = sdhci_readl(host, SDHCI_TEGRA_VENDOR_CLOCK_CTRL);
@@ -335,6 +341,10 @@  static const struct sdhci_pltfm_data sdhci_tegra114_pdata = {
 
 static const struct sdhci_tegra_soc_data soc_data_tegra114 = {
 	.pdata = &sdhci_tegra114_pdata,
+};
+
+static const struct sdhci_tegra_soc_data soc_data_tegra124 = {
+	.pdata = &sdhci_tegra114_pdata,
 	.nvquirks = NVQUIRK_ENABLE_SDR50 |
 		    NVQUIRK_ENABLE_DDR50 |
 		    NVQUIRK_ENABLE_SDR104,
@@ -357,7 +367,7 @@  static const struct sdhci_tegra_soc_data soc_data_tegra210 = {
 
 static const struct of_device_id sdhci_tegra_dt_match[] = {
 	{ .compatible = "nvidia,tegra210-sdhci", .data = &soc_data_tegra210 },
-	{ .compatible = "nvidia,tegra124-sdhci", .data = &soc_data_tegra114 },
+	{ .compatible = "nvidia,tegra124-sdhci", .data = &soc_data_tegra124 },
 	{ .compatible = "nvidia,tegra114-sdhci", .data = &soc_data_tegra114 },
 	{ .compatible = "nvidia,tegra30-sdhci", .data = &soc_data_tegra30 },
 	{ .compatible = "nvidia,tegra20-sdhci", .data = &soc_data_tegra20 },