hv_utils: drain the timesync packets on onchannelcallback
authorVineeth Pillai <viremana@linux.microsoft.com>
Fri, 21 Aug 2020 15:28:49 +0000 (15:28 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Sep 2020 17:14:10 +0000 (19:14 +0200)
commit94fd015fe91f7f3980218ab363c045b2d80122ba
treef489fac01b18b58bce0e0e1dcc40f252a67150f0
parent6a725c83a08d41f2bc1630835712a4edc2e6caad
hv_utils: drain the timesync packets on onchannelcallback

[ Upstream commit b46b4a8a57c377b72a98c7930a9f6969d2d4784e ]

There could be instances where a system stall prevents the timesync
packets to be consumed. And this might lead to more than one packet
pending in the ring buffer. Current code empties one packet per callback
and it might be a stale one. So drain all the packets from ring buffer
on each callback.

Signed-off-by: Vineeth Pillai <viremana@linux.microsoft.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/20200821152849.99517-1-viremana@linux.microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hv/hv_util.c