mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] mci: atmel_mci: fix off-by-1000 in poll timeout
@ 2023-01-11 17:39 Ahmad Fatoum
  2023-01-11 17:39 ` [PATCH 2/2] mci: atmel_mci: don't print error messages when probing SDIO Ahmad Fatoum
  2023-01-12 14:47 ` [PATCH 1/2] mci: atmel_mci: fix off-by-1000 in poll timeout Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2023-01-11 17:39 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

read_poll_timeout assumes microsecond timeouts, not nanoseconds. One
second instead of a thousand is still plenty time when polling for a
MCI controller to change state, so use that.

Fixes: 4fc0369b1a55 ("mci: atmel_mci: add PBL support")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/mci/atmel_mci_common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mci/atmel_mci_common.c b/drivers/mci/atmel_mci_common.c
index c8e21933fe51..99e65adb2cf0 100644
--- a/drivers/mci/atmel_mci_common.c
+++ b/drivers/mci/atmel_mci_common.c
@@ -90,8 +90,8 @@ static int atmci_poll_status(struct atmel_mci *host, u32 mask)
 	u32 stat;
 	int ret;
 
-	ret = read_poll_timeout(atmci_readl, stat, (stat & mask), SECOND, host,
-				ATMCI_SR);
+	ret = read_poll_timeout(atmci_readl, stat, (stat & mask), USEC_PER_SEC,
+				host, ATMCI_SR);
 	if (ret < 0) {
 		dev_err(host->hw_dev, "timeout\n");
 		host->need_reset = true;
-- 
2.30.2




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

* [PATCH 2/2] mci: atmel_mci: don't print error messages when probing SDIO
  2023-01-11 17:39 [PATCH 1/2] mci: atmel_mci: fix off-by-1000 in poll timeout Ahmad Fatoum
@ 2023-01-11 17:39 ` Ahmad Fatoum
  2023-01-12 14:47 ` [PATCH 1/2] mci: atmel_mci: fix off-by-1000 in poll timeout Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2023-01-11 17:39 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Returning -EINVAL is enough for MCI core to try SD communication next.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/mci/atmel_mci_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mci/atmel_mci_common.c b/drivers/mci/atmel_mci_common.c
index 99e65adb2cf0..ec710f1cfc38 100644
--- a/drivers/mci/atmel_mci_common.c
+++ b/drivers/mci/atmel_mci_common.c
@@ -315,7 +315,7 @@ static int atmci_start_cmd(struct atmel_mci *host, struct mci_cmd *cmd,
 		flags |= ATMCI_CMDR_RSPTYP_NONE;
 		break;
 	default:
-		dev_err(host->hw_dev, "unhandled response type 0x%x\n",
+		dev_dbg(host->hw_dev, "unhandled response type 0x%x\n",
 				cmd->resp_type);
 		return -EINVAL;
 	}
-- 
2.30.2




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

* Re: [PATCH 1/2] mci: atmel_mci: fix off-by-1000 in poll timeout
  2023-01-11 17:39 [PATCH 1/2] mci: atmel_mci: fix off-by-1000 in poll timeout Ahmad Fatoum
  2023-01-11 17:39 ` [PATCH 2/2] mci: atmel_mci: don't print error messages when probing SDIO Ahmad Fatoum
@ 2023-01-12 14:47 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2023-01-12 14:47 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Wed, Jan 11, 2023 at 06:39:20PM +0100, Ahmad Fatoum wrote:
> read_poll_timeout assumes microsecond timeouts, not nanoseconds. One
> second instead of a thousand is still plenty time when polling for a
> MCI controller to change state, so use that.
> 
> Fixes: 4fc0369b1a55 ("mci: atmel_mci: add PBL support")
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  drivers/mci/atmel_mci_common.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/mci/atmel_mci_common.c b/drivers/mci/atmel_mci_common.c
> index c8e21933fe51..99e65adb2cf0 100644
> --- a/drivers/mci/atmel_mci_common.c
> +++ b/drivers/mci/atmel_mci_common.c
> @@ -90,8 +90,8 @@ static int atmci_poll_status(struct atmel_mci *host, u32 mask)
>  	u32 stat;
>  	int ret;
>  
> -	ret = read_poll_timeout(atmci_readl, stat, (stat & mask), SECOND, host,
> -				ATMCI_SR);
> +	ret = read_poll_timeout(atmci_readl, stat, (stat & mask), USEC_PER_SEC,
> +				host, ATMCI_SR);
>  	if (ret < 0) {
>  		dev_err(host->hw_dev, "timeout\n");
>  		host->need_reset = true;
> -- 
> 2.30.2
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



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

end of thread, other threads:[~2023-01-12 14:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-11 17:39 [PATCH 1/2] mci: atmel_mci: fix off-by-1000 in poll timeout Ahmad Fatoum
2023-01-11 17:39 ` [PATCH 2/2] mci: atmel_mci: don't print error messages when probing SDIO Ahmad Fatoum
2023-01-12 14:47 ` [PATCH 1/2] mci: atmel_mci: fix off-by-1000 in poll timeout Sascha Hauer

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