mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 17:30:02 +00:00
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>
This commit is contained in:
parent
8c960e49d8
commit
5996b3ddc4
2 changed files with 5 additions and 13 deletions
|
@ -611,7 +611,7 @@ void VmbusChannelClose(struct vmbus_channel *Channel)
|
||||||
|
|
||||||
/* Stop callback and cancel the timer asap */
|
/* Stop callback and cancel the timer asap */
|
||||||
Channel->OnChannelCallback = NULL;
|
Channel->OnChannelCallback = NULL;
|
||||||
del_timer(&Channel->poll_timer);
|
del_timer_sync(&Channel->poll_timer);
|
||||||
|
|
||||||
/* Send a closing message */
|
/* Send a closing message */
|
||||||
info = kmalloc(sizeof(*info) +
|
info = kmalloc(sizeof(*info) +
|
||||||
|
@ -978,14 +978,10 @@ void VmbusChannelOnChannelEvent(struct vmbus_channel *Channel)
|
||||||
{
|
{
|
||||||
DumpVmbusChannel(Channel);
|
DumpVmbusChannel(Channel);
|
||||||
ASSERT(Channel->OnChannelCallback);
|
ASSERT(Channel->OnChannelCallback);
|
||||||
#ifdef ENABLE_POLLING
|
|
||||||
del_timer(&Channel->poll_timer);
|
|
||||||
Channel->OnChannelCallback(Channel->ChannelCallbackContext);
|
Channel->OnChannelCallback(Channel->ChannelCallbackContext);
|
||||||
channel->poll_timer.expires(jiffies + usecs_to_jiffies(100);
|
|
||||||
add_timer(&channel->poll_timer);
|
mod_timer(&Channel->poll_timer, jiffies + usecs_to_jiffies(100));
|
||||||
#else
|
|
||||||
Channel->OnChannelCallback(Channel->ChannelCallbackContext);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -997,10 +993,6 @@ void VmbusChannelOnTimer(unsigned long data)
|
||||||
|
|
||||||
if (channel->OnChannelCallback) {
|
if (channel->OnChannelCallback) {
|
||||||
channel->OnChannelCallback(channel->ChannelCallbackContext);
|
channel->OnChannelCallback(channel->ChannelCallbackContext);
|
||||||
#ifdef ENABLE_POLLING
|
|
||||||
channel->poll_timer.expires(jiffies + usecs_to_jiffies(100);
|
|
||||||
add_timer(&channel->poll_timer);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -119,7 +119,7 @@ static inline void ReleaseVmbusChannel(void *context)
|
||||||
*/
|
*/
|
||||||
void FreeVmbusChannel(struct vmbus_channel *Channel)
|
void FreeVmbusChannel(struct vmbus_channel *Channel)
|
||||||
{
|
{
|
||||||
del_timer(&Channel->poll_timer);
|
del_timer_sync(&Channel->poll_timer);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We have to release the channel's workqueue/thread in the vmbus's
|
* We have to release the channel's workqueue/thread in the vmbus's
|
||||||
|
|
Loading…
Reference in a new issue