From nobody Sun Sep 18 06:42: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 4MVdXR3SHdz4c5nj for ; Sun, 18 Sep 2022 06:42:31 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic315-8.consmr.mail.gq1.yahoo.com (sonic315-8.consmr.mail.gq1.yahoo.com [98.137.65.32]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 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 4MVdXQ1TTMz3hJ8 for ; Sun, 18 Sep 2022 06:42:30 +0000 (UTC) (envelope-from marklmi@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1663483347; bh=Q28Gw2bYV5bu4qGL/YdFRDOtrxEFEA5thD5rHWE1qrI=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=huGHmfTzgJ/EOJozC01cP2iGiW0jBsBjBm1Plv4mRAhSaw/KuxtFmB6CkL/9wSiB2CDi9gAFlL1EHPBd3oDIJiWWtYJm6S1AnluYhUJAhYb3/BiFYhQLVyDhk6GqP1i+cKCdhh168eoW0ZrdPnKMv9MerPrgUhwxWl+ZvqzhF51pftB+OrOWDFPMi6F5Gk+0v8stuFPce9O/Yz1kRUF8foYE2qLWZe4oyKarDiyiWfki3OhjrQaeUxWMQSEWPOmBAVLfngHW0jlbQUKHnRipbFVPt9PBeh6NGYFEOb008ckwA1S0zO62Tx5swhGw8dMnItRsZBxyew4jK6OESJv5Fg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1663483347; bh=PNtLvggp7/hqNzRMOjwbTLZ+gC4BYVDsxXU8Kd4j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H.PqTxSU0LPEdKRzEG2APIV0JxPvCVAqtaKGt03oS40bDEfrTzm 8USOKS1VwER4gxSH88X4eYwWMl9DMG0K3gi9xVNkz.UNPaRJqbLeYw1GuJgx0wRe_BPdiXrx4ZQG sXeYx4IKUKICJ0wQpdbI4NJ6W09jdDPJJwDNf0QDBWebOyGfSnlt1HwCAWFQhP2jNwWOv3SX6QvK f.qFat5kPJ6tM7h_1T0dPTYG7.m_z7aES0dI7qsf8SzaHzCXvGkKX45P4JELSGEWLfttRkRswzc2 2ygZ5JrAsXX6kofww4B3cUgQzi660EWheSW9GA4FIHMFLQmH2LNFHfGgaHv3iz8SWkhQW1jNXmNq MbdE3MyNbcD1MUJu8gskTvVI3Pt74zW6KPso3h7MRyAKtS5Z.DmldmxDpdzaO31aPjmaKqx1LGwJ kBPmmYY0hS9BuhAb0ptlLg0uECWlXrTBQ9gCFfddjjbTymqlBJD.S0AleH6IN0sZZAMSsxKvi_qL eOwHjHnGZwaeZkPzJlEYJrDfF9gUKhi4LDieVjHZIcBFSZj8bhZdq_RqHDAdNM4t63vvFaqZieut TzQ-- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.gq1.yahoo.com with HTTP; Sun, 18 Sep 2022 06:42:27 +0000 Received: by hermes--production-ne1-544744cc75-zkxbp (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID d56076e61afe2d1147e1c54fb6d71ff4; Sun, 18 Sep 2022 06:42:21 +0000 (UTC) Content-Type: text/plain; charset=utf-8 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 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: FYI: RPi4B's and such: VLI_SS_BULK_OUT_BUG quirk handling vs. VL805 (linux example) From: Mark Millard In-Reply-To: <6babc840-0efa-8e89-4273-1a835f06edb7@selasky.org> Date: Sat, 17 Sep 2022 23:42:20 -0700 Cc: freebsd-arm Content-Transfer-Encoding: quoted-printable Message-Id: References: <34A55B2A-1351-4D9A-B5E1-536F32F5F559.ref@yahoo.com> <34A55B2A-1351-4D9A-B5E1-536F32F5F559@yahoo.com> <6babc840-0efa-8e89-4273-1a835f06edb7@selasky.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4MVdXQ1TTMz3hJ8 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=huGHmfTz; dmarc=pass (policy=reject) header.from=yahoo.com; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.65.32 as permitted sender) smtp.mailfrom=marklmi@yahoo.com X-Spamd-Result: default: False [-1.07 / 15.00]; NEURAL_SPAM_SHORT(1.00)[0.998]; NEURAL_HAM_LONG(-0.92)[-0.922]; NEURAL_HAM_MEDIUM(-0.64)[-0.643]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; RCVD_IN_DNSWL_NONE(0.00)[98.137.65.32:from]; TO_DN_ALL(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; MIME_TRACE(0.00)[0:+]; MLMMJ_DEST(0.00)[freebsd-arm@freebsd.org] X-ThisMailContainsUnwantedMimeParts: N On 2022-Sep-17, at 23:05, Hans Petter Selasky wrote: > 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 =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 >> 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 >=20 > Hi, >=20 > It doesn't make sense that this only applies to USB mass storage = devices. Doesn't it apply to all SuperSpeed USB BULK transfers? No clue. > What about other OS'es, do they also get a fix? >=20 I doubt that the raspberry pi folks will go around fixing non-linux kernels directly. I do see evidence of the XHCI_VLI_SS_BULK_OUT_BUG name existing in some other linux kernels and past adjustments by them to track past changes by the raspberry pi folks. However, https://elixir.bootlin.com/linux/latest/A/ident/XHCI_VLI_SS_BULK_OUT_BUG does not find the symbol so linux does not have it in general. (I'd not known of renaming or the like.) =3D=3D=3D Mark Millard marklmi at yahoo.com