lkml.org 
[lkml]   [2004]   [Mar]   [29]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] fix oops at pmac_zilog rmmod'ing
FromBenjamin Herrenschmidt <>
DateMon, 29 Mar 2004 19:05:12 +1000
Andrew / Linus, please apply

Ben.

-----Forwarded Message-----
From: Colin Leroy <colin@colino.net>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>, Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] fix oops at pmac_zilog rmmod'ing
Date: Mon, 29 Mar 2004 10:51:37 +0200
Hi,

rmmod'ing pmac_zilog currently oopses because uart_unregister_driver(),
which nullifies drv->tty_driver, is called before uart_remove_one_port(),
which uses said drv->tty_driver.

The comment at top of uart_unregister_driver() specifically says we have
to have removed all our ports
via uart_remove_one_port() before.

HTH,

--- drivers/serial/pmac_zilog.c.orig	2004-03-29 10:41:22.000000000 +0200
+++ drivers/serial/pmac_zilog.c	2004-03-29 10:42:07.000000000 +0200
@@ -1875,9 +1875,6 @@
 	/* Get rid of macio-driver (detach from macio) */
 	macio_unregister_driver(&pmz_driver);
 
-	/* Unregister UART driver */
-	uart_unregister_driver(&pmz_uart_reg);
-
 	for (i = 0; i < pmz_ports_count; i++) {
 		struct uart_pmac_port *uport = &pmz_ports[i];
 		if (uport->node != NULL) {
@@ -1885,6 +1882,8 @@
 			pmz_dispose_port(uport);
 		}
 	}
+	/* Unregister UART driver */
+	uart_unregister_driver(&pmz_uart_reg);
 }
 
 #ifdef CONFIG_SERIAL_PMACZILOG_CONSOLE

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:02    [from the cache]
©2003-2008