public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: steiner@sgi.com
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [Patch 13/14] Fix bugs related to module unload of the GRU driver
Date: Thu, 22 Jan 2009 11:49:30 -0600	[thread overview]
Message-ID: <20090122175030.038507000@sgi.com> (raw)
In-Reply-To: 20090122174917.563627000@sgi.com

[-- Attachment #1: uv_gru_module_unload --]
[-- Type: text/plain, Size: 2600 bytes --]

From: Jack Steiner <steiner@sgi.com>

Fix bugs related to module unload of the GRU driver.

Signed-off-by: Jack Steiner <steiner@sgi.com>

---
 drivers/misc/sgi-gru/grufile.c      |    5 ++++-
 drivers/misc/sgi-gru/grukservices.c |   19 +++++++++++++++++++
 drivers/misc/sgi-gru/grutables.h    |    1 +
 3 files changed, 24 insertions(+), 1 deletion(-)

Index: linux/drivers/misc/sgi-gru/grufile.c
===================================================================
--- linux.orig/drivers/misc/sgi-gru/grufile.c	2009-01-21 12:53:18.000000000 -0600
+++ linux/drivers/misc/sgi-gru/grufile.c	2009-01-21 12:53:19.000000000 -0600
@@ -452,7 +452,7 @@ exit1:
 
 static void __exit gru_exit(void)
 {
-	int i, bid;
+	int i, bid, gid;
 	int order = get_order(sizeof(struct gru_state) *
 			      GRU_CHIPLETS_PER_BLADE);
 
@@ -462,6 +462,9 @@ static void __exit gru_exit(void)
 	for (i = 0; i < GRU_CHIPLETS_PER_BLADE; i++)
 		free_irq(IRQ_GRU + i, NULL);
 
+	foreach_gid(gid)
+		gru_kservices_exit(GID_TO_GRU(gid));
+
 	for (bid = 0; bid < GRU_MAX_BLADES; bid++)
 		free_pages((unsigned long)gru_base[bid], order);
 
Index: linux/drivers/misc/sgi-gru/grukservices.c
===================================================================
--- linux.orig/drivers/misc/sgi-gru/grukservices.c	2009-01-21 12:53:17.000000000 -0600
+++ linux/drivers/misc/sgi-gru/grukservices.c	2009-01-21 12:53:24.000000000 -0600
@@ -690,3 +690,22 @@ int gru_kservices_init(struct gru_state 
 		quicktest(gru);
 	return 0;
 }
+
+void gru_kservices_exit(struct gru_state *gru)
+{
+	struct gru_context_configuration_handle *cch;
+	struct gru_blade_state *bs;
+
+	bs = gru->gs_blade;
+	if (gru != &bs->bs_grus[1])
+		return;
+
+	cch = get_cch(gru->gs_gru_base_vaddr, KERNEL_CTXNUM);
+	lock_cch_handle(cch);
+	if (cch_interrupt_sync(cch))
+		BUG();
+	if (cch_deallocate(cch))
+		BUG();
+	unlock_cch_handle(cch);
+}
+
Index: linux/drivers/misc/sgi-gru/grutables.h
===================================================================
--- linux.orig/drivers/misc/sgi-gru/grutables.h	2009-01-21 12:53:18.000000000 -0600
+++ linux/drivers/misc/sgi-gru/grutables.h	2009-01-21 12:53:24.000000000 -0600
@@ -600,6 +600,7 @@ extern void gru_unload_context(struct gr
 extern void gts_drop(struct gru_thread_state *gts);
 extern void gru_tgh_flush_init(struct gru_state *gru);
 extern int gru_kservices_init(struct gru_state *gru);
+extern void gru_kservices_exit(struct gru_state *gru);
 extern irqreturn_t gru_intr(int irq, void *dev_id);
 extern int gru_handle_user_call_os(unsigned long address);
 extern int gru_user_flush_tlb(unsigned long arg);


  parent reply	other threads:[~2009-01-22 17:55 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-22 17:49 [Patch 00/14] GRU Driver Patches steiner
2009-01-22 17:49 ` [Patch 01/14] Add definitions of x86_64 GRU MMRs steiner
2009-01-28  9:35   ` Andrew Morton
2009-01-28 14:26     ` Jack Steiner
2009-01-28 19:36     ` [PATCH] - Exclude UV definitions on 32-bit x86 Jack Steiner
2009-01-29 10:36     ` [Patch 01/14] Add definitions of x86_64 GRU MMRs Ingo Molnar
2009-01-22 17:49 ` [Patch 02/14] Add definitions of ia64 " steiner
2009-01-22 17:49 ` [Patch 03/14] Add macros for using the UV hub to send interrupts steiner
2009-01-22 17:49 ` [Patch 04/14] Misc GRU cleanup steiner
2009-01-22 17:49 ` [Patch 05/14] Improvements to GRU debug messages & statistics steiner
2009-01-22 17:49 ` [Patch 06/14] Change GRU CCH commands from inline functions to outofline functions steiner
2009-01-22 17:49 ` [Patch 07/14] Add statistics to the GRU context management functions steiner
2009-01-22 17:49 ` [Patch 08/14] Add support for a user to explicitly unload a GRU context steiner
2009-01-22 17:49 ` [Patch 09/14] ASID (context management) bug fixes steiner
2009-01-22 17:49 ` [Patch 10/14] Restructure the GRU vtop functions steiner
2009-01-22 17:49 ` [Patch 11/14] Add support to the GRU driver for message queue interrupts steiner
2009-01-22 17:49 ` [Patch 12/14] macro for scanning all gru chiplets steiner
2009-01-22 17:49 ` steiner [this message]
2009-01-22 17:49 ` [Patch 14/14] Support multiple pagesizes in GRU steiner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090122175030.038507000@sgi.com \
    --to=steiner@sgi.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox