[IA64-SGI] ensure XPC disengage request is processed

This patch fixes a problem in XPC disengage processing whereby it was not
seeing the request to disengage from a remote partition, so the disengage
wasn't happening. The disengagement is suppose to transpire during the time
a XPC channel is disconnecting, and should be completed before the channel
is declared to be disconnected.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
This commit is contained in:
Dean Nelson 2005-12-22 14:32:56 -06:00 committed by Tony Luck
parent 7ae69d2aa4
commit 246c7e33d5
5 changed files with 19 additions and 12 deletions

View file

@ -707,7 +707,7 @@ extern void xpc_connected_callout(struct xpc_channel *);
extern void xpc_deliver_msg(struct xpc_channel *); extern void xpc_deliver_msg(struct xpc_channel *);
extern void xpc_disconnect_channel(const int, struct xpc_channel *, extern void xpc_disconnect_channel(const int, struct xpc_channel *,
enum xpc_retval, unsigned long *); enum xpc_retval, unsigned long *);
extern void xpc_disconnecting_callout(struct xpc_channel *); extern void xpc_disconnect_callout(struct xpc_channel *, enum xpc_retval);
extern void xpc_partition_going_down(struct xpc_partition *, enum xpc_retval); extern void xpc_partition_going_down(struct xpc_partition *, enum xpc_retval);
extern void xpc_teardown_infrastructure(struct xpc_partition *); extern void xpc_teardown_infrastructure(struct xpc_partition *);

View file

@ -779,6 +779,12 @@ xpc_process_disconnect(struct xpc_channel *ch, unsigned long *irq_flags)
/* both sides are disconnected now */ /* both sides are disconnected now */
if (ch->flags & XPC_C_CONNECTCALLOUT) {
spin_unlock_irqrestore(&ch->lock, *irq_flags);
xpc_disconnect_callout(ch, xpcDisconnected);
spin_lock_irqsave(&ch->lock, *irq_flags);
}
/* it's now safe to free the channel's message queues */ /* it's now safe to free the channel's message queues */
xpc_free_msgqueues(ch); xpc_free_msgqueues(ch);
@ -1645,7 +1651,7 @@ xpc_disconnect_channel(const int line, struct xpc_channel *ch,
void void
xpc_disconnecting_callout(struct xpc_channel *ch) xpc_disconnect_callout(struct xpc_channel *ch, enum xpc_retval reason)
{ {
/* /*
* Let the channel's registerer know that the channel is being * Let the channel's registerer know that the channel is being
@ -1654,15 +1660,13 @@ xpc_disconnecting_callout(struct xpc_channel *ch)
*/ */
if (ch->func != NULL) { if (ch->func != NULL) {
dev_dbg(xpc_chan, "ch->func() called, reason=xpcDisconnecting," dev_dbg(xpc_chan, "ch->func() called, reason=%d, partid=%d, "
" partid=%d, channel=%d\n", ch->partid, ch->number); "channel=%d\n", reason, ch->partid, ch->number);
ch->func(xpcDisconnecting, ch->partid, ch->number, NULL, ch->func(reason, ch->partid, ch->number, NULL, ch->key);
ch->key);
dev_dbg(xpc_chan, "ch->func() returned, reason=" dev_dbg(xpc_chan, "ch->func() returned, reason=%d, partid=%d, "
"xpcDisconnecting, partid=%d, channel=%d\n", "channel=%d\n", reason, ch->partid, ch->number);
ch->partid, ch->number);
} }
} }

View file

@ -773,7 +773,7 @@ xpc_daemonize_kthread(void *args)
ch->flags |= XPC_C_DISCONNECTCALLOUT; ch->flags |= XPC_C_DISCONNECTCALLOUT;
spin_unlock_irqrestore(&ch->lock, irq_flags); spin_unlock_irqrestore(&ch->lock, irq_flags);
xpc_disconnecting_callout(ch); xpc_disconnect_callout(ch, xpcDisconnecting);
} else { } else {
spin_unlock_irqrestore(&ch->lock, irq_flags); spin_unlock_irqrestore(&ch->lock, irq_flags);
} }

View file

@ -771,7 +771,8 @@ xpc_identify_act_IRQ_req(int nasid)
} }
} }
if (!xpc_partition_disengaged(part)) { if (part->disengage_request_timeout > 0 &&
!xpc_partition_disengaged(part)) {
/* still waiting on other side to disengage from us */ /* still waiting on other side to disengage from us */
return; return;
} }

View file

@ -227,7 +227,9 @@ enum xpc_retval {
xpcOpenCloseError, /* 50: channel open/close protocol error */ xpcOpenCloseError, /* 50: channel open/close protocol error */
xpcUnknownReason /* 51: unknown reason -- must be last in list */ xpcDisconnected, /* 51: channel disconnected (closed) */
xpcUnknownReason /* 52: unknown reason -- must be last in list */
}; };