drivers: mmc: check the return value of mmc_send_if_cond() call
PATCH 1/1 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.
--- drivers/mmc/mmc.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/mmc/mmc.c +7 -0
@@ -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);
Signature · 1 line
2.38.GIT
Quoted 8 lines
-----Original Message-----
From: Matt Ranostay [mailto:[email protected]]
Sent: Friday, October 21, 2022 4:16 PM
To: [email protected]; [email protected]
Cc: [email protected]; Matt Ranostay <[email protected]>
Subject: [PATCH] drivers: mmc: check the return value ofmmc_send_if_cond()call
Quoted 8 lines
Return value from
mmc_send_if_cond()isn't checked if it is a error state and the result immediately is overwritten with thesd_send_op_cond()call.Add check for
-EOPNOTSUPPto 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 <[email protected]>
Best Regards,
Jaehoon Chung
Quoted 24 lines
--- drivers/mmc/mmc.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/mmc/mmc.c +7
-1@@ -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
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
Quoted 54 lines
-----Original Message-----
From: U-Boot [mailto:[email protected]] On Behalf Of 정재훈
Sent: Friday, October 21, 2022 6:08 PM
To: 'Matt Ranostay' <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [PATCH] drivers: mmc: check the return value ofmmc_send_if_cond()callQuoted 7 lines
-----Original Message-----
From: Matt Ranostay [mailto:[email protected]]
Sent: Friday, October 21, 2022 4:16 PM
To: [email protected]; [email protected]
Cc: [email protected]; Matt Ranostay <[email protected]>
Subject: [PATCH] drivers: mmc: check the return value ofmmc_send_if_cond()callQuoted 8 lines
Return value from
mmc_send_if_cond()isn't checked if it is a error state and the result immediately is overwritten with thesd_send_op_cond()call.Add check for
-EOPNOTSUPPto 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 <[email protected]>Reviewed-by Jaehoon Chung <[email protected]>Best Regards,
Jaehoon ChungQuoted 24 lines
--- drivers/mmc/mmc.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/mmc/mmc.c +7
-1@@ -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