Date: Mon, 2 Jan 2012 14:42:52 -0800 From: Garrett Cooper <yanegomi@gmail.com> To: Hans Petter Selasky <hselasky@freebsd.org> 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 Message-ID: <CAGH67wR7KobOzZ8UdErNC9r7pc7joqdscRCuR_y%2B2hgaLB_%2BuQ@mail.gmail.com> In-Reply-To: <201112191535.pBJFZ6hY063597@svn.freebsd.org> References: <201112191535.pBJFZ6hY063597@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Dec 19, 2011 at 7:35 AM, Hans Petter Selasky <hselasky@freebsd.org> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGH67wR7KobOzZ8UdErNC9r7pc7joqdscRCuR_y%2B2hgaLB_%2BuQ>