Re: Link order madness :-(

Dan Aloni (da-x@gmx.net)
Sat, 1 Jun 2002 09:55:20 +0300


On Fri, May 31, 2002 at 05:21:22PM -0700, Jean Tourrilhes wrote:
> I was trying to make the IrDA stack work when compiled in the
> kernel in 2.5.X (as opposed to modular). In 2.4.X, it sort of work,
> but whoever made changes to the IrDA init in 2.5.X obviously didn't
> bother to check what he was doing and check his changes.
> So, I was trying to fix that, and I found a problem with
> kernel link order.

It is possible that recent kbuild changes caused that.

[snip]
> As both the random driver and the irda drivers are at the same
> init level, there is no way to enforce those dependancies. Currently,
> the IrDA drivers are loaded before the IrDA stack (== kaboom).
> Personally, I found it a bit strange the the random driver is
> initialised so late in the game when the whole networking code (at
> leasxt) depends on it.
>
> Please advise...

I remember something like this happened awhile back with the IDE driver,
trying to call a function in the cdrom driver before it was initialized.

There is a dirty workaround for this problem: Use a local static variable
to condition the modules' initialization, and make each module call
its init function inside every of its exported function, so this
'init-on-demand' will make sure the init code runs before the other
module's code.

BTW, does the new driver model addresses this problem?

-- 
Dan Aloni
da-x@gmx.net
-
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/