[#3996] dhcpcd not stable on BF548-EZKIT
Submitted By: Yi Li
Open Date
2008-03-30 22:36:33
Priority:
Medium High Assignee:
Sonic Zhang
Status:
Open Fixed In Release:
N/A
Found In Release:
N/A Release:
2008r1
Category:
N/A Board:
N/A
Processor:
BF548 Silicon Revision:
Is this bug repeatable?:
Yes Resolution:
Not reproducible
Uboot version or rev.:
Toolchain version or rev.:
App binary format:
N/A
Summary: dhcpcd not stable on BF548-EZKIT
Details:
BF548-EZKIT LITE Rev 1.3
"dhcpcd" cannot get IP address easily
root:/> dhcpcd &
749
root:/> eth0: SMSC911x/921x identified at 0x24000000, IRQ: 175
eth0: SMSC911x MAC Address: 00:e0:22:fe:b7:4f
eth0: link down
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
root:/> ifconfig
eth0 Link encap:Ethernet HWaddr 00:E0:22:FE:B7:4F
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
Interrupt:175
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
<Wait about 1 min. cannot find "dhcpcd" using "ps" >
root:/> ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
<invoke dhcpcd again and get ip addr >
root:/> dhcpcd &
757
root:/> eth0: SMSC911x/921x identified at 0x24000000, IRQ: 175
eth0: SMSC911x MAC Address: 00:e0:22:fe:b7:4f
eth0: link down
root:/> ifconeth0: link up, 100Mbps, full-duplex, lpa 0x45E1
fig
eth0 Link encap:Ethernet HWaddr 00:E0:22:FE:B7:4F
UP BROADCAST NOTRAILERS RUNNING MTU:1500 Metric:1
RX packets:68 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
Interrupt:175
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
root:/> ifconfig
eth0 Link encap:Ethernet HWaddr 00:E0:22:FE:B7:4F
inet addr:10.99.22.79 Bcast:10.99.22.255 Mask:255.255.255.0
UP BROADCAST NOTRAILERS RUNNING MTU:1500 Metric:1
RX packets:79 errors:0 dropped:0 overruns:0 frame:0
TX packets:9 errors:6 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
Interrupt:175
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
Follow-ups
--- Yi Li 2008-06-19 04:13:56
tested again on BF548, with revision:
uclinux-dist: Revision: 6701
linux: Revision: 4856
Still fails.
--- Yi Li 2008-06-19 06:17:29
I've also run dhcpcd on BF561, using the branch. dhcpcd works well on BF561.
--- Sonic Zhang 2008-06-19 23:28:12
Michael,
Could you take a look at this bug. The dhcpd problem can only be observed on
bf548-ezkit with SMSC921x ethernet driver. The same dhcpd works well with other
blackfin onboard EMAC driver and SMC9111 ethernet driver.
--- Michael Hennerich 2008-06-20 04:39:28
I tried this several times on 2008R1 and trunk - I get always an IP address the
first attempt. Sorry I can't debug something that doesn't fail on my side...
See below.
-Michael
root:/> ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
root:/> dhcpcd &
243
root:/> eth0: SMSC911x/921x identified at 0x24000000, IRQ: 175
eth0: SMSC911x MAC Address: 00:e0:22:fe:b8:44
eth0: link down
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
root:/> ifconfig
eth0 Link encap:Ethernet HWaddr 00:E0:22:FE:B8:44
inet addr:10.44.2.122 Bcast:10.44.2.255 Mask:255.255.255.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:9 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
Interrupt:175
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
root:/> version
kernel: Linux release 2.6.22.19-ADI-2008R1-svn4871, build #1797 Fri Jun 20
10:33:08 CEST 2008
toolchain: bfin-uclinux-gcc release gcc version 4.1.2 (ADI svn)
user-dist: release svn-6801, build #447 Fri Jun 20 10:31:59 CEST 2008
root:/>
-------------------------------------------------------------------------------------------------
root:/> ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
root:/> dhcpcd &
293
root:/> eth0: SMSC911x/921x identified at 0x24000000, IRQ: 175
eth0: link down
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
root:/> ifconfig
eth0 Link encap:Ethernet HWaddr 00:E0:22:FE:B8:44
inet addr:10.44.2.123 Bcast:10.44.2.255 Mask:255.255.255.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:14 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
Interrupt:175
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
root:/> version
kernel: Linux release 2.6.24.7-ADI-2008R2-pre-svn4857, build #6505 Fri Jun
20 10:15:18 CEST 2008
toolchain: bfin-uclinux-gcc release gcc version 4.1.2 (ADI svn)
user-dist: release svn-6800, build #2230 Fri Jun 20 10:14:35 CEST 2008
root:/>
--- Yi Li 2008-06-23 03:10:48
I tried to used the released uImage for BF548-ezkit
( download.analog.com/27516/frsrelease/4/2/3/4234/uImage-bf548-ezkit-2008R1-RC8).
Still cannot get IP address easily. And I tried on two boards, both fail.
Maybe this is related with dhcp server?
--- Michael Hennerich 2008-06-23 03:55:41
What is your u-boot version?
Maybe my u-boot inits the Ethernet MAC differently?
I tried the uImage you pointed at. Works withoit problems on my side.
See below.
>Maybe this is related with dhcp server?
If it's not related to u-boot then it must be related to your dhcp server.
-Michael
root:/> dhcpcd &
227
root:/> eth0: SMSC911x/921x identified at 0x24000000, IRQ: 175
eth0: SMSC911x MAC Address: 00:e0:22:fe:b8:44
eth0: link down
root:/> eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
root:/> ifconfig
eth0 Link encap:Ethernet HWaddr 00:E0:22:FE:B8:44
inet addr:10.44.2.129 Bcast:10.44.2.255 Mask:255.255.255.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
Interrupt:175
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
root:/> version
kernel: Linux release 2.6.22.18-ADI-2008R1-svn, build #15 Tue Mar 18
16:51:56 CST 2008
toolchain: bfin-uclinux-gcc release gcc version 4.1.2 (ADI svn)
user-dist: release 2008R1, build #5 Tue Mar 18 16:50:23 CST 2008
root:/>
--- Yi Li 2008-06-24 00:17:37
Here is my u-boot version:
U-Boot 1.1.6-svn1227 (ADI-2008R2-pre) (Jun 17 2008 - 12:09:00)
CPU: ADSP bf548-0.0 (Detected Rev: 0.1)
Board: ADI BF548 EZ-Kit board
Support: blackfin.uclinux.org/
Clock: VCO: 525 MHz, Core: 525 MHz, System: 131 MHz
RAM: 64 MB
Flash: 16 MB
In: serial
Out: serial
Err: serial
NAND: 256 MiB
Net: LAN9x18 (0x118a0000) detected at 0x24000000
MAC: 00:E0:22:FE:B8:3D
Hit any key to stop autoboot: 0
I think Robin may also see this issue, in the doc:
docs.blackfin.uclinux.org/doku.php?id=hw:boards:bf548_media_demonstration#load_the_filesystem_onto_the_hard_drive
It says:
"
#
Get an IP number (yeah, do it again)
root:/> dhcpcd &
240
root:/> eth0: SMSC911x/921x identified at 0x24000000, IRQ: 175
eth0: SMSC911x MAC Address: 00:e0:22:fe:b9:38
eth0: link down
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
You will have to hit return twice after it runs to get the next root:~>
prompt.
#
Note that you may need to wait 5 - 10 seconds in between running the last
command, and the next - as it may take a few seconds for the dhcp server on the
network to respond to the BF548 EZKit.
#
Check the network settings were set properly. You will get something that looks
like:
root:/> ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:E0:22:FE:B9:38
inet addr:10.64.204.139 Bcast:10.64.204.255 Mask:255.255.255.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:286 errors:0 dropped:1673 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
Interrupt:175
or:
root:/> ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:E0:22:FE:B9:38
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
Interrupt:1
Where the difference between success and failure is the inet addr that is
returned. The first case (success) has one, and the second case (failure) does
not. If it does not have one try repeating things (yeah, I know - this is a bug,
and we are looking into it):
1.
root:/> killall dhcpcd
2.
root:/> dhcpcd &
240
root:/> eth0: SMSC911x/921x identified at 0x24000000, IRQ: 175
eth0: SMSC911x MAC Address: 00:e0:22:fe:b9:38
eth0: link down
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
You will have to hit return twice after it runs to get the next
root:~> prompt.
3.
Note that you may need to wait 5 - 10 seconds in between running the last
command, and the next - as it may take a few seconds for the dhcp server on the
network to respond to the BF548 EZKit.
4.
Check the network settings. You will get something that looks like:
root:/> ifconfig eth0
If you have success (as defined above) continue to the next step, if you
do not get an inet addr address, try again (starting with the killall dhcpcd
step. This seems only to be a problem on 1/2 duplex networks, and like I said -
we are looking into it. If there is a problem (and there normally is not), it
typically only takes a second try and it works.
"
--- Michael Hennerich 2008-06-25 05:33:59
As I said I can't debug something that always works for me.
Can you provide me an strace?
root:/> strace dhcpcd &
-Michael
--- Yi Li 2008-06-25 07:07:46
please see attached file dhcpcd.txt.
Sonic:
Maybe this bug should be assigned to someone in Shanghai (it can be reproduced
in Shanghai office).
--- Michael Hennerich 2008-06-25 11:09:59
This is pointless.
I tried almost the entire day to hunt ghosts, trying to recreate an issue that
doesn’t exist over here.
Please debug this on your site.
Things that help a lot are:
1) Start syslogd
2) Start dhcpcd with the debug flag set.
root:/>
root:/> syslogd
root:/> dhcpcd -d &
245
root:/> cat /var/log/messages
Jan 1 00:14:50 blackfin syslog.info syslogd started: BusyBox v1.4.1
Jan 1 00:15:01 blackfin local0.debug dhcpcd[245]: broadcasting DHCP_DISCOVER
Jan 1 00:15:01 blackfin local0.debug dhcpcd[245]: broadcastAddr option is
missing in DHCP server response. Assuming 10.44.2.255
Jan 1 00:15:01 blackfin local0.debug dhcpcd[245]: broadcasting second
DHCP_DISCOVER
Jan 1 00:15:01 blackfin local0.debug dhcpcd[245]: DHCP_OFFER received from
(10.44.2.17)
Jan 1 00:15:01 blackfin local0.debug dhcpcd[245]: broadcasting DHCP_REQUEST
(dhcpRequest) for 10.44.2.144
Jan 1 00:15:01 blackfin local0.debug dhcpcd[245]: DHCP_ACK received from
(10.44.2.17)
Jan 1 00:15:01 blackfin local0.debug dhcpcd[245]: dhcpcd: your IP address =
10.44.2.144
root:/> ifconfig
eth0 Link encap:Ethernet HWaddr 00:E0:22:FE:B8:44
inet addr:10.44.2.144 Bcast:10.44.2.255 Mask:255.255.255.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:77 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
Interrupt:175
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
root:/>
I compared your system trace and mine.
Your select system call (peekfd) times out.
I receive an answer in time. (try to increase the timeout)
Your trace:
open("/etc/dhcpc/dhcpcd-eth0.cache", O_RDONLY) = -1 ENOENT (No such
file or directory)
ioctl(3, SIOCGIFADDR, {ifr_name="eth0", ???}) = -1 EADDRNOTAVAIL
(Cannot assign requested address)
uname({sys="Linux", node="blackfin", ...}) = 0
send(3, "\377\377\377\377\377\377\0\0\0\0\0\0\10\0E\0\2@k\314\0"...,
590, 0) = 590
gettimeofday({27596, 690666}, NULL) = 0
pselect6(4, [3], NULL, NULL, {2, 11827000}eth0: link up, 100Mbps, full-duplex,
lpa 0x45E1
, 0) = 0 (Timeout)
send(3, "\377\377\377\377\377\377\0\0\0\0\0\0\10\0E\0\2@k\315\0"...,
590, 0) = 590
gettimeofday({27598, 703899}, NULL) = 0
pselect6(4, [3], NULL, NULL, {4, 19378000}, 0) = 0 (Timeout)
send(3, "\377\377\377\377\377\377\0\0\0\0\0\0\10\0E\0\2@k\316\0"...,
590, 0) = 590
gettimeofday({27602, 723902}, NULL) = 0
pselect6(4, [3], NULL, NULL, {8, 4009000}, 0) = 1 (in [3], left {7,
304000000})
My trace:
open("/etc/dhcpc/dhcpcd-eth0.cache", O_RDONLY) = -1 ENOENT (No such
file or directory)
ioctl(3, SIOCGIFADDR, {ifr_name="eth0", ???}) = -1 EADDRNOTAVAIL
(Cannot assign requested address)
uname({sys="Linux", node="blackfin", ...}) = 0
send(3, "\377\377\377\377\377\377\0\0\0\0\0\0\10\0E\0\2@\346\207"...,
590, 0) = 590
gettimeofday({2026563207, 258822}, NULL) = 0
pselect6(4, [3], NULL, NULL, {2, 92853000}eth0: link up, 100Mbps, full-duplex,
lpa 0x45E1
, 0) = 0 (Timeout)
send(3, "\377\377\377\377\377\377\0\0\0\0\0\0\10\0E\0\2@\346\210"...,
590, 0) = 590
gettimeofday({2026563209, 352711}, NULL) = 0
pselect6(4, [3], NULL, NULL, {4, 143710000}, 0) = 1 (in [3], left {4,
143710000})
recv(3, "\377\377\377\377\377\377\0\30\2139|\250\10\0E\0\1K:\206"...,
1514, 0) = 345
gettimeofday({2026563209, 353959}, NULL) = 0
send(3, "\377\377\377\377\377\377\0\0\0\0\0\0\10\0E\0\2@\346\211"...,
590, 0) = 590
I attached my trace to this bug as well.
Sonic,
Please reassign.
-Michael
Files
Changes
Commits
Dependencies
Duplicates
Associations
Tags
File Name File Type File Size Posted By
dhcpcd.txt text/plain 25315 Yi Li
strace_dhcpcd_works.txt text/plain 9419 Michael Hennerich