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/ChannelMgmt.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/ChannelMgmt.c')
-rw-r--r-- | drivers/staging/hv/ChannelMgmt.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/staging/hv/ChannelMgmt.c b/drivers/staging/hv/ChannelMgmt.c index 7a0fd09..ddc7918 100644 --- a/drivers/staging/hv/ChannelMgmt.c +++ b/drivers/staging/hv/ChannelMgmt.c @@ -472,13 +472,14 @@ VmbusChannelOnOpenResult( VMBUS_CHANNEL_MSGINFO* msgInfo; VMBUS_CHANNEL_MESSAGE_HEADER* requestHeader; VMBUS_CHANNEL_OPEN_CHANNEL* openMsg; + unsigned long flags; DPRINT_ENTER(VMBUS); DPRINT_DBG(VMBUS, "vmbus open result - %d", result->Status); // Find the open msg, copy the result and signal/unblock the wait event - SpinlockAcquire(gVmbusConnection.ChannelMsgLock); + spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags); ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelMsgList) { @@ -497,7 +498,7 @@ VmbusChannelOnOpenResult( } } } - SpinlockRelease(gVmbusConnection.ChannelMsgLock); + spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags); DPRINT_EXIT(VMBUS); } @@ -525,13 +526,14 @@ VmbusChannelOnGpadlCreated( VMBUS_CHANNEL_MSGINFO *msgInfo; VMBUS_CHANNEL_MESSAGE_HEADER *requestHeader; VMBUS_CHANNEL_GPADL_HEADER *gpadlHeader; + unsigned long flags; DPRINT_ENTER(VMBUS); DPRINT_DBG(VMBUS, "vmbus gpadl created result - %d", gpadlCreated->CreationStatus); // Find the establish msg, copy the result and signal/unblock the wait event - SpinlockAcquire(gVmbusConnection.ChannelMsgLock); + spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags); ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelMsgList) { @@ -551,7 +553,7 @@ VmbusChannelOnGpadlCreated( } } } - SpinlockRelease(gVmbusConnection.ChannelMsgLock); + spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags); DPRINT_EXIT(VMBUS); } @@ -579,11 +581,12 @@ VmbusChannelOnGpadlTorndown( VMBUS_CHANNEL_MSGINFO* msgInfo; VMBUS_CHANNEL_MESSAGE_HEADER *requestHeader; VMBUS_CHANNEL_GPADL_TEARDOWN *gpadlTeardown; + unsigned long flags; DPRINT_ENTER(VMBUS); // Find the open msg, copy the result and signal/unblock the wait event - SpinlockAcquire(gVmbusConnection.ChannelMsgLock); + spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags); ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelMsgList) { @@ -602,7 +605,7 @@ VmbusChannelOnGpadlTorndown( } } } - SpinlockRelease(gVmbusConnection.ChannelMsgLock); + spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags); DPRINT_EXIT(VMBUS); } @@ -630,10 +633,11 @@ VmbusChannelOnVersionResponse( VMBUS_CHANNEL_MESSAGE_HEADER *requestHeader; VMBUS_CHANNEL_INITIATE_CONTACT *initiate; VMBUS_CHANNEL_VERSION_RESPONSE *versionResponse = (VMBUS_CHANNEL_VERSION_RESPONSE*)hdr; + unsigned long flags; DPRINT_ENTER(VMBUS); - SpinlockAcquire(gVmbusConnection.ChannelMsgLock); + spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags); ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelMsgList) { @@ -647,7 +651,7 @@ VmbusChannelOnVersionResponse( WaitEventSet(msgInfo->WaitEvent); } } - SpinlockRelease(gVmbusConnection.ChannelMsgLock); + spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags); DPRINT_EXIT(VMBUS); } |