[<prev] [next>] [day] [month] [year] [list]
Message-Id: <E1JTfWQ-0003o5-M6@be1.7eggert.dyndns.org>
Date: Mon, 25 Feb 2008 16:45:42 +0100
From: Bodo Eggert <7eggert@....de>
To: Andi Kleen <andi@...stfloor.org>,
Marcel Holtmann <marcel@...tmann.org>,
Simon Richter <sjr@...ian.org>,
Tilman Schmidt <tilman@...p.cc>,
Gregory Nietsky <gregory@...worksentry.co.za>,
Jeff Garzik <jeff@...zik.org>, kkeil@...e.de,
Greg KH <greg@...ah.com>, linux-kernel@...r.kernel.org,
isdn4linux@...tserv.isdn4linux.de, Sam Ravnborg <sam@...nborg.org>
Subject: Re: Plans for mISDN? Was: [PATCH 00/14] [ISDN] ...
Andi Kleen <andi@...stfloor.org> wrote:
>> we were talking about the load order. This will solve the load order,
>> but if we have races like the kind you described, then the whole mISDN
>> design is broken.
>
> It's more a generic problem of the module code.
It's a problem of not enough synchronisation before a module load completes.
If a module provides an interface, but needs some time after being load to
initialize, it obviously MUST provide a way to wait for it. Since you'll
need some i-need-module-foo functions anyway, why not: (bar needs foo)
-foo.c---
DECLARE_COMPLETION(init_complete); /* static? */
module_foo_init_async() {
...
void complete_all(&init_complete);
}
void usemod_foo()
{
wait_for_completion(&init_complete);
}
EXPORT_SYMBOL(usemod_foo)
-bar.c---
DECLARE_COMPLETION(init_complete);
module_bar_init_async() {
usemod_foo();
...
void complete_all(&init_complete);
}
void usemod_bar()
{
wait_for_completion(&init_complete);
}
EXPORT_SYMBOL(usemod_bar)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists