| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| |
| |
| |
| |
| | |
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change is_timeout() to sample current time before invoking poller
infrascructure to avoid occasional false timeout conditions.
Consider the following timeout loop (can be found in wait_on_timeout):
while (!(condition)) {
if (is_timeout(...)) {
return -ETIMEDOUT;
}
}
...
in the original logic of is_timeout() it was possible to end up in the
following situation:
1. Immediate check of of "condition" yeilds false (not enough
time for it to become true has passed yet)
2. is_timeout is called which, in turn, calls poller_call()
3. All registerd pollers take more than specified timeout time
to execute.
4. Sometime during poller_call() "contition" becomes true
5. As a result of #3 is_timeout() returns "true"
6. Code bails out with -ETIMEDOUT early even though timeout
condition didn't really occur.
One concrete example of this problem was discovered on ZII RDU1
board (poller_call() is long due to a serdev) when doing large data
transfers over SPI to attached DataFlash chip.
This commit changes is_timeout() to sample the value of time before
calling poller_call(). This way first call to is_timeout() will almost
always return false thus checking the condition at least twice before
declaring a timeout.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Assigning the dummy clocksource in a initcall has the problem that
get_time_ns() crashes before that initcall is executed. This happens
when dmesg support is enabled in conjunction with CONFIG_DEBUG_INITCALLS.
In this case the dmesg code wants to have the timestamp of a log
message.
Solve this by setting the current clocksource to the dummy clock
statically and not at runtime. This way we always have a dummy
clock available.
Fixes:
commit 8972eb7ff17ad058a6c6018305bb912138ab0ca2
Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Date: Fri Mar 3 13:34:02 2017 +0100
clocksource: move dummy clock source to init_clock
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
| |
And registered it as soon as possible (at pure initcall).
So we not need to check the cs all the time.
As get_time_ns() is one of the most called function of barebox at runtime.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
| |
use the one with the most priority.
We can not select the clocksource at user level.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
| |
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
| |
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
| |
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
make it possible to call get_time_ns() before the clocksource
has been registered. Just return 0 in this case which is still
better than crashing the system.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
For measuring the startup time it's useful to save the first
timestamp after the clocksource has been registered.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
is_timeout call poller_call if the timeout is >= 100us
but on 1-wire bus we need to wait 500us and not more than 930us
for the bus reset. So if the poller_call is caller we can not guarantee it.
So for this introduce is_non_interruptible_timeout than we only wait.
Use it for ndelay too.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
The FSF address has changed in the past. Instead of updating it
each time the address changes, just drop it completely treewide.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
this will allow to always call poller_call even durring timeout
and still the case in getc
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
Added clocks_calc_mult_shift()
Signed-off-by: Carlo Caione <carlo.caione@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
| |
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
| |
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
| |
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[Patch 02/17] U-Boot-V2: Handle case of clock rollover for get_time_ns
get_time_ns does a simplistic delta = cycle_now - cycle_last. It is possible that the h/w counter reached max and reset back to 0.
This patch addresses this issue by checking for rollover condition.
NOTE 1: This does not guarentee that you cannot confuse get_time_ns. You could possibly wait for two reset cycles and then get a messed up value.
To fix that we may need interrupt mode timer tick - something on the lines of jiffies on linux.
NOTE 2: the question of cs->mask is not clear. if the mask is for the tick, then it is better done with (cycle_now & cs->mask) - (cs->cycle_last & cs->mask).
Signed-off-by: Nishanth Menon<x0nishan@ti.com>
|
| |
|
|
|
|
| |
add file headers
|
|
|
|
| |
more cleanups, fix compiler warnings
|
|
|
|
| |
mx31/move_include_asm-arm_arch-arm1136_to_arch-omap24xx.diff
|
|
|
|
| |
change to clocksource api
|
|
add clocksource stuff from kernel and first implementation (imx) (WIP)
|