forked from Minki/linux
Staging: hv: vmbus: Get rid of vmbus_on_isr() by inlining the code
Get rid of vmbus_on_isr() by inlining the code. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
e61ee14f0e
commit
ae4636e6c0
@ -437,53 +437,36 @@ static void vmbus_on_msg_dpc(unsigned long data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
static irqreturn_t vmbus_isr(int irq, void *dev_id)
|
||||||
* vmbus_on_isr - ISR routine
|
|
||||||
*/
|
|
||||||
static int vmbus_on_isr(void)
|
|
||||||
{
|
{
|
||||||
int ret = 0;
|
|
||||||
int cpu = smp_processor_id();
|
int cpu = smp_processor_id();
|
||||||
void *page_addr;
|
void *page_addr;
|
||||||
struct hv_message *msg;
|
struct hv_message *msg;
|
||||||
union hv_synic_event_flags *event;
|
union hv_synic_event_flags *event;
|
||||||
|
bool handled = false;
|
||||||
|
|
||||||
page_addr = hv_context.synic_message_page[cpu];
|
page_addr = hv_context.synic_message_page[cpu];
|
||||||
msg = (struct hv_message *)page_addr + VMBUS_MESSAGE_SINT;
|
msg = (struct hv_message *)page_addr + VMBUS_MESSAGE_SINT;
|
||||||
|
|
||||||
/* Check if there are actual msgs to be process */
|
/* Check if there are actual msgs to be process */
|
||||||
if (msg->header.message_type != HVMSG_NONE)
|
if (msg->header.message_type != HVMSG_NONE) {
|
||||||
ret |= 0x1;
|
handled = true;
|
||||||
|
tasklet_schedule(&msg_dpc);
|
||||||
|
}
|
||||||
|
|
||||||
page_addr = hv_context.synic_event_page[cpu];
|
page_addr = hv_context.synic_event_page[cpu];
|
||||||
event = (union hv_synic_event_flags *)page_addr + VMBUS_MESSAGE_SINT;
|
event = (union hv_synic_event_flags *)page_addr + VMBUS_MESSAGE_SINT;
|
||||||
|
|
||||||
/* Since we are a child, we only need to check bit 0 */
|
/* Since we are a child, we only need to check bit 0 */
|
||||||
if (sync_test_and_clear_bit(0, (unsigned long *) &event->flags32[0]))
|
if (sync_test_and_clear_bit(0, (unsigned long *) &event->flags32[0])) {
|
||||||
ret |= 0x2;
|
handled = true;
|
||||||
|
tasklet_schedule(&event_dpc);
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static irqreturn_t vmbus_isr(int irq, void *dev_id)
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
ret = vmbus_on_isr();
|
|
||||||
|
|
||||||
/* Schedules a dpc if necessary */
|
|
||||||
if (ret > 0) {
|
|
||||||
if (test_bit(0, (unsigned long *)&ret))
|
|
||||||
tasklet_schedule(&msg_dpc);
|
|
||||||
|
|
||||||
if (test_bit(1, (unsigned long *)&ret))
|
|
||||||
tasklet_schedule(&event_dpc);
|
|
||||||
|
|
||||||
return IRQ_HANDLED;
|
|
||||||
} else {
|
|
||||||
return IRQ_NONE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (handled)
|
||||||
|
return IRQ_HANDLED;
|
||||||
|
else
|
||||||
|
return IRQ_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user