UPSTREAM: um: time-travel: avoid multiple identical propagations

If there is some kind of interrupt negotation or such then
it may happen that we send an update message multiple times,
avoid that in the interest of efficiency by storing the last
transmitted value and only sending a new update if it's not
the same as the last update.

Bug: 176213565
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
(cherry picked from commit 58b09f6869)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ie67941f51f7cb927cbef3515269661d4e27174b8
This commit is contained in:
Johannes Berg
2020-12-04 12:34:34 +01:00
committed by Greg Kroah-Hartman
parent d98a5b2fb6
commit 0b1ac02813

View File

@@ -190,7 +190,13 @@ static void time_travel_ext_update_request(unsigned long long time)
void __time_travel_propagate_time(void)
{
static unsigned long long last_propagated;
if (last_propagated == time_travel_time)
return;
time_travel_ext_req(UM_TIMETRAVEL_UPDATE, time_travel_time);
last_propagated = time_travel_time;
}
EXPORT_SYMBOL_GPL(__time_travel_propagate_time);