From owner-freebsd-stable@freebsd.org Tue Jun 19 19:38:20 2018 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 748B5100A3C3 for ; Tue, 19 Jun 2018 19:38:20 +0000 (UTC) (envelope-from philnorm@gmail.com) Received: from mail-wr0-x236.google.com (mail-wr0-x236.google.com [IPv6:2a00:1450:400c:c0c::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01AEB72B35 for ; Tue, 19 Jun 2018 19:38:19 +0000 (UTC) (envelope-from philnorm@gmail.com) Received: by mail-wr0-x236.google.com with SMTP id f16-v6so829816wrm.3 for ; Tue, 19 Jun 2018 12:38:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=oYKkrMhIdfCL1liytVj8Qwv5rVKU257wlmR7583Bq6A=; b=KHXoxT8aqBqvh9EEwTHt2niMy8v8J4RloyYJmfLL9vlugvyew6nquV5nQFzvU6bM3j ThJm+jCnVvmNy0QoVRhtdwFdmkwI4XjPCnpD+rqSzTuxbmR6E+QrT7rcemAWjSwwSSqD vMYbk7NOCOpn18KbRclB28AC72lbt2P2IzqXhyRxwHj5WHJxb74iTcPfmaY4JZKv5nNC nm0uEObDjF5MBztpYj1nzW5wFpQM1ZD2KrT7dfLBpxOBWjeWOvtcRBRgf/hxS1CW5tKo 9pJi/Ttm6w4kVWcqJBiaioIm1G64OYGUyVuv0h++1p6rTKP98h7TKcweXRI6eU4ITjNx mrfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=oYKkrMhIdfCL1liytVj8Qwv5rVKU257wlmR7583Bq6A=; b=mHw3Buh0Al1TpoaSsfsx+Vu0JdOma+RhqbcRt/hszwdqqXKtOpEMbWDAtYWaW71EgM shPY40onrm3B4Ev9UpWt9oo7nF0cNe0FI0HyJ5obsPuGUSrtXyBNUlD5yYT7iP8j7lhx 0Jl4F5yQYWJRyZTTNO+kZA+2tv2d8ag8ku8vSvA+o66LL4rPBTKCZ86GT/htPm6VyvLZ znXwNuaK/6qyIjiZOpA4QIcKFObLB4utQ7yCKMyDhlow+2xHA5gKRCog5ZZkFDMzma3k ateTg8M9H0T00q+o3N3ZRja5jCtsgVQBbdHUQKTdgE0RANm3RK7qW/8/UtZMO8AOFrPh mexw== X-Gm-Message-State: APt69E0pBWAPIVfXMEJvGdYXoIFgEmLR+bRIkpm28APUAhe5X+X5o4l5 Fx7UbCgF74bU9oxn763lOloVDyx4u25j24J7v5MSYzf5 X-Google-Smtp-Source: ADUXVKLPu5KPjcOB5RSMzDBKplIxH+FP7oECpqkBkjV89QXP9cBnqEYOwVtAEG14IwtqR2JhU30N3Fyrurqm81vhTv8= X-Received: by 2002:adf:dc52:: with SMTP id m18-v6mr16049666wrj.84.1529437098387; Tue, 19 Jun 2018 12:38:18 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a1c:7e87:0:0:0:0:0 with HTTP; Tue, 19 Jun 2018 12:38:17 -0700 (PDT) From: Phil Norman Date: Tue, 19 Jun 2018 21:38:17 +0200 Message-ID: Subject: USB trouble on Ryzen 3/AsRock mobo. To: freebsd-stable@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2018 19:38:20 -0000 Hi. I've recently converted to FreeBSD, fleeing the Windowsification of Ubuntu. I've been having some trouble with the USB system, which seems strange as FreeBSD's USB stack is, according to a friend, rock solid. I'd like to narrow down if this is a hardware (CPU or mobo) or software issue. I'm running a Ryzen 3 1200, plugged into a "Fatal1ty X370 Gaming-ITX/ac" motherboard (chosen because it supports ECC RAM and fits in an ITX case). On a cold boot (ie starting by flipping the physical PSU power switch), BSD boots up nice and quickly, without errors, and then runs for days without a single USB-related error on dmesg. However, any other kind of reboot which doesn't interrupt the electricity supply yields a large number of USB errors (USB_ERR_TIMEOUTs every few seconds or so) and frequent resets of the xhci0 controller. On occasion, I also get problems with my keyboard randomly stopping working (but then, if the USB subsystem is continuously resetting, that's only to be expected). I also seem to get slow USB storage device read throughput (2MB/s from a USB3 SSD), although I can't rule out that being caused by the fuse ext4fs driver. Here's what I see in dmesg when the USB system's in spam mode: ---------------- xhci0: Resetting controller usb_alloc_device: set address 2 failed (USB_ERR_TIMEOUT, ignored) usbd_setup_device_desc: getting device descriptor at addr 2 failed, USB_ERR_TIMEOUT igb0: link state changed to UP usbd_req_re_enumerate: addr=2, set address failed! (USB_ERR_TIMEOUT, ignored) usbd_setup_device_desc: getting device descriptor at addr 2 failed, USB_ERR_TIMEOUT uhid0 on uhub3 uhid0: on usbus1 uhid1 on uhub3 uhid1: on usbus1 ums0 on uhub2 ums0: on usbus1 ums0: 3 buttons and [XYZ] coordinates ID=0 usbd_req_re_enumerate: addr=2, set address failed! (USB_ERR_TIMEOUT, ignored) usbd_setup_device_desc: getting device descriptor at addr 2 failed, USB_ERR_TIMEOUT usbd_req_re_enumerate: addr=2, set address failed! (USB_ERR_TIMEOUT, ignored) usbd_setup_device_desc: getting device descriptor at addr 2 failed, USB_ERR_TIMEOUT usbd_req_re_enumerate: addr=2, set address failed! (USB_ERR_TIMEOUT, ignored) usbd_setup_device_desc: getting device descriptor at addr 2 failed, USB_ERR_TIMEOUT ugen0.2: at usbus0 (disconnected) uhub_reattach_port: could not allocate new device uhub1: at usbus0, port 1, addr 1 (disconnected) uhub1: <0x1022 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0 uhub1: 22 ports with 22 removable, self powered xhci0: Resetting controller ----------------- Here's the start of dmesg: ----------------- Copyright (c) 1992-2018 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 11.2-PRERELEASE #0 r335198: Fri Jun 15 20:55:02 CEST 2018 phil@bob:/usr/obj/usr/src/sys/BOB amd64 FreeBSD clang version 6.0.0 (tags/RELEASE_600/final 326565) (based on LLVM 6.0.0) VT(efifb): resolution 1024x768 CPU: AMD Ryzen 3 1200 Quad-Core Processor (3094.26-MHz K8-class CPU) Origin="AuthenticAMD" Id=0x800f11 Family=0x17 Model=0x1 Stepping=1 Features=0x178bfbff Features2=0x7ed8320b AMD Features=0x2e500800 AMD Features2=0x35c233ff Structured Extended Features=0x209c01a9 XSAVE Features=0xf AMD Extended Feature Extensions ID EBX=0x1007 SVM: (disabled in BIOS) NP,NRIP,VClean,AFlush,DAssist,NAsids=32768 TSC: P-state invariant, performance statistics real memory = 17179869184 (16384 MB) avail memory = 16519221248 (15753 MB) Event timer "LAPIC" quality 600 ACPI APIC Table: FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs FreeBSD/SMP: 1 package(s) x 4 core(s) random: unblocking device. Firmware Warning (ACPI): Optional FADT field Pm2ControlBlock has valid Length but zero Address: 0x0000000000000000/0x1 (20171214/tbfadt-796) ioapic0 irqs 0-23 on motherboard ioapic1 irqs 24-55 on motherboard SMP: AP CPU #3 Launched! SMP: AP CPU #2 Launched! SMP: AP CPU #1 Launched! Timecounter "TSC-low" frequency 1547130097 Hz quality 1000 random: entropy device external interface kbd0 at kbdmux0 netmap: loaded module module_register_init: MOD_LOAD (vesa, 0xffffffff80a3bd40, 0) error 19 random: registering fast source Intel Secure Key RNG random: fast provider: "Intel Secure Key RNG" nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms 390.59 Wed May 9 21:54:48 PDT 2018 nexus0 cryptosoft0: on motherboard aesni0: on motherboard acpi0: on motherboard acpi0: Power Button (fixed) cpu0: on acpi0 cpu1: on acpi0 cpu2: on acpi0 cpu3: on acpi0 attimer0: port 0x40-0x43 irq 0 on acpi0 Timecounter "i8254" frequency 1193182 Hz quality 0 Event timer "i8254" frequency 1193182 Hz quality 100 atrtc0: port 0x70-0x71 on acpi0 atrtc0: registered as a time-of-day clock, resolution 1.000000s Event timer "RTC" frequency 32768 Hz quality 0 hpet0: iomem 0xfed00000-0xfed003ff irq 0,8 on acpi0 Timecounter "HPET" frequency 14318180 Hz quality 950 Event timer "HPET" frequency 14318180 Hz quality 450 Event timer "HPET1" frequency 14318180 Hz quality 450 Event timer "HPET2" frequency 14318180 Hz quality 450 Timecounter "ACPI-fast" frequency 3579545 Hz quality 900 acpi_timer0: <32-bit timer at 3.579545MHz> port 0x808-0x80b on acpi0 pcib0: port 0xcf8-0xcff on acpi0 pcib0: _OSC returned error 0x10 pci0: on pcib0 amdsmn0: on hostb0 amdtemp0: on hostb0 pci0: at device 0.2 (no driver attached) pcib1: at device 1.3 on pci0 pci1: on pcib1 xhci0: mem 0xf77a0000-0xf77a7fff irq 32 at device 0.0 on pci1 xhci0: 32 bytes context size, 64-bit DMA usbus0 on xhci0 ----------------- I don't remember if I had similar USB trouble on Linux, but I definitely did during my brief excursion into NetBSD. If anyone knows whether this is likely to be a CPU, mother board or software problem, or knows of something I can try to get more information or try to debug the thing, please let me know. Thanks, Phil