Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Sep 2022 09:09:10 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        freebsd-arm <freebsd-arm@freebsd.org>
Subject:   FYI: RPi4B's and such: VLI_SS_BULK_OUT_BUG quirk handling vs. VL805 (linux example)
Message-ID:  <34A55B2A-1351-4D9A-B5E1-536F32F5F559@yahoo.com>
References:  <34A55B2A-1351-4D9A-B5E1-536F32F5F559.ref@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 =E2=80=A6 =
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 <jonathan@raspberrypi.com>
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.
		 */

=3D=3D=3D
Mark Millard
marklmi at yahoo.com




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?34A55B2A-1351-4D9A-B5E1-536F32F5F559>