]> git.baikalelectronics.ru Git - kernel.git/commit
Drivers: hv: vmbus: Fix signaling logic in hv_need_to_signal_on_read()
authorK. Y. Srinivasan <kys@microsoft.com>
Sat, 2 Apr 2016 23:17:38 +0000 (16:17 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 30 Apr 2016 21:05:44 +0000 (14:05 -0700)
commit552984e7e257cd2dd38f78ff0e5dd8461ce48a77
tree41d26d3e3e0c89a31b6f723b978ba9ac776879b3
parent37cb4062bc4110622e60aafd391b4840252b557c
Drivers: hv: vmbus: Fix signaling logic in hv_need_to_signal_on_read()

On the consumer side, we have interrupt driven flow management of the
producer. It is sufficient to base the signaling decision on the
amount of space that is available to write after the read is complete.
The current code samples the previous available space and uses this
in making the signaling decision. This state can be stale and is
unnecessary. Since the state can be stale, we end up not signaling
the host (when we should) and this can result in a hang. Fix this
problem by removing the unnecessary check. I would like to thank
Arseney Romanenko <arseneyr@microsoft.com> for pointing out this issue.

Also, issue a full memory barrier before making the signaling descision
to correctly deal with potential reordering of the write (read index)
followed by the read of pending_sz.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Tested-by: Dexuan Cui <decui@microsoft.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hv/ring_buffer.c