Merge tag 'sched-urgent-2020-12-27' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / drivers / misc / sgi-xp / xpc_partition.c
index 57df068..1999d02 100644 (file)
@@ -262,8 +262,8 @@ xpc_get_remote_rp(int nasid, unsigned long *discovered_nasids,
  * from us. Though we requested the remote partition to deactivate with regard
  * to us, we really only need to wait for the other side to disengage from us.
  */
-int
-xpc_partition_disengaged(struct xpc_partition *part)
+static int __xpc_partition_disengaged(struct xpc_partition *part,
+                                     bool from_timer)
 {
        short partid = XPC_PARTID(part);
        int disengaged;
@@ -289,9 +289,9 @@ xpc_partition_disengaged(struct xpc_partition *part)
                }
                part->disengage_timeout = 0;
 
-               /* cancel the timer function, provided it's not us */
-               if (!in_interrupt())
-                       del_singleshot_timer_sync(&part->disengage_timer);
+               /* Cancel the timer function if not called from it */
+               if (!from_timer)
+                       del_timer_sync(&part->disengage_timer);
 
                DBUG_ON(part->act_state != XPC_P_AS_DEACTIVATING &&
                        part->act_state != XPC_P_AS_INACTIVE);
@@ -303,6 +303,16 @@ xpc_partition_disengaged(struct xpc_partition *part)
        return disengaged;
 }
 
+int xpc_partition_disengaged(struct xpc_partition *part)
+{
+       return __xpc_partition_disengaged(part, false);
+}
+
+int xpc_partition_disengaged_from_timer(struct xpc_partition *part)
+{
+       return __xpc_partition_disengaged(part, true);
+}
+
 /*
  * Mark specified partition as active.
  */