Re: [PATCH 2/2] net: fec_imx: fix timeout off by *1000 error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux