Commit 0a037e7d authored by Philippe Gerum's avatar Philippe Gerum
Browse files

ipipe/timer: fix timing with NO_HZ_IDLE

Enabling NO_HZ_IDLE may cause large timeout values to be sent to the
host tick emulation handler implemented by the client domain.

Since we refrain from converting the timeout value to timer ticks but
keep it as a count of nanoseconds for stolen timers, we have to make
sure that such value will still fit in the ->set_next_event()
(unsigned long) argument without overflowing.

Cap the maximum delay value which may be passed to ->set_next_event()
by setting max_delta_ns appropriately in the clockevent definition of
stolen timers.
parent 21e627a2
...@@ -365,6 +365,7 @@ int ipipe_timer_start(void (*tick_handler)(void), ...@@ -365,6 +365,7 @@ int ipipe_timer_start(void (*tick_handler)(void),
timer->real_set_next_event = evtdev->set_next_event; timer->real_set_next_event = evtdev->set_next_event;
evtdev->mult = 1; evtdev->mult = 1;
evtdev->shift = 0; evtdev->shift = 0;
evtdev->max_delta_ns = UINT_MAX;
evtdev->set_mode = emumode; evtdev->set_mode = emumode;
evtdev->set_next_event = emutick; evtdev->set_next_event = emutick;
evtdev->ipipe_stolen = 1; evtdev->ipipe_stolen = 1;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment