From owner-freebsd-arm@freebsd.org Mon Jun 1 04:52:41 2020 Return-Path: Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 346932FBB7C for ; Mon, 1 Jun 2020 04:52:41 +0000 (UTC) (envelope-from freebsd-arm@darkain.com) Received: from MTA-09-3.privateemail.com (mta-09-3.privateemail.com [68.65.122.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49b2pw1csrz4ZPR for ; Mon, 1 Jun 2020 04:52:39 +0000 (UTC) (envelope-from freebsd-arm@darkain.com) Received: from MTA-09.privateemail.com (localhost [127.0.0.1]) by MTA-09.privateemail.com (Postfix) with ESMTP id B3E526003F for ; Mon, 1 Jun 2020 00:52:37 -0400 (EDT) Received: from mail-il1-f170.google.com (unknown [10.20.151.247]) by MTA-09.privateemail.com (Postfix) with ESMTPA id 6B72A60034 for ; Mon, 1 Jun 2020 04:52:37 +0000 (UTC) Received: by mail-il1-f170.google.com with SMTP id p5so7081565ile.6 for ; Sun, 31 May 2020 21:52:37 -0700 (PDT) X-Gm-Message-State: AOAM530ryDgBwkT7VxUA7FxqCchoxYOT9KB9JLNa5Q5HXpGoyCCTtVSn aL7HKUNip9McupUAWc1QrJz7A1vLlbdQteInw1I= X-Google-Smtp-Source: ABdhPJxYAZvjUQ5MlBY/W1SdYkkByWhMhCgFv9MrGG4qAVGsBL4h6VbIU8W+T+veLeMAebIEDoCauY8zYVTiQt+V4LQ= X-Received: by 2002:a92:af11:: with SMTP id n17mr6469804ili.156.1590987156740; Sun, 31 May 2020 21:52:36 -0700 (PDT) MIME-Version: 1.0 References: <7F058E92-DDD3-4728-9A51-09BF1D47855C@googlemail.com> <1RBZ-1AclgkiNDwWUqrWhun8T8YSAX6g64NeSc2DKy9EF1wGsJobselP4UYGflpcmbfUx3sEEM2YplIJOXPmZ6EG_GwiMC1_3GLrqpZxisQ=@protonmail.com> <46519DEB-E96D-43DD-B739-401F9F51371E@googlemail.com> <87EE030D-5323-477B-9FF3-CB8970138729@googlemail.com> <37A9A3AA-F2AF-4F08-84BE-8A19E75DB5E0@googlemail.com> In-Reply-To: From: Vincent Milum Jr Date: Sun, 31 May 2020 21:52:25 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Driver for Raspberry Pi 4 PCI-express controller To: =?UTF-8?Q?Klaus_K=C3=BCchemann?= Cc: freebsd-arm@freebsd.org X-Virus-Scanned: ClamAV using ClamSMTP X-Rspamd-Queue-Id: 49b2pw1csrz4ZPR X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd-arm@darkain.com designates 68.65.122.19 as permitted sender) smtp.mailfrom=freebsd-arm@darkain.com X-Spamd-Result: default: False [-2.65 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.07)[-1.066]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:68.65.122.0/27]; NEURAL_HAM_LONG(-0.97)[-0.968]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; DMARC_NA(0.00)[darkain.com]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.31)[-0.313]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[68.65.122.19:from]; FREEMAIL_TO(0.00)[googlemail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:22612, ipnet:68.65.122.0/24, country:US]; RCVD_TLS_LAST(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[68.65.122.19:from] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2020 04:52:41 -0000 My apologies, I forgot that my inbound and outbound email aliases were not the same, so the FreeBSD-ARM mailing list rightfully rejected my email before. > hope it=E2=80=99s okay for you to keep this discussion public Yes, it was intended to be a public discussion :) > Did you test hot-unplugging/replugging the peripherals ? Yes, for the most part it all went exactly as expected. Sometimes one of the controllers would reset, other times it would work perfectly. A couple times it would cause that endless error loop I reported before (in which case, it seems only a power cycle solves it). Console log from an unplug/replug event is listed below. This particular time is one of the times the controller reset itself, and worked properly after. > do you mean that not every boot-attempt does the same (for unknown reason= ) Correct. Once or twice, I had the infinite controller resets on boot. > or whether it`s caused by the pie-driver-electricity This was my initial thought, too. I have been powering this Pi from the USB-C port on my desktop workstation. Once or twice I saw the "low power" warning on screen, so that is certainly a possibility. I've since had the Pi running idle for over 24 hours without issue. Additional testing... USB to Serial adapter: Plugged in and /dev/cuaU0 properly showed up, but I didn't hook it up to anything to test sending/receiving yet. ugen0.8: at usbus0 uplcom0 on uhub1 uplcom0: on usbus0 Microsoft XBOX 360 Wired controller: Same as above. Plugged in, /dev/uhid0 showed up properly, but have not tested usage yet. ugen0.8: at usbus0 uhid0 on uhub1 uhid0: on usbus0 unplug/replug USB hub with multiple devices attached, with "xhci_interrupt: host system error" and controller reset: ugen0.3: at usbus0 (disconnected) uhub2: at uhub1, port 1, addr 2 (disconnected) ugen0.4: at usbus0 (disconnected) ums0: at uhub2, port 1, addr 3 (disconnected) ums0: detached ugen0.5: at usbus0 (disconnected) ure0: at uhub2, port 3, addr 4 (disconnected) rgephy0: detached miibus1: detached ure0: detached Jun 1 04:21:05 generic dhclient[7364]: receive_uhub2: detached packet failed on ue0: Device not configured Jun 1 04:21:05 generic dhclient[7364]: ioctl(SIOCGIFFLAGS) on ue0: Operation not permitted Jun 1 04:21:05 generic dhclient[7364]: Interface ue0 no longer appears valid. Jun 1 04:21:05 generic dhclient[7364]: No live interfaces to poll on - exiting. Jun 1 04:21:05 generic dhclient[7364]: exiting. Jun 1 04:21:05 generic dhclient[7364]: connection closed Jun 1 04:21:05 generic dhclient[7364]: exiting. ugen0.3: at usbus0 uhub2 on uhub1 uhub2: on usbus0 uhub2: MTT enabled uhub2: 4 ports with 4 removable, self powered ugen0.4: at usbus0 ums0 on uhub2 ums0: on usbus0 ums0: 5 buttons and [XYZ] coordinates ID=3D0 ugen0.5: at usbus0 ure0 on uhub2 ure0: on usbus0 miibus1: on ure0 rgephy0: PHY 0 on miibus1 rgephy0: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto xhci_interrupt: host system error xhci0: Resetting controller uhub0: at usbus0, port 1, addr 1 (disconnected) ugen0.2: at usbus0 (disconnected) uhub1: at uhub0, port 1, addr 1 (disconnected) ugen0.3: at usbus0 (disconnected) uhub2: at uhub1, port 1, addr 2 (disconnected) ugen0.4: at usbus0 (disconnected) ums0: at uhub2, port 1, addr 3 (disconnected) ums0: detached ugen0.5: at usbus0 (disconnected) ure0: at uhub2, port 3, addr 4 (disconnected) rgephy0: detached miibus1: detached Jun 1 04:21ure0: detached :37 generic dhclient[8021]: receive_packet failed on ue0: Device not configured Jun 1 04:21:37 generic dhclient[8021]: ioctl(SIOCGIFFLAGS) on ue0: Operation not permitted Jun 1 04:21:37 generic dhclient[8021]: Interface ue0 no longer appears valid. Jun 1 04:21:37 generic dhclient[8021]: No live interfaces to poll on - exiting. Jun 1 04:21:37 generic dhclient[8021]: exiting. Jun 1 04:21:37 generic dhclient[8021]: connection closed Jun 1 04:21:37 generic dhclient[8021]: exiting. uhub2: detached uhub1: detached ugen0.7: at usbus0 (disconnected) umass0: at uhub0, port 3, addr 6 (disconnected) da0 at umass-sim0 bus 0 scbus0 target 0 lun 0 da0: s/n E0D55EA573F5F3B1A9B21117 detached (da0:umass-sim0:0:0:0): Periph destroyed umass0: detached uhub0: detached xhci0: Controller halt timeout. uhub0 on usbus0 uhub0: <0x1106 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0 uhub0: 5 ports with 4 removable, self powered ugen0.2: at usbus0 uhub1 on uhub0 uhub1: on usbus0 uhub1: 4 ports with 4 removable, self powered ugen0.3: at usbus0 uhub2 on uhub1 uhub2: on usbus0 uhub2: MTT enabled uhub2: 4 ports with 4 removable, self powered ugen0.4: at usbus0 ums0 on uhub2 ums0: on usbus0 ums0: 5 buttons and [XYZ] coordinates ID=3D0 ugen0.5: at usbus0 ure0 on uhub2 ure0: on usbus0 miibus1: on ure0 rgephy0: PHY 0 on miibus1 rgephy0: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto ugen0.6: at usbus0 umass0 on uhub0 umass0: on usbus0 umass0: SCSI over Bulk-Only; quirks =3D 0xc100 umass0:0:0: Attached to scbus0 da0 at umass-sim0 bus 0 scbus0 target 0 lun 0 da0: Removable Direct Access SPC-4 SCSI device da0: Serial Number E0D55EA573F5F3B1A9B21117 da0: 400.000MB/s transfers da0: 14755MB (30218842 512 byte sectors) da0: quirks=3D0x2 On Sat, May 30, 2020 at 1:28 PM Klaus K=C3=BCchemann wrote: > Hi, > thanks, Vincent, for your extensive testing, very helpful ! > `hope it=E2=80=99s okay for you to keep this discussion public(forward to > freebsd-arm@freebsd.org) . > > > Am 30.05.2020 um 20:11 schrieb Vincent M. Jr <>: > > > > dmesg: https://dmesgd.nycbug.org/index.cgi?do=3Dview&id=3D5523 > > > > =E2=80=A6=E2=80=A6. > > It isn't perfectly stable, but at least initially working=E2=80=A6.. > > Yeah, initially (sometimes) works for me too... > > > > Testing it with a USB-C (with adapter) ethernet + 3-port hub. I'm using > this for wired ethernet rather than the built in ethernet just for testin= g. > > > > On the three hub ports, I have a microsoft keyboard, microsoft mouse, > and a kingston datatraveler thumbdriv > > There is also a Logitech keyboard on one of the Pi's USB 2.0 ports > > Did you test hot-unplugging/replugging the peripherals ? > > > > > For testing, I've created a single-drive ZFS pool with the kingston > drive. > > > > I went to delete a test file, and got the following: > > > > xhci_interrupt: host system error > > xhci0: Resetting controller > > uhub0: at usbus0, port 1, addr 1 (disconnected) > > ugen0.2: at usbus0 (disconnected) > > uhub1: at uhub0, port 1, addr 1 (disconnected) > > ugen0.3: at usbus0 (disconnected) > > uhub2: at uhub1, port 1, addr 2 (disconnected) > > ugen0.4: at usbus0 (disconnected) > > umass0: at uhub2, port 1, addr 3 (disconnected) > > (da0:umass-sim0:0:0:0): WRITE(10). CDB: 2a 00 00 a0 21 a5 00 00 80 00 > > (da0:umass-sim0:0:0:0): CAM status: CCB request completed with an error > > (da0:umass-sim0:0:0:0): Retrying command, 3 more tries remain > > > > But every single device had to be re-detected which took ~5-10 seconds > to complete. > > Yeah, experienced that too ... > > > > > > > On another boot attempt, I'm getting this repeatedly while at the login > prompt:...usb_alloc_device: device init 2 failed (USB_ERR_TIMEOUT, > ignored)...ugen0.2: at usbus0 (disconnected)=E2=80=A6. > > This is a very interesting information : > =E2=80=A6 do you mean that not every boot-attempt = does the > same (for unknown reason) > (That=E2=80=99s what I have experienced but I wasn=E2=80=99t sure whether= my uSD is > damaged or whether it`s caused by the pie-driver-electricity ?? > Specially the at -thing only appears in some boot attempts(not > all) > In my tests the strange thing is that one boot-attempt succeeds and > another not , while left the machine completely untouched between those > attempts.. > > > > > update: i've gotten this also while doing a lengthy transfer to USB ZFS > pool, and the error cycling never stops. > > I will try to make a ZFS-pool-test... > > > > > xhci0: Controller reset timeout. > > uhub0 on usbus0 > > uhub0: <0x1106 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbu= s0 > > uhub0: 5 ports with 4 removable, self powered > > xhci0: Resetting controller > > usb_alloc_device: device init 2 failed (USB_ERR_TIMEOUT, ignored) > > ugen0.2: at usbus0 (disconnected) > > uhub_reattach_port: could not allocate new device > > uhub0: at usbus0, port 1, addr 1 (disconnected) > > uhub0: detached > > xhci0: Controller halt timeout. > > xhci0: Controller reset timeout. > > xhci0: Controller reset timeout. > > uhub0 on usbus0 > > uhub0: <0x1106 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbu= s0 > > uhub0: 5 ports with 4 removable, self powered > > xhci0: Resetting controller > > usb_alloc_device: device init 2 failed (USB_ERR_TIMEOUT, ignored) > > ugen0.2: at usbus0 (disconnected) > > uhub_reattach_port: could not allocate new device > > uhub0: at usbus0, port 1, addr 1 (disconnected) > > uhub0: detached > > xhci0: Controller halt timeout. > > xhci0: Controller reset timeout. > > xhci0: Controller reset timeout. > > > > > > =E2=80=A6=E2=80=A6.. > > xhci0 is this : > > https://svnweb.freebsd.org/base/head/sys/dev/usb/controller/generic_xhci.= c?view=3Dmarkup > (and the corresponding fdt/acpi-files) > > uhub0 is this : > https://svnweb.freebsd.org/base/head/sys/dev/usb/usb_hub.c?view=3Dmarkup > > Thanks again for testing, > Regards > > > > > > >