Commit 88491d8(drivers/net: Kconfig & Makefile cleanup) causes a
regression that netconsole does not work if netconsole and network
device driver are build into kernel, because netconsole is linked before
network device driver.
Fixes it by moving netconsole.o after network device driver.
Signed-off-by: Lin Ming <redacted>
---
drivers/net/Makefile | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
@@ -66,3 +65,9 @@ obj-$(CONFIG_USB_USBNET) += usb/obj-$(CONFIG_USB_ZD1201)+=usb/obj-$(CONFIG_USB_IPHETH)+=usb/obj-$(CONFIG_USB_CDC_PHONET)+=usb/++#+# If netconsole and network device driver are build-in,+# netconsole must be linked after network device driver+#+obj-$(CONFIG_NETCONSOLE)+=netconsole.o
From: Andrew Morton <akpm@linux-foundation.org> Date: 2011-09-10 00:00:31
On Tue, 06 Sep 2011 16:35:29 +0800
Lin Ming [off-list ref] wrote:
quoted hunk
Commit 88491d8(drivers/net: Kconfig & Makefile cleanup) causes a
regression that netconsole does not work if netconsole and network
device driver are build into kernel, because netconsole is linked before
network device driver.
Fixes it by moving netconsole.o after network device driver.
Signed-off-by: Lin Ming <redacted>
---
drivers/net/Makefile | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
@@ -66,3 +65,9 @@ obj-$(CONFIG_USB_USBNET) += usb/obj-$(CONFIG_USB_ZD1201)+=usb/obj-$(CONFIG_USB_IPHETH)+=usb/obj-$(CONFIG_USB_CDC_PHONET)+=usb/++#+# If netconsole and network device driver are build-in,+# netconsole must be linked after network device driver+#+obj-$(CONFIG_NETCONSOLE)+=netconsole.o
It would be preferable to fix this with initcall ordering. Perhaps by
switching init_netconsole() to subsys_initcall.
On Sat, 2011-09-10 at 08:00 +0800, Andrew Morton wrote:
On Tue, 06 Sep 2011 16:35:29 +0800
Lin Ming [off-list ref] wrote:
quoted
Commit 88491d8(drivers/net: Kconfig & Makefile cleanup) causes a
regression that netconsole does not work if netconsole and network
device driver are build into kernel, because netconsole is linked before
network device driver.
Fixes it by moving netconsole.o after network device driver.
Signed-off-by: Lin Ming <redacted>
---
drivers/net/Makefile | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
@@ -66,3 +65,9 @@ obj-$(CONFIG_USB_USBNET) += usb/obj-$(CONFIG_USB_ZD1201)+=usb/obj-$(CONFIG_USB_IPHETH)+=usb/obj-$(CONFIG_USB_CDC_PHONET)+=usb/++#+# If netconsole and network device driver are build-in,+# netconsole must be linked after network device driver+#+obj-$(CONFIG_NETCONSOLE)+=netconsole.o
It would be preferable to fix this with initcall ordering. Perhaps by
switching init_netconsole() to subsys_initcall.
subsys_initcall is defined as __define_initcall("4",fn,4).
In !MODULE case, device driver module_int() is defined as
__define_initcall("6",fn,6)
If we use subsys_initcall for init_netconsole, it will still be called
before network device driver is initialized.
How about late_initcall?
(Not tested yet)
From 11f4f035e96ff430192d0a75552dd715acb5f3b8 Mon Sep 17 00:00:00 2001
From: Lin Ming <redacted>
Date: Sat, 10 Sep 2011 10:36:10 +0800
Subject: [PATCH] drivers/net: Makefile, fix netconsole link order
Commit 88491d8(drivers/net: Kconfig & Makefile cleanup) causes a
regression that netconsole does not work if netconsole and network
device driver are build into kernel, because netconsole is linked before
network device driver.
Fixes it by switching init_netconsole() to late_initcall if it's
build-in.
Signed-off-by: Lin Ming <redacted>
---
drivers/net/netconsole.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
From: Andrew Morton <akpm@linux-foundation.org> Date: 2011-09-10 04:06:05
On Sat, 10 Sep 2011 10:43:32 +0800 Lin Ming [off-list ref] wrote:
On Sat, 2011-09-10 at 08:00 +0800, Andrew Morton wrote:
quoted
quoted
+obj-$(CONFIG_NETCONSOLE) += netconsole.o
It would be preferable to fix this with initcall ordering. Perhaps by
switching init_netconsole() to subsys_initcall.
subsys_initcall is defined as __define_initcall("4",fn,4).
In !MODULE case, device driver module_int() is defined as
__define_initcall("6",fn,6)
oop, yes, I am chronologically challenged.
quoted hunk
If we use subsys_initcall for init_netconsole, it will still be called
before network device driver is initialized.
How about late_initcall?
(Not tested yet)
quoted
From 11f4f035e96ff430192d0a75552dd715acb5f3b8 Mon Sep 17 00:00:00 2001
From: Lin Ming <redacted>
Date: Sat, 10 Sep 2011 10:36:10 +0800
Subject: [PATCH] drivers/net: Makefile, fix netconsole link order
Commit 88491d8(drivers/net: Kconfig & Makefile cleanup) causes a
regression that netconsole does not work if netconsole and network
device driver are build into kernel, because netconsole is linked before
network device driver.
Fixes it by switching init_netconsole() to late_initcall if it's
build-in.
Signed-off-by: Lin Ming <redacted>
---
drivers/net/netconsole.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
That should work, unless any net driver is weirdly also using
late_initcall. But if there are such drivers, they would have failed
with the old Makefile ordering.
On Sat, 2011-09-10 at 12:10 +0800, Andrew Morton wrote:
On Sat, 10 Sep 2011 10:43:32 +0800 Lin Ming [off-list ref] wrote:
quoted
On Sat, 2011-09-10 at 08:00 +0800, Andrew Morton wrote:
quoted
quoted
+obj-$(CONFIG_NETCONSOLE) += netconsole.o
It would be preferable to fix this with initcall ordering. Perhaps by
switching init_netconsole() to subsys_initcall.
subsys_initcall is defined as __define_initcall("4",fn,4).
In !MODULE case, device driver module_int() is defined as
__define_initcall("6",fn,6)
oop, yes, I am chronologically challenged.
quoted
If we use subsys_initcall for init_netconsole, it will still be called
before network device driver is initialized.
How about late_initcall?
(Not tested yet)
quoted
From 11f4f035e96ff430192d0a75552dd715acb5f3b8 Mon Sep 17 00:00:00 2001
From: Lin Ming <redacted>
Date: Sat, 10 Sep 2011 10:36:10 +0800
Subject: [PATCH] drivers/net: Makefile, fix netconsole link order
Commit 88491d8(drivers/net: Kconfig & Makefile cleanup) causes a
regression that netconsole does not work if netconsole and network
device driver are build into kernel, because netconsole is linked before
network device driver.
Fixes it by switching init_netconsole() to late_initcall if it's
build-in.
Signed-off-by: Lin Ming <redacted>
---
drivers/net/netconsole.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
That should work, unless any net driver is weirdly also using
late_initcall. But if there are such drivers, they would have failed
with the old Makefile ordering.
Yes.
BTW, may I get your ACK after testing this patch?
Thanks.