]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
Drivers: hv: vmbus: avoid unneeded compiler optimizations in vmbus_wait_for_unload()
authorVitaly Kuznetsov <vkuznets@redhat.com>
Fri, 26 Feb 2016 23:13:18 +0000 (15:13 -0800)
committerTim Gardner <tim.gardner@canonical.com>
Wed, 6 Apr 2016 09:29:05 +0000 (10:29 +0100)
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: 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>
(cherry picked from commit d452ab7b4c65dfcaee88a0d6866eeeb98a3d1884)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/hv/channel_mgmt.c

index 73a17be1f340a31a6c0e177599a3674cdb2d7153..38b682bab85a81a6482ec5dac0cdc29ad912488b 100644 (file)
@@ -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;
                }