Date: Tue, 16 Feb 2010 14:24:50 +0800 From: Adrian Chadd <adrian.chadd@gmail.com> To: smeagle@bsdler.de Cc: freebsd-mips@freebsd.org Subject: Re: rspro board and mounting root from SD Message-ID: <d763ac661002152224i7310a0d3q52bd93b64428297a@mail.gmail.com> In-Reply-To: <1265398292.2149.3.camel@brain.lan.terror.local> References: <d763ac661002042109o4522e5c1ia2eb51cf199bec75@mail.gmail.com> <20100204.222438.246077296855181113.imp@bsdimp.com> <d763ac661002042128g4eec226fue4011dc3195a86b@mail.gmail.com> <1265398292.2149.3.camel@brain.lan.terror.local>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <smeagle@bsdler.de> 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 <imp@bsdimp.com> 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" >> > > >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d763ac661002152224i7310a0d3q52bd93b64428297a>