aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/sgi-gru/grufile.c
diff options
context:
space:
mode:
authorJack Steiner <steiner@sgi.com>2009-06-17 19:28:28 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-18 16:04:03 -0400
commitd5826dd6002f23940458860701ce22fba9df2614 (patch)
treeb0220c628cc2606b77fd39c38144c83396b83ca9 /drivers/misc/sgi-gru/grufile.c
parent1a2c09e3b41e334b6651d53b39cfe8ceefbc45f8 (diff)
gru: add user request to explicitly unload a gru context
Add user function to explicitly unload GRU kernel contexts from the GRU. Only contexts that are not in-use will be unloaded. This function is primarily for testing. It is not expected that this will be used in normal production systems. 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.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/misc/sgi-gru/grufile.c b/drivers/misc/sgi-gru/grufile.c
index bfc88d1b2a5b..e22012db239e 100644
--- a/drivers/misc/sgi-gru/grufile.c
+++ b/drivers/misc/sgi-gru/grufile.c
@@ -287,7 +287,6 @@ static void gru_init_chiplet(struct gru_state *gru, unsigned long paddr,
287 gru_dbg(grudev, "bid %d, nid %d, gid %d, vaddr %p (0x%lx)\n", 287 gru_dbg(grudev, "bid %d, nid %d, gid %d, vaddr %p (0x%lx)\n",
288 bid, nid, gru->gs_gid, gru->gs_gru_base_vaddr, 288 bid, nid, gru->gs_gid, gru->gs_gru_base_vaddr,
289 gru->gs_gru_base_paddr); 289 gru->gs_gru_base_paddr);
290 gru_kservices_init(gru);
291} 290}
292 291
293static int gru_init_tables(unsigned long gru_base_paddr, void *gru_base_vaddr) 292static int gru_init_tables(unsigned long gru_base_paddr, void *gru_base_vaddr)
@@ -314,6 +313,7 @@ static int gru_init_tables(unsigned long gru_base_paddr, void *gru_base_vaddr)
314 memset(gru_base[bid], 0, sizeof(struct gru_blade_state)); 313 memset(gru_base[bid], 0, sizeof(struct gru_blade_state));
315 gru_base[bid]->bs_lru_gru = &gru_base[bid]->bs_grus[0]; 314 gru_base[bid]->bs_lru_gru = &gru_base[bid]->bs_grus[0];
316 spin_lock_init(&gru_base[bid]->bs_lock); 315 spin_lock_init(&gru_base[bid]->bs_lock);
316 init_rwsem(&gru_base[bid]->bs_kgts_sema);
317 317
318 dsrbytes = 0; 318 dsrbytes = 0;
319 cbrs = 0; 319 cbrs = 0;
@@ -426,6 +426,7 @@ static int __init gru_init(void)
426 printk(KERN_ERR "%s: init tables failed\n", GRU_DRIVER_ID_STR); 426 printk(KERN_ERR "%s: init tables failed\n", GRU_DRIVER_ID_STR);
427 goto exit3; 427 goto exit3;
428 } 428 }
429 gru_kservices_init();
429 430
430 printk(KERN_INFO "%s: v%s\n", GRU_DRIVER_ID_STR, 431 printk(KERN_INFO "%s: v%s\n", GRU_DRIVER_ID_STR,
431 GRU_DRIVER_VERSION_STR); 432 GRU_DRIVER_VERSION_STR);
@@ -444,7 +445,7 @@ exit1:
444 445
445static void __exit gru_exit(void) 446static void __exit gru_exit(void)
446{ 447{
447 int i, bid, gid; 448 int i, bid;
448 int order = get_order(sizeof(struct gru_state) * 449 int order = get_order(sizeof(struct gru_state) *
449 GRU_CHIPLETS_PER_BLADE); 450 GRU_CHIPLETS_PER_BLADE);
450 451
@@ -453,10 +454,7 @@ static void __exit gru_exit(void)
453 454
454 for (i = 0; i < GRU_CHIPLETS_PER_BLADE; i++) 455 for (i = 0; i < GRU_CHIPLETS_PER_BLADE; i++)
455 free_irq(IRQ_GRU + i, NULL); 456 free_irq(IRQ_GRU + i, NULL);
456 457 gru_kservices_exit();
457 foreach_gid(gid)
458 gru_kservices_exit(GID_TO_GRU(gid));
459
460 for (bid = 0; bid < GRU_MAX_BLADES; bid++) 458 for (bid = 0; bid < GRU_MAX_BLADES; bid++)
461 free_pages((unsigned long)gru_base[bid], order); 459 free_pages((unsigned long)gru_base[bid], order);
462 460