for Linux IRDA initialisation bug 2.4.5
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 14 lines
Quoted 5 lines
I've found that if you compile IRDA into the kernel,
irda_proto_initgets called twice - once atdo_initcallstime, and once explicitly indo_basic_setup- eventually resulting in a hang (asregister_netdevice_notifiergets called twice with the same struct, and it's list becomes circular).The suggested patch has one non-obvious side effect which somebody in irda needs to verify is OK. Previously
irda_proto_init()andirda_device_init()were called after every other driver had initialized. Nowirda_proto_init()is called based on the object order in the top levelMakefile, so irda is initialized before i2c, telephony, acpi and mddev. Is this a valid initialization order? If not, move
Quoted 3 lines
DRIVERS-$(CONFIG_IRDA) += drivers/net/irda/irda.oto the end of the drivers list and document why it needs to be there.
Keith, you mistake Matt's fix for an "obvious" fix that turns old style inits into new ones. Matt's fix does not change initialization order and certainly cannot be corrected by moving object files about.
I tried to change the thing to new style init and it did not quite work. The original problem was fixed but now the system hangs when it tries to initialize IP loopback. Perhaps irda0 gets in the way.
The suggestion about the link order is very relevant for the attached patch. I need Dag to pick it where I left it.
-- Pete
net/irda/ircomm/ircomm_core.c +0 -0
return 0;
}
-#ifdef MODULE
-void ircomm_cleanup(void)
+void __exit ircomm_cleanup(void)
{
IRDA_DEBUG(2, __FUNCTION__ "()\n");
@@ -87,7 +86,6 @@
remove_proc_entry("ircomm", proc_irda);
#endif /* CONFIG_PROC_FS */
}
-#endif /* MODULE */
/*
* Function ircomm_open (client_notify)
@@ -511,18 +509,8 @@
}
#endif /* CONFIG_PROC_FS */
-#ifdef MODULE
MODULE_AUTHOR("Dag Brattli <[email protected]>");
MODULE_DESCRIPTION("IrCOMM protocol");
-int init_module(void)
-{
- return ircomm_init();
-}
-
-void cleanup_module(void)
-{
- ircomm_cleanup();
-}
-#endif /* MODULE */
-
+module_init(ircomm_init);
+module_exit(ircomm_cleanup);
net/irda/ircomm/ircomm_tty.c +0 -0
* Init IrCOMM TTY layer/driver
*
*/
-int __init ircomm_tty_init(void)
+static int __init ircomm_tty_init(void)
{
ircomm_tty = hashbin_new(HB_LOCAL);
if (ircomm_tty == NULL) {
@@ -142,8 +142,7 @@
return 0;
}
-#ifdef MODULE
-static void __ircomm_tty_cleanup(struct ircomm_tty_cb *self) +static void __exit __ircomm_tty_cleanup(struct ircomm_tty_cb *self)
{
IRDA_DEBUG(0, __FUNCTION__ "()\n");
@@ -162,7 +161,7 @@
* Remove IrCOMM TTY layer/driver
*
*/
-void ircomm_tty_cleanup(void)
+static void __exit ircomm_tty_cleanup(void)
{
int ret;
@@ -176,7 +175,6 @@
hashbin_delete(ircomm_tty, (FREE_FUNC) __ircomm_tty_cleanup);
}
-#endif /* MODULE */
/*
* Function ircomm_startup (self)
@@ -1359,22 +1357,8 @@
}
#endif /* CONFIG_PROC_FS */
-#ifdef MODULE
MODULE_AUTHOR("Dag Brattli <[email protected]>");
MODULE_DESCRIPTION("IrCOMM serial TTY driver");
-int init_module(void)
-{
- return ircomm_tty_init();
-}
-
-void cleanup_module(void)
-{
- ircomm_tty_cleanup();
-}
-
-#endif /* MODULE */
-
-
-
-
+module_init(ircomm_tty_init);
+module_exit(ircomm_tty_cleanup);
net/irda/irsyms.c +0 -6
@@ -61,8 +61,6 @@extern int irlan_init (void );extern int irlan_client_init (void );extern int irlan_server_init (void ); -extern int ircomm_init (void ); -extern int ircomm_tty_init (void );extern int irlpt_client_init (void );extern int irlpt_server_init (void );
@@ -203,10 +201,6 @@*/ #ifdef CONFIG_IRLAN irlan_init (); -#endif -#ifdef CONFIG_IRCOMM -ircomm_init (); -ircomm_tty_init ();#endif #ifdef CONFIG_IRDA_COMPRESSION