From owner-freebsd-arm@FreeBSD.ORG Sat Oct 26 01:40:23 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 79E65DD5; Sat, 26 Oct 2013 01:40:23 +0000 (UTC) (envelope-from ssl.qlt@gmail.com) Received: from mail-bk0-x241.google.com (mail-bk0-x241.google.com [IPv6:2a00:1450:4008:c01::241]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CB8FA2F17; Sat, 26 Oct 2013 01:40:22 +0000 (UTC) Received: by mail-bk0-f65.google.com with SMTP id w14so276348bkz.8 for ; Fri, 25 Oct 2013 18:40:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=WoU9Netn8lyOkYJwetRV2VpJgEwwiUnevtBm8fO5Bzw=; b=DRtKVXm4oM6Rgj0NV7B5n+wMj54MBkqvLHcna9E4QHyE/Cfg3X8WKivBphEmBMhkGv HEXd5TvKAYoMNteVCrJvgRDrdXQpdmCb8vjMUZUkGTkWBUqY9uhcAONhGiKDw57w7kIx Bg2n0TWYYScbFNsgTikctyfKtKyIeD288kQYwQEu+Vsx3sxnQcxyjYo9ZTYoscYJMOQ4 ZGIRjclc2AjpEnv3ya2IenRATz5f0mt2dOGRm/R1j4LCs1bbDXF/XoR4lIpO436/4hc2 wZWc82Q+v29UdYJSWlQZ7KWksnJc7utLxDRsJ+N//5MhE8N9uM+8XMdMlI5cwhEOtEhI CZtw== MIME-Version: 1.0 X-Received: by 10.204.229.76 with SMTP id jh12mr231891bkb.44.1382751620929; Fri, 25 Oct 2013 18:40:20 -0700 (PDT) Received: by 10.204.231.209 with HTTP; Fri, 25 Oct 2013 18:40:20 -0700 (PDT) In-Reply-To: <1382738462.1170.153.camel@revolution.hippie.lan> References: <1382734990.1170.132.camel@revolution.hippie.lan> <1382738462.1170.153.camel@revolution.hippie.lan> Date: Fri, 25 Oct 2013 18:40:20 -0700 Message-ID: Subject: Re: Fwd: Dreamplug stable/10 usb - sd file transfer corruption error - cache related? From: Steven Lee To: Ian Lepore Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 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: Sat, 26 Oct 2013 01:40:23 -0000 Ian, thanks for taking a look to see if you can recreate the problem. In case it makes any difference in behavior, the command I used for the transfer was: (dump -0Lf - /) | (cd /mnt/flash_root ; restore -rf -) with /dev/da2s2 mounted at / and /dev/da0s2 mounted at /mnt/flash_root Regards, Steve On Fri, Oct 25, 2013 at 3:01 PM, Ian Lepore wrote: > That old advice was based on bugs in old code that has been fixed. I've > just been double-checking that the various fixes are in 10 (some of them > were things I submitted a PR for before I became a committer). I'm not > sure about the usb driver, but there have been big changes in the dma > cache coherency code between 9 and 10, although much of that is the > fixes I was alluding to. > > Basically what you're doing is a usb->usb copy, I'll see if I can > recreate the corruption on my dreamplug here the same way. > > -- Ian > > On Fri, 2013-10-25 at 14:38 -0700, Steven Lee wrote: > > ---------- Forwarded message ---------- > > From: Steven Lee > > Date: Fri, Oct 25, 2013 at 2:37 PM > > Subject: Re: Dreamplug stable/10 usb - sd file transfer corruption error > - > > cache related? > > To: Ian Lepore > > > > > > Ian, thanks for your reply. > > > > I am using the DREAMPLUG-1001 stock kernel config, and you are right the > > internal sd card shows up as a usb device, /dev/da0. > > > > As I mentioned, I tried modifying pmap.c as per one of your suggestions > to > > an earlier poster / problem, but it didn't seem to help the issue. I > > changed the pmap_pte_init_arm10() function to look like the > > pmap_pte_init_arm9() function. > > > > Any other thoughts about things to try? Since it seems like this is a > > regression between 9 and 10, are you aware of any specific cache related > > changes to the usb driver between the branches? > > > > - Steve > > > > > > On Fri, Oct 25, 2013 at 2:03 PM, Ian Lepore wrote: > > > > > 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 > > > > > > > > _______________________________________________ > > freebsd-arm@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-arm > > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org" > > >