diff mbox series

[v2,net-next] irda: fix link order if IRDA is built into the kernel

Message ID 20170829174622.GA25926@kroah.com
State RFC, archived
Delegated to: David Miller
Headers show
Series [v2,net-next] irda: fix link order if IRDA is built into the kernel | expand

Commit Message

Greg KH Aug. 29, 2017, 5:46 p.m. UTC
When moving the IRDA code out of net/ into drivers/staging/irda/net, the
link order changes when IRDA is built into the kernel.  That causes a
kernel crash at boot time as netfilter isn't initialized yet.

To fix this, build and link the irda networking code in the same exact
order that it was previously before the move.

Reported-by: kernel test robot <fengguang.wu@intel.com>
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org
---
v2 - don't force irda to be a module, make the Makefiles put irda back
     where it was before in the link order.

 drivers/staging/Makefile | 1 -
 net/Makefile             | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller Aug. 29, 2017, 5:49 p.m. UTC | #1
From: Greg KH <gregkh@linuxfoundation.org>
Date: Tue, 29 Aug 2017 19:46:22 +0200

> When moving the IRDA code out of net/ into drivers/staging/irda/net, the
> link order changes when IRDA is built into the kernel.  That causes a
> kernel crash at boot time as netfilter isn't initialized yet.
> 
> To fix this, build and link the irda networking code in the same exact
> order that it was previously before the move.
> 
> Reported-by: kernel test robot <fengguang.wu@intel.com>
> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org

Greg, just change the initializer in IRDA so that it will run
after subsys_init() when built statically.

IRDA is definitely not the first pontentially statically built
thing that needs netlink up and available.
Greg KH Aug. 29, 2017, 7:05 p.m. UTC | #2
On Tue, Aug 29, 2017 at 10:49:45AM -0700, David Miller wrote:
> From: Greg KH <gregkh@linuxfoundation.org>
> Date: Tue, 29 Aug 2017 19:46:22 +0200
> 
> > When moving the IRDA code out of net/ into drivers/staging/irda/net, the
> > link order changes when IRDA is built into the kernel.  That causes a
> > kernel crash at boot time as netfilter isn't initialized yet.
> > 
> > To fix this, build and link the irda networking code in the same exact
> > order that it was previously before the move.
> > 
> > Reported-by: kernel test robot <fengguang.wu@intel.com>
> > Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> > Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org
> 
> Greg, just change the initializer in IRDA so that it will run
> after subsys_init() when built statically.
> 
> IRDA is definitely not the first pontentially statically built
> thing that needs netlink up and available.

Ok, will do that tomorrow and test it and send you the patch.

thanks,

greg k-h
diff mbox series

Patch

diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
index fced929a0e67..1192caa94435 100644
--- a/drivers/staging/Makefile
+++ b/drivers/staging/Makefile
@@ -2,7 +2,6 @@ 
 
 obj-y				+= media/
 obj-y				+= typec/
-obj-$(CONFIG_IRDA)		+= irda/net/
 obj-$(CONFIG_IRDA)		+= irda/drivers/
 obj-$(CONFIG_PRISM2_USB)	+= wlan-ng/
 obj-$(CONFIG_COMEDI)		+= comedi/
diff --git a/net/Makefile b/net/Makefile
index 3d3feff3643b..ddd059c3dfa4 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -31,6 +31,7 @@  obj-$(CONFIG_NETROM)		+= netrom/
 obj-$(CONFIG_ROSE)		+= rose/
 obj-$(CONFIG_AX25)		+= ax25/
 obj-$(CONFIG_CAN)		+= can/
+obj-$(CONFIG_IRDA)		+= ../drivers/staging/irda/net/
 obj-$(CONFIG_BT)		+= bluetooth/
 obj-$(CONFIG_SUNRPC)		+= sunrpc/
 obj-$(CONFIG_AF_RXRPC)		+= rxrpc/