mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH RFC] ARM: imx8: fix discrepancy between comment and code
@ 2019-05-31  7:41 Ahmad Fatoum
  2019-05-31  7:55 ` Andrey Smirnov
  2019-06-04  6:51 ` Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2019-05-31  7:41 UTC (permalink / raw)
  To: barebox

The comment speaks of a one second polling timeout, while the polling
is indefinite with timeout not accounted for. Thus change the comment
to reflect the actual behavior.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/mach-imx/imx8-ddrc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-imx/imx8-ddrc.c b/arch/arm/mach-imx/imx8-ddrc.c
index 18454a91533b..736865eb6f12 100644
--- a/arch/arm/mach-imx/imx8-ddrc.c
+++ b/arch/arm/mach-imx/imx8-ddrc.c
@@ -29,7 +29,7 @@ static u32 ddrc_phy_get_message(void __iomem *phy, int type)
 
 	/*
 	 * When BIT0 set to 0, the PMU has a message for the user
-	 * 10ms seems not enough for poll message, so use 1s here.
+	 * Wait for it indefinitely.
 	 */
 	readl_poll_timeout(phy + DDRC_PHY_REG(0xd0004),
 			   r, !(r & BIT(0)), 0);
@@ -104,4 +104,4 @@ void ddrc_phy_wait_training_complete(void __iomem *phy)
 		putc_ll('\r');
 		putc_ll('\n');
 	}
-}
\ No newline at end of file
+}
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH RFC] ARM: imx8: fix discrepancy between comment and code
  2019-05-31  7:41 [PATCH RFC] ARM: imx8: fix discrepancy between comment and code Ahmad Fatoum
@ 2019-05-31  7:55 ` Andrey Smirnov
  2019-06-04  6:51 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Andrey Smirnov @ 2019-05-31  7:55 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: Barebox List

On Fri, May 31, 2019 at 12:41 AM Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
>
> The comment speaks of a one second polling timeout, while the polling
> is indefinite with timeout not accounted for. Thus change the comment
> to reflect the actual behavior.
>
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

Ugh, my bad, not sure where I got that comment from, I am guessing
some version of old U-Boot code that actually implemented that timeout
properly. Definitely should be fixed.

Acked-by: Andrey Smirnov <andrew.smirnov@gmail.com>

Thanks,
Andrey Smirnov

> ---
>  arch/arm/mach-imx/imx8-ddrc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-imx/imx8-ddrc.c b/arch/arm/mach-imx/imx8-ddrc.c
> index 18454a91533b..736865eb6f12 100644
> --- a/arch/arm/mach-imx/imx8-ddrc.c
> +++ b/arch/arm/mach-imx/imx8-ddrc.c
> @@ -29,7 +29,7 @@ static u32 ddrc_phy_get_message(void __iomem *phy, int type)
>
>         /*
>          * When BIT0 set to 0, the PMU has a message for the user
> -        * 10ms seems not enough for poll message, so use 1s here.
> +        * Wait for it indefinitely.
>          */
>         readl_poll_timeout(phy + DDRC_PHY_REG(0xd0004),
>                            r, !(r & BIT(0)), 0);
> @@ -104,4 +104,4 @@ void ddrc_phy_wait_training_complete(void __iomem *phy)
>                 putc_ll('\r');
>                 putc_ll('\n');
>         }
> -}
> \ No newline at end of file
> +}
> --
> 2.20.1
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH RFC] ARM: imx8: fix discrepancy between comment and code
  2019-05-31  7:41 [PATCH RFC] ARM: imx8: fix discrepancy between comment and code Ahmad Fatoum
  2019-05-31  7:55 ` Andrey Smirnov
@ 2019-06-04  6:51 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2019-06-04  6:51 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Fri, May 31, 2019 at 09:41:02AM +0200, Ahmad Fatoum wrote:
> The comment speaks of a one second polling timeout, while the polling
> is indefinite with timeout not accounted for. Thus change the comment
> to reflect the actual behavior.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  arch/arm/mach-imx/imx8-ddrc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/arch/arm/mach-imx/imx8-ddrc.c b/arch/arm/mach-imx/imx8-ddrc.c
> index 18454a91533b..736865eb6f12 100644
> --- a/arch/arm/mach-imx/imx8-ddrc.c
> +++ b/arch/arm/mach-imx/imx8-ddrc.c
> @@ -29,7 +29,7 @@ static u32 ddrc_phy_get_message(void __iomem *phy, int type)
>  
>  	/*
>  	 * When BIT0 set to 0, the PMU has a message for the user
> -	 * 10ms seems not enough for poll message, so use 1s here.
> +	 * Wait for it indefinitely.
>  	 */
>  	readl_poll_timeout(phy + DDRC_PHY_REG(0xd0004),
>  			   r, !(r & BIT(0)), 0);
> @@ -104,4 +104,4 @@ void ddrc_phy_wait_training_complete(void __iomem *phy)
>  		putc_ll('\r');
>  		putc_ll('\n');
>  	}
> -}
> \ No newline at end of file
> +}
> -- 
> 2.20.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2019-06-04  6:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-31  7:41 [PATCH RFC] ARM: imx8: fix discrepancy between comment and code Ahmad Fatoum
2019-05-31  7:55 ` Andrey Smirnov
2019-06-04  6:51 ` Sascha Hauer

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