From nobody Sun Sep 18 06:05:40 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 4MVck23l2rz4bypZ for ; Sun, 18 Sep 2022 06:05:46 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (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 4MVck14510z3Smt for ; Sun, 18 Sep 2022 06:05:45 +0000 (UTC) (envelope-from hps@selasky.org) Received: from [10.3.0.9] (unknown [178.232.223.95]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id C89B8260A4F; Sun, 18 Sep 2022 08:05:43 +0200 (CEST) Message-ID: <6babc840-0efa-8e89-4273-1a835f06edb7@selasky.org> Date: Sun, 18 Sep 2022 08:05:40 +0200 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:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: FYI: RPi4B's and such: VLI_SS_BULK_OUT_BUG quirk handling vs. VL805 (linux example) Content-Language: en-US To: Mark Millard , freebsd-arm References: <34A55B2A-1351-4D9A-B5E1-536F32F5F559.ref@yahoo.com> <34A55B2A-1351-4D9A-B5E1-536F32F5F559@yahoo.com> From: Hans Petter Selasky In-Reply-To: <34A55B2A-1351-4D9A-B5E1-536F32F5F559@yahoo.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4MVck14510z3Smt X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-1.19 / 15.00]; NEURAL_SPAM_SHORT(0.99)[0.991]; NEURAL_HAM_LONG(-0.98)[-0.981]; NEURAL_HAM_MEDIUM(-0.90)[-0.897]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net:c]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_TO(0.00)[yahoo.com,freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[freebsd-arm@freebsd.org]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/32, country:DE]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; DMARC_NA(0.00)[selasky.org]; FROM_HAS_DN(0.00)[]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On 9/17/22 18:09, Mark Millard wrote: > https://github.com/raspberrypi/linux/pull/5173 reports: > > QUOTE > After several months back-and-forth with VIA, we have a candidate root-cause for #4844 and a suggested fix. My known-bad pendrive now gets written to endlessly without suffering data corruption. > END QUOTE > > and: > > QUOTE > usb: xhci: expand mitigations for VLI_SS_BULK_OUT_BUG quirk … c9e051a > > The VL805 can cause data corruption if a SS Bulk OUT endpoint enters a > flow-control condition and there are TRBs in the transfer ring that are > not an integral size of wMaxPacket and the endpoint is behind one or more > hubs. > > This is frequently the case encountered when FAT32 filesystems are > present on mass-storage devices with cluster sizes of 1 sector, and the > filesystem is being written to with an aggregate of small files. > > The initial implementation of this quirk separated TRBs that didn't > adhere to this limitation into two - the first a multiple of wMaxPacket > and the second the 512-byte remainder - in an attempt to force TD > fragments to align with packet boundaries. This reduced the incidence > rate of data corruption but did not resolve it. > > The fix as recommended by VIA is to disable bursts if this sequence of > TRBs can occur. > > Limit turning off bursts to just USB mass-storage devices by searching > the device's configuration for an interface with a class type of > USB_CLASS_MASS_STORAGE. > > Signed-off-by: Jonathan Bell > END QUOTE > > and the drivers/usb/host/xhci-mem.c change has the comments: > > > /* > * VL805 errata - Bulk OUT bursts to superspeed mass-storage > * devices behind hub ports can cause data corruption with > * non-wMaxPacket-multiple transfers. > */ > . . . > > /* > * Slight hack - look at interface altsetting 0, which > * should be the UMS bulk-only interface. If the class > * matches, then we disable out bursts for all OUT > * endpoints because endpoint assignments may change > * between alternate settings. > */ > > === > Mark Millard > marklmi at yahoo.com > > Hi, It doesn't make sense that this only applies to USB mass storage devices. Doesn't it apply to all SuperSpeed USB BULK transfers? What about other OS'es, do they also get a fix? --HPS