From owner-svn-src-head@FreeBSD.ORG Mon Jan 2 22:42:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF9301065677; Mon, 2 Jan 2012 22:42:53 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5C60B8FC0A; Mon, 2 Jan 2012 22:42:53 +0000 (UTC) Received: by obbwd18 with SMTP id wd18so18027974obb.13 for ; Mon, 02 Jan 2012 14:42:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=9Oct8IdXaioou1/618V8W5+jQXLhVp+ctt6PFrQGgds=; b=BQSLmsqJfCAtLF8XZ0sMqsufCAsDUBHS25TgKesdJiMSFJ5Bmj35jD7/a5gcvfQZJk YUW1msEnNf0ya+5kJVU3hHf/Jy4fYlhzxxUIZUGCQ7A4+ed1rzoI9rgZt5aij6pgBj59 ErjC6NqSOJaUZ2tRQF7eI6tu3YBr3Qjx/F8HQ= MIME-Version: 1.0 Received: by 10.182.187.37 with SMTP id fp5mr17935532obc.21.1325544172926; Mon, 02 Jan 2012 14:42:52 -0800 (PST) Received: by 10.182.152.6 with HTTP; Mon, 2 Jan 2012 14:42:52 -0800 (PST) In-Reply-To: <201112191535.pBJFZ6hY063597@svn.freebsd.org> References: <201112191535.pBJFZ6hY063597@svn.freebsd.org> Date: Mon, 2 Jan 2012 14:42:52 -0800 Message-ID: From: Garrett Cooper To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r228711 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2012 22:42:53 -0000 On Mon, Dec 19, 2011 at 7:35 AM, Hans Petter Selasky wrote: > Author: hselasky > Date: Mon Dec 19 15:35:05 2011 > New Revision: 228711 > URL: http://svn.freebsd.org/changeset/base/228711 > > Log: > =A0Add code to wait for USB shutdown to be executed at system shutdown. > =A0Add sysctl which can be used to skip this waiting. > > =A0MFC after: =A0 =A03 days > > Modified: > =A0head/sys/dev/usb/controller/usb_controller.c > > Modified: head/sys/dev/usb/controller/usb_controller.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/usb/controller/usb_controller.c =A0 =A0 =A0 =A0Mon Dec 1= 9 14:55:14 2011 =A0 =A0 =A0 =A0(r228710) > +++ head/sys/dev/usb/controller/usb_controller.c =A0 =A0 =A0 =A0Mon Dec 1= 9 15:35:05 2011 =A0 =A0 =A0 =A0(r228711) > @@ -87,7 +87,12 @@ SYSCTL_INT(_hw_usb_ctrl, OID_AUTO, debug > =A0static int usb_no_boot_wait =3D 0; > =A0TUNABLE_INT("hw.usb.no_boot_wait", &usb_no_boot_wait); > =A0SYSCTL_INT(_hw_usb, OID_AUTO, no_boot_wait, CTLFLAG_RDTUN, &usb_no_boo= t_wait, 0, > - =A0 =A0"No device enumerate waiting at boot."); > + =A0 =A0"No USB device enumerate waiting at boot."); > + > +static int usb_no_shutdown_wait =3D 0; > +TUNABLE_INT("hw.usb.no_shutdown_wait", &usb_no_shutdown_wait); > +SYSCTL_INT(_hw_usb, OID_AUTO, no_shutdown_wait, CTLFLAG_RDTUN, &usb_no_s= hutdown_wait, 0, > + =A0 =A0"No USB device waiting at system shutdown."); > > =A0static devclass_t usb_devclass; > > @@ -277,11 +282,20 @@ usb_shutdown(device_t dev) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (0); > =A0 =A0 =A0 =A0} > > + =A0 =A0 =A0 device_printf(bus->bdev, "Controller shutdown\n"); > + > =A0 =A0 =A0 =A0USB_BUS_LOCK(bus); > =A0 =A0 =A0 =A0usb_proc_msignal(&bus->explore_proc, > =A0 =A0 =A0 =A0 =A0 =A0&bus->shutdown_msg[0], &bus->shutdown_msg[1]); > + =A0 =A0 =A0 if (usb_no_shutdown_wait =3D=3D 0) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* wait for shutdown callback to be execute= d */ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 usb_proc_mwait(&bus->explore_proc, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 &bus->shutdown_msg[0], &bus->shutdo= wn_msg[1]); > + =A0 =A0 =A0 } > =A0 =A0 =A0 =A0USB_BUS_UNLOCK(bus); > > + =A0 =A0 =A0 device_printf(bus->bdev, "Controller shutdown complete\n"); > + These printouts are a bit chatty. Could they be put under USB_DEBUG ? Thanks! -Garrett