From owner-freebsd-ppc@freebsd.org Mon Feb 1 19:47:19 2021 Return-Path: Delivered-To: freebsd-ppc@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 5E495534D63 for ; Mon, 1 Feb 2021 19:47:19 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gate2.funkthat.com", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTz426dbRz4pp2 for ; Mon, 1 Feb 2021 19:47:14 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.15.2/8.15.2) with ESMTPS id 111Jl2Nw086680 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 1 Feb 2021 11:47:02 -0800 (PST) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.15.2/8.15.2/Submit) id 111Jl20M086679; Mon, 1 Feb 2021 11:47:02 -0800 (PST) (envelope-from jmg) Date: Mon, 1 Feb 2021 11:47:02 -0800 From: John-Mark Gurney To: Mark Millard Cc: freebsd-ppc Subject: Re: Expected issue? Old PowerMac G5 [...] vs. USB [...] [RealTek EtherNet] devices (...) Message-ID: <20210201194702.GU31099@funkthat.com> Mail-Followup-To: Mark Millard , freebsd-ppc References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 11.3-STABLE amd64 X-PGP-Fingerprint: D87A 235F FB71 1F3F 55B7 ED9B D5FF 5A51 C0AC 3D65 X-Files: The truth is out there X-URL: https://www.funkthat.com/ X-Resume: https://www.funkthat.com/~jmg/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (gold.funkthat.com [127.0.0.1]); Mon, 01 Feb 2021 11:47:02 -0800 (PST) X-Rspamd-Queue-Id: 4DTz426dbRz4pp2 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of jmg@gold.funkthat.com has no SPF policy when checking 208.87.223.18) smtp.mailfrom=jmg@gold.funkthat.com X-Spamd-Result: default: False [-1.32 / 15.00]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.52)[-0.522]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[yahoo.com]; FORGED_SENDER(0.30)[jmg@funkthat.com,jmg@gold.funkthat.com]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[208.87.223.18:from]; ASN(0.00)[asn:32354, ipnet:208.87.216.0/21, country:US]; FROM_NEQ_ENVFROM(0.00)[jmg@funkthat.com,jmg@gold.funkthat.com]; SUBJECT_HAS_QUESTION(0.00)[]; R_DKIM_NA(0.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[jmg]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[funkthat.com]; AUTH_NA(1.00)[]; SPAMHAUS_ZRD(0.00)[208.87.223.18:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_SPF_NA(0.00)[no SPF record]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-ppc] X-Mailman-Approved-At: Mon, 01 Feb 2021 21:02:17 +0000 X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 19:47:19 -0000 Mark Millard wrote this message on Sun, Jan 31, 2021 at 13:45 -0800: > [I provide some older context before the new material.] > > On 2020-Jul-27, at 19:47, Mark Millard wrote: > > > Context: head -r363590 based context, non-debug build. > > > > Using a couple of USB EtherNet devices (with different > > chip set families from different companies), I get > > the like of: > > > > 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 > > 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 > > 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 > > ugen2.2: at usbus2 (disconnected) > > uhub_reattach_port: could not allocate new device > > > > when I plug in the device. The one way I've found to avoid that > > is to boot using: > > > > hw.usb.xhci.use_polling=1 > > > > but this appears to have large performance consequences for > > receiving data over the device. > > > > (The only reason I've tried this on a PowerMac G5 is as a test > > for a Realtek driver update that John-Mark Gurney has produced > > and requested testing of: PowerPC is the only Big Endian type > > of context that I have access to. Going the other way, the only > > powerpc families that I have access to are in old PowerMacs. > > The above is not limited to Realtek chipsets.) > > > > With the forced polling I get (for the device I originally > > intended to test with): > > > > ugen2.2: at usbus2 > > ure0 numa-domain 0 on uhub2 > > ure0: on usbus2 > > miibus2: numa-domain 0 on ure0 > > rgephy0: PHY 0 on miibus2 > > rgephy0: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto > > ue0: on ure0 > > ue0: Ethernet address: ### > > ue0: link state changed to DOWN > > > > and: > > > > ue0: flags=8843 metric 0 mtu 1500 > > options=68009b > > ether ### > > inet 192.168.1.149 netmask 0xffffff00 broadcast 192.168.1.255 > > media: Ethernet autoselect (1000baseT ) > > status: active > > nd6 options=29 > > > > I will note that the USB device is USB3 capable but supports > > use on USB2 as well. This was also true of the other device > > that I tried that had a different chip set. > > > > > > I do not know if some other types of USB devices also have > > such problems on old PowerMacs (or powerpc64 more generally). > > Newer context: Both old 2-socke-t/2-cores-each PowerMac G5s > now suffer Heat Deaths when used for much. So this is tied > to attempting to switch to another variant of the G5s that > happens to be accessible. But I think the end result is > reporting a new problem. > > Well, I tried using the 2-socket/1-core-each PowerMac G5 but > discovered that its gem0 gets regular device timeouts after > a while, making EtherNet useless via gem0. This lead to again > looking at using USB based EtherNet on this old PowerMac G5. > > So I tried plugging one of the RealTek USB ethernet devices, > with hw.usb.xhci.use_polling=1 in place at boot. The result > was an immediate, slient death in that the console display > stopped responding. > > For reference: > > # ~/fbsd-based-on-what-freebsd-main.sh > merge-base: 3f43ada98c89bce5ae416e203ba0e81595a5cd88 > merge-base: CommitDate: 2021-01-29 19:46:24 +0000 > e124d7d5fc88 (HEAD -> mm-src) mm-src snapshot for mm's patched build in git context. > 3f43ada98c89 (freebsd/main, freebsd/HEAD, pure-src, main) Catch up with 6edfd179c86: mechanically rename IFCAP_NOMAP to IFCAP_MEXTPG. > FreeBSD FBSDG5L2 14.0-CURRENT FreeBSD 14.0-CURRENT mm-src-n244523-e124d7d5fc88 GENERIC64vtsc-NODBG powerpc powerpc64 1400003 1400003 > > I doubt that plugging in a USB "RTL8251/8153 1000BASE-T > media interface" should crash the PowerMac G5, but it > does, and does so in a way that leaves no access to find > evidence with. (I've no serial console for any PowerMac.) > > > So I tried a non-RealTek USB3 capable EtherNet device, both > with and without hw.usb.xhci.use_polling=1 : > > axge0 numa-domain 0 on uhub4 > axge0: on usbus4 > miibus1: numa-domain 0 on axge0 > rgephy0: PHY 3 on miibus1 > rgephy0: none, 10baseT, 10baseT-FDX, 10baseT-FDX-flow, 100baseTX, 100baseTX-FDX, 100baseTX-FDX-flow, 1000baseT-FDX, 1000baseT-FDX-master, 1000baseT-FDX-flow, 1000baseT-FDX-flow-master, auto, auto-flow > ue0: on axge0 > ue0: Ethernet address: 00:05:1b:af:1a:21 > ue0: link state changed to DOWN > ue0: link state changed to UP > > So far it seems to be working just fine. I'm using it > without hw.usb.xhci.use_polling=1 . Is the axge a USB3 or USB3 device? The driver attached to both... [...] > So the crash appears to be RealTek-device specific in some > way, not some sort of generic USB EtherNet problem. My guess is that there's a USB3 issue.. Because an endianness issue in the driver would cause it to not attach or misbehave, it should not cause a hard lock.. I assume it was a hard lock enough that you were unable to break into ddb? Without more information, it will be impossible for me to debug this. > I've no clue if the gem0 issue is HW, SW, or some mix, but > its failure is not as big of a deal as crashing just from > plugging in a USB device. > > > Note: The G5 is doing a poudriere-based build that may take it > days, with llvm building yet to start. I have 2 ssh sessions > going, one session is running my variant of top and the other > is running poudriere(-devel). -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."