aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/sgi-xp/xpc_sn2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/sgi-xp/xpc_sn2.c')
-rw-r--r--drivers/misc/sgi-xp/xpc_sn2.c44
1 files changed, 37 insertions, 7 deletions
diff --git a/drivers/misc/sgi-xp/xpc_sn2.c b/drivers/misc/sgi-xp/xpc_sn2.c
index eaaa964942de..43ad2968daf5 100644
--- a/drivers/misc/sgi-xp/xpc_sn2.c
+++ b/drivers/misc/sgi-xp/xpc_sn2.c
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved. 6 * Copyright (c) 2008-2009 Silicon Graphics, Inc. All Rights Reserved.
7 */ 7 */
8 8
9/* 9/*
@@ -629,7 +629,7 @@ xpc_setup_rsvd_page_sn_sn2(struct xpc_rsvd_page *rp)
629 629
630 xpc_vars_sn2 = XPC_RP_VARS(rp); 630 xpc_vars_sn2 = XPC_RP_VARS(rp);
631 631
632 rp->sn.vars_pa = xp_pa(xpc_vars_sn2); 632 rp->sn.sn2.vars_pa = xp_pa(xpc_vars_sn2);
633 633
634 /* vars_part array follows immediately after vars */ 634 /* vars_part array follows immediately after vars */
635 xpc_vars_part_sn2 = (struct xpc_vars_part_sn2 *)((u8 *)XPC_RP_VARS(rp) + 635 xpc_vars_part_sn2 = (struct xpc_vars_part_sn2 *)((u8 *)XPC_RP_VARS(rp) +
@@ -693,6 +693,33 @@ xpc_setup_rsvd_page_sn_sn2(struct xpc_rsvd_page *rp)
693 return 0; 693 return 0;
694} 694}
695 695
696static int
697xpc_hb_allowed_sn2(short partid, void *heartbeating_to_mask)
698{
699 return test_bit(partid, heartbeating_to_mask);
700}
701
702static void
703xpc_allow_hb_sn2(short partid)
704{
705 DBUG_ON(xpc_vars_sn2 == NULL);
706 set_bit(partid, xpc_vars_sn2->heartbeating_to_mask);
707}
708
709static void
710xpc_disallow_hb_sn2(short partid)
711{
712 DBUG_ON(xpc_vars_sn2 == NULL);
713 clear_bit(partid, xpc_vars_sn2->heartbeating_to_mask);
714}
715
716static void
717xpc_disallow_all_hbs_sn2(void)
718{
719 DBUG_ON(xpc_vars_sn2 == NULL);
720 bitmap_zero(xpc_vars_sn2->heartbeating_to_mask, xp_max_npartitions);
721}
722
696static void 723static void
697xpc_increment_heartbeat_sn2(void) 724xpc_increment_heartbeat_sn2(void)
698{ 725{
@@ -719,7 +746,6 @@ xpc_heartbeat_init_sn2(void)
719 DBUG_ON(xpc_vars_sn2 == NULL); 746 DBUG_ON(xpc_vars_sn2 == NULL);
720 747
721 bitmap_zero(xpc_vars_sn2->heartbeating_to_mask, XP_MAX_NPARTITIONS_SN2); 748 bitmap_zero(xpc_vars_sn2->heartbeating_to_mask, XP_MAX_NPARTITIONS_SN2);
722 xpc_heartbeating_to_mask = &xpc_vars_sn2->heartbeating_to_mask[0];
723 xpc_online_heartbeat_sn2(); 749 xpc_online_heartbeat_sn2();
724} 750}
725 751
@@ -751,9 +777,9 @@ xpc_get_remote_heartbeat_sn2(struct xpc_partition *part)
751 remote_vars->heartbeating_to_mask[0]); 777 remote_vars->heartbeating_to_mask[0]);
752 778
753 if ((remote_vars->heartbeat == part->last_heartbeat && 779 if ((remote_vars->heartbeat == part->last_heartbeat &&
754 remote_vars->heartbeat_offline == 0) || 780 !remote_vars->heartbeat_offline) ||
755 !xpc_hb_allowed(sn_partition_id, 781 !xpc_hb_allowed_sn2(sn_partition_id,
756 &remote_vars->heartbeating_to_mask)) { 782 remote_vars->heartbeating_to_mask)) {
757 ret = xpNoHeartbeat; 783 ret = xpNoHeartbeat;
758 } else { 784 } else {
759 part->last_heartbeat = remote_vars->heartbeat; 785 part->last_heartbeat = remote_vars->heartbeat;
@@ -972,7 +998,7 @@ xpc_identify_activate_IRQ_req_sn2(int nasid)
972 return; 998 return;
973 } 999 }
974 1000
975 remote_vars_pa = remote_rp->sn.vars_pa; 1001 remote_vars_pa = remote_rp->sn.sn2.vars_pa;
976 remote_rp_version = remote_rp->version; 1002 remote_rp_version = remote_rp->version;
977 remote_rp_ts_jiffies = remote_rp->ts_jiffies; 1003 remote_rp_ts_jiffies = remote_rp->ts_jiffies;
978 1004
@@ -2325,6 +2351,10 @@ xpc_init_sn2(void)
2325 xpc_teardown_partitions_sn = xpc_teardown_partitions_sn_sn2; 2351 xpc_teardown_partitions_sn = xpc_teardown_partitions_sn_sn2;
2326 xpc_get_partition_rsvd_page_pa = xpc_get_partition_rsvd_page_pa_sn2; 2352 xpc_get_partition_rsvd_page_pa = xpc_get_partition_rsvd_page_pa_sn2;
2327 xpc_setup_rsvd_page_sn = xpc_setup_rsvd_page_sn_sn2; 2353 xpc_setup_rsvd_page_sn = xpc_setup_rsvd_page_sn_sn2;
2354
2355 xpc_allow_hb = xpc_allow_hb_sn2;
2356 xpc_disallow_hb = xpc_disallow_hb_sn2;
2357 xpc_disallow_all_hbs = xpc_disallow_all_hbs_sn2;
2328 xpc_increment_heartbeat = xpc_increment_heartbeat_sn2; 2358 xpc_increment_heartbeat = xpc_increment_heartbeat_sn2;
2329 xpc_offline_heartbeat = xpc_offline_heartbeat_sn2; 2359 xpc_offline_heartbeat = xpc_offline_heartbeat_sn2;
2330 xpc_online_heartbeat = xpc_online_heartbeat_sn2; 2360 xpc_online_heartbeat = xpc_online_heartbeat_sn2;