Re: USB disks attach after rootfs prompt

2016-03-20 Thread Poul-Henning Kamp

In message <9901a1b3-1629-4bc7-9f2c-d5b0f1f2b...@freebsd.org>, =?utf-8?Q?Edward
_Tomasz_Napiera=C5=82a?= writes:

>That's seriously weird.  Did you see the messages about root mount waiting
>for usbusX, with the patch applied?  What's the hardware?

The hardware is BHYVE.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: USB disks attach after rootfs prompt

2016-03-20 Thread Edward Tomasz Napierała
Dnia 20.03.2016 o godz. 09:13 Poul-Henning Kamp  
napisał(a):

> 
> In message <20160319215624.ga1...@brick.home>, Edward Tomasz 
> =?utf-8?Q?Napiera=
> C5=82a?= writes:
> 
>>> I am somewhat certain that this used to work...
>> 
>> That might be my fault.
> 
> I built this kernel overnight:
> 
>FreeBSD 11.0-CURRENT #2 r297053: Sun Mar 20 02:47:38 UTC 2016
> 
> Now it doesn't find _any_ devices at the -a prompt.
> 
> Your suggested patch did not change that.

That's seriously weird.  Did you see the messages about root mount waiting for 
usbusX, with the patch applied?  What's the hardware?

___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Re: USB disks attach after rootfs prompt

2016-03-20 Thread Poul-Henning Kamp

In message <20160319215624.ga1...@brick.home>, Edward Tomasz =?utf-8?Q?Napiera=
C5=82a?= writes:

>> I am somewhat certain that this used to work...
>
>That might be my fault.

I built this kernel overnight:

FreeBSD 11.0-CURRENT #2 r297053: Sun Mar 20 02:47:38 UTC 2016

Now it doesn't find _any_ devices at the -a prompt.

Your suggested patch did not change that.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: USB disks attach after rootfs prompt

2016-03-19 Thread Edward Tomasz Napierała
On 0319T1509, Poul-Henning Kamp wrote:
> 
> In message <1458397972.68920.69.ca...@freebsd.org>, Ian Lepore writes:
> >On Sat, 2016-03-19 at 13:04 +, Poul-Henning Kamp wrote:
> >> Running:
> >> 
> >>FreeBSD 11.0-CURRENT #32 r296137: Sat Feb 27 11:34:01 UTC 2016
> >> 
> >> I tried "boot -a" and found that USB disks only attach *after* you
> >> enter some root filesystem.
> >> 
> >> That's not terribly useful.
> >
> >iirc, interrupts are disabled while you're at the mountroot prompt,
> >which freezes usb enumeration.
> 
> I am somewhat certain that this used to work...

That might be my fault.  I've modified the root mount mechanism to only
wait for the root mount tokens (ie USB) if the root device isn't already
there; basically this makes the kernel not wait for USB if rootfs is
on SATA.

Does the following fix things for you?  (Note there's something
seriously wrong with character echo, but it doesn't seem related.)

Index: svn/head/sys/kern/vfs_mountroot.c
===
--- svn/head/sys/kern/vfs_mountroot.c   (revision 297053)
+++ svn/head/sys/kern/vfs_mountroot.c   (working copy)
@@ -89,6 +89,7 @@ __FBSDID("$FreeBSD$");
 static int parse_mount(char **);
 static struct mntarg *parse_mountroot_options(struct mntarg *, const char *);
 static int sysctl_vfs_root_mount_hold(SYSCTL_HANDLER_ARGS);
+static void vfs_mountroot_wait(void);
 static int vfs_mountroot_wait_if_neccessary(const char *fs, const char *dev);
 
 /*
@@ -488,6 +489,8 @@ parse_dir_ask(char **conf)
char *mnt;
int error;
 
+   vfs_mountroot_wait();
+
printf("\nLoader variables:\n");
parse_dir_ask_printenv("vfs.root.mountfrom");
parse_dir_ask_printenv("vfs.root.mountfrom.options");

___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: USB disks attach after rootfs prompt

2016-03-19 Thread Justin Hibbits
On Sat, 19 Mar 2016 15:09:35 +
"Poul-Henning Kamp"  wrote:

> 
> In message <1458397972.68920.69.ca...@freebsd.org>, Ian Lepore writes:
> >On Sat, 2016-03-19 at 13:04 +, Poul-Henning Kamp wrote:  
> >> Running:
> >> 
> >>FreeBSD 11.0-CURRENT #32 r296137: Sat Feb 27 11:34:01 UTC
> >> 2016
> >> 
> >> I tried "boot -a" and found that USB disks only attach *after* you
> >> enter some root filesystem.
> >> 
> >> That's not terribly useful.  
> >
> >iirc, interrupts are disabled while you're at the mountroot prompt,
> >which freezes usb enumeration.  
> 
> I am somewhat certain that this used to work...
> 
> 

Tunable vfs.mountroot.timeout may be what you're looking for.  By
default it waits for 3 seconds, but for USB it's suggested 10s or more,
from what I recall.

- Justin
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: USB disks attach after rootfs prompt

2016-03-19 Thread Poul-Henning Kamp

In message <1458397972.68920.69.ca...@freebsd.org>, Ian Lepore writes:
>On Sat, 2016-03-19 at 13:04 +, Poul-Henning Kamp wrote:
>> Running:
>> 
>>  FreeBSD 11.0-CURRENT #32 r296137: Sat Feb 27 11:34:01 UTC 2016
>> 
>> I tried "boot -a" and found that USB disks only attach *after* you
>> enter some root filesystem.
>> 
>> That's not terribly useful.
>
>iirc, interrupts are disabled while you're at the mountroot prompt,
>which freezes usb enumeration.

I am somewhat certain that this used to work...


-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: USB disks attach after rootfs prompt

2016-03-19 Thread Ian Lepore
On Sat, 2016-03-19 at 13:04 +, Poul-Henning Kamp wrote:
> Running:
> 
>   FreeBSD 11.0-CURRENT #32 r296137: Sat Feb 27 11:34:01 UTC 2016
> 
> I tried "boot -a" and found that USB disks only attach *after* you
> enter some root filesystem.
> 
> That's not terribly useful.
> 

iirc, interrupts are disabled while you're at the mountroot prompt,
which freezes usb enumeration.  It should do a sleep/pause every time
you enter '.', which should allow the interrupt-driven enumeration to
finish.  It's been a long time since I've done it, but it seems to
still work... I just plugged in a usb drive while I was at the prompt
and it didn't show up until the second time I entered a '.'.

-- Ian
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"