vlan.tar.xz (27.9 KB)
I am suspecting , I may have missed in mdef. Could you please help me with this. I have attached source of driver
the source code is different, that is why it will have different behavior
Have you recompiled the new one?
I have taken source from yocto build , and recompiled using mdef in mangoh github link source code with legato 11.2 toolchain . Still the errors is same. Hence unsure about the process I am following is correct using mdef. I am not getting errors when I used in-tree module using yocto build image.
if you suspect the mdef method has problem, you can directly modify Makefile and just use the toolchain to make the driver.
Here is an example of compiling the kernel driver with toolchain only:
This method tried earlier, compilation failed. Could you please confirm include path for this method.
I can see segmentation fault here:
root@swi-mdm9x28-wp:~# ip link add link rmnet0 name rmnet0.3719 type vlan id 3719
Segmentation fault
[ 111.332230] BUG: sleeping function called from invalid context at /usr/src/kernel/arch/arm/mm/fault.c:308
[ 111.360197] in_atomic(): 0, irqs_disabled(): 0, pid: 2248, name: ip
[ 111.365430] Preemption disabled at:[< (null)>] (null)
[ 111.376088]
[ 111.376112] CPU: 0 PID: 2248 Comm: ip Tainted: G O 3.18.140 #1
[ 111.376153] [<c0014428>] (unwind_backtrace) from [<c00122ac>] (show_stack+0x10/0x14)
[ 111.376173] [<c00122ac>] (show_stack) from [<c0017254>] (do_page_fault+0x120/0x32c)
[ 111.376190] [<c0017254>] (do_page_fault) from [<c00084e4>] (do_DataAbort+0x38/0x9c)
[ 111.376204] [<c00084e4>] (do_DataAbort) from [<c0012c60>] (__dabt_svc+0x40/0x60)
[ 111.376215] Exception stack(0xcd71ba88 to 0xcd71bad0)
[ 111.376229] ba80: ccc73000 00000005 c1add400 00000001 ccc73000 0000000d
[ 111.376244] baa0: 00000000 cd71bb44 c0eb9804 00000000 ccc73520 cd71bd04 bf1340c0 cd71bad8
[ 111.376256] bac0: bf132ebc bf132ec0 20000013 ffffffff
[ 111.376298] [<c0012c60>] (__dabt_svc) from [<bf132ec0>] (vlan_proc_add_dev+0x1c/0xa0 [8021q])
[ 111.376341] [<bf132ec0>] (vlan_proc_add_dev [8021q]) from [<bf1301d8>] (vlan_device_event+0x40/0x594 [8021q])
[ 111.376373] [<bf1301d8>] (vlan_device_event [8021q]) from [<c00362ec>] (notifier_call_chain+0x40/0x64)
[ 111.376392] [<c00362ec>] (notifier_call_chain) from [<c0036368>] (raw_notifier_call_chain+0x14/0x1c)
[ 111.376412] [<c0036368>] (raw_notifier_call_chain) from [<c063eb40>] (call_netdevice_notifiers+0xc/0x14)
[ 111.376430] [<c063eb40>] (call_netdevice_notifiers) from [<c06452c0>] (register_netdevice+0x36c/0x41c)
[ 111.376459] [<c06452c0>] (register_netdevice) from [<bf1308dc>] (register_vlan_dev+0x124/0x1f8 [8021q])
[ 111.376487] [<bf1308dc>] (register_vlan_dev [8021q]) from [<c06537b8>] (rtnl_newlink+0x51c/0x5ec)
[ 111.376504] [<c06537b8>] (rtnl_newlink) from [<c0653934>] (rtnetlink_rcv_msg+0xac/0x19c)
[ 111.376522] [<c0653934>] (rtnetlink_rcv_msg) from [<c0663dd8>] (netlink_rcv_skb+0x68/0xbc)
[ 111.376538] [<c0663dd8>] (netlink_rcv_skb) from [<c0651ef4>] (rtnetlink_rcv+0x18/0x24)
[ 111.376554] [<c0651ef4>] (rtnetlink_rcv) from [<c06637b4>] (netlink_unicast+0x140/0x1ec)
[ 111.376572] [<c06637b4>] (netlink_unicast) from [<c0663c60>] (netlink_sendmsg+0x344/0x35c)
[ 111.376589] [<c0663c60>] (netlink_sendmsg) from [<c062c9a8>] (sock_sendmsg+0x88/0xa4)
[ 111.376606] [<c062c9a8>] (sock_sendmsg) from [<c062db68>] (___sys_sendmsg.part.3+0x1fc/0x244)
[ 111.376623] [<c062db68>] (___sys_sendmsg.part.3) from [<c062ec44>] (__sys_sendmsg+0x4c/0x70)
[ 111.376639] [<c062ec44>] (__sys_sendmsg) from [<c000e6e0>] (ret_fast_syscall+0x0/0x44)
[ 111.376658] Unable to handle kernel NULL pointer dereference at virtual address 000005b8
[ 111.385945] pgd = cd708000
[ 111.387618] [000005b8] *pgd=00000000
[ 111.391436] Internal error: Oops: 5 [#1] PREEMPT ARM
[ 111.396123] Modules linked in: 8021q(O) garp(O) mrp(O) [last unloaded: cfg80211]
[ 111.403504] CPU: 0 PID: 2248 Comm: ip Tainted: G O 3.18.140 #1
[ 111.410360] task: c1add400 ti: cd71a000 task.ti: cd71a000
[ 111.415765] PC is at vlan_proc_add_dev+0x1c/0xa0 [8021q]
[ 111.421045] LR is at vlan_proc_add_dev+0x18/0xa0 [8021q]
[ 111.426335] pc : [<bf132ec0>] lr : [<bf132ebc>] psr: 20000013
[ 111.426335] sp : cd71bad8 ip : bf1340c0 fp : cd71bd04
[ 111.437791] r10: ccc73520 r9 : 00000000 r8 : c0eb9804
[ 111.442998] r7 : cd71bb44 r6 : 00000000 r5 : 0000000d r4 : ccc73000
[ 111.449510] r3 : 00000001 r2 : c1add400 r1 : 00000005 r0 : ccc73000
[ 111.456018] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
[ 111.463135] Control: 10c53c7d Table: 8d708059 DAC: 00000051
[ 111.468865] Process ip (pid: 2248, stack limit = 0xcd71a208)
[ 111.474507] Stack: (0xcd71bad8 to 0xcd71c000)
[ 111.478852] bac0: ccc73000 00000005
[ 111.487009] bae0: ccc73000 00000005 00000005 bf1301d8 cd71baf0 cd71baf0 ffffffeb 00000000
[ 111.495173] bb00: 00000005 cd71bb44 c0eb9804 ccc73520 cd71bd04 c00362ec ccc73000 00000000
[ 111.503331] bb20: 00005820 00000000 e039007b c0036368 00000000 00000005 cd71bb44 c063eb40
[ 111.511489] bb40: 00000005 ccc73000 00000000 c06452c0 ccc73000 cd71bb5c 00000001 c9cd0800
[ 111.519652] bb60: ccc73000 cbc11e00 cbc11e1c 00000e87 00000007 bf1308dc bf134110 ccc73000
[ 111.527811] bb80: c0eb8b98 00000000 bf1327a4 cd71bba8 cd71bc00 c06537b8 cd71bc00 cd71bca0
[ 111.535968] bba0: 00000004 c02289f0 00000000 c0d9f448 00000000 00000000 00000000 00000000
[ 111.544132] bbc0: c0841a22 0000938c 00000000 c9a89840 c0d9f410 cd71bbc0 00000000 c0eb8b98
[ 111.552289] bbe0: 00000000 cd6d4cc0 00000000 c0d9f43c c0d9f444 00000000 00000000 00000000
[ 111.560452] bc00: 00000000 00000000 00000000 c0d9f428 00000000 c0d9f420 00000000 00000000
[ 111.568609] bc20: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 111.576766] bc40: 00000000 00000000 c0d9f438 00000000 00000000 00000000 00000000 00000000
[ 111.584928] bc60: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 111.593086] bc80: 00000000 00000000 00000000 00000000 656e6d72 332e3074 00393137 00000000
[ 111.601249] bca0: 6e616c76 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 111.609406] bcc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ea44e057
[ 111.617570] bce0: cfc762ac 00000000 c0d9f400 00000000 c9a89840 cd71bd54 00000000 00000000
[ 111.625728] bd00: cd71be00 c0653934 0000000f c021b940 cbc11580 c021b9b8 cec19000 c0eb9838
[ 111.633886] bd20: c0d9f400 c9a89840 c0653888 ce9de000 cd71bd54 c0663dd8 c9a89840 c9a89840
[ 111.642050] bd40: 00000050 c0651ef4 ced52400 c06637b4 ce9de000 7fffffff 00000000 c9a89840
[ 111.650208] bd60: 00000000 cd71bf7c ce9de000 00000050 00000000 c0663c60 0000001c c0ec2a5c
[ 111.658365] bd80: cd71a000 00000008 c0b3e280 00000000 000008c8 00000000 00000000 00000000
[ 111.666529] bda0: 00000000 c8fc88c0 cd71bf7c 00000050 c066391c 00000000 c8fc88c0 cd71be64
[ 111.674686] bdc0: 00000000 c062c9a8 00000000 00000000 00000000 cd71be00 c1add400 00000000
[ 111.682843] bde0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 111.691008] be00: c09b4c5e c09995d8 cfc763c8 00000050 c8fc88c0 c919aec8 cd71bd88 cd71bf7c
[ 111.699164] be20: cd71bec4 cd71be64 00000051 00000128 00000000 cd71be64 00000008 00000000
[ 111.707328] be40: cd71bf7c cd71bf7c 00000050 00000000 cd71bea4 c062db68 c0dfb048 c00af9a0
[ 111.715486] be60: 00000119 beaed6cc 00000000 c0e07928 00000000 cd71a000 cd708000 c0796494
[ 111.723643] be80: 000003ac 000005f5 00000080 000000eb cd71bfb0 cec0dc00 cda44000 cd71bfb0
[ 111.731807] bea0: beaeb000 c919aec8 000000a9 c1add400 cda44000 00000817 cd71a000 c00172a4
[ 111.739965] bec0: 00000000 00000010 00000000 00000000 00000000 cda44048 c0f1e164 00000800
[ 111.748123] bee0: 00000000 c0e08b68 c0e0900c 00000817 c0e0489c beaeb000 cd71bfb0 10c53c7d
[ 111.756287] bf00: beaed6c0 7f5e1cf0 beae55d0 c00084e4 c0e042cc 00000002 cec60000 ffffffff
[ 111.764445] bf20: 00000000 c00363f8 cd71bf54 c07964d4 cd97c000 c0039414 c09b4c4d 00000051
[ 111.772602] bf40: beae55d0 ea44e057 c000e8a4 c8fc88c0 00000000 beae55d0 00000128 c000e8a4
[ 111.780766] bf60: cd71a000 00000000 beae55d0 c062ec44 cec08000 00000000 fffffff7 cd71bec4
[ 111.788923] bf80: 0000000c cd71be64 00000001 00000000 00000000 00000000 beaed67c beae55bc
[ 111.797079] bfa0: 00000000 c000e6e0 beaed67c beae55bc 00000003 beae55d0 00000000 00000000
[ 111.805244] bfc0: beaed67c beae55bc 00000000 00000128 7f5e2008 12d55ac9 7f5e1cf0 beae55d0
[ 111.813401] bfe0: 00000064 beae5578 7f5ac5cc b6e35a64 600f0010 00000003 00000000 00000000
[ 111.821598] [<bf132ec0>] (vlan_proc_add_dev [8021q]) from [<bf1301d8>] (vlan_device_event+0x40/0x594 [8021q])
[ 111.831477] [<bf1301d8>] (vlan_device_event [8021q]) from [<c00362ec>] (notifier_call_chain+0x40/0x64)
[ 111.840751] [<c00362ec>] (notifier_call_chain) from [<c0036368>] (raw_notifier_call_chain+0x14/0x1c)
[ 111.849865] [<c0036368>] (raw_notifier_call_chain) from [<c063eb40>] (call_netdevice_notifiers+0xc/0x14)
[ 111.859326] [<c063eb40>] (call_netdevice_notifiers) from [<c06452c0>] (register_netdevice+0x36c/0x41c)
[ 111.868621] [<c06452c0>] (register_netdevice) from [<bf1308dc>] (register_vlan_dev+0x124/0x1f8 [8021q])
[ 111.877997] [<bf1308dc>] (register_vlan_dev [8021q]) from [<c06537b8>] (rtnl_newlink+0x51c/0x5ec)
[ 111.886840] [<c06537b8>] (rtnl_newlink) from [<c0653934>] (rtnetlink_rcv_msg+0xac/0x19c)
[ 111.894914] [<c0653934>] (rtnetlink_rcv_msg) from [<c0663dd8>] (netlink_rcv_skb+0x68/0xbc)
[ 111.903160] [<c0663dd8>] (netlink_rcv_skb) from [<c0651ef4>] (rtnetlink_rcv+0x18/0x24)
[ 111.911058] [<c0651ef4>] (rtnetlink_rcv) from [<c06637b4>] (netlink_unicast+0x140/0x1ec)
[ 111.919132] [<c06637b4>] (netlink_unicast) from [<c0663c60>] (netlink_sendmsg+0x344/0x35c)
[ 111.927378] [<c0663c60>] (netlink_sendmsg) from [<c062c9a8>] (sock_sendmsg+0x88/0xa4)
[ 111.935189] [<c062c9a8>] (sock_sendmsg) from [<c062db68>] (___sys_sendmsg.part.3+0x1fc/0x244)
[ 111.943697] [<c062db68>] (___sys_sendmsg.part.3) from [<c062ec44>] (__sys_sendmsg+0x4c/0x70)
[ 111.952118] [<c062ec44>] (__sys_sendmsg) from [<c000e6e0>] (ret_fast_syscall+0x0/0x44)
[ 111.960016] Code: e5935000 e5906278 eb3c8bb7 e3550000 (e59635b8)
[ 111.972742] ---[ end trace 49e71f88192296c9 ]---
Seems it stops at vlan_proc_add_dev() in vlanproc.c…
have you added debug message to your driver to see why it crashes?
BTW, why you cannot upgrade the yocto.cwe if it already works?
Does this means that these many dependencies are there?
LLC has to be linked before the files in net/802/
obj-$(CONFIG_LLC) += llc/
obj-$(CONFIG_NET) += ethernet/ 802/ sched/ netlink/
obj-$(CONFIG_NETFILTER) += netfilter/
obj-$(CONFIG_INET) += ipv4/
obj-$(CONFIG_XFRM) += xfrm/
obj-$(CONFIG_UNIX) += unix/
obj-$(CONFIG_NET) += ipv6/
obj-$(CONFIG_PACKET) += packet/
obj-$(CONFIG_NET_KEY) += key/
obj-$(CONFIG_BRIDGE) += bridge/
obj-$(CONFIG_NET_DSA) += dsa/
obj-$(CONFIG_IPX) += ipx/
obj-$(CONFIG_ATALK) += appletalk/
obj-$(CONFIG_X25) += x25/
obj-$(CONFIG_LAPB) += lapb/
obj-$(CONFIG_NETROM) += netrom/
obj-$(CONFIG_ROSE) += rose/
obj-$(CONFIG_AX25) += ax25/
obj-$(CONFIG_CAN) += can/
obj-$(CONFIG_IRDA) += irda/
obj-$(CONFIG_BT) += bluetooth/
obj-$(CONFIG_SUNRPC) += sunrpc/
obj-$(CONFIG_AF_RXRPC) += rxrpc/
obj-$(CONFIG_ATM) += atm/
obj-$(CONFIG_L2TP) += l2tp/
obj-$(CONFIG_DECNET) += decnet/
obj-$(CONFIG_PHONET) += phonet/
ifneq ($(CONFIG_VLAN_8021Q),)
obj-y += 8021q/
endif
no idea, i am not expert in vlan, but it could be the problem.
BTW, why you cannot upgrade the yocto.cwe if it already works?
We are using ipk method for upgrade.
I have no experience on IPK method…
Good luck!
BTW, what is the reason that you cannot use normal method to upgrade yotco.cwe?
