Date: Mon, 2 Jan 2012 23:57:21 +0100 From: Hans Petter Selasky <hselasky@c2i.net> To: Garrett Cooper <yanegomi@gmail.com> Cc: "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org> Subject: Re: svn commit: r228711 - head/sys/dev/usb/controller Message-ID: <201201022357.22021.hselasky@c2i.net> In-Reply-To: <CAGH67wR7KobOzZ8UdErNC9r7pc7joqdscRCuR_y%2B2hgaLB_%2BuQ@mail.gmail.com> References: <201112191535.pBJFZ6hY063597@svn.freebsd.org> <CAGH67wR7KobOzZ8UdErNC9r7pc7joqdscRCuR_y%2B2hgaLB_%2BuQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Monday 02 January 2012 23:42:52 Garrett Cooper wrote: > 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: > > Add code to wait for USB shutdown to be executed at system shutdown. > > Add sysctl which can be used to skip this waiting. > > > > MFC after: 3 days > > > > Modified: > > head/sys/dev/usb/controller/usb_controller.c > > > > Modified: head/sys/dev/usb/controller/usb_controller.c > > ========================================================================= > > ===== --- head/sys/dev/usb/controller/usb_controller.c Mon Dec 19 > > 14:55:14 2011 (r228710) +++ > > head/sys/dev/usb/controller/usb_controller.c Mon Dec 19 15:35:05 > > 2011 (r228711) @@ -87,7 +87,12 @@ SYSCTL_INT(_hw_usb_ctrl, > > OID_AUTO, debug > > static int usb_no_boot_wait = 0; > > TUNABLE_INT("hw.usb.no_boot_wait", &usb_no_boot_wait); > > SYSCTL_INT(_hw_usb, OID_AUTO, no_boot_wait, CTLFLAG_RDTUN, > > &usb_no_boot_wait, 0, - "No device enumerate waiting at boot."); > > + "No USB device enumerate waiting at boot."); > > + > > +static int usb_no_shutdown_wait = 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_shutdown_wait, 0, + "No USB device waiting at system > > shutdown."); > > > > static devclass_t usb_devclass; > > > > @@ -277,11 +282,20 @@ usb_shutdown(device_t dev) > > return (0); > > } > > > > + device_printf(bus->bdev, "Controller shutdown\n"); > > + > > USB_BUS_LOCK(bus); > > usb_proc_msignal(&bus->explore_proc, > > &bus->shutdown_msg[0], &bus->shutdown_msg[1]); > > + if (usb_no_shutdown_wait == 0) { > > + /* wait for shutdown callback to be executed */ > > + usb_proc_mwait(&bus->explore_proc, > > + &bus->shutdown_msg[0], &bus->shutdown_msg[1]); > > + } > > USB_BUS_UNLOCK(bus); > > > > + device_printf(bus->bdev, "Controller shutdown complete\n"); > > + > > These printouts are a bit chatty. Could they be put under USB_DEBUG ? Yes, I can do that if others agree too. --HPS
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201022357.22021.hselasky>