summaryrefslogtreecommitdiff
path: root/drivers/staging/hv/Connection.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2009-07-15 21:56:45 (GMT)
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-15 19:01:48 (GMT)
commitdd0813b6f51b33529f37ba43334ac65e82d772e8 (patch)
tree480924fd5a542fee8415d03b31d745a11b2d543c /drivers/staging/hv/Connection.c
parent6436873afce6f20fecc0c5099db899b25e1e6c2b (diff)
downloadlinux-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/Connection.c')
-rw-r--r--drivers/staging/hv/Connection.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/staging/hv/Connection.c b/drivers/staging/hv/Connection.c
index 6f78351..13e164d 100644
--- a/drivers/staging/hv/Connection.c
+++ b/drivers/staging/hv/Connection.c
@@ -53,6 +53,7 @@ VmbusConnect(
int ret=0;
VMBUS_CHANNEL_MSGINFO *msgInfo=NULL;
VMBUS_CHANNEL_INITIATE_CONTACT *msg;
+ unsigned long flags;
DPRINT_ENTER(VMBUS);
@@ -65,7 +66,7 @@ VmbusConnect(
gVmbusConnection.WorkQueue = WorkQueueCreate("vmbusQ");
INITIALIZE_LIST_HEAD(&gVmbusConnection.ChannelMsgList);
- gVmbusConnection.ChannelMsgLock = SpinlockCreate();
+ spin_lock_init(&gVmbusConnection.channelmsg_lock);
INITIALIZE_LIST_HEAD(&gVmbusConnection.ChannelList);
gVmbusConnection.ChannelLock = SpinlockCreate();
@@ -107,9 +108,9 @@ VmbusConnect(
// Add to list before we send the request since we may receive the response
// before returning from this routine
- 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, "Vmbus connection - interrupt pfn %llx, monitor1 pfn %llx,, monitor2 pfn %llx",
msg->InterruptPage, msg->MonitorPage1, msg->MonitorPage2);
@@ -156,7 +157,6 @@ Cleanup:
WorkQueueClose(gVmbusConnection.WorkQueue);
SpinlockClose(gVmbusConnection.ChannelLock);
- SpinlockClose(gVmbusConnection.ChannelMsgLock);
if (gVmbusConnection.InterruptPage)
{
@@ -222,8 +222,6 @@ VmbusDisconnect(
// TODO: iterate thru the msg list and free up
- SpinlockClose(gVmbusConnection.ChannelMsgLock);
-
WorkQueueClose(gVmbusConnection.WorkQueue);
gVmbusConnection.ConnectState = Disconnected;