In Linux initrd image, ethernet fails to work

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

In Linux initrd image, ethernet fails to work

跳至解决方案
2,007 次查看
viveksundarthir
Contributor II

I am working on SABRE SD Development board, which uses i.Mx6 Quad core processor. I have developed a initrd image for this board. The kernel boots up and the initrd images is mounted successfully. Even the fec ethernet drivers are loaded properly.

But during the init process the dhcp fails to designate an ip for the ethernet device. On analysis using the strace utility on the 'dhcp' command the following log was obtained: In the log a select system call Timeouts causing the error. A selective portion of the log is given bellow.  The timeout is highlighted.

write(1, "Sending discover...\n", 20Sending discover...

)   = 20

socket(PF_PACKET, SOCK_DGRAM, 8)        = 6

bind(6, {sa_family=AF_PACKET, proto=0x800, if2, pkttype=PACKET_HOST, addr(6)={0, ffffffffffff}, 20) = 0

sendto(6, "E\0\0014\0\0\0\0@\21y\272\0\0\0\0\377\377\377\377\0D\0C\1 ,h\1\1\6\0"..., 308, 0, {sa_family=AF_PACKET, proto=0x800, if2, pkttype=PACKET_HOST, add8

close(6)                                = 0

fcntl64(5, F_SETFD, FD_CLOEXEC)         = 0

clock_gettime(CLOCK_MONOTONIC, {53, 990583005}) = 0

select(6, [3 5], NULL, NULL, {3, 0})    = 0 (Timeout)

And after some time with the dhcp with strace running  a kernel crash is observed the crash dump is as follows:

udhcpc (v1.21.1) started

Sending discover...

Sending discover...

------------[ cut here ]------------

WARNING: at net/sched/sch_generic.c:255 dev_watchdog+0x288/0x294()

NETDEV WATCHDOG: eth0 (fec): transmit queue 0 timed out

Modules linked in:

CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.10.17+gec1af9f #17

[<80013b44>] (unwind_backtrace+0x0/0xf4) from [<80011564>] (show_stack+0x10/0x14)

[<80011564>] (show_stack+0x10/0x14) from [<80025e60>] (warn_slowpath_common+0x54/0x6c)

[<80025e60>] (warn_slowpath_common+0x54/0x6c) from [<80025ea8>] (warn_slowpath_fmt+0x30/0x40)

[<80025ea8>] (warn_slowpath_fmt+0x30/0x40) from [<804c5c5c>] (dev_watchdog+0x288/0x294)

[<804c5c5c>] (dev_watchdog+0x288/0x294) from [<80032f0c>] (call_timer_fn.isra.30+0x24/0x88)

[<80032f0c>] (call_timer_fn.isra.30+0x24/0x88) from [<80033104>] (run_timer_softirq+0x194/0x210)

[<80033104>] (run_timer_softirq+0x194/0x210) from [<8002d1d4>] (__do_softirq+0x124/0x204)

[<8002d1d4>] (__do_softirq+0x124/0x204) from [<8002d364>] (do_softirq+0x54/0x5c)

[<8002d364>] (do_softirq+0x54/0x5c) from [<8002d5ec>] (irq_exit+0x9c/0xd0)

[<8002d5ec>] (irq_exit+0x9c/0xd0) from [<8000e84c>] (handle_IRQ+0x44/0x90)

[<8000e84c>] (handle_IRQ+0x44/0x90) from [<80008570>] (gic_handle_irq+0x2c/0x5c)

[<80008570>] (gic_handle_irq+0x2c/0x5c) from [<8000dbc0>] (__irq_svc+0x40/0x50)

Exception stack(0x80bddf20 to 0x80bddf68)

BUG: scheduling while atomic: swapper/0/0/0x40000100

Modules linked in:

CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.10.17+gec1af9f #17

[<80013b44>] (unwind_backtrace+0x0/0xf4) from [<80011564>] (show_stack+0x10/0x14)

[<80011564>] (show_stack+0x10/0x14) from [<805d4c9c>] (__schedule_bug+0x50/0x64)

[<805d4c9c>] (__schedule_bug+0x50/0x64) from [<805d9e2c>] (__schedule+0x534/0x5a8)

[<805d9e2c>] (__schedule+0x534/0x5a8) from [<8004d5e8>] (__cond_resched+0x24/0x34)

[<8004d5e8>] (__cond_resched+0x24/0x34) from [<805da20c>] (_cond_resched+0x3c/0x44)

[<805da20c>] (_cond_resched+0x3c/0x44) from [<80011418>] (dump_mem+0xd0/0x140)

[<80011418>] (dump_mem+0xd0/0x140) from [<80013bb4>] (unwind_backtrace+0x70/0xf4)

[<80013bb4>] (unwind_backtrace+0x70/0xf4) from [<80011564>] (show_stack+0x10/0x14)

[<80011564>] (show_stack+0x10/0x14) from [<80025e60>] (warn_slowpath_common+0x54/0x6c)

[<80025e60>] (warn_slowpath_common+0x54/0x6c) from [<80025ea8>] (warn_slowpath_fmt+0x30/0x40)

[<80025ea8>] (warn_slowpath_fmt+0x30/0x40) from [<804c5c5c>] (dev_watchdog+0x288/0x294)

[<804c5c5c>] (dev_watchdog+0x288/0x294) from [<80032f0c>] (call_timer_fn.isra.30+0x24/0x88)

[<80032f0c>] (call_timer_fn.isra.30+0x24/0x88) from [<80033104>] (run_timer_softirq+0x194/0x210)

[<80033104>] (run_timer_softirq+0x194/0x210) from [<8002d1d4>] (__do_softirq+0x124/0x204)

[<8002d1d4>] (__do_softirq+0x124/0x204) from [<8002d364>] (do_softirq+0x54/0x5c)

[<8002d364>] (do_softirq+0x54/0x5c) from [<8002d5ec>] (irq_exit+0x9c/0xd0)

[<8002d5ec>] (irq_exit+0x9c/0xd0) from [<8000e84c>] (handle_IRQ+0x44/0x90)

[<8000e84c>] (handle_IRQ+0x44/0x90) from [<80008570>] (gic_handle_irq+0x2c/0x5c)

[<80008570>] (gic_handle_irq+0x2c/0x5c) from [<8000dbc0>] (__irq_svc+0x40/0x50)

Exception stack(0x80bddf20 to 0x80bddf68)

df20: 80bddf68 000000d4 9a2c6fff 00000031 9868dbd4 00000031 8149d080 80bea050

df40: 00000000 00000000 80bdc000 80be44d8 00000017 80bddf68 8005a264 803ee6fc

df60: 60000013 ffffffff

[<8000dbc0>] (__irq_svc+0x40/0x50) from [<803ee6fc>] (cpuidle_enter_state+0x50/0xe0)

[<803ee6fc>] (cpuidle_enter_state+0x50/0xe0) from [<803ee83c>] (cpuidle_idle_call+0xb0/0x148)

[<803ee83c>] (cpuidle_idle_call+0xb0/0x148) from [<8000eb7c>] (arch_cpu_idle+0x10/0x54)

[<8000eb7c>] (arch_cpu_idle+0x10/0x54) from [<80059af8>] (cpu_startup_entry+0xfc/0x140)

[<80059af8>] (cpu_startup_entry+0xfc/0x140) from [<80b90a9c>] (start_kernel+0x324/0x330)

df20: 80bddf68 000000d4 9a2c6fff 00000031 9868dbd4 00000031 8149d080 80bea050

df40: 00000000 00000000 80bdc000 80be44d8 00000017 80bddf68 8005a264 803ee6fc

BUG: scheduling while atomic: swapper/0/0/0x40000100

Modules linked in:

CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W    3.10.17+gec1af9f #17

[<80013b44>] (unwind_backtrace+0x0/0xf4) from [<80011564>] (show_stack+0x10/0x14)

[<80011564>] (show_stack+0x10/0x14) from [<805d4c9c>] (__schedule_bug+0x50/0x64)

[<805d4c9c>] (__schedule_bug+0x50/0x64) from [<805d9e2c>] (__schedule+0x534/0x5a8)

[<805d9e2c>] (__schedule+0x534/0x5a8) from [<8004d5e8>] (__cond_resched+0x24/0x34)

[<8004d5e8>] (__cond_resched+0x24/0x34) from [<805da20c>] (_cond_resched+0x3c/0x44)

[<805da20c>] (_cond_resched+0x3c/0x44) from [<80011418>] (dump_mem+0xd0/0x140)

[<80011418>] (dump_mem+0xd0/0x140) from [<80013bb4>] (unwind_backtrace+0x70/0xf4)

[<80013bb4>] (unwind_backtrace+0x70/0xf4) from [<80011564>] (show_stack+0x10/0x14)

[<80011564>] (show_stack+0x10/0x14) from [<80025e60>] (warn_slowpath_common+0x54/0x6c)

[<80025e60>] (warn_slowpath_common+0x54/0x6c) from [<80025ea8>] (warn_slowpath_fmt+0x30/0x40)

[<80025ea8>] (warn_slowpath_fmt+0x30/0x40) from [<804c5c5c>] (dev_watchdog+0x288/0x294)

[<804c5c5c>] (dev_watchdog+0x288/0x294) from [<80032f0c>] (call_timer_fn.isra.30+0x24/0x88)

[<80032f0c>] (call_timer_fn.isra.30+0x24/0x88) from [<80033104>] (run_timer_softirq+0x194/0x210)

[<80033104>] (run_timer_softirq+0x194/0x210) from [<8002d1d4>] (__do_softirq+0x124/0x204)

[<8002d1d4>] (__do_softirq+0x124/0x204) from [<8002d364>] (do_softirq+0x54/0x5c)

[<8002d364>] (do_softirq+0x54/0x5c) from [<8002d5ec>] (irq_exit+0x9c/0xd0)

[<8002d5ec>] (irq_exit+0x9c/0xd0) from [<8000e84c>] (handle_IRQ+0x44/0x90)

[<8000e84c>] (handle_IRQ+0x44/0x90) from [<80008570>] (gic_handle_irq+0x2c/0x5c)

[<80008570>] (gic_handle_irq+0x2c/0x5c) from [<8000dbc0>] (__irq_svc+0x40/0x50)

Exception stack(0x80bddf20 to 0x80bddf68)

df20: 80bddf68 000000d4 9a2c6fff 00000031 9868dbd4 00000031 8149d080 80bea050

df40: 00000000 00000000 80bdc000 80be44d8 00000017 80bddf68 8005a264 803ee6fc

df60: 60000013 ffffffff

[<8000dbc0>] (__irq_svc+0x40/0x50) from [<803ee6fc>] (cpuidle_enter_state+0x50/0xe0)

[<803ee6fc>] (cpuidle_enter_state+0x50/0xe0) from [<803ee83c>] (cpuidle_idle_call+0xb0/0x148)

[<803ee83c>] (cpuidle_idle_call+0xb0/0x148) from [<8000eb7c>] (arch_cpu_idle+0x10/0x54)

[<8000eb7c>] (arch_cpu_idle+0x10/0x54) from [<80059af8>] (cpu_startup_entry+0xfc/0x140)

[<80059af8>] (cpu_startup_entry+0xfc/0x140) from [<80b90a9c>] (start_kernel+0x324/0x330)

df60: 60000013 ffffffff

[<8000dbc0>] (__irq_svc+0x40/0x50) from [<803ee6fc>] (cpuidle_enter_state+0x50/0xe0)

[<803ee6fc>] (cpuidle_enter_state+0x50/0xe0) from [<803ee83c>] (cpuidle_idle_call+0xb0/0x148)

[<803ee83c>] (cpuidle_idle_call+0xb0/0x148) from [<8000eb7c>] (arch_cpu_idle+0x10/0x54)

[<8000eb7c>] (arch_cpu_idle+0x10/0x54) from [<80059af8>] (cpu_startup_entry+0xfc/0x140)

[<80059af8>] (cpu_startup_entry+0xfc/0x140) from [<80b90a9c>] (start_kernel+0x324/0x330)

---[ end trace 2759b8ad088db885 ]---

Sending discover...

No lease, failing

But when the same rootfs used in initrd image is used with SD card boot, the dhcp command does not fail.

Can any one help me with some clues?

with regards,

Vivek

标签 (2)
标记 (4)
1 解答
1,485 次查看
viveksundarthir
Contributor II

Hello Jaime,

Thaks for your reply.  The issue is that in the dtb file i used rmii instead of rgmii interface... which caused this issue... I remember changing that for one of our custom made boards.  It is to hard to find this silly mistake.

with regards,

Vivek

在原帖中查看解决方案

2 回复数
1,485 次查看
jamesbone
NXP TechSupport
NXP TechSupport

Hello Vivek,

Can you please explain, the steps that you are using for the booting process, where is the image located? TFTP? NFS?  EmmC?.  Since I assumed that the SD Card it is working, then if you use only uboot, and try the DHCP is the problem happening? are you putting a different MAC Address on the FEC? is the DHCP directly connected to the board? or it is a router/server?


Have a great day,
Jaime

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
1,486 次查看
viveksundarthir
Contributor II

Hello Jaime,

Thaks for your reply.  The issue is that in the dtb file i used rmii instead of rgmii interface... which caused this issue... I remember changing that for one of our custom made boards.  It is to hard to find this silly mistake.

with regards,

Vivek