diff options
-rw-r--r-- | drivers/misc/sgi-gru/grufile.c | 5 | ||||
-rw-r--r-- | drivers/misc/sgi-gru/grukservices.c | 19 | ||||
-rw-r--r-- | drivers/misc/sgi-gru/grutables.h | 1 |
3 files changed, 24 insertions, 1 deletions
diff --git a/drivers/misc/sgi-gru/grufile.c b/drivers/misc/sgi-gru/grufile.c index b7a21ce91496..3e6e42d2f01b 100644 --- a/drivers/misc/sgi-gru/grufile.c +++ b/drivers/misc/sgi-gru/grufile.c | |||
@@ -440,7 +440,7 @@ exit1: | |||
440 | 440 | ||
441 | static void __exit gru_exit(void) | 441 | static void __exit gru_exit(void) |
442 | { | 442 | { |
443 | int i, bid; | 443 | int i, bid, gid; |
444 | int order = get_order(sizeof(struct gru_state) * | 444 | int order = get_order(sizeof(struct gru_state) * |
445 | GRU_CHIPLETS_PER_BLADE); | 445 | GRU_CHIPLETS_PER_BLADE); |
446 | 446 | ||
@@ -450,6 +450,9 @@ static void __exit gru_exit(void) | |||
450 | for (i = 0; i < GRU_CHIPLETS_PER_BLADE; i++) | 450 | for (i = 0; i < GRU_CHIPLETS_PER_BLADE; i++) |
451 | free_irq(IRQ_GRU + i, NULL); | 451 | free_irq(IRQ_GRU + i, NULL); |
452 | 452 | ||
453 | foreach_gid(gid) | ||
454 | gru_kservices_exit(GID_TO_GRU(gid)); | ||
455 | |||
453 | for (bid = 0; bid < GRU_MAX_BLADES; bid++) | 456 | for (bid = 0; bid < GRU_MAX_BLADES; bid++) |
454 | free_pages((unsigned long)gru_base[bid], order); | 457 | free_pages((unsigned long)gru_base[bid], order); |
455 | 458 | ||
diff --git a/drivers/misc/sgi-gru/grukservices.c b/drivers/misc/sgi-gru/grukservices.c index a37128431155..6b1efe447274 100644 --- a/drivers/misc/sgi-gru/grukservices.c +++ b/drivers/misc/sgi-gru/grukservices.c | |||
@@ -690,3 +690,22 @@ int gru_kservices_init(struct gru_state *gru) | |||
690 | quicktest(gru); | 690 | quicktest(gru); |
691 | return 0; | 691 | return 0; |
692 | } | 692 | } |
693 | |||
694 | void gru_kservices_exit(struct gru_state *gru) | ||
695 | { | ||
696 | struct gru_context_configuration_handle *cch; | ||
697 | struct gru_blade_state *bs; | ||
698 | |||
699 | bs = gru->gs_blade; | ||
700 | if (gru != &bs->bs_grus[1]) | ||
701 | return; | ||
702 | |||
703 | cch = get_cch(gru->gs_gru_base_vaddr, KERNEL_CTXNUM); | ||
704 | lock_cch_handle(cch); | ||
705 | if (cch_interrupt_sync(cch)) | ||
706 | BUG(); | ||
707 | if (cch_deallocate(cch)) | ||
708 | BUG(); | ||
709 | unlock_cch_handle(cch); | ||
710 | } | ||
711 | |||
diff --git a/drivers/misc/sgi-gru/grutables.h b/drivers/misc/sgi-gru/grutables.h index c6e0e3de07f3..8e5c8e5bb533 100644 --- a/drivers/misc/sgi-gru/grutables.h +++ b/drivers/misc/sgi-gru/grutables.h | |||
@@ -600,6 +600,7 @@ extern void gru_unload_context(struct gru_thread_state *gts, int savestate); | |||
600 | extern void gts_drop(struct gru_thread_state *gts); | 600 | extern void gts_drop(struct gru_thread_state *gts); |
601 | extern void gru_tgh_flush_init(struct gru_state *gru); | 601 | extern void gru_tgh_flush_init(struct gru_state *gru); |
602 | extern int gru_kservices_init(struct gru_state *gru); | 602 | extern int gru_kservices_init(struct gru_state *gru); |
603 | extern void gru_kservices_exit(struct gru_state *gru); | ||
603 | extern irqreturn_t gru_intr(int irq, void *dev_id); | 604 | extern irqreturn_t gru_intr(int irq, void *dev_id); |
604 | extern int gru_handle_user_call_os(unsigned long address); | 605 | extern int gru_handle_user_call_os(unsigned long address); |
605 | extern int gru_user_flush_tlb(unsigned long arg); | 606 | extern int gru_user_flush_tlb(unsigned long arg); |