From owner-freebsd-usb@freebsd.org Thu Jul 12 07:27:27 2018 Return-Path: Delivered-To: freebsd-usb@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 5D649103BD24 for ; Thu, 12 Jul 2018 07:27:27 +0000 (UTC) (envelope-from stb@lassitu.de) Received: from gilb.zs64.net (gilb.zs64.net [IPv6:2a00:14b0:4200:32e0::1ea]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gilb.zs64.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC4CC8150E for ; Thu, 12 Jul 2018 07:27:26 +0000 (UTC) (envelope-from stb@lassitu.de) Received: by gilb.zs64.net (Postfix, from stb@lassitu.de) id E2BF71169E0 for ; Thu, 12 Jul 2018 07:27:25 +0000 (UTC) From: Stefan Bethke Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: USB problems on PC Engines APU2C4 Message-Id: Date: Thu, 12 Jul 2018 09:27:24 +0200 To: freebsd-usb@freebsd.org X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2018 07:27:27 -0000 I=E2=80=99m having trouble using USB2 devices on the two USB3 ports on = the back of the APU2C4. I=E2=80=99m on 11.2-RELEASE. The APU2 also has two USB2 ports, but they=E2=80=99re only on a pin = header, and I=E2=80=99m waiting for a cable to try them to see if there = is a difference. First, I had trouble installing from: ugen0.2: at usbus0 umass0 on uhub1 umass0: on = usbus0 umass0: SCSI over Bulk-Only; quirks =3D 0x8100 umass0:2:0: Attached to scbus2 This is all that gets probed on most attempts to connect the stick. = Sometimes, it succeeds immediately, or after a couple of retries, like = this: ugen0.2: at usbus0 umass0 on uhub1 umass0: on = usbus0 umass0: SCSI over Bulk-Only; quirks =3D 0x8100 umass0:2:0: Attached to scbus2 (probe0:umass-sim0:0:0:0): INQUIRY. CDB: 12 00 00 00 24 00=20 (probe0:umass-sim0:0:0:0): CAM status: CCB request completed with an = error (probe0:umass-sim0:0:0:0): Retrying command da0 at umass-sim0 bus 0 scbus2 target 0 lun 0 da0: Removable Direct Access SCSI device da0: Serial Number 001CC0EC34F4BB6155F10168 da0: 40.000MB/s transfers da0: 15252MB (31236096 512 byte sectors) da0: quirks=3D0x2 On other machines, that stick works just fine. The other device I=E2=80=99m having trouble with is a Huawei E3272 LTE = stick. In it=E2=80=99s default mode, it shows up as a umass device; = using usb_modeswitch, it can be configured as a serial modem or an CDC = ethernet device. [root@apu2 ~]# lsusb Bus /dev/usb Device /dev/ugen0.2: ID 12d1:1f01 Huawei Technologies Co., = Ltd. E353/E3131 (Mass storage mode) Bus /dev/usb Device /dev/ugen1.2: ID 0438:7900 Advanced Micro Devices, = Inc.=20 Bus /dev/usb Device /dev/ugen0.1: ID 0000:0000 =20 Bus /dev/usb Device /dev/ugen1.1: ID 0000:0000 =20 It appears that communication issues stop usb_modeswitch from switching = to the desired mode: [root@apu2 ~]# /usr/local/sbin/usb_modeswitch -v 12d1 -p 1f01 -V 12d1 -P = 1001 -M 55534243000000000000000000000011060000000000000000000000000000 Look for target devices ... No devices in target mode or class found Look for default devices ... Found devices in default mode (1) Access device 002 on bus 000 Get the current device configuration ... Current configuration number is 1 Use interface number 0 with class 8 Use endpoints 0x01 (out) and 0x81 (in) Looking for active drivers ... OK, driver detached Set up interface 0 Use endpoint 0x01 for message sending ... Trying to send message 1 to endpoint 0x01 ... Sending the message returned error -7. Try to continue Read the response to message 1 (CSW) ... Response reading failed (error -7) Device is gone, skip any further commands -> Run lsusb to note any changes. Bye! At the same time, the console shows a lot of errors and then: (cd0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 00 ff ff 00 00 01 00=20 (cd0:umass-sim0:0:0:0): CAM status: SCSI Status Error (cd0:umass-sim0:0:0:0): SCSI status: Check Condition (cd0:umass-sim0:0:0:0): SCSI sense: MEDIUM ERROR asc:11,0 (Unrecovered = read err) (cd0:umass-sim0:0:0:0): Info: 0xffff (cd0:umass-sim0:0:0:0): Error 5, Unretryable error (cd0:umass-sim0:0:0:0): cddone: got error 0x5 back umass0: at uhub1, port 3, addr 1 (disconnected) cd0 at umass-sim0 bus 0 scbus2 target 0 lun 0 cd0: detached (cd0:umass-sim0:0:0:0): Periph destroyed umass0: detached Here=E2=80=99s the PCI devices the APU has: [root@apu2 ~]# pciconf -lv hostb0@pci0:0:0:0: class=3D0x060000 card=3D0x15661022 = chip=3D0x15661022 rev=3D0x00 hdr=3D0x00 vendor =3D 'Advanced Micro Devices, Inc. [AMD]' class =3D bridge subclass =3D HOST-PCI hostb1@pci0:0:2:0: class=3D0x060000 card=3D0x00000000 = chip=3D0x156b1022 rev=3D0x00 hdr=3D0x00 vendor =3D 'Advanced Micro Devices, Inc. [AMD]' class =3D bridge subclass =3D HOST-PCI pcib1@pci0:0:2:2: class=3D0x060400 card=3D0x12341022 = chip=3D0x14391022 rev=3D0x00 hdr=3D0x01 vendor =3D 'Advanced Micro Devices, Inc. [AMD]' device =3D 'Family 16h Processor Functions 5:1' class =3D bridge subclass =3D PCI-PCI pcib2@pci0:0:2:3: class=3D0x060400 card=3D0x12341022 = chip=3D0x14391022 rev=3D0x00 hdr=3D0x01 vendor =3D 'Advanced Micro Devices, Inc. [AMD]' device =3D 'Family 16h Processor Functions 5:1' class =3D bridge subclass =3D PCI-PCI pcib3@pci0:0:2:4: class=3D0x060400 card=3D0x12341022 = chip=3D0x14391022 rev=3D0x00 hdr=3D0x01 vendor =3D 'Advanced Micro Devices, Inc. [AMD]' device =3D 'Family 16h Processor Functions 5:1' class =3D bridge subclass =3D PCI-PCI none0@pci0:0:8:0: class=3D0x108000 card=3D0x15371022 = chip=3D0x15371022 rev=3D0x00 hdr=3D0x00 vendor =3D 'Advanced Micro Devices, Inc. [AMD]' class =3D encrypt/decrypt xhci0@pci0:0:16:0: class=3D0x0c0330 card=3D0x14101022 = chip=3D0x78141022 rev=3D0x11 hdr=3D0x00 vendor =3D 'Advanced Micro Devices, Inc. [AMD]' device =3D 'FCH USB XHCI Controller' class =3D serial bus subclass =3D USB ahci0@pci0:0:17:0: class=3D0x010601 card=3D0x00000000 = chip=3D0x78001022 rev=3D0x39 hdr=3D0x00 vendor =3D 'Advanced Micro Devices, Inc. [AMD]' device =3D 'FCH SATA Controller [IDE mode]' class =3D mass storage subclass =3D SATA ehci0@pci0:0:19:0: class=3D0x0c0320 card=3D0x78081022 = chip=3D0x78081022 rev=3D0x39 hdr=3D0x00 vendor =3D 'Advanced Micro Devices, Inc. [AMD]' device =3D 'FCH USB EHCI Controller' class =3D serial bus subclass =3D USB none1@pci0:0:20:0: class=3D0x0c0500 card=3D0x780b1022 = chip=3D0x780b1022 rev=3D0x42 hdr=3D0x00 vendor =3D 'Advanced Micro Devices, Inc. [AMD]' device =3D 'FCH SMBus Controller' class =3D serial bus subclass =3D SMBus isab0@pci0:0:20:3: class=3D0x060100 card=3D0x780e1022 = chip=3D0x780e1022 rev=3D0x11 hdr=3D0x00 vendor =3D 'Advanced Micro Devices, Inc. [AMD]' device =3D 'FCH LPC Bridge' class =3D bridge subclass =3D PCI-ISA sdhci_pci0@pci0:0:20:7: class=3D0x080501 card=3D0x78061022 = chip=3D0x78131022 rev=3D0x01 hdr=3D0x00 vendor =3D 'Advanced Micro Devices, Inc. [AMD]' device =3D 'FCH SD Flash Controller' class =3D base peripheral subclass =3D SD host controller hostb2@pci0:0:24:0: class=3D0x060000 card=3D0x00000000 = chip=3D0x15801022 rev=3D0x00 hdr=3D0x00 vendor =3D 'Advanced Micro Devices, Inc. [AMD]' class =3D bridge subclass =3D HOST-PCI hostb3@pci0:0:24:1: class=3D0x060000 card=3D0x00000000 = chip=3D0x15811022 rev=3D0x00 hdr=3D0x00 vendor =3D 'Advanced Micro Devices, Inc. [AMD]' class =3D bridge subclass =3D HOST-PCI hostb4@pci0:0:24:2: class=3D0x060000 card=3D0x00000000 = chip=3D0x15821022 rev=3D0x00 hdr=3D0x00 vendor =3D 'Advanced Micro Devices, Inc. [AMD]' class =3D bridge subclass =3D HOST-PCI hostb5@pci0:0:24:3: class=3D0x060000 card=3D0x00000000 = chip=3D0x15831022 rev=3D0x00 hdr=3D0x00 vendor =3D 'Advanced Micro Devices, Inc. [AMD]' class =3D bridge subclass =3D HOST-PCI hostb6@pci0:0:24:4: class=3D0x060000 card=3D0x00000000 = chip=3D0x15841022 rev=3D0x00 hdr=3D0x00 vendor =3D 'Advanced Micro Devices, Inc. [AMD]' class =3D bridge subclass =3D HOST-PCI hostb7@pci0:0:24:5: class=3D0x060000 card=3D0x00000000 = chip=3D0x15851022 rev=3D0x00 hdr=3D0x00 vendor =3D 'Advanced Micro Devices, Inc. [AMD]' class =3D bridge subclass =3D HOST-PCI igb0@pci0:1:0:0: class=3D0x020000 card=3D0x00008086 = chip=3D0x157b8086 rev=3D0x03 hdr=3D0x00 vendor =3D 'Intel Corporation' device =3D 'I210 Gigabit Network Connection' class =3D network subclass =3D ethernet igb1@pci0:2:0:0: class=3D0x020000 card=3D0x00008086 = chip=3D0x157b8086 rev=3D0x03 hdr=3D0x00 vendor =3D 'Intel Corporation' device =3D 'I210 Gigabit Network Connection' class =3D network subclass =3D ethernet igb2@pci0:3:0:0: class=3D0x020000 card=3D0x00008086 = chip=3D0x157b8086 rev=3D0x03 hdr=3D0x00 vendor =3D 'Intel Corporation' device =3D 'I210 Gigabit Network Connection' class =3D network subclass =3D ethernet Here=E2=80=99s the 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-RELEASE #0 r335510: Fri Jun 22 04:32:14 UTC 2018 root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64 FreeBSD clang version 6.0.0 (tags/RELEASE_600/final 326565) (based on = LLVM 6.0.0) VT(vga): resolution 640x480 CPU: AMD GX-412TC SOC (998.15-MHz = K8-class CPU) Origin=3D"AuthenticAMD" Id=3D0x730f01 Family=3D0x16 Model=3D0x30 = Stepping=3D1 = Features=3D0x178bfbff = Features2=3D0x3ed8220b AMD Features=3D0x2e500800 AMD = Features2=3D0x1d4037ff Structured Extended Features=3D0x8 XSAVE Features=3D0x1 SVM: NP,NRIP,AFlush,DAssist,NAsids=3D8 TSC: P-state invariant, performance statistics real memory =3D 5083496448 (4848 MB) avail memory =3D 4072296448 (3883 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) ioapic1: Changing APIC ID to 5 ioapic0 irqs 0-23 on motherboard ioapic1 irqs 24-55 on motherboard SMP: AP CPU #2 Launched! SMP: AP CPU #1 Launched! SMP: AP CPU #3 Launched! Timecounter "TSC" frequency 998148477 Hz quality 1000 random: entropy device external interface kbd0 at kbdmux0 netmap: loaded module module_register_init: MOD_LOAD (vesa, 0xffffffff80ff4550, 0) error 19 nexus0 vtvga0: on motherboard cryptosoft0: on motherboard acpi0: on motherboard acpi0: Power Button (fixed) cpu0: on acpi0 cpu1: on acpi0 cpu2: on acpi0 cpu3: on acpi0 atrtc0: port 0x70-0x71 irq 8 on acpi0 atrtc0: registered as a time-of-day clock, resolution 1.000000s Event timer "RTC" frequency 32768 Hz quality 0 attimer0: port 0x40-0x43 irq 0 on acpi0 Timecounter "i8254" frequency 1193182 Hz quality 0 Event timer "i8254" frequency 1193182 Hz quality 100 hpet0: iomem 0xfed00000-0xfed003ff on acpi0 Timecounter "HPET" frequency 14318180 Hz quality 950 Timecounter "ACPI-safe" frequency 3579545 Hz quality 850 acpi_timer0: <32-bit timer at 3.579545MHz> port 0x818-0x81b on acpi0 acpi_button0: on acpi0 pcib0: port 0xcf8-0xcff on acpi0 pci0: on pcib0 pcib1: irq 25 at device 2.2 on pci0 pcib1: failed to allocate initial I/O port window: 0x1000-0x1fff pci1: on pcib1 igb0: mem = 0xf7a00000-0xf7a1ffff,0xf7a20000-0xf7a23fff irq 28 at device 0.0 on pci1 igb0: Using MSIX interrupts with 5 vectors igb0: Ethernet address: 00:0d:b9:4b:e2:cc igb0: Bound queue 0 to cpu 0 igb0: Bound queue 1 to cpu 1 igb0: Bound queue 2 to cpu 2 igb0: Bound queue 3 to cpu 3 igb0: netmap queues/slots: TX 4/1024, RX 4/1024 pcib2: irq 26 at device 2.3 on pci0 pci2: on pcib2 igb1: port = 0x2000-0x201f mem 0xf7b00000-0xf7b1ffff,0xf7b20000-0xf7b23fff irq 32 at = device 0.0 on pci2 igb1: Using MSIX interrupts with 5 vectors igb1: Ethernet address: 00:0d:b9:4b:e2:cd igb1: Bound queue 0 to cpu 0 igb1: Bound queue 1 to cpu 1 igb1: Bound queue 2 to cpu 2 igb1: Bound queue 3 to cpu 3 igb1: netmap queues/slots: TX 4/1024, RX 4/1024 pcib3: at device 2.4 on pci0 pci3: on pcib3 igb2: port = 0x3000-0x301f mem 0xf7c00000-0xf7c1ffff,0xf7c20000-0xf7c23fff at device = 0.0 on pci3 igb2: Using MSIX interrupts with 5 vectors igb2: Ethernet address: 00:0d:b9:4b:e2:ce igb2: Bound queue 0 to cpu 0 igb2: Bound queue 1 to cpu 1 igb2: Bound queue 2 to cpu 2 igb2: Bound queue 3 to cpu 3 igb2: netmap queues/slots: TX 4/1024, RX 4/1024 pci0: at device 8.0 (no driver attached) xhci0: mem 0xf7f22000-0xf7f23fff irq 18 at = device 16.0 on pci0 xhci0: 32 bytes context size, 64-bit DMA xhci0: Unable to map MSI-X table=20 usbus0 on xhci0 usbus0: 5.0Gbps Super Speed USB v3.0 ahci0: port = 0x4010-0x4017,0x4020-0x4023,0x4018-0x401f,0x4024-0x4027,0x4000-0x400f = mem 0xf7f25000-0xf7f253ff at device 17.0 on pci0 ahci0: AHCI v1.30 with 2 6Gbps ports, Port Multiplier supported with FBS ahcich0: at channel 0 on ahci0 ahcich1: at channel 1 on ahci0 ehci0: mem 0xf7f26000-0xf7f260ff irq 18 at = device 19.0 on pci0 usbus1: EHCI version 1.0 usbus1 on ehci0 usbus1: 480Mbps High Speed USB v2.0 isab0: at device 20.3 on pci0 isa0: on isab0 sdhci_pci0: mem 0xf7f27000-0xf7f270ff at device 20.7 on = pci0 sdhci_pci0: 1 slot(s) allocated orm0: at iomem 0xee800-0xeffff on isa0 ppc0: cannot reserve I/O port range uart0: <16550 or compatible> at port 0x3f8 irq 4 flags 0x10 on isa0 uart0: console (115200,n,8,1) uart1: <16550 or compatible> at port 0x2f8 irq 3 on isa0 hwpstate0: on cpu0 ZFS NOTICE: Prefetch is disabled by default if less than 4GB of RAM is = present; to enable, add "vfs.zfs.prefetch_disable=3D0" to = /boot/loader.conf. ZFS filesystem version: 5 ZFS storage pool version: features support (5000) Timecounters tick every 1.000 msec ugen1.1: at usbus1 ugen0.1: <0x1022 XHCI root HUB> at usbus0 ada0 at ahcich0 bus 0 scbus0 target 0 lun 0 uhub0: ada0: ACS-4 ATA SATA 3.x device ada0: Serial Number A4620782148900312898 ada0: 600.000MB/s transfers on usbus1 (SATA 3.x, UDMA6, PIO 8192bytes) ada0: Command Queueing enabled ada0: 15272MB (31277232 512 byte sectors) Trying to mount root from zfs:zroot/ROOT/default []... uhub1: <0x1022 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on = usbus0 Root mount waiting for: usbus1 usbus0 uhub1: 4 ports with 4 removable, self powered Root mount waiting for: usbus1 usbus0 uhub0: 2 ports with 2 removable, self powered ugen0.2: at usbus0 ugen1.2: at usbus1 uhub2 on uhub0 uhub2: = on usbus1 Root mount waiting for: usbus1 uhub2: 4 ports with 4 removable, self powered random: unblocking device. Stefan --=20 Stefan Bethke Fon +49 151 14070811