summaryrefslogtreecommitdiffstats
path: root/drivers/hv/channel_mgmt.c
diff options
context:
space:
mode:
authorVitaly Kuznetsov2016-02-27 00:13:18 +0100
committerGreg Kroah-Hartman2016-03-02 01:57:20 +0100
commitd452ab7b4c65dfcaee88a0d6866eeeb98a3d1884 (patch)
treeea442d4397fab07eee2c31d5a12a49628298fc21 /drivers/hv/channel_mgmt.c
parentDrivers: hv: vmbus: remove code duplication in message handling (diff)
downloadkernel-qcow2-linux-d452ab7b4c65dfcaee88a0d6866eeeb98a3d1884.tar.gz
kernel-qcow2-linux-d452ab7b4c65dfcaee88a0d6866eeeb98a3d1884.tar.xz
kernel-qcow2-linux-d452ab7b4c65dfcaee88a0d6866eeeb98a3d1884.zip
Drivers: hv: vmbus: avoid unneeded compiler optimizations in vmbus_wait_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>
Diffstat (limited to 'drivers/hv/channel_mgmt.c')
-rw-r--r--drivers/hv/channel_mgmt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index 73a17be1f340..38b682bab85a 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -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;
}