diff options
author | Dean Nelson <dcn@sgi.com> | 2008-07-30 01:34:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-30 12:41:50 -0400 |
commit | 61deb86e98f51151b225f7563ee1cf2b50857d10 (patch) | |
tree | 0196f0748fed77b100476067ca31254517e939b1 /drivers/misc/sgi-xp/xpc_sn2.c | |
parent | a812dcc3a298eef650c381e094e2cf41a4ecc9ad (diff) |
sgi-xp: move xpc_check_remote_hb() to support both SN2 and UV
Move xpc_check_remote_hb() so it can support both SN2 and UV.
Signed-off-by: Dean Nelson <dcn@sgi.com>
Cc: Jack Steiner <steiner@sgi.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc/sgi-xp/xpc_sn2.c')
-rw-r--r-- | drivers/misc/sgi-xp/xpc_sn2.c | 70 |
1 files changed, 23 insertions, 47 deletions
diff --git a/drivers/misc/sgi-xp/xpc_sn2.c b/drivers/misc/sgi-xp/xpc_sn2.c index 1571a7cdf9d0..d34cdd533a9a 100644 --- a/drivers/misc/sgi-xp/xpc_sn2.c +++ b/drivers/misc/sgi-xp/xpc_sn2.c | |||
@@ -704,61 +704,37 @@ xpc_heartbeat_exit_sn2(void) | |||
704 | xpc_offline_heartbeat_sn2(); | 704 | xpc_offline_heartbeat_sn2(); |
705 | } | 705 | } |
706 | 706 | ||
707 | /* | 707 | static enum xp_retval |
708 | * At periodic intervals, scan through all active partitions and ensure | 708 | xpc_get_remote_heartbeat_sn2(struct xpc_partition *part) |
709 | * their heartbeat is still active. If not, the partition is deactivated. | ||
710 | */ | ||
711 | static void | ||
712 | xpc_check_remote_hb_sn2(void) | ||
713 | { | 709 | { |
714 | struct xpc_vars_sn2 *remote_vars; | 710 | struct xpc_vars_sn2 *remote_vars; |
715 | struct xpc_partition *part; | ||
716 | short partid; | ||
717 | enum xp_retval ret; | 711 | enum xp_retval ret; |
718 | 712 | ||
719 | remote_vars = (struct xpc_vars_sn2 *)xpc_remote_copy_buffer_sn2; | 713 | remote_vars = (struct xpc_vars_sn2 *)xpc_remote_copy_buffer_sn2; |
720 | 714 | ||
721 | for (partid = 0; partid < XP_MAX_NPARTITIONS_SN2; partid++) { | 715 | /* pull the remote vars structure that contains the heartbeat */ |
722 | 716 | ret = xp_remote_memcpy(xp_pa(remote_vars), | |
723 | if (xpc_exiting) | 717 | part->sn.sn2.remote_vars_pa, |
724 | break; | 718 | XPC_RP_VARS_SIZE); |
725 | 719 | if (ret != xpSuccess) | |
726 | if (partid == sn_partition_id) | 720 | return ret; |
727 | continue; | ||
728 | |||
729 | part = &xpc_partitions[partid]; | ||
730 | |||
731 | if (part->act_state == XPC_P_INACTIVE || | ||
732 | part->act_state == XPC_P_DEACTIVATING) { | ||
733 | continue; | ||
734 | } | ||
735 | |||
736 | /* pull the remote_hb cache line */ | ||
737 | ret = xp_remote_memcpy(xp_pa(remote_vars), | ||
738 | part->sn.sn2.remote_vars_pa, | ||
739 | XPC_RP_VARS_SIZE); | ||
740 | if (ret != xpSuccess) { | ||
741 | XPC_DEACTIVATE_PARTITION(part, ret); | ||
742 | continue; | ||
743 | } | ||
744 | |||
745 | dev_dbg(xpc_part, "partid = %d, heartbeat = %ld, last_heartbeat" | ||
746 | " = %ld, heartbeat_offline = %ld, HB_mask[0] = 0x%lx\n", | ||
747 | partid, remote_vars->heartbeat, part->last_heartbeat, | ||
748 | remote_vars->heartbeat_offline, | ||
749 | remote_vars->heartbeating_to_mask[0]); | ||
750 | |||
751 | if (((remote_vars->heartbeat == part->last_heartbeat) && | ||
752 | (remote_vars->heartbeat_offline == 0)) || | ||
753 | !xpc_hb_allowed(sn_partition_id, | ||
754 | &remote_vars->heartbeating_to_mask)) { | ||
755 | |||
756 | XPC_DEACTIVATE_PARTITION(part, xpNoHeartbeat); | ||
757 | continue; | ||
758 | } | ||
759 | 721 | ||
722 | dev_dbg(xpc_part, "partid=%d, heartbeat=%ld, last_heartbeat=%ld, " | ||
723 | "heartbeat_offline=%ld, HB_mask[0]=0x%lx\n", XPC_PARTID(part), | ||
724 | remote_vars->heartbeat, part->last_heartbeat, | ||
725 | remote_vars->heartbeat_offline, | ||
726 | remote_vars->heartbeating_to_mask[0]); | ||
727 | |||
728 | if ((remote_vars->heartbeat == part->last_heartbeat && | ||
729 | remote_vars->heartbeat_offline == 0) || | ||
730 | !xpc_hb_allowed(sn_partition_id, | ||
731 | &remote_vars->heartbeating_to_mask)) { | ||
732 | ret = xpNoHeartbeat; | ||
733 | } else { | ||
760 | part->last_heartbeat = remote_vars->heartbeat; | 734 | part->last_heartbeat = remote_vars->heartbeat; |
761 | } | 735 | } |
736 | |||
737 | return ret; | ||
762 | } | 738 | } |
763 | 739 | ||
764 | /* | 740 | /* |
@@ -2416,7 +2392,7 @@ xpc_init_sn2(void) | |||
2416 | xpc_online_heartbeat = xpc_online_heartbeat_sn2; | 2392 | xpc_online_heartbeat = xpc_online_heartbeat_sn2; |
2417 | xpc_heartbeat_init = xpc_heartbeat_init_sn2; | 2393 | xpc_heartbeat_init = xpc_heartbeat_init_sn2; |
2418 | xpc_heartbeat_exit = xpc_heartbeat_exit_sn2; | 2394 | xpc_heartbeat_exit = xpc_heartbeat_exit_sn2; |
2419 | xpc_check_remote_hb = xpc_check_remote_hb_sn2; | 2395 | xpc_get_remote_heartbeat = xpc_get_remote_heartbeat_sn2; |
2420 | 2396 | ||
2421 | xpc_request_partition_activation = xpc_request_partition_activation_sn2; | 2397 | xpc_request_partition_activation = xpc_request_partition_activation_sn2; |
2422 | xpc_request_partition_reactivation = | 2398 | xpc_request_partition_reactivation = |