Re: how can I make freebsd wait for usb to become active? Or delay mountroot?

2017-02-14 Thread tech-lists
On 13/02/2017 19:10, Paul Mather wrote:
> 
> This topic cropped up on the freebsd-arm mailing list very recently.
> One solution is to add this to /boot/loader.conf:
> 
> kern.cam.boot_delay="1"
> 
> That instructs the system to wait 10 seconds (1 milliseconds)
> during boot to give time for the CAM subsystem probes to complete.
> (USB storage devices use the CAM subsystem.)

>> vfs.root_mount_always_wait=1 loader tunable.  The knob should be
>> merged to 11 in two weeks.

I'll try that second suggestion as I'm already past r313350

thanks for the advice

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


Re: how can I make freebsd wait for usb to become active? Or delay mountroot?

2017-02-13 Thread Chris H
On Mon, 13 Feb 2017 19:00:39 + tech-lists  wrote

> Hello stable@,
> 
> system: 11-stable r313553
> 
> In the kernel there is an option for scsi delay.
It should be enough to bump the kern.cam.scsi_delay=
a couple hundred at a time, until you find the "sweet spot".
You might also try the autoboot_delay= option instead. It
might give your USB port enough time to come ready.

> Is there also one for
> usb? Perhaps not in the kernel but elsewhere. I can't find it.
> 
> The problem is seen especially where the bootable device is usb. The
> boot process starts and dumps me at mountroot where I wait for a short
> time until the usb stick is properly detected (bright white writing at
> the console). The usb stick is plugged into a usb3 port. For example:
> 
> [snip]
> 
> usbus0: 5.0Gbps Super Speed USB v3.0
> usbus1: 12Mbps Full Speed USB v1.0
> usbus2: 480Mbps High Speed USB v2.0
> usbus3: 12Mbps Full Speed USB v1.0
> ugen0.1: <0x1022 XHCI root HUB> at usbus0
> uhub0: <0x1022 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0
> ugen1.1:  at usbus1
> uhub1:  on usbus1
> ugen2.1:  at usbus2
> uhub2:  on usbus2
> ugen3.1:  at usbus3
> uhub3:  on usbus3
> usbus4: 480Mbps High Speed USB v2.0
> ugen4.1:  at usbus4
> uhub4:  on usbus4
> acpi_tz0: _CRT value is absurd, ignored (255.1C)
> ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
> ada0:  ACS-2 ATA SATA 3.x device
> cd0 at ahcich1 bus 0 scbus1 target 0 lun 0
> cd0:  Removable CD-ROM SCSI device
> cd0: Serial Number 1415TP277450E0H6H
> cd0: 150.000MB/s transfers (SATA 1.x, UDMA5, ATAPI 12bytes, PIO 8192bytes)
> cd0: Attempt to query device size failed: NOT READY, Medium not present
> - tray open
> ada0: Serial Number JA1006103G0ALV
> ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
> ada0: Command Queueing enabled
> ada0: 953869MB (1953525168 512 byte sectors)
> SMP: AP CPU #3 Launched!
> SMP: AP CPU #1 Launched!
> SMP: AP CPU #2 Launched!
> Timecounter "TSC" frequency 1597045198 Hz quality 1000
> Trying to mount root from ufs:/dev/da0p2 [rw]...
> uhub3: 5 ports with 5 removable, self powered
> uhub1: 5 ports with 5 removable, self powered
> uhub0: 4 ports with 4 removable, self powered
> Root mount waiting for: usbus4 usbus2 usbus0
> ugen0.2:  at usbus0
> umass0 on uhub0
> umass0: 
> on usbus0
> umass0:  SCSI over Bulk-Only; quirks = 0x8100
> umass0:3:0: Attached to scbus3
> uhub2: 5 ports with 5 removable, self powered
> uhub4: 5 ports with 5 removable, self powered
> ugen0.3:  at usbus0
> ukbd0 on uhub0
> ukbd0:  on usbus0
> kbd2 at ukbd0
> Root mount waiting for: usbus4
> ugen4.2:  at usbus4
> mountroot: waiting for device /dev/da0p2...
> Mounting from ufs:/dev/da0p2 failed with error 19.
> 
> Loader variables:
>   vfs.root.mountfrom=ufs:/dev/da0p2
>   vfs.root.mountfrom.options=rw
> 
> Manual root filesystem specification:
>   : [options]
>   Mount  using filesystem 
>   and with the specified (optional) option list.
> 
> eg. ufs:/dev/da0s1a
> zfs:tank
> cd9660:/dev/cd0 ro
>   (which is equivalent to: mount -t cd9660 -o ro /dev/cd0 /)
> 
>   ?   List valid disk boot devices
>   .   Yield 1 second (for background tasks)
>   Abort manual input
> 
> mountroot> Trying to mount root from ufs:/dev/da0p2 []...
> mountroot: waiting for device /dev/da0p2...
> Mounting from ufs:/dev/da0p2 failed with error 19.
> 
> mountroot>
> 
> [snip]
> 
> Then this happens:
> 
> (probe0:umass-sim0:0:0:0): INQUIRY. CDB: 12 00 00 00 24 00
> (probe0:umass-sim0:0:0:0): CAM status: CCB request completed with an error
> (probe0:umass-sim0:0:0:0): Retrying command
> da0 at umass-sim0 bus 0 scbus3 target 0 lun 0
> da0: < USB DISK 3.0 PMAP> Removable Direct Access SPC-4 SCSI device
> da0: Serial Number 070B4722335D3288
> da0: 400.000MB/s transfers
> da0: 30176MB (61800448 512 byte sectors)
> da0: quirks=0x3
> 
> so now at the mountroot prompt I enter ufs:/dev/da0p2 (which is a value
> that mountroot already had) and carry on booting:
> 
> mountroot> Trying to mount root from ufs:/dev/da0p2 []...
> re0: link state changed to DOWN
> re0: link state changed to UP
> ums0 on uhub0
> ums0:  on usbus0
> ums0: 16 buttons and [XYZT] coordinates ID=2
> uhid0 on uhub0
> uhid0:  on usbus0
> 
> [...]
> 
> The same sort of thing happens on an 11-stable r313043 desktop, only
> this time I'm not booting from usb. The system comes up, I get a login
> prompt, then five or ten seconds later usb wakes up having detected the
> usb3 external HD.
> 
> How can I fix this?
> 
> thanks,
> -- 
> J.
> ___
> freebsd-stable@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-stable
> To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


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

Re: how can I make freebsd wait for usb to become active? Or delay mountroot?

2017-02-13 Thread Paul Mather
On Feb 13, 2017, at 2:00 PM, tech-lists  wrote:

> Hello stable@,
> 
> system: 11-stable r313553
> 
> In the kernel there is an option for scsi delay. Is there also one for
> usb? Perhaps not in the kernel but elsewhere. I can't find it.
> 
> The problem is seen especially where the bootable device is usb. The
> boot process starts and dumps me at mountroot where I wait for a short
> time until the usb stick is properly detected (bright white writing at
> the console). The usb stick is plugged into a usb3 port. For example:
> 
> [snip]
> 
> usbus0: 5.0Gbps Super Speed USB v3.0
> usbus1: 12Mbps Full Speed USB v1.0
> usbus2: 480Mbps High Speed USB v2.0
> usbus3: 12Mbps Full Speed USB v1.0
> ugen0.1: <0x1022 XHCI root HUB> at usbus0
> uhub0: <0x1022 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0
> ugen1.1:  at usbus1
> uhub1:  on usbus1
> ugen2.1:  at usbus2
> uhub2:  on usbus2
> ugen3.1:  at usbus3
> uhub3:  on usbus3
> usbus4: 480Mbps High Speed USB v2.0
> ugen4.1:  at usbus4
> uhub4:  on usbus4
> acpi_tz0: _CRT value is absurd, ignored (255.1C)
> ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
> ada0:  ACS-2 ATA SATA 3.x device
> cd0 at ahcich1 bus 0 scbus1 target 0 lun 0
> cd0:  Removable CD-ROM SCSI device
> cd0: Serial Number 1415TP277450E0H6H
> cd0: 150.000MB/s transfers (SATA 1.x, UDMA5, ATAPI 12bytes, PIO 8192bytes)
> cd0: Attempt to query device size failed: NOT READY, Medium not present
> - tray open
> ada0: Serial Number JA1006103G0ALV
> ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
> ada0: Command Queueing enabled
> ada0: 953869MB (1953525168 512 byte sectors)
> SMP: AP CPU #3 Launched!
> SMP: AP CPU #1 Launched!
> SMP: AP CPU #2 Launched!
> Timecounter "TSC" frequency 1597045198 Hz quality 1000
> Trying to mount root from ufs:/dev/da0p2 [rw]...
> uhub3: 5 ports with 5 removable, self powered
> uhub1: 5 ports with 5 removable, self powered
> uhub0: 4 ports with 4 removable, self powered
> Root mount waiting for: usbus4 usbus2 usbus0
> ugen0.2:  at usbus0
> umass0 on uhub0
> umass0: 
> on usbus0
> umass0:  SCSI over Bulk-Only; quirks = 0x8100
> umass0:3:0: Attached to scbus3
> uhub2: 5 ports with 5 removable, self powered
> uhub4: 5 ports with 5 removable, self powered
> ugen0.3:  at usbus0
> ukbd0 on uhub0
> ukbd0:  on usbus0
> kbd2 at ukbd0
> Root mount waiting for: usbus4
> ugen4.2:  at usbus4
> mountroot: waiting for device /dev/da0p2...
> Mounting from ufs:/dev/da0p2 failed with error 19.
> 
> Loader variables:
>  vfs.root.mountfrom=ufs:/dev/da0p2
>  vfs.root.mountfrom.options=rw
> 
> Manual root filesystem specification:
>  : [options]
>  Mount  using filesystem 
>  and with the specified (optional) option list.
> 
>eg. ufs:/dev/da0s1a
>zfs:tank
>cd9660:/dev/cd0 ro
>  (which is equivalent to: mount -t cd9660 -o ro /dev/cd0 /)
> 
>  ?   List valid disk boot devices
>  .   Yield 1 second (for background tasks)
>  Abort manual input
> 
> mountroot> Trying to mount root from ufs:/dev/da0p2 []...
> mountroot: waiting for device /dev/da0p2...
> Mounting from ufs:/dev/da0p2 failed with error 19.
> 
> mountroot>
> 
> [snip]
> 
> Then this happens:
> 
> (probe0:umass-sim0:0:0:0): INQUIRY. CDB: 12 00 00 00 24 00
> (probe0:umass-sim0:0:0:0): CAM status: CCB request completed with an error
> (probe0:umass-sim0:0:0:0): Retrying command
> da0 at umass-sim0 bus 0 scbus3 target 0 lun 0
> da0: < USB DISK 3.0 PMAP> Removable Direct Access SPC-4 SCSI device
> da0: Serial Number 070B4722335D3288
> da0: 400.000MB/s transfers
> da0: 30176MB (61800448 512 byte sectors)
> da0: quirks=0x3
> 
> so now at the mountroot prompt I enter ufs:/dev/da0p2 (which is a value
> that mountroot already had) and carry on booting:
> 
> mountroot> Trying to mount root from ufs:/dev/da0p2 []...
> re0: link state changed to DOWN
> re0: link state changed to UP
> ums0 on uhub0
> ums0:  on usbus0
> ums0: 16 buttons and [XYZT] coordinates ID=2
> uhid0 on uhub0
> uhid0:  on usbus0
> 
> [...]
> 
> The same sort of thing happens on an 11-stable r313043 desktop, only
> this time I'm not booting from usb. The system comes up, I get a login
> prompt, then five or ten seconds later usb wakes up having detected the
> usb3 external HD.
> 
> How can I fix this?


This topic cropped up on the freebsd-arm mailing list very recently.  One 
solution is to add this to /boot/loader.conf:

kern.cam.boot_delay="1"

That instructs the system to wait 10 seconds (1 milliseconds) during boot 
to give time for the CAM subsystem probes to complete.  (USB storage devices 
use the CAM subsystem.)

It was also noted by Konstantin Belousov in that thread 
(https://lists.freebsd.org/pipermail/freebsd-arm/2017-February/015626.html 
) 
that a newer option is available:

> Right solution after r313350 is to set
>   vfs.root_mount_always_wait=1
> loader tunable.  The knob should be merged to

how can I make freebsd wait for usb to become active? Or delay mountroot?

2017-02-13 Thread tech-lists
Hello stable@,

system: 11-stable r313553

In the kernel there is an option for scsi delay. Is there also one for
usb? Perhaps not in the kernel but elsewhere. I can't find it.

The problem is seen especially where the bootable device is usb. The
boot process starts and dumps me at mountroot where I wait for a short
time until the usb stick is properly detected (bright white writing at
the console). The usb stick is plugged into a usb3 port. For example:

[snip]

usbus0: 5.0Gbps Super Speed USB v3.0
usbus1: 12Mbps Full Speed USB v1.0
usbus2: 480Mbps High Speed USB v2.0
usbus3: 12Mbps Full Speed USB v1.0
ugen0.1: <0x1022 XHCI root HUB> at usbus0
uhub0: <0x1022 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0
ugen1.1:  at usbus1
uhub1:  on usbus1
ugen2.1:  at usbus2
uhub2:  on usbus2
ugen3.1:  at usbus3
uhub3:  on usbus3
usbus4: 480Mbps High Speed USB v2.0
ugen4.1:  at usbus4
uhub4:  on usbus4
acpi_tz0: _CRT value is absurd, ignored (255.1C)
ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
ada0:  ACS-2 ATA SATA 3.x device
cd0 at ahcich1 bus 0 scbus1 target 0 lun 0
cd0:  Removable CD-ROM SCSI device
cd0: Serial Number 1415TP277450E0H6H
cd0: 150.000MB/s transfers (SATA 1.x, UDMA5, ATAPI 12bytes, PIO 8192bytes)
cd0: Attempt to query device size failed: NOT READY, Medium not present
- tray open
ada0: Serial Number JA1006103G0ALV
ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
ada0: Command Queueing enabled
ada0: 953869MB (1953525168 512 byte sectors)
SMP: AP CPU #3 Launched!
SMP: AP CPU #1 Launched!
SMP: AP CPU #2 Launched!
Timecounter "TSC" frequency 1597045198 Hz quality 1000
Trying to mount root from ufs:/dev/da0p2 [rw]...
uhub3: 5 ports with 5 removable, self powered
uhub1: 5 ports with 5 removable, self powered
uhub0: 4 ports with 4 removable, self powered
Root mount waiting for: usbus4 usbus2 usbus0
ugen0.2:  at usbus0
umass0 on uhub0
umass0: 
on usbus0
umass0:  SCSI over Bulk-Only; quirks = 0x8100
umass0:3:0: Attached to scbus3
uhub2: 5 ports with 5 removable, self powered
uhub4: 5 ports with 5 removable, self powered
ugen0.3:  at usbus0
ukbd0 on uhub0
ukbd0:  on usbus0
kbd2 at ukbd0
Root mount waiting for: usbus4
ugen4.2:  at usbus4
mountroot: waiting for device /dev/da0p2...
Mounting from ufs:/dev/da0p2 failed with error 19.

Loader variables:
  vfs.root.mountfrom=ufs:/dev/da0p2
  vfs.root.mountfrom.options=rw

Manual root filesystem specification:
  : [options]
  Mount  using filesystem 
  and with the specified (optional) option list.

eg. ufs:/dev/da0s1a
zfs:tank
cd9660:/dev/cd0 ro
  (which is equivalent to: mount -t cd9660 -o ro /dev/cd0 /)

  ?   List valid disk boot devices
  .   Yield 1 second (for background tasks)
  Abort manual input

mountroot> Trying to mount root from ufs:/dev/da0p2 []...
mountroot: waiting for device /dev/da0p2...
Mounting from ufs:/dev/da0p2 failed with error 19.

mountroot>

[snip]

Then this happens:

(probe0:umass-sim0:0:0:0): INQUIRY. CDB: 12 00 00 00 24 00
(probe0:umass-sim0:0:0:0): CAM status: CCB request completed with an error
(probe0:umass-sim0:0:0:0): Retrying command
da0 at umass-sim0 bus 0 scbus3 target 0 lun 0
da0: < USB DISK 3.0 PMAP> Removable Direct Access SPC-4 SCSI device
da0: Serial Number 070B4722335D3288
da0: 400.000MB/s transfers
da0: 30176MB (61800448 512 byte sectors)
da0: quirks=0x3

so now at the mountroot prompt I enter ufs:/dev/da0p2 (which is a value
that mountroot already had) and carry on booting:

mountroot> Trying to mount root from ufs:/dev/da0p2 []...
re0: link state changed to DOWN
re0: link state changed to UP
ums0 on uhub0
ums0:  on usbus0
ums0: 16 buttons and [XYZT] coordinates ID=2
uhid0 on uhub0
uhid0:  on usbus0

[...]

The same sort of thing happens on an 11-stable r313043 desktop, only
this time I'm not booting from usb. The system comes up, I get a login
prompt, then five or ten seconds later usb wakes up having detected the
usb3 external HD.

How can I fix this?

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