diff options
author | Dean Nelson <dcn@sgi.com> | 2008-07-30 01:34:07 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-30 12:41:49 -0400 |
commit | aaa3cd694c0c4ae534e8aafdf4227e395c57d6bd (patch) | |
tree | 8494fab9a16530f0e2b4095d56d59f9ac3ee8966 /drivers/misc/sgi-xp/xpc_partition.c | |
parent | 33ba3c7724be79f7cdbfc611335572c056d9a05a (diff) |
sgi-xp: base xpc_rsvd_page's timestamp on jiffies
Change XPC's reserved page timestamp to be based on jiffies.
Signed-off-by: Dean Nelson <dcn@sgi.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_partition.c')
-rw-r--r-- | drivers/misc/sgi-xp/xpc_partition.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/drivers/misc/sgi-xp/xpc_partition.c b/drivers/misc/sgi-xp/xpc_partition.c index 4e14effdeddb..90ec5ca8c9ab 100644 --- a/drivers/misc/sgi-xp/xpc_partition.c +++ b/drivers/misc/sgi-xp/xpc_partition.c | |||
@@ -152,6 +152,7 @@ xpc_setup_rsvd_page(void) | |||
152 | { | 152 | { |
153 | struct xpc_rsvd_page *rp; | 153 | struct xpc_rsvd_page *rp; |
154 | u64 rp_pa; | 154 | u64 rp_pa; |
155 | unsigned long new_stamp; | ||
155 | 156 | ||
156 | /* get the local reserved page's address */ | 157 | /* get the local reserved page's address */ |
157 | 158 | ||
@@ -201,7 +202,10 @@ xpc_setup_rsvd_page(void) | |||
201 | * This signifies to the remote partition that our reserved | 202 | * This signifies to the remote partition that our reserved |
202 | * page is initialized. | 203 | * page is initialized. |
203 | */ | 204 | */ |
204 | rp->stamp = CURRENT_TIME; | 205 | new_stamp = jiffies; |
206 | if (new_stamp == 0 || new_stamp == rp->stamp) | ||
207 | new_stamp++; | ||
208 | rp->stamp = new_stamp; | ||
205 | 209 | ||
206 | return rp; | 210 | return rp; |
207 | } | 211 | } |
@@ -350,18 +354,8 @@ xpc_get_remote_rp(int nasid, u64 *discovered_nasids, | |||
350 | discovered_nasids[i] |= remote_part_nasids[i]; | 354 | discovered_nasids[i] |= remote_part_nasids[i]; |
351 | } | 355 | } |
352 | 356 | ||
353 | /* check that the partid is valid and is for another partition */ | 357 | /* see if the reserved page has been set up by XPC */ |
354 | 358 | if (remote_rp->stamp == 0) | |
355 | if (remote_rp->SAL_partid < 0 || | ||
356 | remote_rp->SAL_partid >= xp_max_npartitions) { | ||
357 | return xpInvalidPartid; | ||
358 | } | ||
359 | |||
360 | if (remote_rp->SAL_partid == sn_partition_id) | ||
361 | return xpLocalPartid; | ||
362 | |||
363 | /* see if the rest of the reserved page has been set up by XPC */ | ||
364 | if (timespec_equal(&remote_rp->stamp, &ZERO_STAMP)) | ||
365 | return xpRsvdPageNotSet; | 359 | return xpRsvdPageNotSet; |
366 | 360 | ||
367 | if (XPC_VERSION_MAJOR(remote_rp->version) != | 361 | if (XPC_VERSION_MAJOR(remote_rp->version) != |
@@ -369,8 +363,15 @@ xpc_get_remote_rp(int nasid, u64 *discovered_nasids, | |||
369 | return xpBadVersion; | 363 | return xpBadVersion; |
370 | } | 364 | } |
371 | 365 | ||
372 | if (remote_rp->max_npartitions <= sn_partition_id) | 366 | /* check that both local and remote partids are valid for each side */ |
367 | if (remote_rp->SAL_partid < 0 || | ||
368 | remote_rp->SAL_partid >= xp_max_npartitions || | ||
369 | remote_rp->max_npartitions <= sn_partition_id) { | ||
373 | return xpInvalidPartid; | 370 | return xpInvalidPartid; |
371 | } | ||
372 | |||
373 | if (remote_rp->SAL_partid == sn_partition_id) | ||
374 | return xpLocalPartid; | ||
374 | 375 | ||
375 | return xpSuccess; | 376 | return xpSuccess; |
376 | } | 377 | } |
@@ -388,8 +389,8 @@ xpc_partition_disengaged(struct xpc_partition *part) | |||
388 | disengaged = (xpc_partition_engaged(1UL << partid) == 0); | 389 | disengaged = (xpc_partition_engaged(1UL << partid) == 0); |
389 | if (part->disengage_request_timeout) { | 390 | if (part->disengage_request_timeout) { |
390 | if (!disengaged) { | 391 | if (!disengaged) { |
391 | if (time_before(jiffies, | 392 | if (time_is_after_jiffies(part-> |
392 | part->disengage_request_timeout)) { | 393 | disengage_request_timeout)) { |
393 | /* timelimit hasn't been reached yet */ | 394 | /* timelimit hasn't been reached yet */ |
394 | return 0; | 395 | return 0; |
395 | } | 396 | } |