Re: bug in /net/core/dev.c

Keith Owens (kaos@ocs.com.au)
Wed, 13 Jun 2001 01:34:19 +1000


On Tue, 12 Jun 2001 07:57:56 -0700 (PDT),
"David S. Miller" <davem@redhat.com> wrote:
>You need to find a way to link in the S390 network drivers after the
>net/ module so that the drivers run their init after net_dev_init()
>runs.

Tricky.

net_dev_init() is in net/core/dev.c which is linked into
net/core/core.o which is linked into net/network.o which is linked into
vmlinux as part of $(NETWORKS).

drivers/s390/net creates drivers/s390/net/s390-net.o which is linked
into drivers/s390/io.o which is part of $(CORE_FILES), not $(DRIVERS).

$(NETWORKS) is linked _after_ both $(CORE_FILES) and $(DRIVERS).

Have I mentioned recently how much I hate the "link order depends on
Makefile compile order, except where fudged by special case Makefiles"
method?

David, how do any network drivers that need net_dev_init() work when
all $(DRIVERS) come before $(NETWORKS)? This is a generic problem, not
s390 specific.

AFAICT net_dev_init() needs to be promoted ahead of $(DRIVERS), either
as minimal code or by moving all of $(NETWORKS). Then moving
drivers/s390/io.o to $(DRIVERS) instead of $(CORE_FILES) will fix the
problem.

-
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/