Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65c17b80 authored by Dean Nelson's avatar Dean Nelson Committed by Linus Torvalds
Browse files

drivers/misc/sgi-xp: clean up return values



Make XP return values more generic to XP and not so tied to XPC by changing
enum xpc_retval to xp_retval, along with changing return value prefixes from
xpc to xp.  Also, cleanup a comment block that referenced some of these return
values as well as the handling of BTE related return values.

Signed-off-by: default avatarDean Nelson <dcn@sgi.com>
Acked-by: default avatarRobin Holt <holt@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0cf942d7
Loading
Loading
Loading
Loading
+106 −185
Original line number Diff line number Diff line
@@ -157,215 +157,136 @@ struct xpc_msg {
/*
 * Define the return values and values passed to user's callout functions.
 * (It is important to add new value codes at the end just preceding
 * xpcUnknownReason, which must have the highest numerical value.)
 * xpUnknownReason, which must have the highest numerical value.)
 */
enum xpc_retval {
	xpcSuccess = 0,
enum xp_retval {
	xpSuccess = 0,

	xpcNotConnected,	/*  1: channel is not connected */
	xpcConnected,		/*  2: channel connected (opened) */
	xpcRETIRED1,		/*  3: (formerly xpcDisconnected) */
	xpNotConnected,		/*  1: channel is not connected */
	xpConnected,		/*  2: channel connected (opened) */
	xpRETIRED1,		/*  3: (formerly xpDisconnected) */

	xpcMsgReceived,		/*  4: message received */
	xpcMsgDelivered,	/*  5: message delivered and acknowledged */
	xpMsgReceived,		/*  4: message received */
	xpMsgDelivered,		/*  5: message delivered and acknowledged */

	xpcRETIRED2,		/*  6: (formerly xpcTransferFailed) */
	xpRETIRED2,		/*  6: (formerly xpTransferFailed) */

	xpcNoWait,		/*  7: operation would require wait */
	xpcRetry,		/*  8: retry operation */
	xpcTimeout,		/*  9: timeout in xpc_allocate_msg_wait() */
	xpcInterrupted,		/* 10: interrupted wait */
	xpNoWait,		/*  7: operation would require wait */
	xpRetry,		/*  8: retry operation */
	xpTimeout,		/*  9: timeout in xpc_allocate_msg_wait() */
	xpInterrupted,		/* 10: interrupted wait */

	xpcUnequalMsgSizes,	/* 11: message size disparity between sides */
	xpcInvalidAddress,	/* 12: invalid address */
	xpUnequalMsgSizes,	/* 11: message size disparity between sides */
	xpInvalidAddress,	/* 12: invalid address */

	xpcNoMemory,		/* 13: no memory available for XPC structures */
	xpcLackOfResources,	/* 14: insufficient resources for operation */
	xpcUnregistered,	/* 15: channel is not registered */
	xpcAlreadyRegistered,	/* 16: channel is already registered */
	xpNoMemory,		/* 13: no memory available for XPC structures */
	xpLackOfResources,	/* 14: insufficient resources for operation */
	xpUnregistered,		/* 15: channel is not registered */
	xpAlreadyRegistered,	/* 16: channel is already registered */

	xpcPartitionDown,	/* 17: remote partition is down */
	xpcNotLoaded,		/* 18: XPC module is not loaded */
	xpcUnloading,		/* 19: this side is unloading XPC module */
	xpPartitionDown,	/* 17: remote partition is down */
	xpNotLoaded,		/* 18: XPC module is not loaded */
	xpUnloading,		/* 19: this side is unloading XPC module */

	xpcBadMagic,		/* 20: XPC MAGIC string not found */
	xpBadMagic,		/* 20: XPC MAGIC string not found */

	xpcReactivating,	/* 21: remote partition was reactivated */
	xpReactivating,		/* 21: remote partition was reactivated */

	xpcUnregistering,	/* 22: this side is unregistering channel */
	xpcOtherUnregistering,	/* 23: other side is unregistering channel */
	xpUnregistering,	/* 22: this side is unregistering channel */
	xpOtherUnregistering,	/* 23: other side is unregistering channel */

	xpcCloneKThread,	/* 24: cloning kernel thread */
	xpcCloneKThreadFailed,	/* 25: cloning kernel thread failed */
	xpCloneKThread,		/* 24: cloning kernel thread */
	xpCloneKThreadFailed,	/* 25: cloning kernel thread failed */

	xpcNoHeartbeat,		/* 26: remote partition has no heartbeat */
	xpNoHeartbeat,		/* 26: remote partition has no heartbeat */

	xpcPioReadError,	/* 27: PIO read error */
	xpcPhysAddrRegFailed,	/* 28: registration of phys addr range failed */
	xpPioReadError,		/* 27: PIO read error */
	xpPhysAddrRegFailed,	/* 28: registration of phys addr range failed */

	xpcBteDirectoryError,	/* 29: maps to BTEFAIL_DIR */
	xpcBtePoisonError,	/* 30: maps to BTEFAIL_POISON */
	xpcBteWriteError,	/* 31: maps to BTEFAIL_WERR */
	xpcBteAccessError,	/* 32: maps to BTEFAIL_ACCESS */
	xpcBtePWriteError,	/* 33: maps to BTEFAIL_PWERR */
	xpcBtePReadError,	/* 34: maps to BTEFAIL_PRERR */
	xpcBteTimeOutError,	/* 35: maps to BTEFAIL_TOUT */
	xpcBteXtalkError,	/* 36: maps to BTEFAIL_XTERR */
	xpcBteNotAvailable,	/* 37: maps to BTEFAIL_NOTAVAIL */
	xpcBteUnmappedError,	/* 38: unmapped BTEFAIL_ error */
	xpRETIRED3,		/* 29: (formerly xpBteDirectoryError) */
	xpRETIRED4,		/* 30: (formerly xpBtePoisonError) */
	xpRETIRED5,		/* 31: (formerly xpBteWriteError) */
	xpRETIRED6,		/* 32: (formerly xpBteAccessError) */
	xpRETIRED7,		/* 33: (formerly xpBtePWriteError) */
	xpRETIRED8,		/* 34: (formerly xpBtePReadError) */
	xpRETIRED9,		/* 35: (formerly xpBteTimeOutError) */
	xpRETIRED10,		/* 36: (formerly xpBteXtalkError) */
	xpRETIRED11,		/* 37: (formerly xpBteNotAvailable) */
	xpRETIRED12,		/* 38: (formerly xpBteUnmappedError) */

	xpcBadVersion,		/* 39: bad version number */
	xpcVarsNotSet,		/* 40: the XPC variables are not set up */
	xpcNoRsvdPageAddr,	/* 41: unable to get rsvd page's phys addr */
	xpcInvalidPartid,	/* 42: invalid partition ID */
	xpcLocalPartid,		/* 43: local partition ID */
	xpBadVersion,		/* 39: bad version number */
	xpVarsNotSet,		/* 40: the XPC variables are not set up */
	xpNoRsvdPageAddr,	/* 41: unable to get rsvd page's phys addr */
	xpInvalidPartid,	/* 42: invalid partition ID */
	xpLocalPartid,		/* 43: local partition ID */

	xpcOtherGoingDown,	/* 44: other side going down, reason unknown */
	xpcSystemGoingDown,	/* 45: system is going down, reason unknown */
	xpcSystemHalt,		/* 46: system is being halted */
	xpcSystemReboot,	/* 47: system is being rebooted */
	xpcSystemPoweroff,	/* 48: system is being powered off */
	xpOtherGoingDown,	/* 44: other side going down, reason unknown */
	xpSystemGoingDown,	/* 45: system is going down, reason unknown */
	xpSystemHalt,		/* 46: system is being halted */
	xpSystemReboot,		/* 47: system is being rebooted */
	xpSystemPoweroff,	/* 48: system is being powered off */

	xpcDisconnecting,	/* 49: channel disconnecting (closing) */
	xpDisconnecting,	/* 49: channel disconnecting (closing) */

	xpcOpenCloseError,	/* 50: channel open/close protocol error */
	xpOpenCloseError,	/* 50: channel open/close protocol error */

	xpcDisconnected,	/* 51: channel disconnected (closed) */
	xpDisconnected,		/* 51: channel disconnected (closed) */

	xpcBteSh2Start,		/* 52: BTE CRB timeout */
	xpBteCopyError,		/* 52: bte_copy() returned error */

				/* 53: 0x1 BTE Error Response Short */
	xpcBteSh2RspShort = xpcBteSh2Start + BTEFAIL_SH2_RESP_SHORT,

				/* 54: 0x2 BTE Error Response Long */
	xpcBteSh2RspLong = xpcBteSh2Start + BTEFAIL_SH2_RESP_LONG,

				/* 56: 0x4 BTE Error Response DSB */
	xpcBteSh2RspDSB = xpcBteSh2Start + BTEFAIL_SH2_RESP_DSP,

				/* 60: 0x8 BTE Error Response Access */
	xpcBteSh2RspAccess = xpcBteSh2Start + BTEFAIL_SH2_RESP_ACCESS,

				/* 68: 0x10 BTE Error CRB timeout */
	xpcBteSh2CRBTO = xpcBteSh2Start + BTEFAIL_SH2_CRB_TO,

				/* 84: 0x20 BTE Error NACK limit */
	xpcBteSh2NACKLimit = xpcBteSh2Start + BTEFAIL_SH2_NACK_LIMIT,

				/* 115: BTE end */
	xpcBteSh2End = xpcBteSh2Start + BTEFAIL_SH2_ALL,

	xpcUnknownReason	/* 116: unknown reason - must be last in enum */
	xpUnknownReason		/* 53: unknown reason - must be last in enum */
};

/*
 * Define the callout function types used by XPC to update the user on
 * connection activity and state changes (via the user function registered by
 * xpc_connect()) and to notify them of messages received and delivered (via
 * the user function registered by xpc_send_notify()).
 *
 * The two function types are xpc_channel_func and xpc_notify_func and
 * both share the following arguments, with the exception of "data", which
 * only xpc_channel_func has.
 * Define the callout function type used by XPC to update the user on
 * connection activity and state changes via the user function registered
 * by xpc_connect().
 *
 * Arguments:
 *
 *	reason - reason code. (See following table.)
 *	reason - reason code.
 *	partid - partition ID associated with condition.
 *	ch_number - channel # associated with condition.
 *	data - pointer to optional data. (See following table.)
 *	data - pointer to optional data.
 *	key - pointer to optional user-defined value provided as the "key"
 *	      argument to xpc_connect() or xpc_send_notify().
 *
 * In the following table the "Optional Data" column applies to callouts made
 * to functions registered by xpc_connect(). A "NA" in that column indicates
 * that this reason code can be passed to functions registered by
 * xpc_send_notify() (i.e. they don't have data arguments).
 *	      argument to xpc_connect().
 *
 * Also, the first three reason codes in the following table indicate
 * success, whereas the others indicate failure. When a failure reason code
 * is received, one can assume that the channel is not connected.
 * A reason code of xpConnected indicates that a connection has been
 * established to the specified partition on the specified channel. The data
 * argument indicates the max number of entries allowed in the message queue.
 *
 * A reason code of xpMsgReceived indicates that a XPC message arrived from
 * the specified partition on the specified channel. The data argument
 * specifies the address of the message's payload. The user must call
 * xpc_received() when finished with the payload.
 *
 * Reason Code          | Cause                          | Optional Data
 * =====================+================================+=====================
 * xpcConnected         | connection has been established| max #of entries
 *                      | to the specified partition on  | allowed in message
 *                      | the specified channel          | queue
 * ---------------------+--------------------------------+---------------------
 * xpcMsgReceived       | an XPC message arrived from    | address of payload
 *                      | the specified partition on the |
 *                      | specified channel              | [the user must call
 *                      |                                | xpc_received() when
 *                      |                                | finished with the
 *                      |                                | payload]
 * ---------------------+--------------------------------+---------------------
 * xpcMsgDelivered      | notification that the message  | NA
 *                      | was delivered to the intended  |
 *                      | recipient and that they have   |
 *                      | acknowledged its receipt by    |
 *                      | calling xpc_received()         |
 * =====================+================================+=====================
 * xpcUnequalMsgSizes   | can't connect to the specified | NULL
 *                      | partition on the specified     |
 *                      | channel because of mismatched  |
 *                      | message sizes                  |
 * ---------------------+--------------------------------+---------------------
 * xpcNoMemory          | insufficient memory avaiable   | NULL
 *                      | to allocate message queue      |
 * ---------------------+--------------------------------+---------------------
 * xpcLackOfResources   | lack of resources to create    | NULL
 *                      | the necessary kthreads to      |
 *                      | support the channel            |
 * ---------------------+--------------------------------+---------------------
 * xpcUnregistering     | this side's user has           | NULL or NA
 *                      | unregistered by calling        |
 *                      | xpc_disconnect()               |
 * ---------------------+--------------------------------+---------------------
 * xpcOtherUnregistering| the other side's user has      | NULL or NA
 *                      | unregistered by calling        |
 *                      | xpc_disconnect()               |
 * ---------------------+--------------------------------+---------------------
 * xpcNoHeartbeat       | the other side's XPC is no     | NULL or NA
 *                      | longer heartbeating            |
 *                      |                                |
 * ---------------------+--------------------------------+---------------------
 * xpcUnloading         | this side's XPC module is      | NULL or NA
 *                      | being unloaded                 |
 *                      |                                |
 * ---------------------+--------------------------------+---------------------
 * xpcOtherUnloading    | the other side's XPC module is | NULL or NA
 *                      | is being unloaded              |
 *                      |                                |
 * ---------------------+--------------------------------+---------------------
 * xpcPioReadError      | xp_nofault_PIOR() returned an  | NULL or NA
 *                      | error while sending an IPI     |
 *                      |                                |
 * ---------------------+--------------------------------+---------------------
 * xpcInvalidAddress    | the address either received or | NULL or NA
 *                      | sent by the specified partition|
 *                      | is invalid                     |
 * ---------------------+--------------------------------+---------------------
 * xpcBteNotAvailable   | attempt to pull data from the  | NULL or NA
 * xpcBtePoisonError    | specified partition over the   |
 * xpcBteWriteError     | specified channel via a        |
 * xpcBteAccessError    | bte_copy() failed              |
 * xpcBteTimeOutError   |                                |
 * xpcBteXtalkError     |                                |
 * xpcBteDirectoryError |                                |
 * xpcBteGenericError   |                                |
 * xpcBteUnmappedError  |                                |
 * ---------------------+--------------------------------+---------------------
 * xpcUnknownReason     | the specified channel to the   | NULL or NA
 *                      | specified partition was        |
 *                      | unavailable for unknown reasons|
 * =====================+================================+=====================
 * All other reason codes indicate failure. The data argmument is NULL.
 * When a failure reason code is received, one can assume that the channel
 * is not connected.
 */

typedef void (*xpc_channel_func) (enum xpc_retval reason, partid_t partid,
typedef void (*xpc_channel_func) (enum xp_retval reason, partid_t partid,
				  int ch_number, void *data, void *key);

typedef void (*xpc_notify_func) (enum xpc_retval reason, partid_t partid,
/*
 * Define the callout function type used by XPC to notify the user of
 * messages received and delivered via the user function registered by
 * xpc_send_notify().
 *
 * Arguments:
 *
 *	reason - reason code.
 *	partid - partition ID associated with condition.
 *	ch_number - channel # associated with condition.
 *	key - pointer to optional user-defined value provided as the "key"
 *	      argument to xpc_send_notify().
 *
 * A reason code of xpMsgDelivered indicates that the message was delivered
 * to the intended recipient and that they have acknowledged its receipt by
 * calling xpc_received().
 *
 * All other reason codes indicate failure.
 */
typedef void (*xpc_notify_func) (enum xp_retval reason, partid_t partid,
				 int ch_number, void *key);

/*
@@ -401,43 +322,43 @@ struct xpc_registration {
struct xpc_interface {
	void (*connect) (int);
	void (*disconnect) (int);
	enum xpc_retval (*allocate) (partid_t, int, u32, void **);
	enum xpc_retval (*send) (partid_t, int, void *);
	enum xpc_retval (*send_notify) (partid_t, int, void *,
	enum xp_retval (*allocate) (partid_t, int, u32, void **);
	enum xp_retval (*send) (partid_t, int, void *);
	enum xp_retval (*send_notify) (partid_t, int, void *,
					xpc_notify_func, void *);
	void (*received) (partid_t, int, void *);
	enum xpc_retval (*partid_to_nasids) (partid_t, void *);
	enum xp_retval (*partid_to_nasids) (partid_t, void *);
};

extern struct xpc_interface xpc_interface;

extern void xpc_set_interface(void (*)(int),
			      void (*)(int),
			      enum xpc_retval (*)(partid_t, int, u32, void **),
			      enum xpc_retval (*)(partid_t, int, void *),
			      enum xpc_retval (*)(partid_t, int, void *,
			      enum xp_retval (*)(partid_t, int, u32, void **),
			      enum xp_retval (*)(partid_t, int, void *),
			      enum xp_retval (*)(partid_t, int, void *,
						  xpc_notify_func, void *),
			      void (*)(partid_t, int, void *),
			      enum xpc_retval (*)(partid_t, void *));
			      enum xp_retval (*)(partid_t, void *));
extern void xpc_clear_interface(void);

extern enum xpc_retval xpc_connect(int, xpc_channel_func, void *, u16,
extern enum xp_retval xpc_connect(int, xpc_channel_func, void *, u16,
				   u16, u32, u32);
extern void xpc_disconnect(int);

static inline enum xpc_retval
static inline enum xp_retval
xpc_allocate(partid_t partid, int ch_number, u32 flags, void **payload)
{
	return xpc_interface.allocate(partid, ch_number, flags, payload);
}

static inline enum xpc_retval
static inline enum xp_retval
xpc_send(partid_t partid, int ch_number, void *payload)
{
	return xpc_interface.send(partid, ch_number, payload);
}

static inline enum xpc_retval
static inline enum xp_retval
xpc_send_notify(partid_t partid, int ch_number, void *payload,
		xpc_notify_func func, void *key)
{
@@ -450,7 +371,7 @@ xpc_received(partid_t partid, int ch_number, void *payload)
	return xpc_interface.received(partid, ch_number, payload);
}

static inline enum xpc_retval
static inline enum xp_retval
xpc_partid_to_nasids(partid_t partid, void *nasids)
{
	return xpc_interface.partid_to_nasids(partid, nasids);
+19 −19
Original line number Diff line number Diff line
@@ -42,21 +42,21 @@ EXPORT_SYMBOL_GPL(xpc_registrations);
/*
 * Initialize the XPC interface to indicate that XPC isn't loaded.
 */
static enum xpc_retval
static enum xp_retval
xpc_notloaded(void)
{
	return xpcNotLoaded;
	return xpNotLoaded;
}

struct xpc_interface xpc_interface = {
	(void (*)(int))xpc_notloaded,
	(void (*)(int))xpc_notloaded,
	(enum xpc_retval(*)(partid_t, int, u32, void **))xpc_notloaded,
	(enum xpc_retval(*)(partid_t, int, void *))xpc_notloaded,
	(enum xpc_retval(*)(partid_t, int, void *, xpc_notify_func, void *))
	(enum xp_retval(*)(partid_t, int, u32, void **))xpc_notloaded,
	(enum xp_retval(*)(partid_t, int, void *))xpc_notloaded,
	(enum xp_retval(*)(partid_t, int, void *, xpc_notify_func, void *))
	    xpc_notloaded,
	(void (*)(partid_t, int, void *))xpc_notloaded,
	(enum xpc_retval(*)(partid_t, void *))xpc_notloaded
	(enum xp_retval(*)(partid_t, void *))xpc_notloaded
};
EXPORT_SYMBOL_GPL(xpc_interface);

@@ -66,12 +66,12 @@ EXPORT_SYMBOL_GPL(xpc_interface);
void
xpc_set_interface(void (*connect) (int),
		  void (*disconnect) (int),
		  enum xpc_retval (*allocate) (partid_t, int, u32, void **),
		  enum xpc_retval (*send) (partid_t, int, void *),
		  enum xpc_retval (*send_notify) (partid_t, int, void *,
		  enum xp_retval (*allocate) (partid_t, int, u32, void **),
		  enum xp_retval (*send) (partid_t, int, void *),
		  enum xp_retval (*send_notify) (partid_t, int, void *,
						  xpc_notify_func, void *),
		  void (*received) (partid_t, int, void *),
		  enum xpc_retval (*partid_to_nasids) (partid_t, void *))
		  enum xp_retval (*partid_to_nasids) (partid_t, void *))
{
	xpc_interface.connect = connect;
	xpc_interface.disconnect = disconnect;
@@ -91,16 +91,16 @@ xpc_clear_interface(void)
{
	xpc_interface.connect = (void (*)(int))xpc_notloaded;
	xpc_interface.disconnect = (void (*)(int))xpc_notloaded;
	xpc_interface.allocate = (enum xpc_retval(*)(partid_t, int, u32,
	xpc_interface.allocate = (enum xp_retval(*)(partid_t, int, u32,
						     void **))xpc_notloaded;
	xpc_interface.send = (enum xpc_retval(*)(partid_t, int, void *))
	xpc_interface.send = (enum xp_retval(*)(partid_t, int, void *))
	    xpc_notloaded;
	xpc_interface.send_notify = (enum xpc_retval(*)(partid_t, int, void *,
	xpc_interface.send_notify = (enum xp_retval(*)(partid_t, int, void *,
							xpc_notify_func,
							void *))xpc_notloaded;
	xpc_interface.received = (void (*)(partid_t, int, void *))
	    xpc_notloaded;
	xpc_interface.partid_to_nasids = (enum xpc_retval(*)(partid_t, void *))
	xpc_interface.partid_to_nasids = (enum xp_retval(*)(partid_t, void *))
	    xpc_notloaded;
}
EXPORT_SYMBOL_GPL(xpc_clear_interface);
@@ -123,13 +123,13 @@ EXPORT_SYMBOL_GPL(xpc_clear_interface);
 *	nentries - max #of XPC message entries a message queue can contain.
 *		   The actual number, which is determined when a connection
 * 		   is established and may be less then requested, will be
 *		   passed to the user via the xpcConnected callout.
 *		   passed to the user via the xpConnected callout.
 *	assigned_limit - max number of kthreads allowed to be processing
 * 			 messages (per connection) at any given instant.
 *	idle_limit - max number of kthreads allowed to be idle at any given
 * 		     instant.
 */
enum xpc_retval
enum xp_retval
xpc_connect(int ch_number, xpc_channel_func func, void *key, u16 payload_size,
	    u16 nentries, u32 assigned_limit, u32 idle_limit)
{
@@ -143,12 +143,12 @@ xpc_connect(int ch_number, xpc_channel_func func, void *key, u16 payload_size,
	registration = &xpc_registrations[ch_number];

	if (mutex_lock_interruptible(&registration->mutex) != 0)
		return xpcInterrupted;
		return xpInterrupted;

	/* if XPC_CHANNEL_REGISTERED(ch_number) */
	if (registration->func != NULL) {
		mutex_unlock(&registration->mutex);
		return xpcAlreadyRegistered;
		return xpAlreadyRegistered;
	}

	/* register the channel for connection */
@@ -163,7 +163,7 @@ xpc_connect(int ch_number, xpc_channel_func func, void *key, u16 payload_size,

	xpc_interface.connect(ch_number);

	return xpcSuccess;
	return xpSuccess;
}
EXPORT_SYMBOL_GPL(xpc_connect);

+20 −51

File changed.

Preview size limit exceeded, changes collapsed.

+83 −83

File changed.

Preview size limit exceeded, changes collapsed.

+22 −22
Original line number Diff line number Diff line
@@ -315,13 +315,13 @@ xpc_initiate_discovery(void *ignore)
 * the XPC per partition variables from the remote partition and waiting for
 * the remote partition to pull ours.
 */
static enum xpc_retval
static enum xp_retval
xpc_make_first_contact(struct xpc_partition *part)
{
	enum xpc_retval ret;
	enum xp_retval ret;

	while ((ret = xpc_pull_remote_vars_part(part)) != xpcSuccess) {
		if (ret != xpcRetry) {
	while ((ret = xpc_pull_remote_vars_part(part)) != xpSuccess) {
		if (ret != xpRetry) {
			XPC_DEACTIVATE_PARTITION(part, ret);
			return ret;
		}
@@ -406,7 +406,7 @@ xpc_partition_up(struct xpc_partition *part)

	dev_dbg(xpc_chan, "activating partition %d\n", XPC_PARTID(part));

	if (xpc_setup_infrastructure(part) != xpcSuccess)
	if (xpc_setup_infrastructure(part) != xpSuccess)
		return;

	/*
@@ -418,7 +418,7 @@ xpc_partition_up(struct xpc_partition *part)

	(void)xpc_part_ref(part);	/* this will always succeed */

	if (xpc_make_first_contact(part) == xpcSuccess)
	if (xpc_make_first_contact(part) == xpSuccess)
		xpc_channel_mgr(part);

	xpc_part_deref(part);
@@ -470,7 +470,7 @@ xpc_activating(void *__partid)

		spin_lock_irqsave(&part->act_lock, irq_flags);
		part->act_state = XPC_P_INACTIVE;
		XPC_SET_REASON(part, xpcPhysAddrRegFailed, __LINE__);
		XPC_SET_REASON(part, xpPhysAddrRegFailed, __LINE__);
		spin_unlock_irqrestore(&part->act_lock, irq_flags);
		part->remote_rp_pa = 0;
		return 0;
@@ -488,7 +488,7 @@ xpc_activating(void *__partid)
	xpc_disallow_hb(partid, xpc_vars);
	xpc_mark_partition_inactive(part);

	if (part->reason == xpcReactivating) {
	if (part->reason == xpReactivating) {
		/* interrupting ourselves results in activating partition */
		xpc_IPI_send_reactivate(part);
	}
@@ -508,7 +508,7 @@ xpc_activate_partition(struct xpc_partition *part)
	DBUG_ON(part->act_state != XPC_P_INACTIVE);

	part->act_state = XPC_P_ACTIVATION_REQ;
	XPC_SET_REASON(part, xpcCloneKThread, __LINE__);
	XPC_SET_REASON(part, xpCloneKThread, __LINE__);

	spin_unlock_irqrestore(&part->act_lock, irq_flags);

@@ -517,7 +517,7 @@ xpc_activate_partition(struct xpc_partition *part)
	if (IS_ERR(kthread)) {
		spin_lock_irqsave(&part->act_lock, irq_flags);
		part->act_state = XPC_P_INACTIVE;
		XPC_SET_REASON(part, xpcCloneKThreadFailed, __LINE__);
		XPC_SET_REASON(part, xpCloneKThreadFailed, __LINE__);
		spin_unlock_irqrestore(&part->act_lock, irq_flags);
	}
}
@@ -696,7 +696,7 @@ xpc_kthread_start(void *args)
		ch->flags |= XPC_C_DISCONNECTINGCALLOUT;
		spin_unlock_irqrestore(&ch->lock, irq_flags);

		xpc_disconnect_callout(ch, xpcDisconnecting);
		xpc_disconnect_callout(ch, xpDisconnecting);

		spin_lock_irqsave(&ch->lock, irq_flags);
		ch->flags |= XPC_C_DISCONNECTINGCALLOUT_MADE;
@@ -776,7 +776,7 @@ xpc_create_kthreads(struct xpc_channel *ch, int needed,
			 * then we'll deadlock if all other kthreads assigned
			 * to this channel are blocked in the channel's
			 * registerer, because the only thing that will unblock
			 * them is the xpcDisconnecting callout that this
			 * them is the xpDisconnecting callout that this
			 * failed kthread_run() would have made.
			 */

@@ -796,7 +796,7 @@ xpc_create_kthreads(struct xpc_channel *ch, int needed,
				 * to function.
				 */
				spin_lock_irqsave(&ch->lock, irq_flags);
				XPC_DISCONNECT_CHANNEL(ch, xpcLackOfResources,
				XPC_DISCONNECT_CHANNEL(ch, xpLackOfResources,
						       &irq_flags);
				spin_unlock_irqrestore(&ch->lock, irq_flags);
			}
@@ -857,7 +857,7 @@ xpc_disconnect_wait(int ch_number)
}

static void
xpc_do_exit(enum xpc_retval reason)
xpc_do_exit(enum xp_retval reason)
{
	partid_t partid;
	int active_part_count, printed_waiting_msg = 0;
@@ -955,7 +955,7 @@ xpc_do_exit(enum xpc_retval reason)
	del_timer_sync(&xpc_hb_timer);
	DBUG_ON(xpc_vars->heartbeating_to_mask != 0);

	if (reason == xpcUnloading) {
	if (reason == xpUnloading) {
		/* take ourselves off of the reboot_notifier_list */
		(void)unregister_reboot_notifier(&xpc_reboot_notifier);

@@ -981,20 +981,20 @@ xpc_do_exit(enum xpc_retval reason)
static int
xpc_system_reboot(struct notifier_block *nb, unsigned long event, void *unused)
{
	enum xpc_retval reason;
	enum xp_retval reason;

	switch (event) {
	case SYS_RESTART:
		reason = xpcSystemReboot;
		reason = xpSystemReboot;
		break;
	case SYS_HALT:
		reason = xpcSystemHalt;
		reason = xpSystemHalt;
		break;
	case SYS_POWER_OFF:
		reason = xpcSystemPoweroff;
		reason = xpSystemPoweroff;
		break;
	default:
		reason = xpcSystemGoingDown;
		reason = xpSystemGoingDown;
	}

	xpc_do_exit(reason);
@@ -1279,7 +1279,7 @@ xpc_init(void)
		/* mark this new thread as a non-starter */
		complete(&xpc_discovery_exited);

		xpc_do_exit(xpcUnloading);
		xpc_do_exit(xpUnloading);
		return -EBUSY;
	}

@@ -1297,7 +1297,7 @@ module_init(xpc_init);
void __exit
xpc_exit(void)
{
	xpc_do_exit(xpcUnloading);
	xpc_do_exit(xpUnloading);
}

module_exit(xpc_exit);
Loading