Drivers: hv: vmbus: don't loose HVMSG_TIMER_EXPIRED messages

We must handle HVMSG_TIMER_EXPIRED messages in the interrupt context
and we offload all the rest to vmbus_on_msg_dpc() tasklet. This functions
loops to see if there are new messages pending. In case we'll ever see
HVMSG_TIMER_EXPIRED message there we're going to lose it as we can't
handle it from there. Avoid looping in vmbus_on_msg_dpc(), we're OK
with handling one message per interrupt.

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>
This commit is contained in:
Vitaly Kuznetsov 2016-02-26 15:13:15 -08:00 committed by Greg Kroah-Hartman
parent bec3c11bad
commit 7be3e16944

View File

@ -740,10 +740,9 @@ static void vmbus_on_msg_dpc(unsigned long data)
struct vmbus_channel_message_table_entry *entry;
struct onmessage_work_context *ctx;
while (1) {
if (msg->header.message_type == HVMSG_NONE)
/* no msg */
break;
return;
hdr = (struct vmbus_channel_message_header *)msg->u.payload;
@ -756,7 +755,7 @@ static void vmbus_on_msg_dpc(unsigned long data)
if (entry->handler_type == VMHT_BLOCKING) {
ctx = kmalloc(sizeof(*ctx), GFP_ATOMIC);
if (ctx == NULL)
continue;
return;
INIT_WORK(&ctx->work, vmbus_onmessage_work);
memcpy(&ctx->msg, msg, sizeof(*msg));
@ -785,7 +784,6 @@ msg_handled:
*/
wrmsrl(HV_X64_MSR_EOM, 0);
}
}
}
static void vmbus_isr(void)