diff mbox series

[v2,2/3] mmc: dw_mmc: Don't return error if data busy timeout

Message ID 20240201-mmc-v2-2-9f09dc1335fd@outlook.com
State Accepted
Commit 1fa6dc2879899a42ba85d4ece617c2356d048308
Delegated to: Jaehoon Chung
Headers show
Series mmc: hi6220-dwmmc: handle resets and clocks | expand

Commit Message

Yang Xiwen via B4 Relay Feb. 1, 2024, 2:05 p.m. UTC
From: Yang Xiwen <forbidden405@outlook.com>

As described in [1], some poor hardware or cards would fail to release
the bus and keep driving data lines low. Ignore it and send the next cmd
directly seems okay for most cases.

[1]: https://patchwork.kernel.org/project/linux-mmc/patch/1424458179-5456-1-git-send-email-dianders@chromium.org/

Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
---
 drivers/mmc/dw_mmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jaehoon Chung April 3, 2024, 12:41 a.m. UTC | #1
Hi,

On 2/1/24 23:05, Yang Xiwen via B4 Relay wrote:
> From: Yang Xiwen <forbidden405@outlook.com>
> 
> As described in [1], some poor hardware or cards would fail to release
> the bus and keep driving data lines low. Ignore it and send the next cmd
> directly seems okay for most cases.
This patch seems to be same with previous patch, right?

Best Regards,
Jaehoon Chung

> 
> [1]: https://patchwork.kernel.org/project/linux-mmc/patch/1424458179-5456-1-git-send-email-dianders@chromium.org/
> 
> Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
> ---
>  drivers/mmc/dw_mmc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
> index 400066fa99..e103664145 100644
> --- a/drivers/mmc/dw_mmc.c
> +++ b/drivers/mmc/dw_mmc.c
> @@ -262,8 +262,8 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
>  
>  	while (dwmci_readl(host, DWMCI_STATUS) & DWMCI_BUSY) {
>  		if (get_timer(start) > timeout) {
> -			debug("%s: Timeout on data busy\n", __func__);
> -			return -ETIMEDOUT;
> +			debug("%s: Timeout on data busy, continue anyway\n", __func__);
> +			break;
>  		}
>  	}
>
Yang Xiwen April 3, 2024, 1:19 a.m. UTC | #2
On 4/3/2024 8:41 AM, Jaehoon Chung wrote:
> Hi,
>
> On 2/1/24 23:05, Yang Xiwen via B4 Relay wrote:
>> From: Yang Xiwen <forbidden405@outlook.com>
>>
>> As described in [1], some poor hardware or cards would fail to release
>> the bus and keep driving data lines low. Ignore it and send the next cmd
>> directly seems okay for most cases.
> This patch seems to be same with previous patch, right?


 From my observation, this patch does fix some weird problems and is 
mostly okay for other dwmmc users. I can't say it is very well tested 
because of I can't come up of other tests i can do except some `mmc 
read` and `mmc write`.


>
> Best Regards,
> Jaehoon Chung
>
>> [1]: https://patchwork.kernel.org/project/linux-mmc/patch/1424458179-5456-1-git-send-email-dianders@chromium.org/
>>
>> Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
>> ---
>>   drivers/mmc/dw_mmc.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
>> index 400066fa99..e103664145 100644
>> --- a/drivers/mmc/dw_mmc.c
>> +++ b/drivers/mmc/dw_mmc.c
>> @@ -262,8 +262,8 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
>>   
>>   	while (dwmci_readl(host, DWMCI_STATUS) & DWMCI_BUSY) {
>>   		if (get_timer(start) > timeout) {
>> -			debug("%s: Timeout on data busy\n", __func__);
>> -			return -ETIMEDOUT;
>> +			debug("%s: Timeout on data busy, continue anyway\n", __func__);
>> +			break;
>>   		}
>>   	}
>>
Jaehoon Chung April 15, 2024, 6:58 a.m. UTC | #3
Hi,

> -----Original Message-----
> From: Yang Xiwen <forbidden405@outlook.com>
> Sent: Wednesday, April 3, 2024 10:20 AM
> To: Jaehoon Chung <jh80.chung@samsung.com>; Peng Fan <peng.fan@nxp.com>
> Cc: u-boot@lists.denx.de
> Subject: Re: [PATCH v2 2/3] mmc: dw_mmc: Don't return error if data busy timeout
> 
> On 4/3/2024 8:41 AM, Jaehoon Chung wrote:
> > Hi,
> >
> > On 2/1/24 23:05, Yang Xiwen via B4 Relay wrote:
> >> From: Yang Xiwen <forbidden405@outlook.com>
> >>
> >> As described in [1], some poor hardware or cards would fail to release
> >> the bus and keep driving data lines low. Ignore it and send the next cmd
> >> directly seems okay for most cases.
> > This patch seems to be same with previous patch, right?
> 
> 
>  From my observation, this patch does fix some weird problems and is
> mostly okay for other dwmmc users. I can't say it is very well tested
> because of I can't come up of other tests i can do except some `mmc
> read` and `mmc write`.
> 
> 
> >
> > Best Regards,
> > Jaehoon Chung
> >
> >> [1]: https://patchwork.kernel.org/project/linux-mmc/patch/1424458179-5456-1-git-send-email-
> dianders@chromium.org/
> >>
> >> Signed-off-by: Yang Xiwen <forbidden405@outlook.com>

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

Best Regards,
Jaehoon Chung

> >> ---
> >>   drivers/mmc/dw_mmc.c | 4 ++--
> >>   1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
> >> index 400066fa99..e103664145 100644
> >> --- a/drivers/mmc/dw_mmc.c
> >> +++ b/drivers/mmc/dw_mmc.c
> >> @@ -262,8 +262,8 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
> >>
> >>   	while (dwmci_readl(host, DWMCI_STATUS) & DWMCI_BUSY) {
> >>   		if (get_timer(start) > timeout) {
> >> -			debug("%s: Timeout on data busy\n", __func__);
> >> -			return -ETIMEDOUT;
> >> +			debug("%s: Timeout on data busy, continue anyway\n", __func__);
> >> +			break;
> >>   		}
> >>   	}
> >>
> 
> 
> --
> Regards,
> Yang Xiwen
diff mbox series

Patch

diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
index 400066fa99..e103664145 100644
--- a/drivers/mmc/dw_mmc.c
+++ b/drivers/mmc/dw_mmc.c
@@ -262,8 +262,8 @@  static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
 
 	while (dwmci_readl(host, DWMCI_STATUS) & DWMCI_BUSY) {
 		if (get_timer(start) > timeout) {
-			debug("%s: Timeout on data busy\n", __func__);
-			return -ETIMEDOUT;
+			debug("%s: Timeout on data busy, continue anyway\n", __func__);
+			break;
 		}
 	}