WD My Book Duo USB

Are there any known issues using the USB-Port with OpenWrt 21.02.1?
I do not see any reaction when I connect a USB device (hard disk / stick) on an running system.
It seems to me that the device is trying to boot from an attached harddisk on power on, but after booting from internal disk there is also no USB device available.

Can confirm: USB port does not even supply power.

@chunkeey, looks to me like another regulator wrongly initialized "active low" in the dts:

usbpwr: usb-regulator {
	compatible = "regulator-fixed";
	regulator-name = "Power USB Core";
	gpios = <&GPIO1 2 GPIO_ACTIVE_LOW>;
	regulator-min-microvolt = <5000000>;
	regulator-max-microvolt = <5000000>;
};

I tried to decompile/change/recompile the dtb with the following regulator section:

usb-regulator {
  		  compatible = "regulator-fixed";
  		  regulator-name = "Power USB Core";
  		  gpios = <0xc 0x2 0x0>;
  		  regulator-min-microvolt = <0x4c4b40>;
  		  regulator-max-microvolt = <0x4c4b40>;
  		  regulator-boot-on;
  		  regulator-always-on;
  		  enable-active-high;
  		  phandle = <0xf>;
};

(0x0 is the hex value for GPIO_ACTIVE_HIGH ... regulator-boot-on, regulator-always-on, enable-active-high I grabbed from your recent commit.)

With that change, the USB port is powered again, but dwc2 then fails when I plug something in, e.g. a USB stick:

[   36.483848] dwc2 4bff80000.usbotg: dwc2_restore_global_registers: no global registers to restore
[   36.492616] dwc2 4bff80000.usbotg: dwc2_exit_partial_power_down: failed to restore registers
[   36.501019] dwc2 4bff80000.usbotg: exit partial_power_down failed
[   36.517452] dwc2 4bff80000.usbotg: HC died; cleaning up

Another test with a Wifi dongle shows a kernel warning irq 36: nobody cared followed by a stack trace and Disabling IRQ #36.

The same happens if I remove the regulator section altogether, so I think there's another problem somewhere, one I am not able to diagnose and fix.

Thank you very much for looking into the issue. If you need some help for testing, please let me know.

Appreciated, but I lack the knowledge and experience to continue here. Hesitantly pinging @chunkeey, maybe he finds time to take a look at it.

new (fixed) builds are on the way. Check later today or tomorrow when they become available.

Fetched the wd_mybooklive-ext4 image from snapshots with upload date Mon Dec 27 20:26:09 2021. Unfortunately i have no luck with the sysupgrade and factory versions. The device gets an IP address via DHCP and i receive ICMP responses with ping, but it seems to me there are no listeners for HTTP or SSH.

The device gets an IP address via DHCP and i receive ICMP responses with ping, but it seems to me there are no listeners for HTTP or SSH.

HTTP not working is understandable of the Snapshots. They don't come with luci/uhttpd out of the box (but can be installed with opkg). SSH however should be working, especially with the factory images that restore the device back to default (and generate new keys).

(have you tried with just one HDD? This is in case it picks up an old rootfs from the other drive, the MBL's bootargs "root=/dev/sda2" are quite fragile in this regard.)

Thank you very much for your time and your support.
You are right, SSH-Login is possible!
But still no function on the external USB port.
In the meantime i have learned to build OpenWRT from source and the strange thing is, with my build - based on GIT hash 69ce75fb12526e11f79618a7cbedb32335b1f2bc, pulled master branch at Dec 27 2021 8:51 pm CET - the USB port works for me.
I will keep my build and configuration unchanged in case you want additional information.

Can you post some kernel logs from the dmesg command (from the snapshot)?
(And cat /sys/kernel/debug/usb/devices before and after adding a usb-stick)

The MBL snapshot images do come with kmod-usb-storage out of the box, so at least the any supported usb stick (there are a lot) should be announced and can be manually mounted. For automounting the blockd package is needed.

After downloading and preparing the current factory image snapshot (Wed Dec 29 11:19:40 2021) the USB port works as expected. The test was done with only one harddisk installed,
Possibly I was too early with the image on 12/27/2021.
Thank you for your great work and your friendly support.

Please see also the requested logs attached:

cat /sys/kernel/debug/usb/devices before adding usb device

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 1
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 5.10
S:  Manufacturer=Linux 5.10.88 dwc2_hsotg
S:  Product=DWC OTG Controller
S:  SerialNumber=4bff80000.usbotg
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

cat /sys/kernel/debug/usb/devices after adding usb device

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 1
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 5.10
S:  Manufacturer=Linux 5.10.88 dwc2_hsotg
S:  Product=DWC OTG Controller
S:  SerialNumber=4bff80000.usbotg
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0930 ProdID=6545 Rev= 1.10
S:  Manufacturer=TOSHIBA
S:  Product=TransMemory
S:  SerialNumber=5B840C00007E
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=200mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

dmesg_complete_before_adding_usb

[    0.000000] printk: bootconsole [udbg0] enabled
[    0.000000] Linux version 5.10.88 (builder@buildhost) (powerpc-openwrt-linux-musl-gcc (OpenWrt GCC 11.2.0 r18441-79a81d36ae) 11.2.0, GNU ld (GNU Binutils) 2.37) #0 Wed Dec 29 02:44:56 2021
[    0.000000] Using PowerPC 44x Platform machine description
[    0.000000] -----------------------------------------------------
[    0.000000] phys_mem_size     = 0x10000000
[    0.000000] dcache_bsize      = 0x20
[    0.000000] icache_bsize      = 0x20
[    0.000000] cpu_features      = 0x0000000000000120
[    0.000000]   possible        = 0x0000000040000120
[    0.000000]   always          = 0x0000000000000120
[    0.000000] cpu_user_features = 0x8c008000 0x00000000
[    0.000000] mmu_features      = 0x00000008
[    0.000000] -----------------------------------------------------
[    0.000000] Top of RAM: 0x10000000, Total RAM: 0x10000000
[    0.000000] Memory hole size: 0MB
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000] On node 0 totalpages: 65536
[    0.000000]   Normal zone: 576 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 65536 pages, LIFO batch:15
[    0.000000] MMU: Allocated 1088 bytes of context maps for 255 contexts
[    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: 64960
[    0.000000] Kernel command line: root=/dev/sda2 rw rootfstype=squashfs,ext4 console=ttyS0,115200
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 249944K/262144K available (7104K kernel code, 668K rwdata, 1408K rodata, 184K init, 223K bss, 12200K reserved, 0K cma-reserved)
[    0.000000] Kernel virtual memory layout:
[    0.000000]   * 0xffbdf000..0xfffff000  : fixmap
[    0.000000]   * 0xd1000000..0xffbdf000  : vmalloc & ioremap
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 512, nr_irqs: 512, preallocated irqs: 16
[    0.000000] UIC0 (32 IRQ sources) at DCR 0xc0
[    0.000000] UIC1 (32 IRQ sources) at DCR 0xd0
[    0.000000] UIC2 (32 IRQ sources) at DCR 0xe0
[    0.000000] UIC3 (32 IRQ sources) at DCR 0xf0
[    0.000000] random: get_random_u32 called from start_kernel+0x2e0/0x3f0 with crng_init=0
[    0.000000] time_init: decrementer frequency = 800.000008 MHz
[    0.000000] time_init: processor frequency   = 800.000008 MHz
[    0.000017] clocksource: timebase: mask: 0xffffffffffffffff max_cycles: 0xb881274fa3, max_idle_ns: 440795210636 ns
[    0.010285] clocksource: timebase mult[1400000] shift[24] registered
[    0.016603] clockevent: decrementer mult[ccccccef] shift[32] cpu[0]
[    0.022926] pid_max: default: 32768 minimum: 301
[    0.027618] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.034828] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.044411] dyndbg: Ignore empty _ddebug table in a CONFIG_DYNAMIC_DEBUG_CORE build
[    0.054671] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.064438] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.074620] NET: Registered protocol family 16
[    0.079539] DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations
[    0.087101] thermal_sys: Registered thermal governor 'step_wise'
[    0.088710] 256k L2-cache enabled
[    0.098015] PCIE0: Port disabled via device-tree
[    0.103306] PCI: Probing PCI hardware
[    0.124877] SCSI subsystem initialized
[    0.129612] libata version 3.00 loaded.
[    0.136129] clocksource: Switched to clocksource timebase
[    0.142340] NET: Registered protocol family 2
[    0.146745] IP idents hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.154339] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.162632] TCP established hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.170210] TCP bind hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.177196] TCP: Hash tables configured (established 2048 bind 2048)
[    0.183575] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.190028] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.197060] NET: Registered protocol family 1
[    0.201346] PCI: CLS 0 bytes, default 32
[    0.230251] dw_dmac 4bffd0800.dma: DesignWare DMA Controller, 2 channels
[    0.247040] workingset: timestamp_bits=14 max_order=16 bucket_order=2
[    0.257469] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.433587] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    0.441724] gpio-473 (Enable Reset Button, disable NOR): hogged as output/low
[    0.449717] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.458433] printk: console [ttyS0] disabled
[    0.462690] 4ef600300.serial: ttyS0 at MMIO 0x4ef600300 (irq = 33, base_baud = 462962) is a TI16750
[    0.471678] printk: console [ttyS0] enabled
[    0.479942] printk: bootconsole [udbg0] disabled
[    0.502188] loop: module loaded
[    0.505339] Loading iSCSI transport class v2.0-870.
[    0.514007] sata-dwc 4bffd1000.sata: id 0, controller version 1.91
[    0.521769] scsi host0: sata-dwc
[    0.525262] ata1: SATA max UDMA/133 irq 40
[    0.529613] sata-dwc 4bffd1800.sata: id 0, controller version 1.91
[    0.537947] scsi host1: sata-dwc
[    0.541368] ata2: SATA max UDMA/133 irq 41
[    0.546679] libphy: Fixed MDIO Bus: probed
[    0.550765] PPC 4xx OCP EMAC driver, version 3.54
[    0.555877] MAL v2 /plb/mcmal, 1 TX channels, 1 RX channels
[    0.561675] RGMII /plb/opb/emac-rgmii@ef601500 initialized with MDIO support
[    0.568880] TAH /plb/opb/emac-tah@ef601350 initialized
[    0.574317] /plb/opb/emac-rgmii@ef601500: input 0 in rgmii-id mode
[    0.582005] libphy: emac_mdio: probed
[    0.594061] eth0: EMAC-0 /plb/opb/ethernet@ef600c00, MAC 00:90:a9:be:fc:b1
[    0.600975] eth0: found Broadcom BCM50610 PHY (0x01)
[    0.606104] i2c /dev entries driver
[    0.609710] booke_wdt: powerpc book-e watchdog driver loaded
[    0.630235] NET: Registered protocol family 10
[    0.636035] Segment Routing with IPv6
[    0.639813] NET: Registered protocol family 17
[    0.644286] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    0.657208] 8021q: 802.1Q VLAN Support v1.8
[    0.661450] drmem: No dynamic reconfiguration memory found
[    0.867394] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[    0.875993] ata1.00: ATA-9: WDC WD30EFRX-68AX9N0, 80.00A80, max UDMA/133
[    0.882699] ata1.00: 5860533168 sectors, multi 0: LBA48 NCQ (depth 1/32)
[    0.892646] ata1.00: configured for UDMA/133
[    0.897307] scsi 0:0:0:0: Direct-Access     ATA      WDC WD30EFRX-68A 0A80 PQ: 0 ANSI: 5
[    0.906570] sd 0:0:0:0: [sda] 5860533168 512-byte logical blocks: (3.00 TB/2.73 TiB)
[    0.914296] sd 0:0:0:0: [sda] 4096-byte physical blocks
[    0.919577] ata2: SATA link down (SStatus 0 SControl 300)
[    0.925782] sd 0:0:0:0: [sda] Write Protect is off
[    0.930593] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[    0.935731] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    0.955139]  sda: sda1 sda2
[    0.959070] sd 0:0:0:0: [sda] Attached SCSI disk
[    0.963831] md: Waiting for all devices to be available before autodetect
[    0.970627] md: If you don't use raid, use raid=noautodetect
[    0.976265] md: Autodetecting RAID arrays.
[    0.980344] md: autorun ...
[    0.983126] md: ... autorun DONE.
[    0.993662] EXT4-fs (sda2): warning: mounting unchecked fs, running e2fsck is recommended
[    1.014440] EXT4-fs (sda2): mounted filesystem without journal. Opts: (null)
[    1.021558] VFS: Mounted root (ext4 filesystem) on device 8:2.
[    1.028177] Freeing unused kernel memory: 184K
[    1.032676] Run /sbin/init as init process
[    1.036794]   with arguments:
[    1.039752]     /sbin/init
[    1.042448]   with environment:
[    1.045576]     HOME=/
[    1.047931]     TERM=linux
[    1.111684] init: Console is alive
[    1.115313] init: - watchdog -
[    1.139722] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    1.192727] Key type encrypted registered
[    1.198577] random: fast init done
[    1.215953] usbcore: registered new interface driver usbfs
[    1.221540] usbcore: registered new interface driver hub
[    1.226932] usbcore: registered new device driver usb
[    1.242137] dwc2 4bff80000.usbotg: supply vusb_d not found, using dummy regulator
[    1.249855] dwc2 4bff80000.usbotg: supply vusb_a not found, using dummy regulator
[    1.360426] dwc2 4bff80000.usbotg: DWC OTG Controller
[    1.365497] dwc2 4bff80000.usbotg: new USB bus registered, assigned bus number 1
[    1.372937] dwc2 4bff80000.usbotg: irq 36, io mem 0x4bff80000
[    1.379387] hub 1-0:1.0: USB hub found
[    1.383508] hub 1-0:1.0: 1 port detected
[    1.395398] usbcore: registered new interface driver usb-storage
[    1.402261] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    1.411998] init: - preinit -
[    1.537890] eth0: link is down
[    1.575579] random: procd: uninitialized urandom read (4 bytes read)
[    4.686442] eth0: link is up, 1000 FDX, pause enabled
[    4.691535] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    5.679745] mount_root: mounting /dev/root
[    5.691619] EXT4-fs (sda2): re-mounted. Opts: (null)
[    5.696872] mount_root: loading kmods from internal overlay
[    5.711135] kmodloader: loading kernel modules from //etc/modules-boot.d/*
[    5.719737] kmodloader: done loading kernel modules from //etc/modules-boot.d/*
[    5.948437] block: attempting to load /etc/config/fstab
[    5.954159] block: unable to load configuration (fstab: Entry not found)
[    5.961000] block: no usable configuration
[    5.991279] EXT4-fs (sda1): warning: mounting unchecked fs, running e2fsck is recommended
[    6.014465] EXT4-fs (sda1): mounted filesystem without journal. Opts: (null)
[    6.022963] urandom-seed: Seed file not found (/etc/urandom.seed)
[    6.051979] procd: - early -
[    6.055010] procd: - watchdog -
[    6.618666] procd: - watchdog -
[    6.622480] procd: - ubus -
[    6.641129] random: ubusd: uninitialized urandom read (4 bytes read)
[    6.675048] random: ubusd: uninitialized urandom read (4 bytes read)
[    6.681786] random: ubusd: uninitialized urandom read (4 bytes read)
[    6.690070] procd: - init -
[    7.107581] kmodloader: loading kernel modules from /etc/modules.d/*
[    7.165716] device-mapper: ioctl: 4.43.0-ioctl (2020-10-01) initialised: dm-devel@redhat.com
[    7.228092] kmodloader: done loading kernel modules from /etc/modules.d/*
[    7.285995] urngd: v1.0.2 started.
[    7.396609] random: crng init done
[    7.400004] random: 6 urandom warning(s) missed due to ratelimiting
[   16.348652] eth0: link is up, 1000 FDX, pause enabled
[   16.363833] br-lan: port 1(eth0) entered blocking state
[   16.369106] br-lan: port 1(eth0) entered disabled state
[   16.374565] device eth0 entered promiscuous mode
[   17.396208] br-lan: port 1(eth0) entered blocking state
[   17.401440] br-lan: port 1(eth0) entered forwarding state
[   17.408213] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready

dmesg_after_adding_usb

[   17.408213] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[  384.644945] usb 1-1: new high-speed USB device number 2 using dwc2
[  384.907828] usb-storage 1-1:1.0: USB Mass Storage device detected
[  384.916365] scsi host2: usb-storage 1-1:1.0
[  385.986548] scsi 2:0:0:0: Direct-Access     TOSHIBA  TransMemory      PMAP PQ: 0 ANSI: 0 CCS
[  389.788299] sd 2:0:0:0: [sdb] 15667200 512-byte logical blocks: (8.02 GB/7.47 GiB)
[  389.796043] sd 2:0:0:0: [sdb] Write Protect is off
[  389.800823] sd 2:0:0:0: [sdb] Mode Sense: 23 00 00 00
[  389.806361] sd 2:0:0:0: [sdb] No Caching mode page found
[  389.811665] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[  389.864673]  sdb: sdb1
[  389.870559] sd 2:0:0:0: [sdb] Attached SCSI removable disk

dmesg after removing usb

  627.986254] F2FS-fs (sdb): Magic Mismatch, valid(0xf2f52010) - read(0x0)
[  627.992944] F2FS-fs (sdb): Can't find valid F2FS filesystem in 1th superblock
[  628.000813] F2FS-fs (sdb): Magic Mismatch, valid(0xf2f52010) - read(0x0)
[  628.007521] F2FS-fs (sdb): Can't find valid F2FS filesystem in 2th superblock
[  635.028745] F2FS-fs (sdb1): Magic Mismatch, valid(0xf2f52010) - read(0x0)
[  635.035581] F2FS-fs (sdb1): Can't find valid F2FS filesystem in 1th superblock
[  635.043239] F2FS-fs (sdb1): Magic Mismatch, valid(0xf2f52010) - read(0x0)
[  635.050031] F2FS-fs (sdb1): Can't find valid F2FS filesystem in 2th superblock
[  635.062056] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[  663.874009] dwc2 4bff80000.usbotg: Not connected
[  664.694087] usb 1-1: USB disconnect, device number 2
1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.