Modify

Opened 7 years ago

Closed 7 years ago

Last modified 4 years ago

#9581 closed defect (fixed)

[adm5120] USB host broken in r27162

Reported by: anonymous Owned by: florian
Priority: normal Milestone: Barrier Breaker 14.07
Component: kernel Version: Trunk
Keywords: adm5120 usb r27162 bug Cc:

Description

Hardware: Edimax BR-6104K with USB host mod (using BR-6104KP image), self built trunk r27210

When a USB device is plugged in it hangs in

usb 1-1: new full speed USB device using adm5120-hcd and address 2

then it reboots after about 30 seconds

Full boot log (trunk r27210):

LZMA loader for BR-6104KP, Copyright (C) 2007-2008 OpenWrt.org

decompressing kernel... done!
launching kernel...

Linux version 2.6.32.33 (vmware@vmware-desktop) (gcc version 4.5.4 20110505 (pre
release) (Linaro GCC 4.5-2011.05-0) ) #2 Fri Jun 17 19:51:27 PET 2011
bootconsole [early0] enabled
CPU revision is: 0001800b (MIPS 4Kc)
SoC      : ADM5120P rev 8, running at 175.000 MHz
Bootdev  : NOR flash
Prom     : Generic
Determined physical RAM map:
 memory: 01000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Zone PFN ranges:
  Normal   0x00000000 -> 0x00001000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00001000
Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 4064
Kernel command line: console=ttyS0,115200 rootfstype=squashfs,yaffs2,jffs2
PID hash table entries: 64 (order: -4, 256 bytes)
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
Primary instruction cache 8kB, VIPT, 2-way, linesize 16 bytes.
Primary data cache 8kB, 2-way, VIPT, no aliases, linesize 16 bytes
Memory: 13048k/16384k available (1889k kernel code, 3336k reserved, 329k data, 8
52k init, 0k highmem)
SLUB: Genslabs=7, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Hierarchical RCU implementation.
NR_IRQS:24
Calibrating delay loop... 173.05 BogoMIPS (lpj=346112)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
MIPS: machine is Edimax BR-6104KP
PCI: not available on ADM5120P
bio: create slab <bio-0> at 0
Switching to clocksource MIPS
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 512 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 512 bind 512)
TCP reno registered
NET: Registered protocol family 1
squashfs: version 4.0 (2009/01/31) Phillip Lougher
Registering mini_fo version $Id$
JFFS2 version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006
 Red Hat, Inc.
yaffs Jun 16 2011 20:39:42 Installing.
msgmni has been set to 25
io scheduler noop registered
io scheduler deadline registered (default)
Serial: AMBA driver
apb:uart0: ttyS0 at MMIO 0x12600000 (irq = 9) is a AMBA
console [ttyS0] enabled, bootconsole disabled
console [ttyS0] enabled, bootconsole disabled
apb:uart1: ttyS1 at MMIO 0x12800000 (irq = 10) is a AMBA
adm5120-flash.0: probing at 0x1FC00000, size:2048KiB, width:16 bits
adm5120-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
 CFI mfr 0x000000c2
 CFI id  0x00002249
 Amd/Fujitsu Extended Query Table at 0x0040
  Amd/Fujitsu Extended Query version 1.0.
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
adm5120-flash.0: found at 0x1FC00000, size:2048KiB, width:16 bits
adm5120-flash.0: adding static partitions
Creating 3 MTD partitions on "adm5120-flash.0":
0x000000000000-0x000000008000 : "admboot"
0x000000008000-0x000000010000 : "config"
0x000000010000-0x000000200000 : "firmware"
ADM5120 built-in ethernet switch driver version 0.1.1
adm5120_wdt: Watchdog Timer version 0.1
TCP westwood registered
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
trxsplit: searching TRX header in 'admboot'
trxsplit: searching TRX header in 'config'
trxsplit: searching TRX header in 'firmware'
trxsplit: TRX header found at 0x2000
trxsplit: creating TRX partitions in 'firmware' (31,2)
Creating 2 MTD partitions on "firmware":
0x00000000201c-0x0000000c9c00 : "kernel"
mtd: partition "kernel" must either start or end on erase block boundary or be s
maller than an erase block -- forcing read-only
0x0000000c9c00-0x0000001f0000 : "rootfs"
mtd: partition "rootfs" must either start or end on erase block boundary or be s
maller than an erase block -- forcing read-only
mtd: partition "rootfs" set to be root filesystem
mtd: partition "rootfs_data" created automatically, ofs=190000, len=60000
0x000000190000-0x0000001f0000 : "rootfs_data"
Freeing unused kernel memory: 852k freed
Please be patient, while OpenWrt loads ...
input: gpio-buttons as /devices/platform/gpio-buttons/input/input0
Button Hotplug driver version 0.4.1
- preinit -
Registered led device: power
Registered led device: usb1
Registered led device: usb2
Registered led device: wan_speed
Registered led device: wan_lnkact
Registered led device: lan1_speed
Registered led device: lan1_lnkact
Registered led device: lan2_speed
Registered led device: lan2_lnkact
Registered led device: lan3_speed
Registered led device: lan3_lnkact
Registered led device: lan4_speed
Registered led device: lan4_lnkact
Press the [f] key and hit [enter] to enter failsafe mode
- regular preinit -
- init -

Please press Enter to activate this console. device eth0 entered promiscuous mod
e
br-lan: port 1(eth0) entering forwarding state
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
admhc-hcd: ADMtek USB 1.1 Host Controller Driver version 0.27.0
admhc-hcd: block sizes: ed 64 td 64
adm5120-hcd adm5120-hcd: ADM5120 built-in USB 1.1 Host Controller
adm5120-hcd adm5120-hcd: new USB bus registered, assigned bus number 1
adm5120-hcd adm5120-hcd: irq 11, io mem 0x11200000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
br-lan: port 1(eth0) entering disabled state
br-lan: port 1(eth0) entering forwarding state
adm5120_wdt: enabling watchdog timer



BusyBox v1.18.4 (2011-06-16 20:29:58 PET) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 ATTITUDE ADJUSTMENT (bleeding edge, r27210) ----------
  * 1/4 oz Vodka      Pour all ingredients into mixing
  * 1/4 oz Gin        tin with ice, strain into glass.
  * 1/4 oz Amaretto
  * 1/4 oz Triple sec
  * 1/4 oz Peach schnapps
  * 1/4 oz Sour mix
  * 1 splash Cranberry juice
 -----------------------------------------------------
root@OpenWrt:/# usb 1-1: new full speed USB device using adm5120-hcd and address
 2
þ
ADM5120 Boot:

Problem is in file: trunk/target/linux/adm5120/files/drivers/usb/host/adm5120-q.c from r27162

Missing braces in line 721 in function if (tick_before(tick, ed->tick))

			if (tick_before(tick, ed->tick))
skip_ed:
				last = &ed->ed_rm_next;
				continue;

Should be:

			if (tick_before(tick, ed->tick)) {
skip_ed:
				last = &ed->ed_rm_next;
				continue;
			}

(skip_ed label doesn't seem to be used anywhere, maybe that confuses checkpatch.pl?)

After fixing that, USB works again

Also, patch 402-magic_mac_base.patch from #4241 could be applied, it fixes MAC address on Edimax boards (now eth0 and eth1 get correct MAC addresses from config partition, without that patch MAC addresses are always 22:DA:E2:A8:86:2A, 22:DA:E2:A8:86:2B and so on...)

Attachments (1)

fix-usb-r27162.patch (420 bytes) - added by anonymous 7 years ago.
fix for missing braces in adm5120-q.c

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by anonymous

fix for missing braces in adm5120-q.c

comment:1 Changed 7 years ago by florian

  • Owner changed from developers to florian
  • Status changed from new to accepted

comment:2 Changed 7 years ago by florian

  • Resolution set to fixed
  • Status changed from accepted to closed

Applied in r27243, thanks!

comment:3 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.