Commit 9ab3d057 authored by Vitaly Kuznetsov's avatar Vitaly Kuznetsov Committed by Tim Gardner

Drivers: hv: vmbus: avoid unneeded compiler optimizations in vmbus_wait_for_unload()

BugLink: http://bugs.launchpad.net/bugs/1541585

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: default avatarRadim Krcmar <rkrcmar@redhat.com>
Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: Radim Kr.má<rkrcmar@redhat.com>
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit d452ab7b)
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
parent d98c8022
......@@ -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;
}
......
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