aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHaiyang Zhang <haiyangz@microsoft.com>2009-11-20 11:29:17 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-11-30 19:39:29 -0500
commit5996b3ddc422a16d53b8acf4980d0d6e8b2bf1ed (patch)
tree62f9898be6346988e33d2fb85b1b126accb3b5fb /drivers
parent8c960e49d8beaca7c5b3967cede225bbba36bf43 (diff)
Staging: hv: Fix vmbus event handler bug
The flag ENABLE_POLLING is always enabled in original Makefile, but accidently removed during porting to mainline kernel. The patch fixes this bug which can cause stalled network communication. Credit needs to go to Eric Sesterhenn <eric.sesterhenn@lsexperts.de> For pointing out a typo in the original code as well. Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/hv/Channel.c16
-rw-r--r--drivers/staging/hv/ChannelMgmt.c2
2 files changed, 5 insertions, 13 deletions
diff --git a/drivers/staging/hv/Channel.c b/drivers/staging/hv/Channel.c
index d649ee169d95..746370e82115 100644
--- a/drivers/staging/hv/Channel.c
+++ b/drivers/staging/hv/Channel.c
@@ -611,7 +611,7 @@ void VmbusChannelClose(struct vmbus_channel *Channel)
611 611
612 /* Stop callback and cancel the timer asap */ 612 /* Stop callback and cancel the timer asap */
613 Channel->OnChannelCallback = NULL; 613 Channel->OnChannelCallback = NULL;
614 del_timer(&Channel->poll_timer); 614 del_timer_sync(&Channel->poll_timer);
615 615
616 /* Send a closing message */ 616 /* Send a closing message */
617 info = kmalloc(sizeof(*info) + 617 info = kmalloc(sizeof(*info) +
@@ -978,14 +978,10 @@ void VmbusChannelOnChannelEvent(struct vmbus_channel *Channel)
978{ 978{
979 DumpVmbusChannel(Channel); 979 DumpVmbusChannel(Channel);
980 ASSERT(Channel->OnChannelCallback); 980 ASSERT(Channel->OnChannelCallback);
981#ifdef ENABLE_POLLING 981
982 del_timer(&Channel->poll_timer);
983 Channel->OnChannelCallback(Channel->ChannelCallbackContext);
984 channel->poll_timer.expires(jiffies + usecs_to_jiffies(100);
985 add_timer(&channel->poll_timer);
986#else
987 Channel->OnChannelCallback(Channel->ChannelCallbackContext); 982 Channel->OnChannelCallback(Channel->ChannelCallbackContext);
988#endif 983
984 mod_timer(&Channel->poll_timer, jiffies + usecs_to_jiffies(100));
989} 985}
990 986
991/** 987/**
@@ -997,10 +993,6 @@ void VmbusChannelOnTimer(unsigned long data)
997 993
998 if (channel->OnChannelCallback) { 994 if (channel->OnChannelCallback) {
999 channel->OnChannelCallback(channel->ChannelCallbackContext); 995 channel->OnChannelCallback(channel->ChannelCallbackContext);
1000#ifdef ENABLE_POLLING
1001 channel->poll_timer.expires(jiffies + usecs_to_jiffies(100);
1002 add_timer(&channel->poll_timer);
1003#endif
1004 } 996 }
1005} 997}
1006 998
diff --git a/drivers/staging/hv/ChannelMgmt.c b/drivers/staging/hv/ChannelMgmt.c
index 3db62caedcff..ef38467ed4e2 100644
--- a/drivers/staging/hv/ChannelMgmt.c
+++ b/drivers/staging/hv/ChannelMgmt.c
@@ -119,7 +119,7 @@ static inline void ReleaseVmbusChannel(void *context)
119 */ 119 */
120void FreeVmbusChannel(struct vmbus_channel *Channel) 120void FreeVmbusChannel(struct vmbus_channel *Channel)
121{ 121{
122 del_timer(&Channel->poll_timer); 122 del_timer_sync(&Channel->poll_timer);
123 123
124 /* 124 /*
125 * We have to release the channel's workqueue/thread in the vmbus's 125 * We have to release the channel's workqueue/thread in the vmbus's