public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] drivers: mmc: check the return value of mmc_send_if_cond() call
@ 2022-10-21  7:16 ` Matt Ranostay
  2022-10-21  9:07   ` 정재훈
  0 siblings, 1 reply; 3+ messages in thread
From: Matt Ranostay @ 2022-10-21  7:16 UTC (permalink / raw)
  To: peng.fan, jh80.chung; +Cc: u-boot, Matt Ranostay

Return value from mmc_send_if_cond() isn't checked if it is a error state
and the result immediately is overwritten with the sd_send_op_cond() call.

Add check for -EOPNOTSUPP to fail early, and trigger a retry for any other
error code.

Fixes: afd5932b2c27 ("Revert "mmc: retry the cmd8 to meet 74 clocks requirement in the spec")
Signed-off-by: Matt Ranostay <mranostay@ti.com>
---
 drivers/mmc/mmc.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 0b7c0be8cbc..e26a457a74c 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -2862,6 +2862,13 @@ retry:
 
 	/* Test for SD version 2 */
 	err = mmc_send_if_cond(mmc);
+	if (err == -EOPNOTSUPP)
+		return err;
+
+	if (err) {
+		mmc_power_cycle(mmc);
+		goto retry;
+	}
 
 	/* Now try to get the SD card's operating condition */
 	err = sd_send_op_cond(mmc, uhs_en);
-- 
2.38.GIT


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

* RE: [PATCH] drivers: mmc: check the return value of mmc_send_if_cond() call
  2022-10-21  7:16 ` [PATCH] drivers: mmc: check the return value of mmc_send_if_cond() call Matt Ranostay
@ 2022-10-21  9:07   ` 정재훈
  2022-10-24 10:54     ` Jaehoon Chung
  0 siblings, 1 reply; 3+ messages in thread
From: 정재훈 @ 2022-10-21  9:07 UTC (permalink / raw)
  To: 'Matt Ranostay', peng.fan; +Cc: u-boot


> -----Original Message-----
> From: Matt Ranostay [mailto:mranostay@ti.com]
> Sent: Friday, October 21, 2022 4:16 PM
> To: peng.fan@nxp.com; jh80.chung@samsung.com
> Cc: u-boot@lists.denx.de; Matt Ranostay <mranostay@ti.com>
> Subject: [PATCH] drivers: mmc: check the return value of mmc_send_if_cond() call
> 
> Return value from mmc_send_if_cond() isn't checked if it is a error state
> and the result immediately is overwritten with the sd_send_op_cond() call.
> 
> Add check for -EOPNOTSUPP to fail early, and trigger a retry for any other
> error code.
> 
> Fixes: afd5932b2c27 ("Revert "mmc: retry the cmd8 to meet 74 clocks requirement in the spec")
> Signed-off-by: Matt Ranostay <mranostay@ti.com>

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

Best Regards,
Jaehoon Chung

> ---
>  drivers/mmc/mmc.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index 0b7c0be8cbc..e26a457a74c 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -2862,6 +2862,13 @@ retry:
> 
>  	/* Test for SD version 2 */
>  	err = mmc_send_if_cond(mmc);
> +	if (err == -EOPNOTSUPP)
> +		return err;
> +
> +	if (err) {
> +		mmc_power_cycle(mmc);
> +		goto retry;
> +	}
> 
>  	/* Now try to get the SD card's operating condition */
>  	err = sd_send_op_cond(mmc, uhs_en);
> --
> 2.38.GIT



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

* RE: [PATCH] drivers: mmc: check the return value of mmc_send_if_cond() call
  2022-10-21  9:07   ` 정재훈
@ 2022-10-24 10:54     ` Jaehoon Chung
  0 siblings, 0 replies; 3+ messages in thread
From: Jaehoon Chung @ 2022-10-24 10:54 UTC (permalink / raw)
  To: 'Matt Ranostay', peng.fan; +Cc: u-boot, 'Jaehoon Chung'

Hi Matt,

After applied this patch, CI Test is failed.
Test for Nokia RX-51 (aka N900)

I will not apply this patch at this time until fixing CI fail issue.

Best Regards,
Jaehoon Chung

> -----Original Message-----
> From: U-Boot [mailto:u-boot-bounces@lists.denx.de] On Behalf Of 정재훈
> Sent: Friday, October 21, 2022 6:08 PM
> To: 'Matt Ranostay' <mranostay@ti.com>; peng.fan@nxp.com
> Cc: u-boot@lists.denx.de
> Subject: RE: [PATCH] drivers: mmc: check the return value of mmc_send_if_cond() call
> 
> 
> > -----Original Message-----
> > From: Matt Ranostay [mailto:mranostay@ti.com]
> > Sent: Friday, October 21, 2022 4:16 PM
> > To: peng.fan@nxp.com; jh80.chung@samsung.com
> > Cc: u-boot@lists.denx.de; Matt Ranostay <mranostay@ti.com>
> > Subject: [PATCH] drivers: mmc: check the return value of mmc_send_if_cond() call
> >
> > Return value from mmc_send_if_cond() isn't checked if it is a error state
> > and the result immediately is overwritten with the sd_send_op_cond() call.
> >
> > Add check for -EOPNOTSUPP to fail early, and trigger a retry for any other
> > error code.
> >
> > Fixes: afd5932b2c27 ("Revert "mmc: retry the cmd8 to meet 74 clocks requirement in the spec")
> > Signed-off-by: Matt Ranostay <mranostay@ti.com>
> 
> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
> 
> Best Regards,
> Jaehoon Chung
> 
> > ---
> >  drivers/mmc/mmc.c | 7 +++++++
> >  1 file changed, 7 insertions(+)
> >
> > diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> > index 0b7c0be8cbc..e26a457a74c 100644
> > --- a/drivers/mmc/mmc.c
> > +++ b/drivers/mmc/mmc.c
> > @@ -2862,6 +2862,13 @@ retry:
> >
> >  	/* Test for SD version 2 */
> >  	err = mmc_send_if_cond(mmc);
> > +	if (err == -EOPNOTSUPP)
> > +		return err;
> > +
> > +	if (err) {
> > +		mmc_power_cycle(mmc);
> > +		goto retry;
> > +	}
> >
> >  	/* Now try to get the SD card's operating condition */
> >  	err = sd_send_op_cond(mmc, uhs_en);
> > --
> > 2.38.GIT
> 




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

end of thread, other threads:[~2022-10-24 10:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20221021071627epcas1p443b2a156e4ef08f8be8b9d02cb699acc@epcas1p4.samsung.com>
2022-10-21  7:16 ` [PATCH] drivers: mmc: check the return value of mmc_send_if_cond() call Matt Ranostay
2022-10-21  9:07   ` 정재훈
2022-10-24 10:54     ` Jaehoon Chung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox