From owner-freebsd-arm@FreeBSD.ORG Fri Oct 25 21:03:14 2013 Return-Path: Delivered-To: freebsd-arm@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1C13C2B7 for ; Fri, 25 Oct 2013 21:03:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E518C2179 for ; Fri, 25 Oct 2013 21:03:13 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1VZoXI-000JO7-Lg; Fri, 25 Oct 2013 21:03:12 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r9PL3Am6047075; Fri, 25 Oct 2013 15:03:10 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18DtOz1bc0HSwc4EHJkRc9d Subject: Re: Dreamplug stable/10 usb - sd file transfer corruption error - cache related? From: Ian Lepore To: Steven Lee In-Reply-To: References: Content-Type: text/plain; charset="us-ascii" Date: Fri, 25 Oct 2013 15:03:10 -0600 Message-ID: <1382734990.1170.132.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: freebsd-arm@FreeBSD.org X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 21:03:14 -0000 On Fri, 2013-10-25 at 13:37 -0700, Steven Lee wrote: > Hello, > > In the process of upgrading my Dreamplug from the stable/9 branch to the > stable/10 branch, I have run into a fairly > significant file corruption problem. The steps that create this problem > are as follows: > > 1. Cross-compile the kernel and buildworld from the stable/10 branch on a > separate host. > 2. Install the kernel and installworld on a usb stick drive > 3. Boot the Dreamplug from the usb drive > > There are no problems that show up to this point, the Dreamplug boots with > no errors. > > 4. Copy the kernel from the usb drive to the internal sd card > 5. Copy the root filesystem from the usb drive to the internal sd card > using (dump | restore) > > It is at step 5 that the error manifests itself, as I found that > approximately 20 shell scripts in the /etc/rc.d directory > had been randomly corrupted with strings of null characters (in groups of > 32). I assume that the rest of the file system > was compromised in a similar fashion. The bug is repeatable, however the > corruption is somewhat random, so > each time different files are corrupted in different places. > > When I followed the exact same steps from the stable/9 branch, the problem > did not occur, so there is clearly some > type of regression error between the 9 and 10 branches. > > After searching through the arm mailing list, I attempted to work around > the problem by: > - mounting the file systems with -o noclusterr -o noclusterrw > - mounting the file systems with -o sync > - as per comments on bug arm/158950, attempted to modify the pmap.c > functions to change the cache from > write-back mode to write-through mode > > but all of these attempts were ineffective. > > Given that I am relatively new to FreeBSD, I was hoping to get any insights > as to any next steps that might make > sense in terms of either working around the problem, narrowing down the > bug, or any obvious rookie mistakes I > am making before I give up and revert back to the 9 branch. > > Thanks for your help! > > Regards, On my dreamplug (model 1001) both the internal and external sd cards are actually usb devices (they show up as /dev/da0 and da1, not mmcsd0/1). I'm not sure if that's true on all models or not. Are you using the stock kernel config (DREAMPLUG-1001)? If not, have you got "option USB_HOST_ALIGN=32" in your kernel config? Corruption in 32 byte chunks is almost always partial cacheline flush problems, but I haven't seen that happen on dreamplug for a long time (and when I did see it, it was with a sata drive). -- Ian