Skip to content

Commit

Permalink
Drivers: hv: vmbus: avoid unneeded compiler optimizations in vmbus_wa…
Browse files Browse the repository at this point in the history
…it_for_unload()

Message header is modified by the hypervisor and we read it in a loop,
we need to prevent compilers from optimizing accesses. There are no such
optimizations at this moment, this is just a future proof.

Suggested-by: Radim Krcmar <rkrcmar@redhat.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: Radim Kr.má<rkrcmar@redhat.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Vitaly Kuznetsov authored and Greg Kroah-Hartman committed Mar 2, 2016
1 parent 0f70b66 commit d452ab7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hv/channel_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ static void vmbus_wait_for_unload(void)
bool unloaded = false;

while (1) {
if (msg->header.message_type == HVMSG_NONE) {
if (READ_ONCE(msg->header.message_type) == HVMSG_NONE) {
mdelay(10);
continue;
}
Expand Down

0 comments on commit d452ab7

Please sign in to comment.