From owner-freebsd-bugs@FreeBSD.ORG Wed Oct 19 15:40:13 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 225C11065695 for ; Wed, 19 Oct 2011 15:40:13 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id F39378FC2A for ; Wed, 19 Oct 2011 15:40:12 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p9JFeCwx032992 for ; Wed, 19 Oct 2011 15:40:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p9JFeCHU032991; Wed, 19 Oct 2011 15:40:12 GMT (envelope-from gnats) Resent-Date: Wed, 19 Oct 2011 15:40:12 GMT Resent-Message-Id: <201110191540.p9JFeCHU032991@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Ivan Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D22641065673 for ; 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 ; 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 ; 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 To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/161809: set kern.cam.boot_delay via build options (usb boot) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2011 15:40:13 -0000 >Number: 161809 >Category: kern >Synopsis: set kern.cam.boot_delay via build options (usb boot) >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Wed Oct 19 15:40:12 UTC 2011 >Closed-Date: >Last-Modified: >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: >Unformatted: