summaryrefslogtreecommitdiff
path: root/drivers/staging/hv/ChannelMgmt.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2009-07-15 21:57:16 (GMT)
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-15 19:01:48 (GMT)
commit0f5e44ca6e777660af6b0eb44d4787563932eda8 (patch)
tree63e1c8598cc093682747da8587292a638a44e68e /drivers/staging/hv/ChannelMgmt.c
parentdd0813b6f51b33529f37ba43334ac65e82d772e8 (diff)
downloadlinux-fsl-qoriq-0f5e44ca6e777660af6b0eb44d4787563932eda8.tar.xz
Staging: hv: make gVmbusConnection.ChannelLock 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.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/staging/hv/ChannelMgmt.c b/drivers/staging/hv/ChannelMgmt.c
index ddc7918..00b4ace 100644
--- a/drivers/staging/hv/ChannelMgmt.c
+++ b/drivers/staging/hv/ChannelMgmt.c
@@ -233,11 +233,12 @@ VmbusChannelProcessOffer(
LIST_ENTRY* curr;
bool fNew = true;
VMBUS_CHANNEL* channel;
+ unsigned long flags;
DPRINT_ENTER(VMBUS);
// Make sure this is a new offer
- SpinlockAcquire(gVmbusConnection.ChannelLock);
+ spin_lock_irqsave(&gVmbusConnection.channel_lock, flags);
ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelList)
{
@@ -255,7 +256,7 @@ VmbusChannelProcessOffer(
{
INSERT_TAIL_LIST(&gVmbusConnection.ChannelList, &newChannel->ListEntry);
}
- SpinlockRelease(gVmbusConnection.ChannelLock);
+ spin_unlock_irqrestore(&gVmbusConnection.channel_lock, flags);
if (!fNew)
{
@@ -282,9 +283,9 @@ VmbusChannelProcessOffer(
DPRINT_ERR(VMBUS, "unable to add child device object (relid %d)",
newChannel->OfferMsg.ChildRelId);
- SpinlockAcquire(gVmbusConnection.ChannelLock);
+ spin_lock_irqsave(&gVmbusConnection.channel_lock, flags);
REMOVE_ENTRY_LIST(&newChannel->ListEntry);
- SpinlockRelease(gVmbusConnection.ChannelLock);
+ spin_unlock_irqrestore(&gVmbusConnection.channel_lock, flags);
FreeVmbusChannel(newChannel);
}
@@ -785,8 +786,9 @@ VmbusChannelReleaseUnattachedChannels(
LIST_ENTRY *entry;
VMBUS_CHANNEL *channel;
VMBUS_CHANNEL *start=NULL;
+ unsigned long flags;
- SpinlockAcquire(gVmbusConnection.ChannelLock);
+ spin_lock_irqsave(&gVmbusConnection.channel_lock, flags);
while (!IsListEmpty(&gVmbusConnection.ChannelList))
{
@@ -813,7 +815,7 @@ VmbusChannelReleaseUnattachedChannels(
}
}
- SpinlockRelease(gVmbusConnection.ChannelLock);
+ spin_unlock_irqrestore(&gVmbusConnection.channel_lock, flags);
}
// eof