From nobody Mon Mar 14 09:31:20 2022 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 57DBE1A10843 for ; Mon, 14 Mar 2022 09:31:40 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4KHBBM3nhNz4Twx for ; Mon, 14 Mar 2022 09:31:39 +0000 (UTC) (envelope-from hps@selasky.org) Received: from [10.36.2.165] (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 0F7ED26062A; Mon, 14 Mar 2022 10:31:32 +0100 (CET) Message-ID: <7a77e3bd-1186-56a6-e60e-89e51c190a01@selasky.org> Date: Mon, 14 Mar 2022 10:31:20 +0100 List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: Raspberry Pi 3B USB Printing Issue Content-Language: en-US To: Archimedes Gaviola Cc: freebsd-arm@freebsd.org References: <7c67118e-f6ec-c87d-9a81-3ee6a5952f49@selasky.org> <60f98b10-dcdc-cdf4-3d7a-fe9fd4dff223@selasky.org> <8226461b-5740-9c19-0575-2740bd952e16@selasky.org> From: Hans Petter Selasky In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4KHBBM3nhNz4Twx X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 88.99.82.50 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-3.30 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; NEURAL_HAM_LONG(-1.00)[-1.000]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-0.999]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; MLMMJ_DEST(0.00)[freebsd-arm]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On 3/14/22 10:20, Archimedes Gaviola wrote: > On Sun, Mar 13, 2022 at 11:25 PM Archimedes Gaviola < > archimedes.gaviola@gmail.com> wrote: > >> >> >> On Sun, Mar 13, 2022 at 2:27 PM Archimedes Gaviola < >> archimedes.gaviola@gmail.com> wrote: >> >>> >>> >>> On Sun, Mar 13, 2022 at 12:38 AM Hans Petter Selasky >>> wrote: >>> >>>> On 3/12/22 16:31, Archimedes Gaviola wrote: >>>>>> >>>>>> IOERROR usually means an electrical error. The RPI3B will use a >>>>>> transaction translator for the FULL speed traffic, which is driven by >>>>>> software. >>>>> >>>> >>>> Hi Archimedes, >>>> >>>>> Hi Hans, >>>>> >>>>> I'm curious about the transaction translator you've mentioned, any >>>> idea why >>>>> there's a need for translation and what is being translated? >>>> >>>> When the High Speed USB HUB was invented, there was a need to support >>>> FULL and LOW speed USB transactions. Because FULL and LOW speed >>>> transactions are slow and take up much bandwidth, a transactions >>>> translator was invented which translates between High Speed USB and >>>> FULL/LOW speed USB. That means the RPi 3B consists of a single USB HIGH >>>> speed port, followed by a USB HUB. These transactions are not visible in >>>> usbdump . >>>> >>>> >Does this only >>>>> happen when RPi 3B (acting as host controller) is transmitting data to >>>> the >>>>> Epson printer? Are translation events visible in the usbdump? In this >>>> case >>>>> there's a way to possibly track what's going on and how to identify any >>>>> info that is being translated? >>>> >>>> By turning on the HC debugging, you can possibly track via debug >>>> messages what is going on. Maybe it is a timing issue, that the SW is >>>> too slow serving the micro transactions. >>>> >>>> Any idea also if translation is being >>>>> performed in RPi 4B? >>>> >>>> The later RPi's do the transaction translator bits in HW or via the XHCI >>>> block. >>>> >>>> As I have conducted several printing cases with my >>>>> Epson printer without any issues with either of the 4 ports. >>>>> >>>>> Sorry for these questions as I am catching-up to the USB technology >>>>> internal workings under the hood. >>>> >>>> You are welcome! >>>> >>> >>> >>> Thank you so much Hans for answering my questions, really appreciate it! >>> I have a much better understanding now. >>> >>> I came from testing with 13.0-RELEASE having the same RPi 3B hardware and >>> setup and it's very stable. I haven't encountered any IOERROR and >>> incomplete printed outputs that were encountered with 14.0-CURRENT >>> (February 24, 2022). By the way, I found in the repository here >>> https://download.freebsd.org/snapshots/arm64/aarch64/ISO-IMAGES/14.0/ >>> that there were two latest snapshots released dated March 3 and March 10, >>> respectively. I need to take printing tests first, especially the latest to >>> check if it also manifests before I go back to the Feb. 24 snapshot and do >>> a thorough test with debugging. I'll provide updates for any observations. >>> >>> Thanks, >>> Archimedes >>> >> >> >> Hi Hans, >> >> Initial testing conducted with the latest 14.0-CURRENT (March 10, 2022 >> snapshot) seems to be stable. Another test will be performed tomorrow. >> >> Thanks, >> Archimedes >> > > Hi Hans, > > I still encountered the issue this morning with 14.0-CURRENT (March 10, > 2022 snapshot). I just noticed when I left my RPi 3B idle for a long period > of time (2-3 hours and more) and started printing, then the issue pops-up. > Another concern I encountered was when I started enabling > hw.usb.dwc_otg.debug but after 1-2 minutes my USB keyboard and network > interface (remotely connected over SSH from my laptop) seemed to freeze and > I got disconnected. > > freebsd@generic:~ % uname -a > FreeBSD generic 14.0-CURRENT FreeBSD 14.0-CURRENT #0 > main-n253697-f1d450ddee6: Thu Mar 10 09:32:38 UTC 2022 > root@releng1.nyi.freebsd.org:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC > arm64 > > root@generic:~ # sysctl -w hw.usb.dwc_otg.debug=1 > hw.usb.dwc_otg.debug: 0 -> 1 > > See attached initial debug info (no printing testing yet). Hi, Nothing obvious there. Maybe you need to add a conditional to DPRINTF's in the fast path, to only print for a certain device, to reduce the debug prints. How many USB devices are connected? One experiment you might try is to comment out: usbd_transfer_submit(xfer); in uhub_intr_callback() in /usr/src/sys/dev/usb/usb_hub.c It will save some USB resources, but also makes USB enumeration a bit slower. Maybe the chip is out of USB HW endpoints and is only polling for RX data ... --HPS