linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci-of-arasan: Allow configuring zero tap values
@ 2020-11-10 17:42 Manish Narani
  2020-11-11  7:59 ` Michal Simek
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Manish Narani @ 2020-11-10 17:42 UTC (permalink / raw)
  To: michal.simek, adrian.hunter, ulf.hansson
  Cc: linux-arm-kernel, linux-mmc, linux-kernel, git, Manish Narani,
	Sai Krishna Potthuri

Allow configuring the Output and Input tap values with zero to avoid
failures in some cases (one of them is SD boot mode) where the output
and input tap values may be already set to non-zero.

Signed-off-by: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
Signed-off-by: Manish Narani <manish.narani@xilinx.com>
---
 drivers/mmc/host/sdhci-of-arasan.c | 40 ++++++------------------------
 1 file changed, 8 insertions(+), 32 deletions(-)

diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c
index 829ccef87426..100621e55427 100644
--- a/drivers/mmc/host/sdhci-of-arasan.c
+++ b/drivers/mmc/host/sdhci-of-arasan.c
@@ -600,14 +600,8 @@ static int sdhci_zynqmp_sdcardclk_set_phase(struct clk_hw *hw, int degrees)
 	u8 tap_delay, tap_max = 0;
 	int ret;
 
-	/*
-	 * This is applicable for SDHCI_SPEC_300 and above
-	 * ZynqMP does not set phase for <=25MHz clock.
-	 * If degrees is zero, no need to do anything.
-	 */
-	if (host->version < SDHCI_SPEC_300 ||
-	    host->timing == MMC_TIMING_LEGACY ||
-	    host->timing == MMC_TIMING_UHS_SDR12 || !degrees)
+	/* This is applicable for SDHCI_SPEC_300 and above */
+	if (host->version < SDHCI_SPEC_300)
 		return 0;
 
 	switch (host->timing) {
@@ -668,14 +662,8 @@ static int sdhci_zynqmp_sampleclk_set_phase(struct clk_hw *hw, int degrees)
 	u8 tap_delay, tap_max = 0;
 	int ret;
 
-	/*
-	 * This is applicable for SDHCI_SPEC_300 and above
-	 * ZynqMP does not set phase for <=25MHz clock.
-	 * If degrees is zero, no need to do anything.
-	 */
-	if (host->version < SDHCI_SPEC_300 ||
-	    host->timing == MMC_TIMING_LEGACY ||
-	    host->timing == MMC_TIMING_UHS_SDR12 || !degrees)
+	/* This is applicable for SDHCI_SPEC_300 and above */
+	if (host->version < SDHCI_SPEC_300)
 		return 0;
 
 	switch (host->timing) {
@@ -733,14 +721,8 @@ static int sdhci_versal_sdcardclk_set_phase(struct clk_hw *hw, int degrees)
 	struct sdhci_host *host = sdhci_arasan->host;
 	u8 tap_delay, tap_max = 0;
 
-	/*
-	 * This is applicable for SDHCI_SPEC_300 and above
-	 * Versal does not set phase for <=25MHz clock.
-	 * If degrees is zero, no need to do anything.
-	 */
-	if (host->version < SDHCI_SPEC_300 ||
-	    host->timing == MMC_TIMING_LEGACY ||
-	    host->timing == MMC_TIMING_UHS_SDR12 || !degrees)
+	/* This is applicable for SDHCI_SPEC_300 and above */
+	if (host->version < SDHCI_SPEC_300)
 		return 0;
 
 	switch (host->timing) {
@@ -804,14 +786,8 @@ static int sdhci_versal_sampleclk_set_phase(struct clk_hw *hw, int degrees)
 	struct sdhci_host *host = sdhci_arasan->host;
 	u8 tap_delay, tap_max = 0;
 
-	/*
-	 * This is applicable for SDHCI_SPEC_300 and above
-	 * Versal does not set phase for <=25MHz clock.
-	 * If degrees is zero, no need to do anything.
-	 */
-	if (host->version < SDHCI_SPEC_300 ||
-	    host->timing == MMC_TIMING_LEGACY ||
-	    host->timing == MMC_TIMING_UHS_SDR12 || !degrees)
+	/* This is applicable for SDHCI_SPEC_300 and above */
+	if (host->version < SDHCI_SPEC_300)
 		return 0;
 
 	switch (host->timing) {
-- 
2.17.1


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

* Re: [PATCH] mmc: sdhci-of-arasan: Allow configuring zero tap values
  2020-11-10 17:42 [PATCH] mmc: sdhci-of-arasan: Allow configuring zero tap values Manish Narani
@ 2020-11-11  7:59 ` Michal Simek
  2020-11-11  8:17   ` Michal Simek
  2020-11-16  7:50 ` Manish Narani
  2020-11-16  8:46 ` Manish Narani
  2 siblings, 1 reply; 5+ messages in thread
From: Michal Simek @ 2020-11-11  7:59 UTC (permalink / raw)
  To: Manish Narani, michal.simek, adrian.hunter, ulf.hansson
  Cc: linux-arm-kernel, linux-mmc, linux-kernel, git,
	Sai Krishna Potthuri, Marek Vasut

+Marek

On 10. 11. 20 18:42, Manish Narani wrote:
> Allow configuring the Output and Input tap values with zero to avoid
> failures in some cases (one of them is SD boot mode) where the output
> and input tap values may be already set to non-zero.
> 
> Signed-off-by: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
> Signed-off-by: Manish Narani <manish.narani@xilinx.com>
> ---
>  drivers/mmc/host/sdhci-of-arasan.c | 40 ++++++------------------------
>  1 file changed, 8 insertions(+), 32 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c
> index 829ccef87426..100621e55427 100644
> --- a/drivers/mmc/host/sdhci-of-arasan.c
> +++ b/drivers/mmc/host/sdhci-of-arasan.c
> @@ -600,14 +600,8 @@ static int sdhci_zynqmp_sdcardclk_set_phase(struct clk_hw *hw, int degrees)
>  	u8 tap_delay, tap_max = 0;
>  	int ret;
>  
> -	/*
> -	 * This is applicable for SDHCI_SPEC_300 and above
> -	 * ZynqMP does not set phase for <=25MHz clock.
> -	 * If degrees is zero, no need to do anything.
> -	 */
> -	if (host->version < SDHCI_SPEC_300 ||
> -	    host->timing == MMC_TIMING_LEGACY ||
> -	    host->timing == MMC_TIMING_UHS_SDR12 || !degrees)
> +	/* This is applicable for SDHCI_SPEC_300 and above */
> +	if (host->version < SDHCI_SPEC_300)
>  		return 0;
>  
>  	switch (host->timing) {
> @@ -668,14 +662,8 @@ static int sdhci_zynqmp_sampleclk_set_phase(struct clk_hw *hw, int degrees)
>  	u8 tap_delay, tap_max = 0;
>  	int ret;
>  
> -	/*
> -	 * This is applicable for SDHCI_SPEC_300 and above
> -	 * ZynqMP does not set phase for <=25MHz clock.
> -	 * If degrees is zero, no need to do anything.
> -	 */
> -	if (host->version < SDHCI_SPEC_300 ||
> -	    host->timing == MMC_TIMING_LEGACY ||
> -	    host->timing == MMC_TIMING_UHS_SDR12 || !degrees)
> +	/* This is applicable for SDHCI_SPEC_300 and above */
> +	if (host->version < SDHCI_SPEC_300)
>  		return 0;
>  
>  	switch (host->timing) {
> @@ -733,14 +721,8 @@ static int sdhci_versal_sdcardclk_set_phase(struct clk_hw *hw, int degrees)
>  	struct sdhci_host *host = sdhci_arasan->host;
>  	u8 tap_delay, tap_max = 0;
>  
> -	/*
> -	 * This is applicable for SDHCI_SPEC_300 and above
> -	 * Versal does not set phase for <=25MHz clock.
> -	 * If degrees is zero, no need to do anything.
> -	 */
> -	if (host->version < SDHCI_SPEC_300 ||
> -	    host->timing == MMC_TIMING_LEGACY ||
> -	    host->timing == MMC_TIMING_UHS_SDR12 || !degrees)
> +	/* This is applicable for SDHCI_SPEC_300 and above */
> +	if (host->version < SDHCI_SPEC_300)
>  		return 0;
>  
>  	switch (host->timing) {
> @@ -804,14 +786,8 @@ static int sdhci_versal_sampleclk_set_phase(struct clk_hw *hw, int degrees)
>  	struct sdhci_host *host = sdhci_arasan->host;
>  	u8 tap_delay, tap_max = 0;
>  
> -	/*
> -	 * This is applicable for SDHCI_SPEC_300 and above
> -	 * Versal does not set phase for <=25MHz clock.
> -	 * If degrees is zero, no need to do anything.
> -	 */
> -	if (host->version < SDHCI_SPEC_300 ||
> -	    host->timing == MMC_TIMING_LEGACY ||
> -	    host->timing == MMC_TIMING_UHS_SDR12 || !degrees)
> +	/* This is applicable for SDHCI_SPEC_300 and above */
> +	if (host->version < SDHCI_SPEC_300)
>  		return 0;
>  
>  	switch (host->timing) {
> 

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

* Re: [PATCH] mmc: sdhci-of-arasan: Allow configuring zero tap values
  2020-11-11  7:59 ` Michal Simek
@ 2020-11-11  8:17   ` Michal Simek
  0 siblings, 0 replies; 5+ messages in thread
From: Michal Simek @ 2020-11-11  8:17 UTC (permalink / raw)
  To: Michal Simek, Manish Narani, adrian.hunter, ulf.hansson
  Cc: linux-arm-kernel, linux-mmc, linux-kernel, git,
	Sai Krishna Potthuri, Marek Vasut



On 11. 11. 20 8:59, Michal Simek wrote:
> +Marek
> 
> On 10. 11. 20 18:42, Manish Narani wrote:
>> Allow configuring the Output and Input tap values with zero to avoid
>> failures in some cases (one of them is SD boot mode) where the output
>> and input tap values may be already set to non-zero.
>>
>> Signed-off-by: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
>> Signed-off-by: Manish Narani <manish.narani@xilinx.com>

Please add also fixed tag to get this to LTS kernel.

Thanks,
Michal

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

* RE: [PATCH] mmc: sdhci-of-arasan: Allow configuring zero tap values
  2020-11-10 17:42 [PATCH] mmc: sdhci-of-arasan: Allow configuring zero tap values Manish Narani
  2020-11-11  7:59 ` Michal Simek
@ 2020-11-16  7:50 ` Manish Narani
  2020-11-16  8:46 ` Manish Narani
  2 siblings, 0 replies; 5+ messages in thread
From: Manish Narani @ 2020-11-16  7:50 UTC (permalink / raw)
  To: Manish Narani, Michal Simek, adrian.hunter, ulf.hansson
  Cc: linux-arm-kernel, linux-mmc, linux-kernel, git, Sai Krishna Potthuri

Hi,

> -----Original Message-----
> From: Manish Narani <manish.narani@xilinx.com>
> Sent: Tuesday, November 10, 2020 11:12 PM
> To: Michal Simek <michals@xilinx.com>; adrian.hunter@intel.com;
> ulf.hansson@linaro.org
> Cc: linux-arm-kernel@lists.infradead.org; linux-mmc@vger.kernel.org; linux-
> kernel@vger.kernel.org; git <git@xilinx.com>; Manish Narani
> <MNARANI@xilinx.com>; Sai Krishna Potthuri <lakshmis@xilinx.com>
> Subject: [PATCH] mmc: sdhci-of-arasan: Allow configuring zero tap values
> 
> Allow configuring the Output and Input tap values with zero to avoid
> failures in some cases (one of them is SD boot mode) where the output
> and input tap values may be already set to non-zero.
> 

Fixes: a5c8b2ae2e51 ("mmc: sdhci-of-arasan: Add support for ZynqMP Platform Tap Delays Setup")

> Signed-off-by: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
> Signed-off-by: Manish Narani <manish.narani@xilinx.com>
> ---
>  drivers/mmc/host/sdhci-of-arasan.c | 40 ++++++------------------------
>  1 file changed, 8 insertions(+), 32 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-
> of-arasan.c
> index 829ccef87426..100621e55427 100644
> --- a/drivers/mmc/host/sdhci-of-arasan.c
> +++ b/drivers/mmc/host/sdhci-of-arasan.c
> @@ -600,14 +600,8 @@ static int sdhci_zynqmp_sdcardclk_set_phase(struct
> clk_hw *hw, int degrees)
>  	u8 tap_delay, tap_max = 0;
>  	int ret;
> 
> -	/*
> -	 * This is applicable for SDHCI_SPEC_300 and above
> -	 * ZynqMP does not set phase for <=25MHz clock.
> -	 * If degrees is zero, no need to do anything.
> -	 */
> -	if (host->version < SDHCI_SPEC_300 ||
> -	    host->timing == MMC_TIMING_LEGACY ||
> -	    host->timing == MMC_TIMING_UHS_SDR12 || !degrees)
> +	/* This is applicable for SDHCI_SPEC_300 and above */
> +	if (host->version < SDHCI_SPEC_300)
>  		return 0;
> 
>  	switch (host->timing) {
> @@ -668,14 +662,8 @@ static int
> sdhci_zynqmp_sampleclk_set_phase(struct clk_hw *hw, int degrees)
>  	u8 tap_delay, tap_max = 0;
>  	int ret;
> 
> -	/*
> -	 * This is applicable for SDHCI_SPEC_300 and above
> -	 * ZynqMP does not set phase for <=25MHz clock.
> -	 * If degrees is zero, no need to do anything.
> -	 */
> -	if (host->version < SDHCI_SPEC_300 ||
> -	    host->timing == MMC_TIMING_LEGACY ||
> -	    host->timing == MMC_TIMING_UHS_SDR12 || !degrees)
> +	/* This is applicable for SDHCI_SPEC_300 and above */
> +	if (host->version < SDHCI_SPEC_300)
>  		return 0;
> 
>  	switch (host->timing) {
> @@ -733,14 +721,8 @@ static int sdhci_versal_sdcardclk_set_phase(struct
> clk_hw *hw, int degrees)
>  	struct sdhci_host *host = sdhci_arasan->host;
>  	u8 tap_delay, tap_max = 0;
> 
> -	/*
> -	 * This is applicable for SDHCI_SPEC_300 and above
> -	 * Versal does not set phase for <=25MHz clock.
> -	 * If degrees is zero, no need to do anything.
> -	 */
> -	if (host->version < SDHCI_SPEC_300 ||
> -	    host->timing == MMC_TIMING_LEGACY ||
> -	    host->timing == MMC_TIMING_UHS_SDR12 || !degrees)
> +	/* This is applicable for SDHCI_SPEC_300 and above */
> +	if (host->version < SDHCI_SPEC_300)
>  		return 0;
> 
>  	switch (host->timing) {
> @@ -804,14 +786,8 @@ static int sdhci_versal_sampleclk_set_phase(struct
> clk_hw *hw, int degrees)
>  	struct sdhci_host *host = sdhci_arasan->host;
>  	u8 tap_delay, tap_max = 0;
> 
> -	/*
> -	 * This is applicable for SDHCI_SPEC_300 and above
> -	 * Versal does not set phase for <=25MHz clock.
> -	 * If degrees is zero, no need to do anything.
> -	 */
> -	if (host->version < SDHCI_SPEC_300 ||
> -	    host->timing == MMC_TIMING_LEGACY ||
> -	    host->timing == MMC_TIMING_UHS_SDR12 || !degrees)
> +	/* This is applicable for SDHCI_SPEC_300 and above */
> +	if (host->version < SDHCI_SPEC_300)
>  		return 0;
> 
>  	switch (host->timing) {
> --
> 2.17.1

Thanks,
Manish

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

* RE: [PATCH] mmc: sdhci-of-arasan: Allow configuring zero tap values
  2020-11-10 17:42 [PATCH] mmc: sdhci-of-arasan: Allow configuring zero tap values Manish Narani
  2020-11-11  7:59 ` Michal Simek
  2020-11-16  7:50 ` Manish Narani
@ 2020-11-16  8:46 ` Manish Narani
  2 siblings, 0 replies; 5+ messages in thread
From: Manish Narani @ 2020-11-16  8:46 UTC (permalink / raw)
  To: Manish Narani, Michal Simek, adrian.hunter, ulf.hansson
  Cc: linux-arm-kernel, linux-mmc, linux-kernel, git, Sai Krishna Potthuri

Hi,

> -----Original Message-----
> From: Manish Narani <manish.narani@xilinx.com>
> Sent: Tuesday, November 10, 2020 11:12 PM
> To: Michal Simek <michals@xilinx.com>; adrian.hunter@intel.com;
> ulf.hansson@linaro.org
> Cc: linux-arm-kernel@lists.infradead.org; linux-mmc@vger.kernel.org; linux-
> kernel@vger.kernel.org; git <git@xilinx.com>; Manish Narani
> <MNARANI@xilinx.com>; Sai Krishna Potthuri <lakshmis@xilinx.com>
> Subject: [PATCH] mmc: sdhci-of-arasan: Allow configuring zero tap values
> 
> Allow configuring the Output and Input tap values with zero to avoid
> failures in some cases (one of them is SD boot mode) where the output
> and input tap values may be already set to non-zero.
> 
> Signed-off-by: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
> Signed-off-by: Manish Narani <manish.narani@xilinx.com>
> ---
>  drivers/mmc/host/sdhci-of-arasan.c | 40 ++++++------------------------
>  1 file changed, 8 insertions(+), 32 deletions(-)
> 

This patch, with "Fixes" tag added in commit, is included along with the
v2 patch series for couple of bug fixes in https://lkml.org/lkml/2020/11/16/142 .
Please review this patch series.

Thanks,
Manish

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

end of thread, other threads:[~2020-11-16  9:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-10 17:42 [PATCH] mmc: sdhci-of-arasan: Allow configuring zero tap values Manish Narani
2020-11-11  7:59 ` Michal Simek
2020-11-11  8:17   ` Michal Simek
2020-11-16  7:50 ` Manish Narani
2020-11-16  8:46 ` Manish Narani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).