From owner-p4-projects@FreeBSD.ORG Tue Jan 19 12:13:58 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 903CE106568B; Tue, 19 Jan 2010 12:13:58 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54F08106566B for ; Tue, 19 Jan 2010 12:13:58 +0000 (UTC) (envelope-from mav@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 42E478FC12 for ; Tue, 19 Jan 2010 12:13:58 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o0JCDw2R043862 for ; Tue, 19 Jan 2010 12:13:58 GMT (envelope-from mav@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o0JCDwTn043860 for perforce@freebsd.org; Tue, 19 Jan 2010 12:13:58 GMT (envelope-from mav@freebsd.org) Date: Tue, 19 Jan 2010 12:13:58 GMT Message-Id: <201001191213.o0JCDwTn043860@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to mav@freebsd.org using -f From: Alexander Motin To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 173361 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2010 12:13:58 -0000 http://p4web.freebsd.org/chv.cgi?CH=173361 Change 173361 by mav@mav_mavtest on 2010/01/19 12:13:44 Add kern.cam.boot_delay tunable, to control time, which CAM will wait for late SIMs (like umass) registration. Affected files ... .. //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#141 edit Differences ... ==== //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#141 (text+ko) ==== @@ -111,6 +111,9 @@ struct intr_config_hook *xpt_config_hook; + int boot_delay; + struct callout boot_callout; + struct mtx xpt_topo_lock; struct mtx xpt_lock; }; @@ -147,6 +150,10 @@ /* Transport layer configuration information */ static struct xpt_softc xsoftc; +TUNABLE_INT("kern.cam.boot_delay", &xsoftc.boot_delay); +SYSCTL_INT(_kern_cam, OID_AUTO, boot_delay, CTLFLAG_RDTUN, + &xsoftc.boot_delay, 0, "Bus registration wait time"); + /* Queues for our software interrupt handler */ typedef TAILQ_HEAD(cam_isrq, ccb_hdr) cam_isrq_t; typedef TAILQ_HEAD(cam_simq, cam_sim) cam_simq_t; @@ -4659,6 +4666,13 @@ } static void +xpt_boot_delay(void *arg) +{ + + xpt_release_boot(); +} + +static void xpt_config(void *arg) { /* @@ -4696,7 +4710,9 @@ periphdriver_init(1); xpt_hold_boot(); - xpt_release_boot(); + callout_init(&xsoftc.boot_callout, 1); + callout_reset(&xsoftc.boot_callout, hz * xsoftc.boot_delay / 1000, + xpt_boot_delay, NULL); /* Fire up rescan thread. */ if (kproc_create(xpt_scanner_thread, NULL, NULL, 0, 0, "xpt_thrd")) { printf("xpt_init: failed to create rescan thread\n");