Re: initcall ordering of driver w/respect to tty_init?

From: Miles Bader
Date: Mon Oct 13 2003 - 21:13:13 EST


Miles Bader <miles@xxxxxxx> writes:
> I think that would solve the problem, but is it the right solution? How
> about all those other drivers that call tty_register_driver? module_init
> becomes __initcall when driver is statically linked into the kernel...

I've looked more at <linux/init.h>, and I think for my driver, which is
always statically linked, I can use `late_initcall' instead of
`__initcall' (it makes me slightly nervous to use the last init slot,
but whatever).

But what about all those tty drivers that are suppose to work as
modules? They use `module_init' to do their initialization, which will
work fine when they _are_ a module, but if they get statically linked,
the module_init will turn into `__initcall', and run into the same
problem I'm having. Presumably they _could_ use `late_initcall', since
<linux/init.h> contains code that makes it work in modules too, but the
comment in the code says you shouldn't do that.

[To recap: tty drivers that use module_init to initialize themselves,
which turns into __initcall if statically linked, will only work if they
happen to be initialized _after_ tty_io.c (because of the kobj stuff) --
and there seems to be nothing enforcing this ordering.]

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