All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mmc: fix switch issue with send_status disabled
@ 2021-08-17  9:20 ` Ye Li
  2021-08-17  9:20   ` [PATCH 2/2] mmc: fix device_remove when HS400_ES is enabled Ye Li
  2021-08-28  4:51   ` [PATCH 1/2] mmc: fix switch issue with send_status disabled Jaehoon Chung
  0 siblings, 2 replies; 4+ messages in thread
From: Ye Li @ 2021-08-17  9:20 UTC (permalink / raw)
  To: jh80.chung, u-boot, peng.fan; +Cc: uboot-imx

When send_status is false or wait_dat0 is not supported, the switch
function should not send CMD13 but directly return.

Signed-off-by: Ye Li <ye.li@nxp.com>
---
 drivers/mmc/mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 8078a89..a1fd533 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -823,7 +823,7 @@ static int __mmc_switch(struct mmc *mmc, u8 set, u8 index, u8 value,
 	 * capable of polling by using mmc_wait_dat0, then rely on waiting the
 	 * stated timeout to be sufficient.
 	 */
-	if (ret == -ENOSYS && !send_status) {
+	if (ret == -ENOSYS || !send_status) {
 		mdelay(timeout_ms);
 		return 0;
 	}
-- 
2.7.4


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

* [PATCH 2/2] mmc: fix device_remove when HS400_ES is enabled
  2021-08-17  9:20 ` [PATCH 1/2] mmc: fix switch issue with send_status disabled Ye Li
@ 2021-08-17  9:20   ` Ye Li
  2021-08-28  5:02     ` Jaehoon Chung
  2021-08-28  4:51   ` [PATCH 1/2] mmc: fix switch issue with send_status disabled Jaehoon Chung
  1 sibling, 1 reply; 4+ messages in thread
From: Ye Li @ 2021-08-17  9:20 UTC (permalink / raw)
  To: jh80.chung, u-boot, peng.fan; +Cc: uboot-imx

HS400_ES is missed when down grade to HS mode during
device_remove the mmc device

Signed-off-by: Ye Li <ye.li@nxp.com>
---
 drivers/mmc/mmc.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index a1fd533..3cb6fda 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -2092,14 +2092,16 @@ static int mmc_select_mode_and_width(struct mmc *mmc, uint card_caps)
 	}
 
 #if CONFIG_IS_ENABLED(MMC_HS200_SUPPORT) || \
-    CONFIG_IS_ENABLED(MMC_HS400_SUPPORT)
+    CONFIG_IS_ENABLED(MMC_HS400_SUPPORT) || \
+    CONFIG_IS_ENABLED(MMC_HS400_ES_SUPPORT)
 	/*
 	 * In case the eMMC is in HS200/HS400 mode, downgrade to HS mode
 	 * before doing anything else, since a transition from either of
 	 * the HS200/HS400 mode directly to legacy mode is not supported.
 	 */
 	if (mmc->selected_mode == MMC_HS_200 ||
-	    mmc->selected_mode == MMC_HS_400)
+	    mmc->selected_mode == MMC_HS_400 ||
+	    mmc->selected_mode == MMC_HS_400_ES)
 		mmc_set_card_speed(mmc, MMC_HS, true);
 	else
 #endif
@@ -2952,7 +2954,7 @@ int mmc_deinit(struct mmc *mmc)
 		return sd_select_mode_and_width(mmc, caps_filtered);
 	} else {
 		caps_filtered = mmc->card_caps &
-			~(MMC_CAP(MMC_HS_200) | MMC_CAP(MMC_HS_400));
+			~(MMC_CAP(MMC_HS_200) | MMC_CAP(MMC_HS_400) | MMC_CAP(MMC_HS_400_ES));
 
 		return mmc_select_mode_and_width(mmc, caps_filtered);
 	}
-- 
2.7.4


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

* Re: [PATCH 1/2] mmc: fix switch issue with send_status disabled
  2021-08-17  9:20 ` [PATCH 1/2] mmc: fix switch issue with send_status disabled Ye Li
  2021-08-17  9:20   ` [PATCH 2/2] mmc: fix device_remove when HS400_ES is enabled Ye Li
@ 2021-08-28  4:51   ` Jaehoon Chung
  1 sibling, 0 replies; 4+ messages in thread
From: Jaehoon Chung @ 2021-08-28  4:51 UTC (permalink / raw)
  To: Ye Li, u-boot, peng.fan; +Cc: uboot-imx

On 8/17/21 6:20 PM, Ye Li wrote:
> When send_status is false or wait_dat0 is not supported, the switch
> function should not send CMD13 but directly return.
> 
> Signed-off-by: Ye Li <ye.li@nxp.com>

Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>

Best Regards,
Jaehoon Chung

> ---
>  drivers/mmc/mmc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index 8078a89..a1fd533 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -823,7 +823,7 @@ static int __mmc_switch(struct mmc *mmc, u8 set, u8 index, u8 value,
>  	 * capable of polling by using mmc_wait_dat0, then rely on waiting the
>  	 * stated timeout to be sufficient.
>  	 */
> -	if (ret == -ENOSYS && !send_status) {
> +	if (ret == -ENOSYS || !send_status) {
>  		mdelay(timeout_ms);
>  		return 0;
>  	}
> 


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

* Re: [PATCH 2/2] mmc: fix device_remove when HS400_ES is enabled
  2021-08-17  9:20   ` [PATCH 2/2] mmc: fix device_remove when HS400_ES is enabled Ye Li
@ 2021-08-28  5:02     ` Jaehoon Chung
  0 siblings, 0 replies; 4+ messages in thread
From: Jaehoon Chung @ 2021-08-28  5:02 UTC (permalink / raw)
  To: Ye Li, u-boot, peng.fan; +Cc: uboot-imx

On 8/17/21 6:20 PM, Ye Li wrote:
> HS400_ES is missed when down grade to HS mode during
> device_remove the mmc device
> 
> Signed-off-by: Ye Li <ye.li@nxp.com>

Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>

Best Regards,
Jaehoon Chung

> ---
>  drivers/mmc/mmc.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index a1fd533..3cb6fda 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -2092,14 +2092,16 @@ static int mmc_select_mode_and_width(struct mmc *mmc, uint card_caps)
>  	}
>  
>  #if CONFIG_IS_ENABLED(MMC_HS200_SUPPORT) || \
> -    CONFIG_IS_ENABLED(MMC_HS400_SUPPORT)
> +    CONFIG_IS_ENABLED(MMC_HS400_SUPPORT) || \
> +    CONFIG_IS_ENABLED(MMC_HS400_ES_SUPPORT)
>  	/*
>  	 * In case the eMMC is in HS200/HS400 mode, downgrade to HS mode
>  	 * before doing anything else, since a transition from either of
>  	 * the HS200/HS400 mode directly to legacy mode is not supported.
>  	 */
>  	if (mmc->selected_mode == MMC_HS_200 ||
> -	    mmc->selected_mode == MMC_HS_400)
> +	    mmc->selected_mode == MMC_HS_400 ||
> +	    mmc->selected_mode == MMC_HS_400_ES)
>  		mmc_set_card_speed(mmc, MMC_HS, true);
>  	else
>  #endif
> @@ -2952,7 +2954,7 @@ int mmc_deinit(struct mmc *mmc)
>  		return sd_select_mode_and_width(mmc, caps_filtered);
>  	} else {
>  		caps_filtered = mmc->card_caps &
> -			~(MMC_CAP(MMC_HS_200) | MMC_CAP(MMC_HS_400));
> +			~(MMC_CAP(MMC_HS_200) | MMC_CAP(MMC_HS_400) | MMC_CAP(MMC_HS_400_ES));
>  
>  		return mmc_select_mode_and_width(mmc, caps_filtered);
>  	}
> 


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

end of thread, other threads:[~2021-08-28  5:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20210817092102epcas1p3ec909faf887173dd86b381785c0a94fb@epcas1p3.samsung.com>
2021-08-17  9:20 ` [PATCH 1/2] mmc: fix switch issue with send_status disabled Ye Li
2021-08-17  9:20   ` [PATCH 2/2] mmc: fix device_remove when HS400_ES is enabled Ye Li
2021-08-28  5:02     ` Jaehoon Chung
2021-08-28  4:51   ` [PATCH 1/2] mmc: fix switch issue with send_status disabled Jaehoon Chung

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.