summaryrefslogtreecommitdiff
path: root/drivers/misc/sgi-gru/grufile.c
diff options
context:
space:
mode:
authorJack Steiner <steiner@sgi.com>2009-04-02 23:59:10 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-03 02:05:06 (GMT)
commite1c3219d06447dab8a87b96df1211d158e21071e (patch)
treeaa3a5ea8af148d2d7d461d61618d7820f099148a /drivers/misc/sgi-gru/grufile.c
parent6f2584f47474d29ce829604bfc8b56c10b352fdb (diff)
downloadlinux-e1c3219d06447dab8a87b96df1211d158e21071e.tar.xz
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/grufile.c')
-rw-r--r--drivers/misc/sgi-gru/grufile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/misc/sgi-gru/grufile.c b/drivers/misc/sgi-gru/grufile.c
index f8dcdb1..b7a21ce 100644
--- a/drivers/misc/sgi-gru/grufile.c
+++ b/drivers/misc/sgi-gru/grufile.c
@@ -47,6 +47,7 @@
struct gru_blade_state *gru_base[GRU_MAX_BLADES] __read_mostly;
unsigned long gru_start_paddr __read_mostly;
unsigned long gru_end_paddr __read_mostly;
+unsigned int gru_max_gids __read_mostly;
struct gru_stats_s gru_stats;
/* Guaranteed user available resources on each node */
@@ -276,6 +277,8 @@ static void gru_init_chiplet(struct gru_state *gru, unsigned long paddr,
gru->gs_dsr_map = (1UL << GRU_DSR_AU) - 1;
gru->gs_asid_limit = MAX_ASID;
gru_tgh_flush_init(gru);
+ if (gru->gs_gid >= gru_max_gids)
+ gru_max_gids = gru->gs_gid + 1;
gru_dbg(grudev, "bid %d, nid %d, gid %d, vaddr %p (0x%lx)\n",
bid, nid, gru->gs_gid, gru->gs_gru_base_vaddr,
gru->gs_gru_base_paddr);