From owner-freebsd-mips@freebsd.org Tue Dec 22 08:12:56 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 CF37FA14E01 for ; Tue, 22 Dec 2015 08:12:56 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x231.google.com (mail-ig0-x231.google.com [IPv6:2607:f8b0:4001:c05::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0E99115C for ; Tue, 22 Dec 2015 08:12:56 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x231.google.com with SMTP id to4so54901241igc.0 for ; Tue, 22 Dec 2015 00:12:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=oIiGK8T/J0uBqtpyzsJAiLTYu4qGah55J3TmpTq8t0s=; b=QtlHC7PxpRJV9hAf6Gv1phaevkBLkZW2n3ESRBLfxdRGS7YZiAvxN5JQU+VL2iTMib BkKODYghHcxZMeb5XnOaB8v4R0JkNk9R6dZ8Su33YiI0/n9Zs0kUs5a6xACGMn2gk0v9 PIinys7gNDi5upMzdHOU3bPtxrTwt35bDb0wYIM69ZoXSWFm8tJiiX5fYQ4Noo2yDpDo XDa5gxSicl4O7XuKoeREqVWc6OtioQuy8yBSzEm3J6TFQh/tNG+mI294vQ163A5RaZHr U6vckAs32UIcUV2m/K6uwRaP0FYKXPkvX1xzQtuXnBMo1B/ay0SBY4fJMZu3t8H06Oz5 lhUA== MIME-Version: 1.0 X-Received: by 10.50.33.69 with SMTP id p5mr21686581igi.61.1450771976034; Tue, 22 Dec 2015 00:12:56 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.121.202 with HTTP; Tue, 22 Dec 2015 00:12:55 -0800 (PST) In-Reply-To: <5678DAF8.6000807@grosbein.net> References: <5678DAF8.6000807@grosbein.net> Date: Tue, 22 Dec 2015 00:12:55 -0800 X-Google-Sender-Auth: s71KLq0y6jiZgSEEmmsGE5ZK8dg Message-ID: Subject: Re: L2 cache management and busdma - or, "damnit USB, who you not like me" From: Adrian Chadd To: Eugene Grosbein Cc: "freebsd-mips@freebsd.org" Content-Type: text/plain; charset=UTF-8 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 08:12:56 -0000 hi, It shouldn't be - the atheros mips doesn't have l2 cache. I wish I could reproduce your issue. :( -a On 21 December 2015 at 21:09, Eugene Grosbein wrote: > 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. >