diff options
Diffstat (limited to 'drivers/misc/sgi-xp/xpc_partition.c')
-rw-r--r-- | drivers/misc/sgi-xp/xpc_partition.c | 59 |
1 files changed, 26 insertions, 33 deletions
diff --git a/drivers/misc/sgi-xp/xpc_partition.c b/drivers/misc/sgi-xp/xpc_partition.c index bf9b1193bd2a..c769ab8f74ef 100644 --- a/drivers/misc/sgi-xp/xpc_partition.c +++ b/drivers/misc/sgi-xp/xpc_partition.c | |||
@@ -242,7 +242,7 @@ xpc_get_remote_rp(int nasid, u64 *discovered_nasids, | |||
242 | return xpBadVersion; | 242 | return xpBadVersion; |
243 | } | 243 | } |
244 | 244 | ||
245 | /* check that both local and remote partids are valid for each side */ | 245 | /* check that both remote and local partids are valid for each side */ |
246 | if (remote_rp->SAL_partid < 0 || | 246 | if (remote_rp->SAL_partid < 0 || |
247 | remote_rp->SAL_partid >= xp_max_npartitions || | 247 | remote_rp->SAL_partid >= xp_max_npartitions || |
248 | remote_rp->max_npartitions <= sn_partition_id) { | 248 | remote_rp->max_npartitions <= sn_partition_id) { |
@@ -256,8 +256,9 @@ xpc_get_remote_rp(int nasid, u64 *discovered_nasids, | |||
256 | } | 256 | } |
257 | 257 | ||
258 | /* | 258 | /* |
259 | * See if the other side has responded to a partition disengage request | 259 | * See if the other side has responded to a partition deactivate request |
260 | * from us. | 260 | * from us. Though we requested the remote partition to deactivate with regard |
261 | * to us, we really only need to wait for the other side to disengage from us. | ||
261 | */ | 262 | */ |
262 | int | 263 | int |
263 | xpc_partition_disengaged(struct xpc_partition *part) | 264 | xpc_partition_disengaged(struct xpc_partition *part) |
@@ -265,41 +266,37 @@ xpc_partition_disengaged(struct xpc_partition *part) | |||
265 | short partid = XPC_PARTID(part); | 266 | short partid = XPC_PARTID(part); |
266 | int disengaged; | 267 | int disengaged; |
267 | 268 | ||
268 | disengaged = (xpc_partition_engaged(1UL << partid) == 0); | 269 | disengaged = !xpc_partition_engaged(partid); |
269 | if (part->disengage_request_timeout) { | 270 | if (part->disengage_timeout) { |
270 | if (!disengaged) { | 271 | if (!disengaged) { |
271 | if (time_is_after_jiffies(part-> | 272 | if (time_is_after_jiffies(part->disengage_timeout)) { |
272 | disengage_request_timeout)) { | ||
273 | /* timelimit hasn't been reached yet */ | 273 | /* timelimit hasn't been reached yet */ |
274 | return 0; | 274 | return 0; |
275 | } | 275 | } |
276 | 276 | ||
277 | /* | 277 | /* |
278 | * Other side hasn't responded to our disengage | 278 | * Other side hasn't responded to our deactivate |
279 | * request in a timely fashion, so assume it's dead. | 279 | * request in a timely fashion, so assume it's dead. |
280 | */ | 280 | */ |
281 | 281 | ||
282 | dev_info(xpc_part, "disengage from remote partition %d " | 282 | dev_info(xpc_part, "deactivate request to remote " |
283 | "timed out\n", partid); | 283 | "partition %d timed out\n", partid); |
284 | xpc_disengage_request_timedout = 1; | 284 | xpc_disengage_timedout = 1; |
285 | xpc_clear_partition_engaged(1UL << partid); | 285 | xpc_assume_partition_disengaged(partid); |
286 | disengaged = 1; | 286 | disengaged = 1; |
287 | } | 287 | } |
288 | part->disengage_request_timeout = 0; | 288 | part->disengage_timeout = 0; |
289 | 289 | ||
290 | /* cancel the timer function, provided it's not us */ | 290 | /* cancel the timer function, provided it's not us */ |
291 | if (!in_interrupt()) { | 291 | if (!in_interrupt()) |
292 | del_singleshot_timer_sync(&part-> | 292 | del_singleshot_timer_sync(&part->disengage_timer); |
293 | disengage_request_timer); | ||
294 | } | ||
295 | 293 | ||
296 | DBUG_ON(part->act_state != XPC_P_DEACTIVATING && | 294 | DBUG_ON(part->act_state != XPC_P_DEACTIVATING && |
297 | part->act_state != XPC_P_INACTIVE); | 295 | part->act_state != XPC_P_INACTIVE); |
298 | if (part->act_state != XPC_P_INACTIVE) | 296 | if (part->act_state != XPC_P_INACTIVE) |
299 | xpc_wakeup_channel_mgr(part); | 297 | xpc_wakeup_channel_mgr(part); |
300 | 298 | ||
301 | if (XPC_SUPPORTS_DISENGAGE_REQUEST(part->remote_vars_version)) | 299 | xpc_cancel_partition_deactivation_request(part); |
302 | xpc_cancel_partition_disengage_request(part); | ||
303 | } | 300 | } |
304 | return disengaged; | 301 | return disengaged; |
305 | } | 302 | } |
@@ -329,7 +326,7 @@ xpc_mark_partition_active(struct xpc_partition *part) | |||
329 | } | 326 | } |
330 | 327 | ||
331 | /* | 328 | /* |
332 | * Notify XPC that the partition is down. | 329 | * Start the process of deactivating the specified partition. |
333 | */ | 330 | */ |
334 | void | 331 | void |
335 | xpc_deactivate_partition(const int line, struct xpc_partition *part, | 332 | xpc_deactivate_partition(const int line, struct xpc_partition *part, |
@@ -344,7 +341,7 @@ xpc_deactivate_partition(const int line, struct xpc_partition *part, | |||
344 | spin_unlock_irqrestore(&part->act_lock, irq_flags); | 341 | spin_unlock_irqrestore(&part->act_lock, irq_flags); |
345 | if (reason == xpReactivating) { | 342 | if (reason == xpReactivating) { |
346 | /* we interrupt ourselves to reactivate partition */ | 343 | /* we interrupt ourselves to reactivate partition */ |
347 | xpc_IPI_send_local_reactivate(part->reactivate_nasid); | 344 | xpc_request_partition_reactivation(part); |
348 | } | 345 | } |
349 | return; | 346 | return; |
350 | } | 347 | } |
@@ -362,17 +359,13 @@ xpc_deactivate_partition(const int line, struct xpc_partition *part, | |||
362 | 359 | ||
363 | spin_unlock_irqrestore(&part->act_lock, irq_flags); | 360 | spin_unlock_irqrestore(&part->act_lock, irq_flags); |
364 | 361 | ||
365 | if (XPC_SUPPORTS_DISENGAGE_REQUEST(part->remote_vars_version)) { | 362 | /* ask remote partition to deactivate with regard to us */ |
366 | xpc_request_partition_disengage(part); | 363 | xpc_request_partition_deactivation(part); |
367 | xpc_IPI_send_disengage(part); | ||
368 | 364 | ||
369 | /* set a timelimit on the disengage request */ | 365 | /* set a timelimit on the disengage phase of the deactivation request */ |
370 | part->disengage_request_timeout = jiffies + | 366 | part->disengage_timeout = jiffies + (xpc_disengage_timelimit * HZ); |
371 | (xpc_disengage_request_timelimit * HZ); | 367 | part->disengage_timer.expires = part->disengage_timeout; |
372 | part->disengage_request_timer.expires = | 368 | add_timer(&part->disengage_timer); |
373 | part->disengage_request_timeout; | ||
374 | add_timer(&part->disengage_request_timer); | ||
375 | } | ||
376 | 369 | ||
377 | dev_dbg(xpc_part, "bringing partition %d down, reason = %d\n", | 370 | dev_dbg(xpc_part, "bringing partition %d down, reason = %d\n", |
378 | XPC_PARTID(part), reason); | 371 | XPC_PARTID(part), reason); |
@@ -505,8 +498,8 @@ xpc_discovery(void) | |||
505 | continue; | 498 | continue; |
506 | } | 499 | } |
507 | 500 | ||
508 | xpc_initiate_partition_activation(remote_rp, | 501 | xpc_request_partition_activation(remote_rp, |
509 | remote_rp_pa, nasid); | 502 | remote_rp_pa, nasid); |
510 | } | 503 | } |
511 | } | 504 | } |
512 | 505 | ||