From: Sascha Hauer <s.hauer@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 2/2] net: fec_imx: fix timeout off by *1000 error
Date: Mon, 17 Dec 2018 10:50:22 +0100 [thread overview]
Message-ID: <20181217095022.b254abkvsovecph5@pengutronix.de> (raw)
In-Reply-To: <ef23a991-be38-c018-3bf6-1940de7a3e6c@pengutronix.de>
On Fri, Dec 14, 2018 at 04:29:02PM +0100, Ahmad Fatoum wrote:
> Hello,
>
> I didn't change read*_poll_timeout to take nanoseconds because it is copied
> over from Linux.
>
> On 14/12/18 16:23, Ahmad Fatoum wrote:
> > read*_poll_timeout's final timeout parameter is in microseconds,
> > but the supplied arguments in fec_imx.c were in nanoseconds,
> > which might lead to barebox getting seemingly stuck in fec_halt
> > (loops for a thousand seconds instead of one).
>
> So, how about dropping the (U|M|)SECOND defines in include/clock.h and replace
> them across the tree by the corresponding NSEC_PER_(U|M|)SEC?
>
> I find them more readable and they would avoid such mistakes in future.
You are probably right that these are more readable, but still you have
to know that is_timeout() takes nanoseconds and readl_poll_timeout takes
microseconds.
Sascha
--
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
next prev parent reply other threads:[~2018-12-17 9:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-14 15:23 [PATCH 1/2] include/linux/time.h: define USEC_PER_SEC and friends Ahmad Fatoum
2018-12-14 15:23 ` [PATCH 2/2] net: fec_imx: fix timeout off by *1000 error Ahmad Fatoum
2018-12-14 15:29 ` Ahmad Fatoum
2018-12-17 9:50 ` Sascha Hauer [this message]
2018-12-17 9:48 ` [PATCH 1/2] include/linux/time.h: define USEC_PER_SEC and friends Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181217095022.b254abkvsovecph5@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox