From owner-freebsd-mips@FreeBSD.ORG Tue Feb 16 06:24:51 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 E99DC1065670 for ; Tue, 16 Feb 2010 06:24:51 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-iw0-f175.google.com (mail-iw0-f175.google.com [209.85.223.175]) by mx1.freebsd.org (Postfix) with ESMTP id A6D968FC08 for ; Tue, 16 Feb 2010 06:24:51 +0000 (UTC) Received: by iwn5 with SMTP id 5so2494669iwn.9 for ; Mon, 15 Feb 2010 22:24:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=j1pHBA9oyv/uETQTPSunMqqHvZHlP3p51qwsfdhbUCE=; b=Jb0l7tUn6fBbJUdFZA20c31Wkrut7FHA8jdCj06fP/PeniCJRH4Flx3g8oDWm1mWPJ eBLVu64BNwkzhBHFkqU7uwV2NJEVEVlrmEHprTIZeOPOh+7gonE1/CHEL9AOX9AVu0Mp iNrzbR2Qt6J1CjLxDLi9v70OdxlV+qQscLG/Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=uWAmLUpNclJ2VrsHX/erjdNBTtdzMjkl7x5sZtHBG2oViFJeR5wG5ffruZlHe8PQVQ haLqeHofl6kTKDQZVtacHfZvGicwY63elOAt9z+HY6CfVpFdS0AeooSPDrdpNvln8eRU zApFrld4qlOe/XjvZ2j+wwYQ1cUfYXg9P5LoM= MIME-Version: 1.0 Received: by 10.231.85.198 with SMTP id p6mr6571436ibl.65.1266301490899; Mon, 15 Feb 2010 22:24:50 -0800 (PST) In-Reply-To: <1265398292.2149.3.camel@brain.lan.terror.local> References: <20100204.222438.246077296855181113.imp@bsdimp.com> <1265398292.2149.3.camel@brain.lan.terror.local> Date: Tue, 16 Feb 2010 14:24:50 +0800 Message-ID: From: Adrian Chadd To: smeagle@bsdler.de Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-mips@freebsd.org Subject: Re: rspro board and mounting root from SD 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: Tue, 16 Feb 2010 06:24:52 -0000 Thanks, I'll just (ab)use this method of delaying the root mounting hackery until the umass child gets a chance to finishing probing. A "better" solution (eg enumerating which USB children need to finish probing and adding them in with relevant notification) may take a bit more hackery than I was hoping for. Maybe slicing something hackish into CAM would be evil but more generic.. thanks, Adrian On 6 February 2010 03:31, Florian Kruegl wrote: > Hi Adrian, > > got it running from sd card for a few month now without probs. Flash > seemed to small for putting freebsd on. > > seems to be a reace condition until usb mas registers scsi device. > > one second is nuff... > > brain:head> svn diff > Index: sys/kern/vfs_mount.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys/kern/vfs_mount.c =A0 =A0 =A0 =A0(revision 203445) > +++ sys/kern/vfs_mount.c =A0 =A0 =A0 =A0(working copy) > @@ -72,6 +72,9 @@ > =A0#define =A0 =A0 =A0 =A0ROOTNAME =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"root_d= evice" > =A0#define =A0 =A0 =A0 =A0VFS_MOUNTARG_SIZE_MAX =A0 (1024 * 64) > > +static int =A0 =A0 mount_root_delay =3D 4; > +TUNABLE_INT("mount_root_delay", &mount_root_delay); > + > =A0static void =A0 =A0set_rootvnode(void); > =A0static int =A0 =A0 vfs_domount(struct thread *td, const char *fstype, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0char *fspath, int fsflags, void *f= sdata); > @@ -1409,13 +1412,18 @@ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0PICKUP_GIANT(); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0mtx_lock(&mountlist_mtx); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (LIST_EMPTY(&root_holds)) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 mtx_unlock(&mountlist_mtx); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if(0 =3D=3D mount_root_delay--) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 mtx_unlock(&mountli= st_mtx); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (ppsratecheck(&lastfail, &curfail, 1)) = { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0printf("Root mount waiting= for:"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0LIST_FOREACH(h, &root_hold= s, list) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0printf(" %= s", h->who); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if(LIST_EMPTY(&root_holds))= { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 printf(" %d secs...= ", mount_root_delay); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0printf("\n"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0msleep(&root_holds, &mountlist_mtx, PZERO = | PDROP, "roothold", > > On Fri, 2010-02-05 at 13:28 +0800, Adrian Chadd wrote: >> On 5 February 2010 13:24, M. Warner Losh wrote: >> >> > : If I stick a root_mount_hold() call in umass_attach(), the umass >> > : device is given the opportunity to complete probe/attach but obvious= ly >> > : then a lack of root_mount_rel() results in nothing completing. >> > >> > Where did you put this? >> >> After the call to umass_cam_attach() in umass_attach() >> >> >> >> >> Adrian >> _______________________________________________ >> freebsd-mips@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-mips >> To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org" >> > > >