提交 d452ab7b 编写于 作者: V Vitaly Kuznetsov 提交者: Greg Kroah-Hartman

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: NRadim Krcmar <rkrcmar@redhat.com>
Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: Radim Kr.má<rkrcmar@redhat.com>
Signed-off-by: NK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 0f70b669
......@@ -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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册