From owner-freebsd-mips@freebsd.org Tue Dec 22 05:09:31 2015 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49B00A4DBC2 for ; Tue, 22 Dec 2015 05:09:31 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [78.47.246.247]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CE8D31B03; Tue, 22 Dec 2015 05:09:29 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221]) by hz.grosbein.net (8.14.9/8.14.9) with ESMTP id tBM59G7n086887 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 22 Dec 2015 06:09:18 +0100 (CET) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: adrian@freebsd.org Received: from eg.sd.rdtc.ru (eugen@localhost [127.0.0.1]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTP id tBM59Cdl032662; Tue, 22 Dec 2015 12:09:12 +0700 (KRAT) (envelope-from eugen@grosbein.net) Subject: Re: L2 cache management and busdma - or, "damnit USB, who you not like me" To: Adrian Chadd , "freebsd-mips@freebsd.org" References: From: Eugene Grosbein Message-ID: <5678DAF8.6000807@grosbein.net> Date: Tue, 22 Dec 2015 12:09:12 +0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM, T_DATE_IN_FUTURE_96_Q autolearn=no version=3.3.2 X-Spam-Report: * 0.0 T_DATE_IN_FUTURE_96_Q Date: is 4 days to 4 months after Received: * date * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 2.6 LOCAL_FROM From my domains X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on hz.grosbein.net X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 05:09:31 -0000 On 21.12.2015 12:02, Adrian Chadd wrote: > hi, > > I've been poking at the ci20 port to bring it up to > self-booting/running, and this involves using USB1 as a rootfs. Yeah, > I know, ohci, but that's what I have for now. > > Anyway, there was filesystem corruption, so I went digging into it and > found that we just weren't taking L2 cache line size into account when > doing the busdma bits. The JZ4780 SoC has 32 byte L1 lines, and 128 > byte L2 lines. Oops > > So, two things are needed: > > * for the ci20 port, which isn't in the mainline tree yet, we need to > use USB_HOST_ALIGN=128, and > * we need to teach the busdma code about the maximum line size, not > just the L1 line size. > > Here's a diff that does the latter: > > https://people.freebsd.org/~adrian/mips/mips-fix-dcache-busdma.diff > > I'm going to test this out on my L1-only platforms (read: atheros) tomorrow. > > Does anyone have any comments? Can that be the source of my USB problems? Total system hang while doing lots of umass I/O with TP-Link TL-WDR3600? If yes, I'd like to re-run my tests with these new patches.