From owner-freebsd-mips@FreeBSD.ORG Thu Mar 4 06:34:30 2010 Return-Path: Delivered-To: freebsd-mips@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F0F3106564A; Thu, 4 Mar 2010 06:34:30 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id ED7588FC08; Thu, 4 Mar 2010 06:34:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o246RF0A094815; Wed, 3 Mar 2010 23:27:15 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 03 Mar 2010 23:27:32 -0700 (MST) Message-Id: <20100303.232732.886714142388177854.imp@bsdimp.com> To: adrian@FreeBSD.org From: "M. Warner Losh" In-Reply-To: References: <20100303235333.794674a4@kan.dnsalias.net> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-mips@FreeBSD.org Subject: Re: Missing hack to resolve umass issues on RouterStation Pro X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2010 06:34:30 -0000 In message: Adrian Chadd writes: : On 4 March 2010 12:53, Alexander Kabaev wrote: : > Hi, : > : > in order to fix issues with umass on RouterStation Pro, I had to : > fix/hack the kenel in two places. One was related in the way we handled : > partial cache line invaidations and I committed it to -current already : > as http://svn.freebsd.org/changeset/base/203080. : > : > Another one is a hack that is not suitable for inclusion into official : > sources, but still is good enough to get RouterStation Pro to work : > reliably. Get it from here: : > : > http://people.freebsd.org/~kan/usb_rspro.diff : > : > I would appreciate if people who still have issues getting their : > USB-attached storage working reliably with RSPro can test it and report : > success/failure. : : It works fine for me. I do see occasional segfault-on-exec which I : wonder whether is due to USB or VM/TLB magic; this smells somewhat : like it could be both. I'll have to re-test things on an NFS root (and : hope there's not MIPS/rspro-y issues with the NFS and NIC code. :) That's weird, and something we should track to ground.. : Is this USB alignment patch something that is needed for all MIPS/USB : stuff, or just this specific SoC. If so, why? And will it potentially : be an issue with other SoCs? It is a fundamental flaw in the USB stack. It co-locates data about the transfer and the data from the transfer within a cache-line without the change. As such, bad thing happen to one set of data depending on the scenario. The patch pushes the two apart. All MIPS chips likely suffer from this problem, although their cache line sizes differ. We should export cache-line size in an MI variable from MD code for all CPUs. The USB code should use that to allocate properly aligned data and meta-data buffers for the transfers. Warner