Closed dlech closed 6 years ago
This is likely related to the use of the MUSB DMA controller that was introduced in the mainline kernel between 4.9 and 4.14.
Easiest fix is probably to just turn it off.
Also see #230
@ndward do you see any errors in the output of the dmesg
command after you lose USB connection?
To clarify, this only applies to the USB 2.0 peripheral port (mini-B jack next to motor ports), not the USB 1.1 host port (USB A port next to the microSD card slot).
I'm not sure how you wanted me to run dmesg. I assume I have to run that via the SSH connection but VS Code has lost that. If I reconnect and run dmesg I get:
[ 0.312206] NET: Registered protocol family 1
[ 0.313978] RPC: Registered named UNIX socket transport module.
[ 0.314146] RPC: Registered udp transport module.
[ 0.314236] RPC: Registered tcp transport module.
[ 0.314309] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.321320] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[ 0.361982] NFS: Registering the id_resolver key type
[ 0.362254] Key type id_resolver registered
[ 0.362359] Key type id_legacy registered
[ 0.362504] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[ 0.388976] io scheduler noop registered (default)
[ 0.389146] io scheduler mq-deadline registered
[ 0.389241] io scheduler kyber registered
[ 0.391316] ev3-board board: could not find pctldev for node /soc@1c00000/pinmux@14120/pinmux-hw-id, deferring probe
[ 0.392896] i2c-legoev3 i2c-legoev3.3: registered on input port 1
[ 0.393913] i2c-legoev3 i2c-legoev3.4: registered on input port 2
[ 0.394975] i2c-legoev3 i2c-legoev3.5: registered on input port 3
[ 0.396006] i2c-legoev3 i2c-legoev3.6: registered on input port 4
[ 0.405161] ev3-input-port ev3-ports:in1: could not find pctldev for node /soc@1c00000/pinmux@14120/pinmux-in1, deferring probe
[ 0.405614] ev3-input-port ev3-ports:in2: could not find pctldev for node /soc@1c00000/pinmux@14120/pinmux-in2, deferring probe
[ 0.406014] ev3-input-port ev3-ports:in3: could not find pctldev for node /soc@1c00000/pinmux@14120/pinmux-in3, deferring probe
[ 0.406402] ev3-input-port ev3-ports:in4: could not find pctldev for node /soc@1c00000/pinmux@14120/pinmux-in4, deferring probe
[ 0.407395] ev3-output-port ev3-ports:outA: could not find pctldev for node /soc@1c00000/pinmux@14120/pinmux-outA, deferring probe
[ 0.407839] ev3-output-port ev3-ports:outB: could not find pctldev for node /soc@1c00000/pinmux@14120/pinmux-outB, deferring probe
[ 0.408243] ev3-output-port ev3-ports:outC: could not find pctldev for node /soc@1c00000/pinmux@14120/pinmux-outC, deferring probe
[ 0.408638] ev3-output-port ev3-ports:outD: could not find pctldev for node /soc@1c00000/pinmux@14120/pinmux-outD, deferring probe
[ 0.409494] snd-legoev3 sound: could not find pctldev for node /soc@1c00000/pinmux@14120/pinmux-sound, deferring probe
[ 0.418058] pinctrl-single 1c14120.pinmux: 160 pins at pa fec14120 size 80
[ 0.427279] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[ 0.433846] serial8250.0: ttyS0 at MMIO 0x1c42000 (irq = 25, base_baud = 9375000) is a TI DA8xx/66AK2x
[ 0.436807] serial8250.1: ttyS1 at MMIO 0x1d0c000 (irq = 53, base_baud = 8250000) is a TI DA8xx/66AK2x
[ 0.439812] serial8250.2: ttyS2 at MMIO 0x1d0d000 (irq = 61, base_baud = 8250000) is a TI DA8xx/66AK2x
[ 0.458040] loop: module loaded
[ 0.460802] zram: Added device: zram0
[ 0.467091] ti-ads79xx spi0.3: spi0.3 supply refin not found, using dummy regulator
[ 0.472902] spi_davinci spi_davinci.0: Controller at 0xfec41000
[ 0.480085] [drm] Initialized st7586 1.0.0 20170801 for spi1.0 on minor 0
[ 0.943922] fbcon_init: disable boot-logo (boot-logo bigger than screen).
[ 0.943983] Console: switching to colour frame buffer device 44x21
[ 0.950036] st7586 spi1.0: fb0: frame buffer device
[ 0.953733] spi_davinci spi_davinci.1: Controller at 0xfef0e000
[ 0.957824] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 0.970585] ohci-da8xx: DA8XX
[ 0.973719] usbcore: registered new interface driver usb-storage
[ 0.979090] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[ 1.013002] i2c /dev entries driver
[ 1.026555] IR NEC protocol handler initialized
[ 1.029137] IR RC5(x/sz) protocol handler initialized
[ 1.033086] IR RC6 protocol handler initialized
[ 1.035856] IR JVC protocol handler initialized
[ 1.048000] IR Sony protocol handler initialized
[ 1.050955] IR SANYO protocol handler initialized
[ 1.053637] IR Sharp protocol handler initialized
[ 1.056167] IR MCE Keyboard/mouse protocol handler initialized
[ 1.062248] IR XMP protocol handler initialized
[ 1.079599] davinci-wdt davinci-wdt: heartbeat 60 sec
[ 1.084662] Bluetooth: HCI UART driver ver 2.3
[ 1.087207] Bluetooth: HCI UART protocol H4 registered
[ 1.091764] Bluetooth: HCI UART protocol BCSP registered
[ 1.096731] davinci_mmc da830-mmc.0: Got CD GPIO
[ 1.161239] davinci_mmc da830-mmc.0: Using DMA, 4-bit mode
[ 1.185759] hidraw: raw HID events driver (C) Jiri Kosina
[ 1.197653] usbcore: registered new interface driver usbhid
[ 1.209235] usbhid: USB HID core driver
[ 1.212268] usbcore: registered new interface driver r8712u
[ 1.229406] mmc0: host does not support reading read-only switch, assuming write-enable
[ 1.247144] NET: Registered protocol family 10
[ 1.255946] mmc0: new high speed SD card at address 59b4
[ 1.260589] Segment Routing with IPv6
[ 1.260999] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[ 1.263830] NET: Registered protocol family 17
[ 1.263940] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 1.263991] Bluetooth: BNEP socket layer initialized
[ 1.264274] Key type dns_resolver registered
[ 1.299347] mmcblk0: mmc0:59b4 USD 1.87 GiB
[ 1.308153] mmcblk0: p1 p2
[ 1.333090] at24 0-0050: 16384 byte 24c128 EEPROM, read-only, 0 bytes/write
[ 1.351026] lego-port port0: Registered 'ev3-ports:in1' on 'ev3-ports:in1'.
[ 1.368844] lego-port port1: Registered 'ev3-ports:in2' on 'ev3-ports:in2'.
[ 1.389312] lego-port port2: Registered 'ev3-ports:in3' on 'ev3-ports:in3'.
[ 1.402001] lego-port port3: Registered 'ev3-ports:in4' on 'ev3-ports:in4'.
[ 1.422257] lego-port port4: Registered 'ev3-ports:outA' on 'ev3-ports:outA'.
[ 1.432920] lego-port port5: Registered 'ev3-ports:outB' on 'ev3-ports:outB'.
[ 1.453325] lego-port port6: Registered 'ev3-ports:outC' on 'ev3-ports:outC'.
[ 1.464257] lego-port port7: Registered 'ev3-ports:outD' on 'ev3-ports:outD'.
[ 1.486333] input: LEGO MINDSTORMS EV3 Speaker as /devices/platform/sound/input/input0
[ 1.498034] ohci-da8xx ohci-da8xx: USB Host Controller
[ 1.502896] ohci-da8xx ohci-da8xx: new USB bus registered, assigned bus number 1
[ 1.510921] ohci-da8xx ohci-da8xx: irq 59, io mem 0x01e25000
[ 1.586769] usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
[ 1.592899] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.600215] usb usb1: Product: USB Host Controller
[ 1.604608] usb usb1: Manufacturer: Linux 4.14.34-ev3dev-1.6.1-ev3 ohci_hcd
[ 1.610716] usb usb1: SerialNumber: ohci-da8xx
[ 1.617809] hub 1-0:1.0: USB hub found
[ 1.621296] hub 1-0:1.0: 1 port detected
[ 1.632278] input: EV3 Brick Buttons as /devices/platform/gpio_keys/input/input1
[ 1.652714] adc ref: supplied by vcc5v
[ 1.658184] adc ref: disabling
[ 1.661070] ALSA device list:
[ 1.670534] #0: LEGO MINDSTORMS EV3 Speaker connected to ehrpwm.0
[ 1.685698] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
[ 1.694612] EXT4-fs (mmcblk0p2): couldn't mount as ext2 due to feature incompatibilities
[ 1.738048] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 1.754357] VFS: Mounted root (ext4 filesystem) on device 179:2.
[ 1.795498] devtmpfs: mounted
[ 1.801581] Freeing unused kernel memory: 208K
[ 1.805450] This architecture does not have kernel memory protection.
[ 1.879842] tacho-motor motor0: Registered 'lego-ev3-m-motor' on 'ev3-ports:outA'.
[ 1.887735] lego-port port4: Added new device 'ev3-ports:outA:lego-ev3-m-motor'
[ 1.927760] tacho-motor motor1: Registered 'lego-ev3-l-motor' on 'ev3-ports:outB'.
[ 1.937865] lego-port port5: Added new device 'ev3-ports:outB:lego-ev3-l-motor'
[ 1.949373] tacho-motor motor2: Registered 'lego-ev3-l-motor' on 'ev3-ports:outC'.
[ 1.964603] lego-port port6: Added new device 'ev3-ports:outC:lego-ev3-l-motor'
[ 2.050726] usb 1-1: new full-speed USB device number 2 using ohci-da8xx
[ 2.109947] lego-port port1: Added new device 'ev3-ports:in2:ev3-uart-host'
[ 2.354874] usb 1-1: New USB device found, idVendor=0846, idProduct=9030
[ 2.365019] usb 1-1: New USB device strings: Mfr=16, Product=32, SerialNumber=48
[ 2.372840] usb 1-1: Product: WNA1100
[ 2.379983] usb 1-1: Manufacturer: NETGEAR WNA
[ 2.384653] usb 1-1: SerialNumber: 12345
[ 2.916932] systemd[1]: System time before build time, advancing clock.
[ 3.050847] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 3.189443] systemd[1]: systemd 232 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
[ 3.224868] systemd[1]: Detected architecture arm.
[ 3.316957] systemd[1]: Set hostname to <ev3dev>.
[ 4.341911] random: crng init done
[ 7.289808] systemd[1]: openrobertalab.service: Cannot add dependency job, ignoring: Unit openrobertalab.service is masked.
[ 7.368422] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[ 7.405649] systemd[1]: Listening on udev Control Socket.
[ 7.436811] systemd[1]: Listening on Journal Socket (/dev/log).
[ 7.468922] systemd[1]: Created slice User and Session Slice.
[ 7.587457] systemd[1]: Listening on udev Kernel Socket.
[ 7.615229] systemd[1]: Created slice System Slice.
[ 8.255466] systemd[1]: Starting swap with zram...
[ 8.419917] systemd[1]: Starting Journal Service...
[ 8.650213] systemd[1]: Starting Remount Root and Kernel File Systems...
[ 8.981510] systemd[1]: Starting Load Kernel Modules...
[ 9.186612] systemd[1]: Starting Restore / save the current clock...
[ 9.411063] zram0: detected capacity change from 0 to 100663296
[ 9.442876] systemd[1]: Starting Create list of required static device nodes for the current kernel...
[ 9.771626] systemd[1]: Starting Set the console keyboard layout...
[ 10.284538] systemd[1]: Mounted RPC Pipe File System.
[ 10.368869] systemd[1]: Mounted POSIX Message Queue File System.
[ 10.441939] EXT4-fs (mmcblk0p2): re-mounted. Opts: errors=remount-ro
[ 10.991423] systemd[1]: Started Remount Root and Kernel File Systems.
[ 11.692827] Adding 98300k swap on /dev/zram0. Priority:16383 extents:1 across:98300k SS
[ 13.505510] systemd[1]: Starting Load/Save Random Seed...
[ 14.010243] systemd[1]: Mounted Configuration File System.
[ 14.178642] systemd[1]: Started Apply Kernel Variables.
[ 14.770078] systemd[1]: Started Create Static Device Nodes in /dev.
[ 14.888668] systemd[1]: Started Load/Save Random Seed.
[ 15.174739] systemd[1]: Starting udev Kernel Device Manager...
[ 17.648773] systemd[1]: Started Journal Service.
[ 20.928312] systemd-journald[89]: Received request to flush runtime journal from PID 1
[ 45.879469] ti_omapl_pru_suart ti_omapl_pru_suart.1: fw size 3772. downloading...
[ 45.908521] ti_omapl_pru_suart.1: ttySU0 at MMIO 0x1d00000 (irq = 3, base_baud = 8250000) is a suart_tty
[ 45.944865] ti_omapl_pru_suart.1: ttySU1 at MMIO 0x1d00000 (irq = 4, base_baud = 8250000) is a suart_tty
[ 45.946664] ti_omapl_pru_suart ti_omapl_pru_suart.1: ti_omapl_pru_suart device registered(pru_clk=150000000, asp_clk=132000000)
[ 47.975959] usb 1-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested
[ 48.005389] usbcore: registered new interface driver ath9k_htc
[ 48.457379] usb 1-1: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.4.0.fw, size: 51008
[ 48.726360] ath9k_htc 1-1:1.0: ath9k_htc: HTC initialized with 33 credits
[ 49.900576] ath9k_htc 1-1:1.0: ath9k_htc: FW Version: 1.4
[ 49.900706] ath9k_htc 1-1:1.0: FW RMW support: On
[ 49.900746] ath: EEPROM regdomain: 0x60
[ 49.900768] ath: EEPROM indicates we should expect a direct regpair map
[ 49.900819] ath: Country alpha2 being used: 00
[ 49.900838] ath: Regpair used: 0x60
[ 50.046947] ieee80211 phy0: Atheros AR9271 Rev:1
[ 54.864744] ath9k_htc 1-1:1.0 wlxc404157ddaec: renamed from wlan0
[ 64.659708] Registered EV3 UART sensor line discipline. (29)
[ 67.239662] lego-sensor sensor0: Registered 'lego-ev3-us' on 'ev3-ports:in2'.
[ 70.242555] using random self ethernet address
[ 70.242608] using random host ethernet address
[ 71.324829] using random self ethernet address
[ 71.324882] using random host ethernet address
[ 71.765380] usb0: HOST MAC 12:16:53:40:37:7e
[ 71.770151] usb0: MAC 02:16:53:40:37:7e
[ 71.815372] usb1: HOST MAC 32:16:53:40:37:7e
[ 71.825337] usb1: MAC 22:16:53:40:37:7e
[ 72.810149] configfs-gadget gadget: high-speed config #2: c
[ 78.226912] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[ 81.827326] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready
Is this after the USB connection failed? In your original description of the problem, you stated that it usually took 10 to 20 minutes before the connection failed. However, the last item in your log is at 81 seconds.
This is after the connection from VS Code failed and was then reestablished to enable me to use SSH from VS Code. When VS Code lost the connection there was still a connection between the PC and the EV3 because the EV3 still displayed 'online' and I because I could still use navigate around within the EV3 file hierarchy, having mapped the EV3 to a Windows drive letter using SFTP Net Drive. Today I continue to lose the connection from VS Code but the connection can last for an hour or two before failing. Maybe the connection is lasting longer because I have been using VS Code less today?
OK, it sounds like this is a VS Code extension problem rather than an ev3dev kernel problem.
Moving issue to https://github.com/ev3dev/vscode-ev3dev-browser/issues/58
Maybe, but it's only since I started using the (updated) 14 April image that I notice this unreliable connection from VS Code (via USB).
Another user reported a similar issue on 10 April, so perhaps the 14 April image just made the issue worse. That's my theory for now, anyway.
from @ndward https://github.com/ev3dev/ev3dev/issues/1022#issuecomment-381444425