From nobody@FreeBSD.org  Wed Oct 19 15:39:33 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D22641065673
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 19 Oct 2011 15:39:33 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id C14ED8FC14
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 19 Oct 2011 15:39:33 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p9JFdXuf087711
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 19 Oct 2011 15:39:33 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p9JFdXsV087710;
	Wed, 19 Oct 2011 15:39:33 GMT
	(envelope-from nobody)
Message-Id: <201110191539.p9JFdXsV087710@red.freebsd.org>
Date: Wed, 19 Oct 2011 15:39:33 GMT
From: Ivan <rozhuk.im@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: set kern.cam.boot_delay via build options (usb boot)
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         161809
>Category:       kern
>Synopsis:       [cam] [patch] set kern.cam.boot_delay via build options (usb boot)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    sbruno
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 19 15:40:12 UTC 2011
>Closed-Date:    Mon Apr 29 06:02:05 UTC 2013
>Last-Modified:  Mon Apr 29 06:02:05 UTC 2013
>Originator:     Ivan
>Release:        FreeBSD 8.2-STABLE
>Organization:
>Environment:
FreeBSD firewall 8.2-STABLE FreeBSD 8.2-STABLE #3: Tue Oct 11 07:33:32 IRKST 2011     root@firewall:/usr/obj/usr/src/sys/RIMx64  amd64
>Description:
Add kernel config option:
CAM_BOOT_DELAY = default value for "kern.cam.boot_delay"

Some devices not using FreeBSD loader and cant set "kern.cam.boot_delay" via loader.conf
>How-To-Repeat:
On FreeBSD 8 with certain USB flash drives and/or USB controllers, when booting from a USB drive the device does not become available until after the system has tried (and failed) to mount / from it. After this has occurred, the user is prompted to manually enter the device name at the mountroot> prompt; for me, even this doesn't work, and the device is not listed in the output from the ? command

(from: pr 138798)
>Fix:
Add to kernel config file and rebuild.

options 	CAM_BOOT_DELAY=4000	# kern.cam.boot_delay: Bus registration wait time

Patch attached with submission follows:

--- /usr/src/sys/cam/cam_xpt_orig.c	2011-10-20 00:08:54.000000000 +0900
+++ /usr/src/sys/cam/cam_xpt.c	2011-10-20 00:09:06.000000000 +0900
@@ -904,6 +904,9 @@
 	mtx_init(&xsoftc.xpt_lock, "XPT lock", NULL, MTX_DEF);
 	mtx_init(&xsoftc.xpt_topo_lock, "XPT topology lock", NULL, MTX_DEF);
 
+#ifdef CAM_BOOT_DELAY
+	xsoftc.boot_delay = CAM_BOOT_DELAY;
+#endif
 	/*
 	 * The xpt layer is, itself, the equivelent of a SIM.
 	 * Allow 16 ccbs in the ccb pool for it.  This should


--- /usr/src/sys/conf/options_orig	2011-10-16 02:17:43.000000000 +0900
+++ /usr/src/sys/conf/options	2011-10-20 00:05:42.000000000 +0900
@@ -301,6 +301,7 @@
 CAM_DEBUG_TARGET	opt_cam.h
 CAM_DEBUG_LUN		opt_cam.h
 CAM_DEBUG_FLAGS		opt_cam.h
+CAM_BOOT_DELAY		opt_cam.h
 SCSI_DELAY		opt_scsi.h
 SCSI_NO_SENSE_STRINGS	opt_scsi.h
 SCSI_NO_OP_STRINGS	opt_scsi.h


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-scsi 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Oct 20 05:26:12 UTC 2011 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=161809 
State-Changed-From-To: open->feedback 
State-Changed-By: sbruno 
State-Changed-When: Fri Apr 12 22:26:39 UTC 2013 
State-Changed-Why:  
I'm leaning towards rejecting this patch.  I see why you would want a compile 
time option for the boot delay variable, but you can accomplish the same thing 
with a loader.conf tuneable now. 

kern.cam.boot_delay: 0 

http://www.freebsd.org/cgi/query-pr.cgi?pr=161809 
Responsible-Changed-From-To: freebsd-scsi->sbruno-scsi 
Responsible-Changed-By: sbruno 
Responsible-Changed-When: Wed Apr 17 19:36:57 UTC 2013 
Responsible-Changed-Why:  
Taking ticket for resolution.  I suspect that I will be comitting this change 

http://www.freebsd.org/cgi/query-pr.cgi?pr=161809 

From: Sean Bruno <sean_bruno@yahoo.com>
To: bug-followup@FreeBSD.org, rozhuk.im@gmail.com
Cc:  
Subject: Re: kern/161809: [cam] [patch] set kern.cam.boot_delay via build
 options (usb boot)
Date: Wed, 17 Apr 2013 12:38:15 -0700

 --=-lGDkhih/QavbiUrm+hCe
 Content-Type: text/plain; charset="us-ascii"
 Content-Transfer-Encoding: quoted-printable
 
 Since the submitter *clearly* said that this was booting without LOADER
 and *clearly* said that the suggest of using a loader tuneable won't
 work, we should consider this a bit more.
 
 Sean
 
 --=-lGDkhih/QavbiUrm+hCe
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: This is a digitally signed message part
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.13 (FreeBSD)
 
 iQEcBAABAgAGBQJRbvonAAoJEBkJRdwI6BaHsrAH/2JQ1BXaqZoC28aXQ/NWFvPq
 NT1urMivkHrMsjB7fdII8lDvNds9J+yldKku6qf+5xQ5k7Iw5MKqJwutZ2usWv7U
 eFRwI5eZrH9An73plE9kyXUdfoBEavPge5mzfx8/lcFZV0JYmgzoYDBgHlIAAhg5
 QXB4YLO9K2l1HhfsiyXgnb9TufUDIieNvNgr8Tpa+QPIWQcf0N1oSHGj8qGXX6pJ
 W5ngvMlIqrifBPnCObx3vJPCSpY0+NVX21DAeldDOF2vcDTs8MrlHtjPglHELRyU
 MSffedmK4vIzwwXSlFIq2pZFGNT5rtNI64wS7QPhAKzV48g7MbPOrwTKoYyyLA0=
 =R39D
 -----END PGP SIGNATURE-----
 
 --=-lGDkhih/QavbiUrm+hCe--
 
Responsible-Changed-From-To: sbruno-scsi->sbruno 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Apr 17 20:03:59 UTC 2013 
Responsible-Changed-Why:  
fix responsible. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=161809 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/161809: commit references a PR
Date: Sat, 20 Apr 2013 00:33:45 +0000 (UTC)

 Author: sbruno
 Date: Sat Apr 20 00:33:37 2013
 New Revision: 249664
 URL: http://svnweb.freebsd.org/changeset/base/249664
 
 Log:
   Expose CAM_BOOT_DELAY as a kernel conf item now.
   
   This allows users who boot without loader to adjust their environments
   around slightly buggy or slow hardware.
   
   PR:	kern/161809
   Submitted by:	rozhuk.im@gmail.com
   MFC after:	2 weeks
 
 Modified:
   head/sys/cam/cam_xpt.c
   head/sys/conf/options
 
 Modified: head/sys/cam/cam_xpt.c
 ==============================================================================
 --- head/sys/cam/cam_xpt.c	Fri Apr 19 23:49:34 2013	(r249663)
 +++ head/sys/cam/cam_xpt.c	Sat Apr 20 00:33:37 2013	(r249664)
 @@ -878,6 +878,13 @@ xpt_init(void *dummy)
  	mtx_init(&xsoftc.xpt_lock, "XPT lock", NULL, MTX_DEF);
  	mtx_init(&xsoftc.xpt_topo_lock, "XPT topology lock", NULL, MTX_DEF);
  
 +#ifdef CAM_BOOT_DELAY
 +	/*
 +	 * Override this value at compile time to assist our users
 +	 * who don't use loader to boot a kernel.
 +	 */
 +	xsoftc.boot_delay = CAM_BOOT_DELAY;
 +#endif
  	/*
  	 * The xpt layer is, itself, the equivelent of a SIM.
  	 * Allow 16 ccbs in the ccb pool for it.  This should
 
 Modified: head/sys/conf/options
 ==============================================================================
 --- head/sys/conf/options	Fri Apr 19 23:49:34 2013	(r249663)
 +++ head/sys/conf/options	Sat Apr 20 00:33:37 2013	(r249664)
 @@ -307,6 +307,7 @@ CAM_DEBUG_BUS		opt_cam.h
  CAM_DEBUG_TARGET	opt_cam.h
  CAM_DEBUG_LUN		opt_cam.h
  CAM_DEBUG_FLAGS		opt_cam.h
 +CAM_BOOT_DELAY		opt_cam.h
  SCSI_DELAY		opt_scsi.h
  SCSI_NO_SENSE_STRINGS	opt_scsi.h
  SCSI_NO_OP_STRINGS	opt_scsi.h
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: feedback->closed 
State-Changed-By: sbruno 
State-Changed-When: Mon Apr 29 06:01:44 UTC 2013 
State-Changed-Why:  
Patches applied 

http://www.freebsd.org/cgi/query-pr.cgi?pr=161809 
>Unformatted:
