DIR-620 A1 18.06 USB not working

I have Dlink DIR-620 A1. USB was fully working on openwrt since barrier breaker 14.07 till 17.01. After update to 18.06.0 (or newer versions) root usb port is detected but the devices connected to it are not, neither usb storage nor usb hid devices.

root@OpenWrt:~# lsusb -t
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc2/1p, 480M

Downgrading back to 17.01 brings USB port up to life again
I installed the same package set as on 17.01:

kmod-usb-core
kmod-usb-dwc2
kmod-usb-dwc3
kmod-usb-ehci
kmod-usb-ohci
kmod-usb-printer
kmod-usb-storage
kmod-usb-storage-extras
kmod-usb-uhci
kmod-usb2
libusb-1.0
usbutils

Tried installing additionaly:

kmod-rt2800-usb
kmod-rt2x00-usb
rt2800-usb-firmware
kmod-usb-storage-uas
kmod-usb-hid
root@OpenWrt:~# dmesg | grep 'USB\|usb'
[    9.333908] usbcore: registered new interface driver usbfs
[    9.345280] usbcore: registered new interface driver hub
[    9.356268] usbcore: registered new device driver usb
[    9.389231] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    9.590510] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    9.725144] dwc2 101c0000.otg: new USB bus registered, assigned bus number 1
[    9.754794] hub 1-0:1.0: USB hub found
[   10.129559] usbcore: registered new interface driver usb-storage
[   10.384249] usbcore: registered new interface driver ums-alauda
[   10.399545] usbcore: registered new interface driver ums-cypress
[   10.414982] usbcore: registered new interface driver ums-datafab
[   10.430438] usbcore: registered new interface driver ums-freecom
[   10.445838] usbcore: registered new interface driver ums-isd200
[   10.461174] usbcore: registered new interface driver ums-jumpshot
[   10.476579] usbcore: registered new interface driver ums-karma
[   10.492485] usbcore: registered new interface driver ums-sddr09
[   10.507763] usbcore: registered new interface driver ums-sddr55
[   10.523343] usbcore: registered new interface driver ums-usbat
[   10.765118] usbcore: registered new interface driver rt2800usb
[  470.282478] usbcore: registered new interface driver uas

try without ohci

i have tried this and other combinations, but couldn't make it work
here is dmesg from working 17.01.7:

[    4.291496] usbcore: registered new interface driver usbfs
[    4.302896] usbcore: registered new interface driver hub
[    4.313867] usbcore: registered new device driver usb
[    4.391145] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    4.421329] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    5.332657] dwc2 101c0000.otg: new USB bus registered, assigned bus number 1
[    5.359489] hub 1-0:1.0: USB hub found
[    5.387624] usbcore: registered new interface driver usb-storage
[    6.132361] usb 1-1: new high-speed USB device number 2 using dwc2
[    6.354385] hub 1-1:1.0: USB hub found
[    6.952797] usb 1-1.1: new high-speed USB device number 3 using dwc2
[    7.065204] usb-storage 1-1.1:1.0: USB Mass Storage device detected
[    7.079619] scsi host0: usb-storage 1-1.1:1.0
[    7.322791] usb 1-1.2: new high-speed USB device number 4 using dwc2
[    7.436147] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[    7.450288] usb-storage 1-1.2:1.0: Quirks match for vid 152d pid 0578: 1000000
[    7.465249] scsi host1: usb-storage 1-1.2:1.0
[    7.712792] usb 1-1.4: new high-speed USB device number 5 using dwc2
[   15.497703] usbcore: registered new interface driver ums-alauda
[   15.517300] usbcore: registered new interface driver ums-cypress
[   15.536498] usbcore: registered new interface driver ums-datafab
[   15.556357] usbcore: registered new interface driver ums-freecom
[   15.576965] usbcore: registered new interface driver ums-isd200
[   15.597182] usbcore: registered new interface driver ums-jumpshot
[   15.615790] usbcore: registered new interface driver ums-karma
[   15.634241] usbcore: registered new interface driver ums-sddr09
[   15.654694] usbcore: registered new interface driver ums-sddr55
[   15.672246] usbcore: registered new interface driver ums-usbat
[   15.696533] usblp 1-1.4:1.1: usblp0: USB Bidirectional printer dev 5 if 1 alt 0 proto 2 vid 0x04E8 pid 0x341B
[   15.717036] usbcore: registered new interface driver usblp

It's a long shot try installing usb-gadget

.

IrDA support (which is not the same as lirc/ IR remotes!) has been removed from kernel v4.17 alltogether, it's no longer available at all (even with an older kernel you're likely to fall into a trap regarding interoperability between base kernel and backports).

Aside from the elephant in the room, IrDA has always been developed for short range communication - it doesn't detect IR signals over more than ~15-20 cm.

Edit: please don't hijack threads that don't have anything in common with your question, please start your own instead (as long as it's not about IrDA, as this is gone).

1 Like

Edited my post.
Was trying to show my reasoning for the suggestion.

Did you manage to solve the problem?
I have same board and USB doesn't work even in fresh 19.07.0?
I belive this board has sligth different phy and it's main reason.

Were you able to solve your usb port problem?
It seems i have the same issue with mine asus n13u b1 on 19.07.1. All drivers installed but no usb activity. It just won't work.

No, and i'm don't have any idea - how to fix this.
dwc2 driver is broken somewhere between 18.06.1 and 18.06.02 for all rt305x targets, but nobody seems to care:
https://bugs.openwrt.org/index.php?do=details&task_id=2473

Still using 17.01.7 - on Dlink Dir-620 A1 and my custom build based on it for hwmoded Acorp WR-300NU.

And it's sad to hear that the RT-N13U had the similar issues on 19.07.1 - because i've just create custom image with imagebuilder based on it.
On Asus RT-N13U i'm currently using 18.06.1 - USB-port is working.

That's not correct. Adrian cares and requests to narrow down where that "somewhere between 18.06.1 and 18.06.02" is (git bisect?). Once that is known, the error can possibly be fixed.

I've tried to do this, but there's no commits affecting dwc2 in source tree, excepting, maybe, kernel minor version bump, so what is the next step?
I've tried to diff sources between 17.01.7 and 18.06.2 and it has a lot of changes in register maping - 18.06.2 using sysc instead of static structures in 17.01.7 but my proramming skills is to weak for additional debugging.

Could you provide dmesg or other logs?

root@OpenSST:~# dmesg
[    0.000000] Linux version 4.14.167 (builder@buildhost) (gcc version 7.5.0 (OpenWrt GCC 7.5.0 r10911-c155900f66)) #0 Wed Jan 29 16:05:35 2020
[    0.000000] SoC Type: Ralink RT3052 id:1 rev:3
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001964c (MIPS 24KEc)
[    0.000000] MIPS: machine is Asus RT-N13U
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] On node 0 totalpages: 16384
[    0.000000] free_area_init_node: node 0, pgdat 803d14e0, node_mem_map 81000040
[    0.000000]   Normal zone: 128 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 16384 pages, LIFO batch:3
[    0.000000] random: get_random_bytes called from 0x803d46ec with crng_init=0
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Writing ErrCtl register=0004242e
[    0.000000] Readback ErrCtl register=0004242e
[    0.000000] Memory: 59564K/65536K available (3312K kernel code, 168K rwdata, 432K rodata, 1200K init, 199K bss, 5972K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 256
[    0.000000] CPU Clock: 384MHz
[    0.000000] timer_probe: no matching timers found
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9954481493 ns
[    0.000014] sched_clock: 32 bits at 192MHz, resolution 5ns, wraps every 11184811005ns
[    0.015705] Calibrating delay loop... 255.59 BogoMIPS (lpj=1277952)
[    0.108112] pid_max: default: 32768 minimum: 301
[    0.117649] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.130764] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.151690] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.171251] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.183515] pinctrl core: initialized pinctrl subsystem
[    0.195916] NET: Registered protocol family 16
[    0.242232] rt2880_gpio 10000600.gpio: registering 24 gpios
[    0.253341] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[    0.272792] clocksource: Switched to clocksource MIPS
[    0.284522] NET: Registered protocol family 2
[    0.294677] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.308544] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.321168] TCP: Hash tables configured (established 1024 bind 1024)
[    0.334053] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.345658] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.358499] NET: Registered protocol family 1
[    0.371947] rt-timer 10000100.timer: maximum frequency is 3906Hz
[    0.385225] Crashlog allocated RAM at address 0x3f00000
[    0.398897] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.421284] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.432864] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.473628] io scheduler noop registered
[    0.481303] io scheduler deadline registered (default)
[    0.492411] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.509826] console [ttyS0] disabled
[    0.516960] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 8000000) is a Palmchip BK-3103
[    0.536698] console [ttyS0] enabled
[    0.550640] bootconsole [early0] disabled
[    0.568575] 1f000000.cfi: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0x0000c2 Chip ID 0x0022cb
[    0.588843] Amd/Fujitsu Extended Query Table at 0x0040
[    0.599252]   Amd/Fujitsu Extended Query version 1.1.
[    0.609463] number of CFI chips: 1
[    0.627186] 4 fixed-partitions partitions found on MTD device 1f000000.cfi
[    0.641119] Creating 4 MTD partitions on "1f000000.cfi":
[    0.651864] 0x000000000000-0x000000030000 : "u-boot"
[    0.663457] 0x000000030000-0x000000040000 : "u-boot-env"
[    0.675692] 0x000000040000-0x000000050000 : "factory"
[    0.687347] 0x000000050000-0x000000800000 : "firmware"
[    0.704644] 2 uimage-fw partitions found on MTD device firmware
[    0.716652] Creating 2 MTD partitions on "firmware":
[    0.726698] 0x000000000000-0x0000001485c0 : "kernel"
[    0.738144] 0x0000001485c0-0x0000007b0000 : "rootfs"
[    0.749613] mtd: device 5 (rootfs) set to be root filesystem
[    0.761135] 1 squashfs-split partitions found on MTD device rootfs
[    0.773647] 0x000000380000-0x0000007b0000 : "rootfs_data"
[    0.786799] libphy: Fixed MDIO Bus: probed
[    0.798616] rt3050-esw 10110000.esw: link changed 0x18
[    0.817530] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    0.835012] rt2880_wdt 10000120.watchdog: Initialized
[    0.847296] NET: Registered protocol family 10
[    0.863380] Segment Routing with IPv6
[    0.870932] NET: Registered protocol family 17
[    0.880080] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    0.906239] 8021q: 802.1Q VLAN Support v1.8
[    0.924462] VFS: Mounted root (squashfs filesystem) readonly on device 31:5.
[    0.947444] Freeing unused kernel memory: 1200K
[    0.956619] This architecture does not have kernel memory protection.
[    2.652810] random: fast init done
[    3.167690] init: Console is alive
[    3.175085] init: - watchdog -
[    4.128593] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    4.492411] usbcore: registered new interface driver usbfs
[    4.503760] usbcore: registered new interface driver hub
[    4.514735] usbcore: registered new device driver usb
[    4.537822] dwc2 101c0000.otg: Configuration mismatch. dr_mode forced to host
[    4.588996] dwc2 101c0000.otg: DWC OTG Controller
[    4.598641] dwc2 101c0000.otg: new USB bus registered, assigned bus number 1
[    4.612968] dwc2 101c0000.otg: irq 26, io mem 0x101c0000
[    4.625786] hub 1-0:1.0: USB hub found
[    4.634122] hub 1-0:1.0: 1 port detected
[    4.648950] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    4.674314] init: - preinit -
[    7.020731] 8021q: adding VLAN 0 to HW filter on device eth0
[    7.474036] random: procd: uninitialized urandom read (4 bytes read)
[   11.365278] jffs2: notice: (349) jffs2_build_xattr_subsystem: complete building xattr subsystem, 4 of xdatum (3 unchecked, 1 orphan) and 34 of xref (1 dead, 0 orphan) found.
[   11.399092] mount_root: switching to jffs2 overlay
[   11.444280] overlayfs: upper fs does not support tmpfile.
[   11.464061] urandom-seed: Seeding with /etc/urandom.seed
[   11.966165] procd: - early -
[   11.972195] procd: - watchdog -
[   13.430598] procd: - watchdog -
[   13.437896] procd: - ubus -
[   13.961400] random: ubusd: uninitialized urandom read (4 bytes read)
[   14.005319] random: ubusd: uninitialized urandom read (4 bytes read)
[   14.030099] random: ubusd: uninitialized urandom read (4 bytes read)
[   14.058691] procd: - init -
[   17.553452] kmodloader: loading kernel modules from /etc/modules.d/*
[   17.616757] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   17.680917] usbcore: registered new interface driver cdc_wdm
[   17.744360] Loading modules backported from Linux version v4.19.98-0-gd183c8e2647a
[   17.759725] Backport generated by backports.git v4.19.98-1-0-g8204eb99
[   17.845012] ip_tables: (C) 2000-2006 Netfilter Core Team
[   17.894962] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[   18.174865] usbcore: registered new interface driver usbserial
[   18.186900] usbcore: registered new interface driver usbserial_generic
[   18.200304] usbserial: USB Serial support registered for generic
[   18.384021] xt_time: kernel timezone is -0000
[   18.415194] usbcore: registered new interface driver cdc_ether
[   18.460381] usbcore: registered new interface driver cdc_ncm
[   18.584801] usbcore: registered new interface driver huawei_cdc_ncm
[   18.781616] PPP generic driver version 2.4.2
[   18.814388] NET: Registered protocol family 24
[   18.916548] usbcore: registered new interface driver option
[   18.928068] usbserial: USB Serial support registered for GSM modem (1-port)
[   19.025233] urngd: v1.0.2 started.
[   19.070033] rt2800_wmac 10180000.wmac: loaded eeprom from mtd device "factory"
[   19.084725] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 2872, rev 0200 detected
[   19.100389] ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 0008 detected
[   19.115302] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   19.233135] kmodloader: done loading kernel modules from /etc/modules.d/*
[   20.035106] random: crng init done
[   20.041970] random: 6 urandom warning(s) missed due to ratelimiting
[   38.897839] rt3050-esw 10110000.esw: link changed 0x08
[   42.745485] rt3050-esw 10110000.esw: link changed 0x0C
[   49.199076] 8021q: adding VLAN 0 to HW filter on device eth0
[   49.246627] br-lan: port 1(eth0.1) entered blocking state
[   49.257622] br-lan: port 1(eth0.1) entered disabled state
[   49.269135] device eth0.1 entered promiscuous mode
[   49.278897] device eth0 entered promiscuous mode
[   49.379364] br-lan: port 1(eth0.1) entered blocking state
[   49.390328] br-lan: port 1(eth0.1) entered forwarding state
[   49.402000] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   50.223690] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   57.439550] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   57.490249] br-lan: port 2(wlan0) entered blocking state
[   57.501070] br-lan: port 2(wlan0) entered disabled state
[   57.512379] device wlan0 entered promiscuous mode
[   58.319148] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   58.332374] br-lan: port 2(wlan0) entered blocking state
[   58.343175] br-lan: port 2(wlan0) entered forwarding state
[   59.687530] br-lan: port 3(wlan0.sta1) entered blocking state
[   59.699214] br-lan: port 3(wlan0.sta1) entered disabled state
[   59.711506] device wlan0.sta1 entered promiscuous mode
[   59.761698] br-lan: port 3(wlan0.sta1) entered blocking state
[   59.773365] br-lan: port 3(wlan0.sta1) entered forwarding state
[  217.323524] rt3050-esw 10110000.esw: link changed 0x08
[  282.525325] rt3050-esw 10110000.esw: link changed 0x0C
[  396.602361] device wlan0.sta1 left promiscuous mode
[  396.612681] br-lan: port 3(wlan0.sta1) entered disabled state
[  396.704184] device wlan0 left promiscuous mode
[  396.713606] br-lan: port 2(wlan0) entered disabled state
[  398.539696] IPv6: ADDRCONF(NETDEV_UP): wlan0-1: link is not ready
[  398.566359] br-lan: port 2(wlan0-1) entered blocking state
[  398.577537] br-lan: port 2(wlan0-1) entered disabled state
[  398.589220] device wlan0-1 entered promiscuous mode
[  399.851239] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  402.088525] wlan0: authenticate with ac:c3:3a:67:11:68
[  402.135680] wlan0: send auth to ac:c3:(try 1/3)
[  402.150215] wlan0: authenticated
[  402.192946] wlan0: associate with ac:c3:3(try 1/3)
[  402.214557] wlan0: RX AssocResp from ac:c(capab=0x411 status=0 aid=2)
[  402.230289] wlan0: associated
[  402.293075] wlan0: Limiting TX power to 30 (30 - 0) dBm as advertised by ac:c3:3a:
[  402.367679] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[  404.309318] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0-1: link becomes ready
[  404.323004] br-lan: port 2(wlan0-1) entered blocking state
[  404.334136] br-lan: port 2(wlan0-1) entered forwarding state
[  495.169188] kmodloader: loading kernel modules from /etc/modules.d/*
[  495.207814] SCSI subsystem initialized
[  495.238554] usbcore: registered new interface driver usb-storage
[  495.253511] kmodloader: done loading kernel modules from /etc/modules.d/*
[  495.412892] kmodloader: loading kernel modules from /etc/modules.d/*
[  495.431866] kmodloader: done loading kernel modules from /etc/modules.d/*
[  516.011603] kmodloader: loading kernel modules from /etc/modules.d/*
[  516.031774] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[  516.048974] ehci-platform: EHCI generic platform driver
[  516.065962] kmodloader: done loading kernel modules from /etc/modules.d/*
[  516.221744] kmodloader: loading kernel modules from /etc/modules.d/*
[  516.240055] kmodloader: done loading kernel modules from /etc/modules.d/*
[  592.120335] kmodloader: loading kernel modules from /etc/modules.d/*
[  592.152646] kmodloader: done loading kernel modules from /etc/modules.d/*
[ 3547.899944] rt3050-esw 10110000.esw: link changed 0x08

I already have a thread open.. with all the necessary logs..
https://forum.openwrt.org/t/19-07-1-asus-n13u-b1-usb-not-working/55526/

Hope it gets fixed soon

Exactly, that's the last i have seen usb port working. In 18.06.2 it stops working.

18.06.1 throwing this error (below) randomly, causing the wifi to stop working, and it won't work unless router is rebooted. I have heard this has been fixed in latest 19.07. And since usb stopped working at 18.06.2, the same code is being used in the later builds. Making usb to remain broken.

kern.err kernel: [45235.026177] ieee80211 phy0: rt2x00queue_write_tx_frame: Error – Dropping frame due to full tx queue 2

I've read your thread & want to clarify:

  • on ramips platforms uBoot puts USB port to suspended state by default on boot;
  • to 'awake' it, kernel patch is applied on compilation time, that resets controller.
    Probably it's stop working after some kernel bump?

By the way, i've read about similar problems with dwc2 driver on other platforms, such as raspi-devices - there's workaround, to disable kernel autosuspend feature at boot-time.
On Openwrt this probably possible with usb-core module (load kmod with parameters, how?) or to compile dwc2 with poweroptimized feature disabled, but i don't figure out how to do this.

Have you tried to enable port with hub-ctl ?

Yes, did that, and it doesn't change a thing.

It's been said that, hub-ctrl only works when hub supports individual power switching, mine is ganged switching, maybe that's why it won't work this way.

I'm probably found it - described in: 19.07.1 ASUS N13U B1, USB not working

1 Like

To make USB woriking, we should revert 0032-USB-dwc2-add-device_reset.patch as described in [0] and tested at [1]
[0]: https://patchwork.ozlabs.org/project/openwrt/patch/20200410223709.1974-1-dobrovolskiy.alexey@gmail.com/
[1]: https://bugs.openwrt.org/index.php?do=details&task_id=247
https://patchwork.ozlabs.org/project/openwrt/patch/20200410223709.1974-1-dobrovolskiy.alexey@gmail.com/

1 Like