Modify

Opened 10 years ago

Closed 9 years ago

Last modified 8 years ago

#3803 closed defect (fixed)

USB2.0 initialization for bcm5354 and 2.4.x kernel

Reported by: sbrown Owned by: agb
Priority: normal Milestone:
Component: packages Version:
Keywords: bcm5354 usb20 2.4.x Cc:

Description

Found this while looking through Asus GPL code.
It corrects an initialization problem that affects both ohci & ehci in 2.4.x.

Attachments (2)

014-pcibios-2.4.patch (1.2 KB) - added by sbrown 10 years ago.
BCM5354 USB20 core initialization patch
pcibios_bcm5354_usb_fix.diff (1.4 KB) - added by gergely.kis@… 9 years ago.
Another patch, tested with [12338]

Download all attachments as: .zip

Change History (11)

Changed 10 years ago by sbrown

BCM5354 USB20 core initialization patch

comment:1 follow-up: Changed 10 years ago by agb

  • Owner changed from developers to agb
  • Status changed from new to assigned

This patch prevents my wl520gU from rebooting, but doesn't fix USB behavior. I tried mounting a USB drive and hit problems when I tried to touch a file on the device.

Jan  1 00:02:06 OpenWrt user.notice root: foo
Jan  1 00:03:17 OpenWrt user.warn kernel: usb_control/bulk_msg: timeout
Jan  1 00:03:57 OpenWrt user.err kernel: hub.c: USB device not accepting new address (error=-71)
Jan  1 00:04:02 OpenWrt user.info kernel: scsi: device set offline - not ready or command retry failed after bus reset: host 0 channel 0 id 0 lun 0
Jan  1 00:04:02 OpenWrt user.warn kernel: SCSI disk error : host 0 channel 0 id 0 lun 0 return code = 70000
Jan  1 00:04:02 OpenWrt user.warn kernel:  I/O error: dev 08:01, sector 496
Jan  1 00:04:02 OpenWrt user.warn kernel:  I/O error: dev 08:01, sector 504
Jan  1 00:04:02 OpenWrt user.warn kernel:  I/O error: dev 08:01, sector 8
Jan  1 00:04:02 OpenWrt user.warn kernel:  I/O error: dev 08:01, sector 0
Jan  1 00:04:02 OpenWrt user.crit kernel: EXT2-fs error (device sd(8,1)): read_inode_bitmap: Cannot read inode bitmap - block_group = 0, inode_bitmap = 62
Jan  1 00:04:09 OpenWrt user.warn kernel:  I/O error: dev 08:01, sector 8
Jan  1 00:04:09 OpenWrt user.warn kernel:  I/O error: dev 08:01, sector 0

I then killed the touch process, unmounted the drive, fscked the filesystem on another device, then plugged it back in and it would not work until I rebooted

Jan  1 00:04:14 OpenWrt user.info kernel: usb.c: USB disconnect on device 00:03.1-1 address 2
Jan  1 00:06:47 OpenWrt user.info kernel: hub.c: new USB device 00:03.1-1, assigned address 3
Jan  1 00:06:47 OpenWrt user.debug kernel: WARNING: USB Mass Storage data integrity not assured
Jan  1 00:06:47 OpenWrt user.debug kernel: USB Mass Storage device found at 3
Jan  1 00:06:47 OpenWrt user.notice root: usb device is mass storage
Jan  1 00:06:47 OpenWrt user.notice root: waiting on usb drive 0 ...
Jan  1 00:06:48 OpenWrt user.notice root: waiting on usb drive 1 ...
Jan  1 00:06:49 OpenWrt user.notice root: waiting on usb drive 2 ...
Jan  1 00:06:50 OpenWrt user.notice root: waiting on usb drive 3 ...
Jan  1 00:06:51 OpenWrt user.notice root: waiting on usb drive 4 ...
Jan  1 00:06:52 OpenWrt user.notice root: waiting on usb drive 5 ...
Jan  1 00:06:53 OpenWrt user.notice root: waiting on usb drive 6 ...
Jan  1 00:06:54 OpenWrt user.notice root: waiting on usb drive 7 ...
Jan  1 00:06:56 OpenWrt user.notice root: waiting on usb drive 8 ...
Jan  1 00:06:57 OpenWrt user.notice root: waiting on usb drive 9 ...
Jan  1 00:06:58 OpenWrt user.notice root: waiting on usb drive 10 ...
Jan  1 00:07:14 OpenWrt user.debug kernel: VFS: Disk change detected on device 08:00
Jan  1 00:07:14 OpenWrt user.info kernel:  /dev/scsi/host0/bus0/target0/lun0: I/O error: dev 08:00, sector 0
Jan  1 00:07:14 OpenWrt user.warn kernel:  I/O error: dev 08:00, sector 0
Jan  1 00:07:17 OpenWrt user.debug kernel: VFS: Disk change detected on device 08:00
Jan  1 00:07:17 OpenWrt user.info kernel:  /dev/scsi/host0/bus0/target0/lun0: I/O error: dev 08:00, sector 0
Jan  1 00:07:17 OpenWrt user.warn kernel:  I/O error: dev 08:00, sector 0
Jan  1 00:07:21 OpenWrt user.debug kernel: VFS: Disk change detected on device 08:00
Jan  1 00:07:21 OpenWrt user.info kernel:  /dev/scsi/host0/bus0/target0/lun0: I/O error: dev 08:00, sector 0
Jan  1 00:07:21 OpenWrt user.warn kernel:  I/O error: dev 08:00, sector 0
Jan  1 00:07:33 OpenWrt user.debug kernel: VFS: Disk change detected on device 08:00
Jan  1 00:07:33 OpenWrt user.info kernel:  /dev/scsi/host0/bus0/target0/lun0: I/O error: dev 08:00, sector 0
Jan  1 00:07:33 OpenWrt user.warn kernel:  I/O error: dev 08:00, sector 0

comment:2 in reply to: ↑ 1 Changed 10 years ago by sbrown

This thread reports success with the patch. http://forum.openwrt.org/viewtopic.php?id=16290

Could you post your bootup log with the drive plugged in?

comment:3 Changed 9 years ago by florian

This patch does not seem to work on bcm5836 :

usb-ohci.c: USB OHCI at membase 0xb8003000, IRQ 6
usb-ohci.c: usb-00:03.0, PCI device 14e4:4715
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 2 ports detected
uhci.c: USB Universal Host Controller Interface driver v1.1
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
USB Mass Storage support registered.
hub.c: Cannot enable port 2 of hub 1, disabling port.
hub.c: Maybe the USB cable is bad?
hub.c: Cannot enable port 2 of hub 1, disabling port.
hub.c: Maybe the USB cable is bad?

comment:4 Changed 9 years ago by anonymous

5836 is a 4704 with additionl components, _NOT_ 5354 - and it doesn't have a USB2 core..

comment:5 Changed 9 years ago by sbrown

I have a wl500gp w/ a bcm4704. The 4704 has a usb ohci core that isn't wired out and a Via uhci/ehci chip on the 4704's pci bus that is. The Via needs the uhci and ehci pci drivers. The ssb ohci driver, if loaded, will bind to the unused ohci core and give these messages.

Changed 9 years ago by gergely.kis@…

Another patch, tested with [12338]

comment:6 follow-up: Changed 9 years ago by gergely.kis@…

I just attached a new patch, which I tested on a ASUS WL500GP v2. This is essentially the same as sbrown's patch, but his patch was already partially applied. Unfortunately the applied patch only took SB core revision 1 into consideration, nd the ASUS WL500GP v2 has rev 2 HW.

I also added a bit more logging, because this place seems to trigger a lot of issues, and this way dmesg will be more informative (hopefully :) ).

comment:7 Changed 9 years ago by kaloz

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

Thanks, commited in [12499].

comment:8 in reply to: ↑ 6 Changed 9 years ago by dannybaumann@…

Replying to gergely.kis@mattakis.com:

I just attached a new patch, which I tested on a ASUS WL500GP v2. This is essentially the same as sbrown's patch, but his patch was already partially applied. Unfortunately the applied patch only took SB core revision 1 into consideration, nd the ASUS WL500GP v2 has rev 2 HW.

It's not ;-)
It's missing the sync register writes (at least Asus calls them SYN01 and SYN03, it's the register writes to 0x894 and 0x89c.
On my WL-500GP V2 those two are necessary as otherwise the first 8kB write transfer to my Seagate FreeAgent Desktop USB HDD will end after 6.5kB with the router only attempting to transfer garbage afterwards (I checked with a USB protocol analyzer).

Writing those two in the 'if (corerev == 1
corerev == 2)' path (not for every chip as Asus did) should be sufficient, though.

I strongly suggest to reopen this bug (I unfortunately don't seem to be allowed to do so).

comment:9 Changed 8 years ago by anonymous

This bug still seems to occur on Kamikaze 8.09 (kernel 2.4.35.4 on a Broadcom BCM4712 chip rev 1) on my WRT54G3G.
Once my pppd connection drops, my USB subsystem (and PCMCIA slot) is rendered useless until I force a reboot.

Oct 22 14:17:09 OpenWrt daemon.info pppd[1401]: No response to 5 echo-requests
Oct 22 14:17:09 OpenWrt daemon.notice pppd[1401]: Serial link appears to be disconnected.
Oct 22 14:17:09 OpenWrt daemon.info pppd[1401]: Connect time 46.1 minutes.
Oct 22 14:17:09 OpenWrt daemon.info pppd[1401]: Sent 20284092 bytes, received 224192463 bytes.
Oct 22 14:17:11 OpenWrt user.notice root: removing wan (ppp0) from firewall zone wan
Oct 22 14:17:12 OpenWrt user.notice root: stopping ntpclient
Oct 22 14:17:15 OpenWrt daemon.notice pppd[1401]: Connection terminated.
Oct 22 14:17:15 OpenWrt daemon.notice pppd[1401]: Modem hangup

and finally after multiple reconnection attempts

Oct 22 14:24:32 OpenWrt daemon.info pppd[1401]: Terminating on signal 15
Oct 22 14:24:32 OpenWrt daemon.info pppd[1401]: Exit.
Oct 22 14:24:32 kernel: usb-ohci.c: unlink URB timeout
Oct 22 14:24:36 kernel: usbserial.c: generic_open - failed resubmitting read urb, error -22
Oct 22 14:25:06 kernel: usbserial.c: __serial_close - port 0: not open
Oct 22 14:25:06 kernel: usbserial.c: generic_open - failed resubmitting read urb, error -22
Oct 22 14:25:10 kernel: usbserial.c: __serial_close - port 0: not open
Oct 22 14:25:11 OpenWrt daemon.notice pppd[2631]: pppd 2.4.3 started by root, uid 0
Oct 22 14:25:11 kernel: usbserial.c: generic_open - failed resubmitting read urb, error -22
Oct 22 14:25:15 OpenWrt daemon.notice pppd[2640]: pppd 2.4.3 started by root, uid 0
Oct 22 14:25:15 OpenWrt daemon.notice pppd[2640]: Device usb_tts_0 is locked by pid 2631
Oct 22 14:25:35 kernel: usbserial.c: __serial_close - port 0: not open
Oct 22 14:25:35 OpenWrt daemon.err pppd[2631]: Failed to open /dev/usb/tts/0: Invalid argument
Oct 22 14:25:35 OpenWrt daemon.info pppd[2631]: Exit.

when a connection is successful the following appears in the logs:

Oct 22 14:30:06 kernel: hub.c: Cannot enable port 2 of hub 1, disabling port.
Oct 22 14:30:06 kernel: hub.c: Maybe the USB cable is bad?
Oct 22 14:35:13 kernel: hub.c: new USB device 02:00.0-2, assigned address 5
Oct 22 14:35:13 kernel: usb.c: USB device not accepting new address=5 (error=-145)
Oct 22 14:35:14 kernel: hub.c: Cannot enable port 2 of hub 1, disabling port.
Oct 22 14:35:14 kernel: hub.c: Maybe the USB cable is bad?
Oct 22 14:36:44 kernel: hub.c: new USB device 02:00.0-2, assigned address 6
Oct 22 14:36:44 kernel: usb.c: USB device not accepting new address=6 (error=-145)
Oct 22 14:36:45 kernel: hub.c: Cannot enable port 2 of hub 1, disabling port.
Oct 22 14:36:45 kernel: hub.c: Maybe the USB cable is bad?
Oct 22 14:38:02 OpenWrt user.info kernel: hub.c: new USB device 02:00.0-2, assigned address 7
Oct 22 14:38:02 OpenWrt user.err kernel: usb.c: USB device not accepting new address=7 (error=-145)
Oct 22 14:38:03 OpenWrt user.err kernel: hub.c: Cannot enable port 2 of hub 1, disabling port.
Oct 22 14:38:03 OpenWrt user.err kernel: hub.c: Maybe the USB cable is bad?
Oct 22 14:38:35 OpenWrt user.info kernel: hub.c: new USB device 02:00.0-2, assigned address 8
Oct 22 14:38:35 kernel: usb.c: USB device not accepting new address=8 (error=-145)
Oct 22 14:38:36 kernel: hub.c: Cannot enable port 2 of hub 1, disabling port.
Oct 22 14:38:36 kernel: hub.c: Maybe the USB cable is bad?
Oct 22 14:40:20 OpenWrt user.info kernel: hub.c: new USB device 02:00.0-2, assigned address 9
Oct 22 14:40:20 OpenWrt user.err kernel: usb.c: USB device not accepting new address=9 (error=-145)
Oct 22 14:40:21 OpenWrt user.err kernel: hub.c: Cannot enable port 2 of hub 1, disabling port.
Oct 22 14:40:21 OpenWrt user.err kernel: hub.c: Maybe the USB cable is bad?

It seems that the USB device has trouble accepting the assigned address?

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.