From: "K. Y. Srinivasan" <kys@microsoft.com>
To: gregkh@suse.de, linux-kernel@vger.kernel.org,
devel@linuxdriverproject.org, virtualization@lists.osdl.org
Cc: "K. Y. Srinivasan" <kys@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>
Subject: [PATCH 1/8] Staging: hv: vmbus: Get rid of vmbus_on_isr() by inlining the code
Date: Mon, 15 Aug 2011 15:12:00 -0700 [thread overview]
Message-ID: <1313446327-10650-1-git-send-email-kys@microsoft.com> (raw)
In-Reply-To: <1313446210-10611-1-git-send-email-kys@microsoft.com>
Get rid of vmbus_on_isr() by inlining this code in the
real interrupt handler.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/vmbus_drv.c | 41 +++++++++++----------------------------
1 files changed, 12 insertions(+), 29 deletions(-)
diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
index b382829..bb25c5b 100644
--- a/drivers/staging/hv/vmbus_drv.c
+++ b/drivers/staging/hv/vmbus_drv.c
@@ -411,53 +411,36 @@ static void vmbus_on_msg_dpc(unsigned long data)
}
}
-/*
- * vmbus_on_isr - ISR routine
- */
-static int vmbus_on_isr(void)
+static irqreturn_t vmbus_isr(int irq, void *dev_id)
{
- int ret = 0;
int cpu = smp_processor_id();
void *page_addr;
struct hv_message *msg;
union hv_synic_event_flags *event;
+ bool handled = false;
page_addr = hv_context.synic_message_page[cpu];
msg = (struct hv_message *)page_addr + VMBUS_MESSAGE_SINT;
/* Check if there are actual msgs to be process */
- if (msg->header.message_type != HVMSG_NONE)
- ret |= 0x1;
+ if (msg->header.message_type != HVMSG_NONE) {
+ handled = true;
+ tasklet_schedule(&msg_dpc);
+ }
page_addr = hv_context.synic_event_page[cpu];
event = (union hv_synic_event_flags *)page_addr + VMBUS_MESSAGE_SINT;
/* Since we are a child, we only need to check bit 0 */
- if (sync_test_and_clear_bit(0, (unsigned long *) &event->flags32[0]))
- ret |= 0x2;
-
- 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);
+ if (sync_test_and_clear_bit(0, (unsigned long *) &event->flags32[0])) {
+ handled = true;
+ tasklet_schedule(&event_dpc);
+ }
+ if (handled)
return IRQ_HANDLED;
- } else {
+ else
return IRQ_NONE;
- }
}
/*
--
1.7.4.1
next prev parent reply other threads:[~2011-08-15 21:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-15 22:10 [PATCH 0/8] Staging: hv: vmbus: Driver cleanup K. Y. Srinivasan
2011-08-15 22:12 ` K. Y. Srinivasan [this message]
2011-08-15 22:12 ` [PATCH 2/8] Staging: hv: vmbus: Invoke vmbus_on_msg_dpc() directly K. Y. Srinivasan
2011-08-17 12:47 ` Sasha Levin
2011-08-17 18:43 ` KY Srinivasan
2011-08-18 5:50 ` Sasha Levin
2011-08-15 22:12 ` [PATCH 3/8] Staging: hv: vmbus: Check for events before messages K. Y. Srinivasan
2011-08-15 22:12 ` [PATCH 4/8] Staging: hv: vmbus: Do not enable auto eoi K. Y. Srinivasan
2011-08-15 22:12 ` [PATCH 5/8] Staging: hv: vmbus: Fixup indentation in vmbus_acpi_add() K. Y. Srinivasan
2011-08-15 22:12 ` [PATCH 6/8] Staging: hv: vmbus: Get rid of some dated/redundant comments K. Y. Srinivasan
2011-08-15 22:12 ` [PATCH 7/8] Staging: hv: vmbus: Fix a bug in error handling in vmbus_bus_init() K. Y. Srinivasan
2011-08-17 13:26 ` Sasha Levin
2011-08-17 19:10 ` KY Srinivasan
2011-08-15 22:12 ` [PATCH 8/8] Staging: hv: vmbus: Get rid of an unnecessary check in vmbus_connect() K. Y. Srinivasan
2011-08-23 23:18 ` [PATCH 0/8] Staging: hv: vmbus: Driver cleanup Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1313446327-10650-1-git-send-email-kys@microsoft.com \
--to=kys@microsoft.com \
--cc=devel@linuxdriverproject.org \
--cc=gregkh@suse.de \
--cc=haiyangz@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=virtualization@lists.osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox