diff options
Diffstat (limited to 'drivers/misc/sgi-xp/xpc_channel.c')
-rw-r--r-- | drivers/misc/sgi-xp/xpc_channel.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/misc/sgi-xp/xpc_channel.c b/drivers/misc/sgi-xp/xpc_channel.c index 17ab75d69e83..73df9fb5ee66 100644 --- a/drivers/misc/sgi-xp/xpc_channel.c +++ b/drivers/misc/sgi-xp/xpc_channel.c | |||
@@ -39,7 +39,7 @@ xpc_process_connect(struct xpc_channel *ch, unsigned long *irq_flags) | |||
39 | 39 | ||
40 | if (!(ch->flags & XPC_C_SETUP)) { | 40 | if (!(ch->flags & XPC_C_SETUP)) { |
41 | spin_unlock_irqrestore(&ch->lock, *irq_flags); | 41 | spin_unlock_irqrestore(&ch->lock, *irq_flags); |
42 | ret = xpc_allocate_msgqueues(ch); | 42 | ret = xpc_setup_msg_structures(ch); |
43 | spin_lock_irqsave(&ch->lock, *irq_flags); | 43 | spin_lock_irqsave(&ch->lock, *irq_flags); |
44 | 44 | ||
45 | if (ret != xpSuccess) | 45 | if (ret != xpSuccess) |
@@ -62,8 +62,6 @@ xpc_process_connect(struct xpc_channel *ch, unsigned long *irq_flags) | |||
62 | if (!(ch->flags & XPC_C_ROPENREPLY)) | 62 | if (!(ch->flags & XPC_C_ROPENREPLY)) |
63 | return; | 63 | return; |
64 | 64 | ||
65 | DBUG_ON(ch->remote_msgqueue_pa == 0); | ||
66 | |||
67 | ch->flags = (XPC_C_CONNECTED | XPC_C_SETUP); /* clear all else */ | 65 | ch->flags = (XPC_C_CONNECTED | XPC_C_SETUP); /* clear all else */ |
68 | 66 | ||
69 | dev_info(xpc_chan, "channel %d to partition %d connected\n", | 67 | dev_info(xpc_chan, "channel %d to partition %d connected\n", |
@@ -134,13 +132,23 @@ xpc_process_disconnect(struct xpc_channel *ch, unsigned long *irq_flags) | |||
134 | spin_lock_irqsave(&ch->lock, *irq_flags); | 132 | spin_lock_irqsave(&ch->lock, *irq_flags); |
135 | } | 133 | } |
136 | 134 | ||
135 | DBUG_ON(atomic_read(&ch->n_to_notify) != 0); | ||
136 | |||
137 | /* it's now safe to free the channel's message queues */ | 137 | /* it's now safe to free the channel's message queues */ |
138 | xpc_free_msgqueues(ch); | 138 | xpc_teardown_msg_structures(ch); |
139 | |||
140 | ch->func = NULL; | ||
141 | ch->key = NULL; | ||
142 | ch->msg_size = 0; | ||
143 | ch->local_nentries = 0; | ||
144 | ch->remote_nentries = 0; | ||
145 | ch->kthreads_assigned_limit = 0; | ||
146 | ch->kthreads_idle_limit = 0; | ||
139 | 147 | ||
140 | /* | 148 | /* |
141 | * Mark the channel disconnected and clear all other flags, including | 149 | * Mark the channel disconnected and clear all other flags, including |
142 | * XPC_C_SETUP (because of call to xpc_free_msgqueues()) but not | 150 | * XPC_C_SETUP (because of call to xpc_teardown_msg_structures()) but |
143 | * including XPC_C_WDISCONNECT (if it was set). | 151 | * not including XPC_C_WDISCONNECT (if it was set). |
144 | */ | 152 | */ |
145 | ch->flags = (XPC_C_DISCONNECTED | (ch->flags & XPC_C_WDISCONNECT)); | 153 | ch->flags = (XPC_C_DISCONNECTED | (ch->flags & XPC_C_WDISCONNECT)); |
146 | 154 | ||
@@ -395,7 +403,7 @@ again: | |||
395 | DBUG_ON(args->remote_nentries == 0); | 403 | DBUG_ON(args->remote_nentries == 0); |
396 | 404 | ||
397 | ch->flags |= XPC_C_ROPENREPLY; | 405 | ch->flags |= XPC_C_ROPENREPLY; |
398 | ch->remote_msgqueue_pa = args->local_msgqueue_pa; | 406 | xpc_save_remote_msgqueue_pa(ch, args->local_msgqueue_pa); |
399 | 407 | ||
400 | if (args->local_nentries < ch->remote_nentries) { | 408 | if (args->local_nentries < ch->remote_nentries) { |
401 | dev_dbg(xpc_chan, "XPC_CHCTL_OPENREPLY: new " | 409 | dev_dbg(xpc_chan, "XPC_CHCTL_OPENREPLY: new " |