diff options
author | Stephen Hemminger <sthemmin@microsoft.com> | 2016-10-28 17:27:10 -0700 |
---|---|---|
committer | Stephen Hemminger <sthemmin@microsoft.com> | 2017-01-13 09:37:36 -0800 |
commit | e25104bf7365224c431149f3af346a3d7529fd40 (patch) | |
tree | 36e70871d77fb7ba79cfc233c4eeff639d039e13 | |
parent | bb7ecf9bf0f2ab0a106a71747ae6637ce0c47b6f (diff) | |
download | vmbus-next-e25104bf7365224c431149f3af346a3d7529fd40.tar.gz |
vmbus: fix send interrupt for 64 bit
The send_int_page is a bitmap, which was being confused between
u32 and unsigned long. Introduce simple common function to send
interrupt, and eliminate untyped pointer.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
-rw-r--r-- | drivers/hv/channel.c | 8 | ||||
-rw-r--r-- | drivers/hv/connection.c | 8 | ||||
-rw-r--r-- | drivers/hv/hyperv_vmbus.h | 8 |
3 files changed, 11 insertions, 13 deletions
diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c index be34547cdb681e..a016c5c0e472b0 100644 --- a/drivers/hv/channel.c +++ b/drivers/hv/channel.c @@ -47,12 +47,8 @@ void vmbus_setevent(struct vmbus_channel *channel) * For channels marked as in "low latency" mode * bypass the monitor page mechanism. */ - if ((channel->offermsg.monitor_allocated) && - (!channel->low_latency)) { - /* Each u32 represents 32 channels */ - sync_set_bit(channel->offermsg.child_relid & 31, - (unsigned long *) vmbus_connection.send_int_page + - (channel->offermsg.child_relid >> 5)); + if (channel->offermsg.monitor_allocated && !channel->low_latency) { + vmbus_send_interrupt(channel->offermsg.child_relid); /* Get the child to parent monitor page */ monitorpage = vmbus_connection.monitor_pages[1]; diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c index 19dd142ed09f3a..3ee5bc4f4d0b4c 100644 --- a/drivers/hv/connection.c +++ b/drivers/hv/connection.c @@ -482,12 +482,8 @@ void vmbus_set_event(struct vmbus_channel *channel) { u32 child_relid = channel->offermsg.child_relid; - if (!channel->is_dedicated_interrupt) { - /* Each u32 represents 32 channels */ - sync_set_bit(child_relid & 31, - (unsigned long *)vmbus_connection.send_int_page + - (child_relid >> 5)); - } + if (!channel->is_dedicated_interrupt) + vmbus_send_interrupt(child_relid); hv_do_hypercall(HVCALL_SIGNAL_EVENT, channel->sig_event, NULL); } diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h index cefa996a7ddd15..915c31038b7445 100644 --- a/drivers/hv/hyperv_vmbus.h +++ b/drivers/hv/hyperv_vmbus.h @@ -576,7 +576,7 @@ struct vmbus_connection { * recvInterruptPage to see which bit is set */ void *int_page; - void *send_int_page; + unsigned long *send_int_page; void *recv_int_page; /* @@ -606,6 +606,12 @@ struct vmbus_msginfo { extern struct vmbus_connection vmbus_connection; +static inline void vmbus_send_interrupt(u32 relid) +{ + sync_set_bit(relid % BITS_PER_LONG, + vmbus_connection.send_int_page + BIT_WORD(relid)); +} + enum vmbus_message_handler_type { /* The related handler can sleep. */ VMHT_BLOCKING = 0, |