diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2009-07-15 21:56:45 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-09-15 19:01:48 (GMT) |
commit | dd0813b6f51b33529f37ba43334ac65e82d772e8 (patch) | |
tree | 480924fd5a542fee8415d03b31d745a11b2d543c /drivers/staging/hv/Channel.c | |
parent | 6436873afce6f20fecc0c5099db899b25e1e6c2b (diff) | |
download | linux-fsl-qoriq-dd0813b6f51b33529f37ba43334ac65e82d772e8.tar.xz |
Staging: hv: make gVmbusConnection.ChannelMsgLock a real spinlock
Don't use the wrapper functions for this lock, make it a real
lock so that we know what is going on.
I don't think we really want to be doing a irqsave for this code, but I
left it alone to preserve the original codepath. It should be reviewed
later.
Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/hv/Channel.c')
-rw-r--r-- | drivers/staging/hv/Channel.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/staging/hv/Channel.c b/drivers/staging/hv/Channel.c index 757aba6..3f48ac7 100644 --- a/drivers/staging/hv/Channel.c +++ b/drivers/staging/hv/Channel.c @@ -214,6 +214,7 @@ VmbusChannelOpen( VMBUS_CHANNEL_OPEN_CHANNEL* openMsg; VMBUS_CHANNEL_MSGINFO* openInfo; void *in, *out; + unsigned long flags; DPRINT_ENTER(VMBUS); @@ -280,9 +281,9 @@ VmbusChannelOpen( memcpy(openMsg->UserData, UserData, UserDataLen); } - SpinlockAcquire(gVmbusConnection.ChannelMsgLock); + spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags); INSERT_TAIL_LIST(&gVmbusConnection.ChannelMsgList, &openInfo->MsgListEntry); - SpinlockRelease(gVmbusConnection.ChannelMsgLock); + spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags); DPRINT_DBG(VMBUS, "Sending channel open msg..."); @@ -306,9 +307,9 @@ VmbusChannelOpen( } Cleanup: - SpinlockAcquire(gVmbusConnection.ChannelMsgLock); + spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags); REMOVE_ENTRY_LIST(&openInfo->MsgListEntry); - SpinlockRelease(gVmbusConnection.ChannelMsgLock); + spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags); WaitEventClose(openInfo->WaitEvent); kfree(openInfo); @@ -531,6 +532,7 @@ VmbusChannelEstablishGpadl( LIST_ENTRY* anchor; LIST_ENTRY* curr; u32 nextGpadlHandle; + unsigned long flags; DPRINT_ENTER(VMBUS); @@ -549,9 +551,9 @@ VmbusChannelEstablishGpadl( DumpGpadlHeader(gpadlMsg); - SpinlockAcquire(gVmbusConnection.ChannelMsgLock); + spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags); INSERT_TAIL_LIST(&gVmbusConnection.ChannelMsgList, &msgInfo->MsgListEntry); - SpinlockRelease(gVmbusConnection.ChannelMsgLock); + spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags); DPRINT_DBG(VMBUS, "buffer %p, size %d msg cnt %d", Kbuffer, Size, msgCount); @@ -592,9 +594,9 @@ VmbusChannelEstablishGpadl( *GpadlHandle = gpadlMsg->Gpadl; Cleanup: - SpinlockAcquire(gVmbusConnection.ChannelMsgLock); + spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags); REMOVE_ENTRY_LIST(&msgInfo->MsgListEntry); - SpinlockRelease(gVmbusConnection.ChannelMsgLock); + spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags); WaitEventClose(msgInfo->WaitEvent); kfree(msgInfo); @@ -624,6 +626,7 @@ VmbusChannelTeardownGpadl( int ret=0; VMBUS_CHANNEL_GPADL_TEARDOWN *msg; VMBUS_CHANNEL_MSGINFO* info; + unsigned long flags; DPRINT_ENTER(VMBUS); @@ -640,9 +643,9 @@ VmbusChannelTeardownGpadl( msg->ChildRelId = Channel->OfferMsg.ChildRelId; msg->Gpadl = GpadlHandle; - SpinlockAcquire(gVmbusConnection.ChannelMsgLock); + spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags); INSERT_TAIL_LIST(&gVmbusConnection.ChannelMsgList, &info->MsgListEntry); - SpinlockRelease(gVmbusConnection.ChannelMsgLock); + spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags); ret = VmbusPostMessage(msg, sizeof(VMBUS_CHANNEL_GPADL_TEARDOWN)); if (ret != 0) @@ -653,9 +656,9 @@ VmbusChannelTeardownGpadl( WaitEventWait(info->WaitEvent); // Received a torndown response - SpinlockAcquire(gVmbusConnection.ChannelMsgLock); + spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags); REMOVE_ENTRY_LIST(&info->MsgListEntry); - SpinlockRelease(gVmbusConnection.ChannelMsgLock); + spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags); WaitEventClose(info->WaitEvent); kfree(info); |