Skip to contentSkip to conversation

Plans for mISDN? Was: [PATCH 00/14] [ISDN] ...

DISCUSSION Bodo Eggert 1 participant 1 message Feb 25, 2008 12 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#12 lore raw
Quoted 5 lines · Andi Kleen
Quoted 3 lines

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)