diff options
author | Jack Steiner <steiner@sgi.com> | 2009-04-02 16:59:10 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-02 19:05:06 -0700 |
commit | e1c3219d06447dab8a87b96df1211d158e21071e (patch) | |
tree | aa3a5ea8af148d2d7d461d61618d7820f099148a /drivers/misc/sgi-gru/grufault.c | |
parent | 6f2584f47474d29ce829604bfc8b56c10b352fdb (diff) | |
download | linux-stable-e1c3219d06447dab8a87b96df1211d158e21071e.tar.gz linux-stable-e1c3219d06447dab8a87b96df1211d158e21071e.tar.bz2 linux-stable-e1c3219d06447dab8a87b96df1211d158e21071e.zip |
sgi-gru: macro for scanning all gru chiplets
Add macro for scanning all active GRU chiplets. Maximum chiplet id is
saved during GRU initialization.
Signed-off-by: Jack Steiner <steiner@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-gru/grufault.c')
-rw-r--r-- | drivers/misc/sgi-gru/grufault.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/misc/sgi-gru/grufault.c b/drivers/misc/sgi-gru/grufault.c index bf6e9f7bed54..15507d31e62b 100644 --- a/drivers/misc/sgi-gru/grufault.c +++ b/drivers/misc/sgi-gru/grufault.c @@ -600,18 +600,11 @@ static int gru_unload_all_contexts(void) { struct gru_thread_state *gts; struct gru_state *gru; - int maxgid, gid, ctxnum; - int nodesperblade; + int gid, ctxnum; if (!capable(CAP_SYS_ADMIN)) return -EPERM; - if (num_online_nodes() > 1 && - (uv_node_to_blade_id(1) == uv_node_to_blade_id(0))) - nodesperblade = 2; - else - nodesperblade = 1; - maxgid = GRU_CHIPLETS_PER_BLADE * num_online_nodes() / nodesperblade; - for (gid = 0; gid < maxgid; gid++) { + foreach_gid(gid) { gru = GID_TO_GRU(gid); spin_lock(&gru->gs_lock); for (ctxnum = 0; ctxnum < GRU_NUM_CCH; ctxnum++) { |