From owner-freebsd-usb@FreeBSD.ORG Sun Dec 18 10:59:06 2011 Return-Path: Delivered-To: usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B7C3106566C; Sun, 18 Dec 2011 10:59:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 94C888FC08; Sun, 18 Dec 2011 10:59:04 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id MAA15619; Sun, 18 Dec 2011 12:58:59 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1RcESI-000Cj5-Rt; Sun, 18 Dec 2011 12:58:58 +0200 Message-ID: <4EEDC771.800@FreeBSD.org> Date: Sun, 18 Dec 2011 12:58:57 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111206 Thunderbird/8.0 MIME-Version: 1.0 To: Hans Petter Selasky References: <4EE51CB5.1060505@FreeBSD.org> <201112160016.33776.hselasky@c2i.net> <4EECADD4.9040509@FreeBSD.org> <201112171806.43764.hselasky@c2i.net> In-Reply-To: <201112171806.43764.hselasky@c2i.net> X-Enigmail-Version: undefined Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: usb@FreeBSD.org, freebsd-hackers@FreeBSD.org, John Baldwin , mdf@FreeBSD.org Subject: Re: kern_yield vs ukbd_yield X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Dec 2011 10:59:06 -0000 on 17/12/2011 19:06 Hans Petter Selasky said the following: > If the problem is only in UKBD driver, I don't think this is a big problem to > solve. The reason for the auto-magic locking, is that I've sometimes seen > callers in non-polling mode call into UKBD without Giant locked. And this > causes a panic when starting USB transfers, because the code expects Giant to > be locked. Hmm, do you have an example of such a panic? I couldn't find how this could be possible in my examination of non-polling entry points into syscons and kbd drives. > Requirement: I would say that to use UKBD polling mode, the scheduler must be > stopped. Else you should not use polling mode at all. I think that mountroot > is getting characters the wrong way in this regard. I think that this is a too strong / unnecessary requirement. I think that now (after my recent syscons commits) ukbd should work correctly and optimally in this context. I have written a small article about my analysis of locking in syscons, underlying kbd drivers and ukbd in particular: http://wiki.freebsd.org/AvgSyscons I could have misunderstood or missed things, so I will appreciate a review and discussion of my observations. Thank you! -- Andriy Gapon From owner-freebsd-usb@FreeBSD.ORG Sun Dec 18 17:41:57 2011 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 084A2106566B; Sun, 18 Dec 2011 17:41:57 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe09.c2i.net [212.247.155.2]) by mx1.freebsd.org (Postfix) with ESMTP id B4B688FC12; Sun, 18 Dec 2011 17:41:55 +0000 (UTC) X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe09.swip.net (CommuniGate Pro SMTP 5.4.2) with ESMTPA id 44558516; Sun, 18 Dec 2011 18:41:53 +0100 From: Hans Petter Selasky To: Andriy Gapon Date: Sun, 18 Dec 2011 18:39:24 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <4EE51CB5.1060505@FreeBSD.org> <201112171806.43764.hselasky@c2i.net> <4EEDC771.800@FreeBSD.org> In-Reply-To: <4EEDC771.800@FreeBSD.org> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201112181839.24813.hselasky@c2i.net> Cc: usb@freebsd.org, freebsd-hackers@freebsd.org, John Baldwin , mdf@freebsd.org Subject: Re: kern_yield vs ukbd_yield X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Dec 2011 17:41:57 -0000 On Sunday 18 December 2011 11:58:57 Andriy Gapon wrote: > on 17/12/2011 19:06 Hans Petter Selasky said the following: > > If the problem is only in UKBD driver, I don't think this is a big > > problem to solve. The reason for the auto-magic locking, is that I've > > sometimes seen callers in non-polling mode call into UKBD without Giant > > locked. And this causes a panic when starting USB transfers, because the > > code expects Giant to be locked. > > Hmm, do you have an example of such a panic? I couldn't find how this could > be possible in my examination of non-polling entry points into syscons and > kbd drives. mtx_assert(&Giant, MTX_OWNED); will panic if Giant is not locked. Do you need an example? > > > Requirement: I would say that to use UKBD polling mode, the scheduler > > must be stopped. Else you should not use polling mode at all. I think > > that mountroot is getting characters the wrong way in this regard. > > I think that this is a too strong / unnecessary requirement. I think that > now (after my recent syscons commits) ukbd should work correctly and > optimally in this context. > > I have written a small article about my analysis of locking in syscons, > underlying kbd drivers and ukbd in particular: > http://wiki.freebsd.org/AvgSyscons > I could have misunderstood or missed things, so I will appreciate a review > and discussion of my observations. Thank you! I will have a look at it when I find some time! --HPS From owner-freebsd-usb@FreeBSD.ORG Sun Dec 18 17:58:58 2011 Return-Path: Delivered-To: usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 063E7106566B; Sun, 18 Dec 2011 17:58:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id B301A8FC0A; Sun, 18 Dec 2011 17:58:56 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA18656; Sun, 18 Dec 2011 19:58:51 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1RcL0c-000CvS-Tv; Sun, 18 Dec 2011 19:58:50 +0200 Message-ID: <4EEE29D7.6020504@FreeBSD.org> Date: Sun, 18 Dec 2011 19:58:47 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111206 Thunderbird/8.0 MIME-Version: 1.0 To: Hans Petter Selasky References: <4EE51CB5.1060505@FreeBSD.org> <201112171806.43764.hselasky@c2i.net> <4EEDC771.800@FreeBSD.org> <201112181839.24813.hselasky@c2i.net> In-Reply-To: <201112181839.24813.hselasky@c2i.net> X-Enigmail-Version: undefined Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: usb@FreeBSD.org, freebsd-hackers@FreeBSD.org, John Baldwin , mdf@FreeBSD.org Subject: Re: kern_yield vs ukbd_yield X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Dec 2011 17:58:58 -0000 on 18/12/2011 19:39 Hans Petter Selasky said the following: > On Sunday 18 December 2011 11:58:57 Andriy Gapon wrote: >> on 17/12/2011 19:06 Hans Petter Selasky said the following: >>> If the problem is only in UKBD driver, I don't think this is a big >>> problem to solve. The reason for the auto-magic locking, is that I've >>> sometimes seen callers in non-polling mode call into UKBD without Giant >>> locked. And this causes a panic when starting USB transfers, because the >>> code expects Giant to be locked. >> >> Hmm, do you have an example of such a panic? I couldn't find how this could >> be possible in my examination of non-polling entry points into syscons and >> kbd drives. > > mtx_assert(&Giant, MTX_OWNED); will panic if Giant is not locked. Do you need > an example? Yes :-) I want to see a non-polled code path in the keyboard layer where Giant is not locked. >>> Requirement: I would say that to use UKBD polling mode, the scheduler >>> must be stopped. Else you should not use polling mode at all. I think >>> that mountroot is getting characters the wrong way in this regard. >> >> I think that this is a too strong / unnecessary requirement. I think that >> now (after my recent syscons commits) ukbd should work correctly and >> optimally in this context. >> >> I have written a small article about my analysis of locking in syscons, >> underlying kbd drivers and ukbd in particular: >> http://wiki.freebsd.org/AvgSyscons >> I could have misunderstood or missed things, so I will appreciate a review >> and discussion of my observations. Thank you! > > I will have a look at it when I find some time! Hope it won't be long. Thank you! -- Andriy Gapon From owner-freebsd-usb@FreeBSD.ORG Mon Dec 19 11:07:17 2011 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E3051065676 for ; Mon, 19 Dec 2011 11:07:17 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3B00B8FC21 for ; Mon, 19 Dec 2011 11:07:17 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id pBJB7HGZ011104 for ; Mon, 19 Dec 2011 11:07:17 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id pBJB7G7u011102 for freebsd-usb@FreeBSD.org; Mon, 19 Dec 2011 11:07:16 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 19 Dec 2011 11:07:16 GMT Message-Id: <201112191107.pBJB7G7u011102@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-usb@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-usb@FreeBSD.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2011 11:07:17 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o usb/163328 usb Hardware o usb/162712 usb added device on if_run. o usb/162306 usb usb devices cant get address asignation, no memories, o usb/162054 usb usbdump just hangs on 9.0-RC1 o usb/161793 usb poor EHCI usb2 i/o performance o usb/160911 usb The usb flash drive JetFlash Transcend 16GB 1100 doesn o usb/160436 usb ucom wedges machine on parity error ? o usb/160299 usb MicroSDHC-to-USB adapters do not work in FreeBSD 8.x o usb/160192 usb [install] Installation from USB-Stick doesn't find the o usb/159274 usb USB 3.0 Etron EJ168A does not work. f usb/159191 usb [fusefs-ntfs] write on fusefs-ntfs mounted partition r o usb/157376 usb LaCie USB disk not recognized o usb/157074 usb [boot] [usb8] vfs_mountroot_ask is called when no usb o usb/156898 usb [keyboard] usb keyboard does not work while boot (ps2 o usb/156735 usb Need Quirk for Goflex USB Disk Drives o usb/156725 usb USB stack stall cause complete system input loss o usb/156596 usb [ehci] Extremely high interrupt rate on ehci/uhci IRQ1 o usb/156000 usb rum(4) Fatal trap 18: integer divide fault while in ke o usb/155996 usb NanoBSD not booted as Disk o usb/155784 usb Problem with Transcend StoreJet 25M3 (2AJ1) on Asus M2 o usb/154710 usb [ugen] Conexant USB Modem is not working in 8.x. In 7. o usb/154506 usb [umass] Copying dir with large files makes FreeBSD loa o usb/154192 usb [umass] In Garmin Oregon GPS, only the first umass dev o i386/153851 usb [keyboard] keyboard issues on new Intel Mother boards. o usb/153703 usb [keyboard] My USB keyboard can not be used in 8-STABLE o usb/153609 usb [zyd] [panic] kernel: Fatal trap 12: page fault while o usb/153149 usb [umass] USB stick quirk regression [regression] o usb/152075 usb [usb8] [ehci] [request] Add quirk for CS5536 USB o usb/150892 usb [zyd] Whenever network contacted in any shape, way or o usb/150189 usb [run] [usb8] [patch] if_run appears to corrupt IP traf p usb/149934 usb [patch] [usb8] Transcend JetFlash V85 poor performance p usb/149900 usb [uftdi] [patch] FreeBSD 8.1 uftdi patch to support usb p usb/149764 usb [u3g] [patch] usbdevs update: Huawei K3765 3G modem o usb/149283 usb [uftdi] avrdude unable to talk to Arduino board (via u o usb/149162 usb [ural] ASUS WL-167g doesn't work in 8.1 (continue of 1 s usb/148702 usb [usb8] [request] IO DATA USB-RSAQ5 support on FreeBSD- o usb/148080 usb usbconfig(8) sometimes does not turn off the device o usb/147516 usb [umass] [usb67] kernel unable to deal with Olympus USB o i386/147475 usb [install] FreeBSD 8.x does not install on ASUS K8N4-E p usb/146871 usb [usbdevs] [usb8] [patch] provide descriprive string fo o usb/146840 usb [hang] FreeBSD 7.2 / 7.3 / 8.0 hang at startup after e o usb/146153 usb [axe] [usb8] Hosts in network doesn't receive any pack f usb/146054 usb [urtw] [usb8] urtw driver potentially out of date f usb/145513 usb [usb8] New USB stack: no new devices after forced usb p usb/145455 usb [usb8] [patch] USB debug support cannot be disabled o usb/145415 usb [umass] [usb8] USB card reader does not create slices a usb/145184 usb GENERIC can't mount root from USB on Asus EEE o usb/145165 usb [keyboard] [usb8] ukbd_set_leds_callback: error=USB_ER f kern/144938 usb [keyboard] [boot] Boot Failure with Apple (MB869LL/A) o usb/144387 usb [run] [panic] if_run panic o usb/144043 usb [umass] [usb8] USB DLT tape drive throws random errors a usb/143790 usb [boot] [cam] can not boot from usb hdd f usb/143620 usb [cdce] [usb8] the module if_cdce doesn't support my Op f usb/143294 usb [usb8] copying process stops at some time (10 - 50 sec o usb/143286 usb [ukbd] [usb8] [boot] boot failures on RELENG_8 system p usb/143186 usb [usbdevs] [usb8] [patch] add USB device IDs for Google a usb/143139 usb [umass] [usb8] [patch] Quirk for Century EX35SW4_SB4 J p usb/143045 usb [umass] [usb8] [patch] mounting Fujitsu 2600Z camera d o usb/142991 usb [uftdi] [usb67] [patch] Patch to add Crystalfontz 533 f usb/142989 usb [usb8] canon eos 50D attaches but detaches after few s f usb/142957 usb [umass] [usb8] [patch] patch for USB disk SYNCHRONIZE o usb/142719 usb [urtw] [usb8] AirLive WL-1600USB (RTL8187L chipset) fa o usb/142713 usb [usb67] [panic] Kernel Panik when connecting an IPhone f usb/142276 usb [umass] [usb8] Cache Synchronization Error with Olympu o usb/142229 usb [ums] [usb8] [hang] connecting a USB mouse to a Dell P f usb/141680 usb [uath] [usb8] Netgear WG111T not working with uath dri o usb/141664 usb [pcm] [usb8] Logitech USB microphone failure [regressi o usb/141474 usb [boot] [usb8] FreeBSD 8.0 can not install from USB CDR o usb/141327 usb [ukbd] [usb67] USB kbd not working with 7.1+PAE on IBM o usb/141212 usb [ukbd] [usb8] ukbd_set_leds_callback:700: error=USB_ER o kern/141011 usb [usb8] Encrypted root, geli password at boot; enter ke o usb/140920 usb [install] [usb8] USB based install fails on 8.0-RELEAS o usb/140893 usb [urtw] [usb8] WPA2 not working on rtl8187b o kern/140849 usb [ums] [usb8] USB mouse doesn't work under FreeBSD 8.0- a usb/140810 usb [uftdi] [usb8] 8.X copy and paste problem / tty overfl o usb/140477 usb [umass] [usb8] [patch] allow boot-time attachment of d o usb/140236 usb [msdosfs] [usb8] Labels wiped on external Journaled US o usb/140160 usb [usb8] [acpi] USB ports are no longer "active" after A s usb/139990 usb [panic] [patch] [usb67] Kernel frequently panics after o usb/139243 usb [uhci] [usb67] unplug prolific USB serial -> uhci_abor f usb/138882 usb [ohci] [panic] [usb67] Can't install FreeBSD 7.2 due t o usb/138798 usb [boot] [usb8] 8.0-BETA4 can't boot from USB flash driv o usb/138659 usb [usb8][uftdi] driver broken in RELENG_8/CURRENT o usb/138175 usb [usb67] [boot] System cannot boot, when USB reader wit o usb/138124 usb [snd_uaudio] [usb8] Axed uaudio functionality in the u o usb/138119 usb [usb67] [usb8] MultiBay CDROM (probably on USB bus) is f usb/137872 usb [usb67] [boot] slow booting on usb flash drive o usb/137806 usb [ukbd] [usb67] USB keyboard doesn't work until it's un o usb/137763 usb [usb67][ukbd] Logitech wireless keyboard media keys no o usb/137377 usb [usb8] request support for Huawei E180 o usb/137341 usb [usb8][rum] driver if_rum doesn't work at all and thro f usb/137190 usb [usb8][patch] inhibit spurious button releases for som o usb/137189 usb [usb8][patch] create and use sysctl nodes for HID repo p usb/137188 usb [usb8][patch] correctly handle USB report descriptors o usb/137129 usb [ums] [usb8] SteelSeries Ikari USB laser mouse not att o usb/135938 usb [aue] [usb67] aue driver only passes traffic in promis o usb/135542 usb [keyboard] boot loader does not work with a usb keyboa o usb/135206 usb machine reboots when inserted USB device f usb/135200 usb SAMSUNG i740 usb mass: Synchronize cache failed, statu o usb/134950 usb Lowering DTR for USB-modem via ubsa is not possible o usb/134299 usb Kernel Panic plugging in MF626 USB UMTS Stick u3g o usb/134193 usb System freeze on usb MP3 player insertion o usb/134085 usb [umass] Adding usb quirk for Sony USB flash drive o usb/133989 usb [usb8] [ukbd] USB keyboard dead at mountroot> prompt o usb/133712 usb [ural] [patch] RE: Fixed an issue with ural(4) that wa o usb/133390 usb umass crashes system in 7.1 when Olympus D-540 attache o usb/133296 usb [rum] driver not working properly in hostap mode o usb/132594 usb USB subsystem causes page fault and crashes o usb/132080 usb [patch] [usb] [rum] [panic] Kernel panic after NOMEM c o usb/132066 usb [ukbd] Keyboard failure USB keyboard DELL 760 o usb/132036 usb [panic] page fault when connecting Olympus C740 camera o usb/131583 usb [umass] Failure when detaching umass Device o usb/131576 usb [aue] ADMtek USB To LAN Converter can't send data o usb/131521 usb Registering Belkin UPS to usb_quirks.c o usb/131074 usb no run-time detection of usb devices plugged into exte o usb/130736 usb Page fault unplugging USB stick o usb/130230 usb [patch] [quirk] [usb67] [usb] [cam] [umass] Samsung El o usb/130208 usb Boot process severely hampered by umass0 error o usb/130122 usb [usb8] DVD drive detects as 'da' device f usb/129766 usb [usb] [panic] plugging in usb modem HUAWEI E226 panics o usb/129500 usb [umass] [panic] FreeBSD Crashes when connecting SanDis o usb/129311 usb [usb] [panic] Instant crash with an USB card reader s usb/128990 usb [usb] u3g does not handle RTS/CTS available on for exa o usb/128977 usb [usb67] [patch] uaudio is not full duplex p usb/128803 usb [usbdevs] [patch] Quirk for I-Tuner Networks USBLCD4X2 o usb/128485 usb [umodem] [patch] Nokia N80 modem support o usb/128425 usb [umass] Cannot Connect Maxtor Onetouch 4 USB drive o usb/128418 usb [panic] [rum] loading if_rum causes panic, looks like o usb/127926 usb [boot] USB Timeout during bootup s usb/127453 usb [request] ubsa, uark, ubser, uftdi, and friends should o usb/127342 usb [boot] [panic] enabling usb keyboard and mouse support o usb/127248 usb [ucom] panic while uplcom devices attach and detach o usb/126884 usb [ugen] [patch] Bug in buffer handling in ugen.c o usb/126848 usb [usb]: USB Keyboard hangs during Installation o usb/126740 usb [ulpt] doesn't work on 7.0-RELEASE, 10 second stall be o usb/126519 usb [usb] [panic] panic when plugging in an iphone o kern/126396 usb [panic] kernel panic after unplug USB Bluetooth device o usb/125631 usb [ums] [panic] kernel panic during bootup while 'Logite o usb/125510 usb [panic] repeated plug and unplug of USB mass storage d f usb/125450 usb [panic] Removing USB flash card while being accessed c o usb/125088 usb [keyboard] Touchpad not detected on Adesso AKB-430UG U o usb/124980 usb [panic] kernel panic on detaching unmounted umass devi o kern/124777 usb [ucom] USB cua devices don't revert to tty devices whe o usb/124758 usb [rum] [panic] rum panics SMP kernel o usb/124708 usb [panic] Kernel panic on USB KVM reattach o kern/124130 usb [usb] gmirror fails to start usb devices that were pre o usb/123969 usb [usb] Supermicro H8SMi-2 usb problem: port reset faile o usb/123714 usb [usb] [panic] Panic when hald-storage-probe runs with o usb/123691 usb usbd(8): usbd hangs o usb/123690 usb [usb] [panic] Panic on USB device insertion when usb l o usb/123611 usb [usb] BBB reset failed, STALLED from Imation/Mitsumi U o usb/122992 usb [umass] [patch] MotoROKR Z6 Phone not recognised by um o usb/122936 usb [ucom] [ubsa] Device does not receive interrupt o usb/122905 usb [ubsa] [patch] add Huawei E220 to ubsa s usb/122819 usb [usb67] [patch] Patch to provide dynamic additions to o usb/122813 usb [udbp] [request] udbp driver should be removed in favo o usb/122547 usb [ehci] USB Printer not being recognized after reboot o usb/122539 usb [ohci] [panic] AnyDATA ADU-E1000D - kernel panic: ohci o usb/122483 usb [panic] [ulpt] Repeatable panic in 7.0-STABLE o usb/122119 usb [umass] umass device causes creation of daX but not da o usb/121734 usb [ugen] ugen HP1022 printer device not working since up o usb/121708 usb [keyboard] nforce 650i mobo w/ usb keyboard infinite k o usb/121474 usb [cam] [patch] QUIRK: SAMSUNG HM250JI in LaCie usb hard o usb/121275 usb [boot] [panic] FreeBSD fails to boot with usb legacy s o usb/121169 usb [umass] Issues with usb mp3 player o usb/121045 usb [uftdi] [patch] Add support for PC-OP-RS1 and KURO-RS f usb/120786 usb [usb] [panic] Kernel panic when forced umount of a det o usb/120729 usb [panic] fault while in kernel mode with connecting USB o usb/120321 usb [hang] System hangs when transferring data to WD MyBoo o usb/120283 usb [panic] Automation reboot with wireless keyboard & mou o usb/120034 usb [hang] 6.2 & 6.3 hangs on boot at usb0: OHCI with 1.5 o usb/119977 usb [ums] Mouse does not work in a Cherry-USB keyboard/mou o usb/119653 usb [cam] [patch] iriver s7 player sync cache error patch o usb/119633 usb [umass] umass0: BBB reset failed, IOERROR [regression] o usb/119509 usb [usb] USB flaky on Dell Optiplex 755 o usb/119389 usb [umass] Sony DSC-W1 CBI reset failed, STALLED [regress o usb/119227 usb [ubsa] [patch] ubsa buffer is too small; should be tun o usb/119201 usb [cam] [patch] Quirks for Olympus FE-210 camera, LG and o usb/118480 usb [umass] Timeout in USB mass storage freezes vfs layer o usb/118353 usb [panic] [ppp] repeatable kernel panic during ppp(4) se o usb/118141 usb [ucom] usb serial and nokia phones ucomreadcb ucomread o usb/118140 usb [ucom] [patch] quick hack for ucom to get it behave wi o usb/118098 usb [umass] 6th gen iPod causes problems when disconnectin o usb/117955 usb [umass] [panic] inserting minolta dimage a2 crashes OS o usb/117946 usb [panic] D-Link DUB-E100 rev. B1 crashes FreeBSD 7.0-BE o usb/117938 usb [ums] [patch] Adding support for MS WL Natural and MS o usb/117911 usb [ums] [request] Mouse Gembird MUSWC not work o usb/117893 usb [umass] Lacie USB DVD writing failing o usb/117613 usb [uhci] [irq] uhci interrupt storm & USB leaked memory o usb/117598 usb [snd_uaudio] [patch] Not possible to record with Plant o usb/117313 usb [umass] [panic] panic on usb camera insertion o usb/117200 usb [ugen] ugen0 prints strange string on attach if detach o usb/117183 usb [panic] USB/fusefs -- panic while transferring large a p usb/116947 usb [ukbd] [patch] [regression] enable boot protocol on th o usb/116561 usb [umodem] [panic] RELENG_6 umodem panic "trying to slee o usb/116282 usb [ulpt] Cannot print on USB HP LJ1018 or LJ1300 o usb/115935 usb [usbdevs] [patch] kernel counterproductively attaches o usb/115933 usb [uftdi] [patch] RATOC REX-USB60F (usb serial converter o usb/115400 usb [ehci] Problem with EHCI on ASUS M2N4-SLI o usb/115298 usb [ulpt] [panic] Turning off USB printer panics kernel o usb/114916 usb [umass] [patch] USB Maxtor drive (L300RO) requires qui o kern/114780 usb [uplcom] [panic] Panics while stress testing the uplco o usb/114682 usb [umass] generic USB media-card reader unusable o usb/114310 usb [libusb] [patch] [panic] USB hub attachment panics ker o usb/114068 usb [usb67] [usb8] [umass] [patch] Problem with connection o conf/114013 usb [patch] WITHOUT_USB allow to compil a lot of USB stuff s usb/113060 usb [usb67] [ulpt] [patch] Samsung printer not working in o usb/110856 usb [usb67] [ugen] [patch] interrupt in msgs are truncated o usb/107827 usb [usb67] [ohci] [panic] ohci_add_done addr not found o usb/107388 usb [usb67] [usb8] [new driver] [patch] add utoppy device o usb/106041 usb [usb67] [usb8] [request] FreeBSD does not recognise Mu s usb/103917 usb [usb67] [uhub] USB driver reports "Addr 0 should never o usb/103418 usb [usb67] [usb8] [patch] [request] usbhidctl(8) add abil o usb/103046 usb [usb67] [ulpt] [patch] ulpt event driven I/O with sele o usb/100746 usb [usb67] [ukbd] system does not boot due to USB keyboar o usb/99431 usb [keyboard] FreeBSD on MSI 6566E (Intel 845E motherboar o kern/99200 usb [usb67] SMP-Kernel crashes reliably when Bluetooth con o usb/98343 usb [boot] BBB reset failed errors with Creative Muvo MP3 o usb/97472 usb [cam] [patch] add support for Olympus C150,D390 s usb/97286 usb [mouse] [request] MS Wireless Intellimouse Explorer 2. o usb/97175 usb [umass] [hang] USB cardreader hangs system o usb/96457 usb [umass] [panic] fatback on umass = reboot o usb/96381 usb [cam] [patch] add a quirk table entry for a flash ram o usb/96224 usb [usb] [msdosfs] mount_msdosfs cause page fault in sync s usb/96120 usb [ums] [request] USB mouse not always detected s usb/95636 usb [umass] [boot] 5 minute delay at boot when using VT620 o usb/95562 usb [umass] Write Stress in USB Mass drive causes "vinvalb o usb/95037 usb [umass] USB disk not recognized on hot-plug. o usb/94897 usb [panic] Kernel Panic when cleanly unmounting USB disk o usb/94717 usb [ulpt] Reading from /dev/ulpt can break work of a UHCI o usb/94384 usb [panic] kernel panic with usb2 hardware o usb/93872 usb [cam] [patch] SCSI quirk required for ELTA 8061 OL USB o usb/93828 usb [ohci] [panic] ohci causes panic on boot (HP Pavillion o usb/93389 usb [umass] [patch] Digital Camera Pentax S60 don't work o usb/92852 usb [ums] [patch] Vertical scroll not working properly on o usb/92171 usb [panic] panic unplugging Vodafone Mobile Connect (UMTS o usb/92142 usb [uhub] SET_ADDR_FAILED and SHORT_XFER errors from usb o usb/92083 usb [ural] [panic] panic using WPA on ural NIC in 6.0-RELE o usb/92052 usb [ulpt] usbd causes defunct process with busy file-hand o usb/91906 usb [ehci] [hang] FreeBSD hangs while booting with USB leg f usb/91896 usb camcontrol(8): Serial Number of USB Memory Sticks is n o usb/91811 usb [umass] Compact Flash in HP Photosmart 2610 return " o usb/91546 usb [umodem] [patch] Nokia 6630 mobile phone does not work o usb/91538 usb [ulpt] [patch] Unable to print to EPSON CX3500 o usb/91283 usb [boot] [regression] booting very slow with usb devices o usb/91238 usb [umass] USB tape unit fails to write a second tape fil o usb/90700 usb [umass] [panic] Kernel panic on connect/mount/use umas o usb/89954 usb [umass] [panic] USB Disk driver race condition? s usb/89003 usb [request] LaCie Firewire drive not properly supported o usb/88743 usb [hang] [regression] USB makes kernel hang at boot (reg o usb/88408 usb [axe] axe0 read PHY failed o usb/87648 usb [mouse] Logitech USB-optical mouse problem. f usb/87224 usb [usb] Cannot mount USB Zip750 o usb/86767 usb [umass] [patch] bogus "slice starts beyond end of the o usb/86298 usb [mouse] Known good USB mouse won't work with correct s s usb/85067 usb [uscanner] Cannot attach ScanJet 4300C to usb device o usb/83977 usb [ucom] [panic] ucom1: open bulk out error (addr 2): IN o usb/83863 usb [ugen] Communication problem between opensc/openct via o usb/83756 usb [ums] [patch] Microsoft Intellimouse Explorer 4.0A doe o usb/83504 usb [kernel] [patch] SpeedTouch USB stop working on recent o usb/82520 usb [udbp] [reboot] Reboot when USL101 connected o usb/82350 usb [ucom] [panic] null pointer dereference in USB stack o usb/81621 usb [ehci] [hang] external hd hangs under load on ehci o usb/80935 usb [uvisor] [patch] uvisor.c is not work with CLIE TH55. s usb/80777 usb [request] usb_rem_task() should wait for callback to c s usb/80776 usb [udav] [request] UDAV device driver shouldn't use usb_ o usb/80774 usb [patch] have "usbd_find_desc" in line with the other " o usb/80361 usb [umass] [patch] mounting of Dell usb-stick fails f usb/80040 usb [sound] [hang] Use of sound mixer causes system freeze o usb/79723 usb [usb] [request] prepare for high speed isochronous tra o usb/78984 usb [umass] [patch] Creative MUVO umass failure f usb/77294 usb [ucom] [panic] ucom + ulpcom panic o usb/76653 usb [umass] [patch] Problem with Asahi Optical usb device f usb/76395 usb [uhci] USB printer does not work, usbdevs says "addr 0 s usb/75928 usb [umass] [request] Cytronix SmartMedia card (SMC) reade o usb/75800 usb [ucom] ucom1: init failed STALLED error in time of syn o usb/75764 usb [umass] [patch] "umass0: Phase Error" - no device for f usb/75705 usb [umass] [panic] da0 attach / Optio S4 (with backtrace) f usb/74771 usb [umass] [hang] mounting write-protected umass device a s usb/74453 usb [umass] [patch] Q-lity CD-RW USB ECW-043 (ScanLogic SL o usb/74211 usb [umass] USB flash drive causes CAM status 0x4 on 4.10R o usb/71417 usb [ugen] Cryptoflex e-gate USB token (ugen0) communicati o usb/71416 usb [ugen] Cryptoflex e-gate USB token (ugen0) detach is n o usb/71280 usb [aue] aue0 device (linksys usb100tx) doesn't work in 1 o usb/71155 usb [ulpt] misbehaving usb-printer hangs processes, causes o usb/69006 usb [usbdevs] [patch] Apple Cinema Display hangs USB ports o usb/67301 usb [uftdi] [panic] RTS and system panic o usb/66547 usb [ucom] Palm Tungsten T USB does not initialize correct o usb/63621 usb [umass] [panic] USB MemoryStick Reader stalls/crashes s usb/62257 usb [umass] [request] card reader UCR-61S2B is only half-s s bin/57255 usb [patch] usbd(8) and multi-function devices s usb/52026 usb [usb] [request] umass driver support for InSystem ISD2 s usb/51958 usb [urio] [patch] update for urio driver o usb/40948 usb [umass] [request] USB HP CDW8200 does not work o usb/30929 usb [usb] [patch] use usbd to initialize USB ADSL modem 295 problems total. From owner-freebsd-usb@FreeBSD.ORG Mon Dec 19 12:34:41 2011 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4469A1065673; Mon, 19 Dec 2011 12:34:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 3F8158FC12; Mon, 19 Dec 2011 12:34:40 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id OAA05527; Mon, 19 Dec 2011 14:16:18 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Rcc8g-000FxF-Hw; Mon, 19 Dec 2011 14:16:18 +0200 Message-ID: <4EEF2B11.6080802@FreeBSD.org> Date: Mon, 19 Dec 2011 14:16:17 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111206 Thunderbird/8.0 MIME-Version: 1.0 To: Hans Petter Selasky X-Enigmail-Version: undefined Content-Type: text/plain; charset=X-VIET-VPS Content-Transfer-Encoding: 7bit Cc: FreeBSD current , freebsd-usb@FreeBSD.org Subject: a few usb issues related to edge cases X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2011 12:34:41 -0000 Hans Petter, I think that I see some issues in the USB code that could cause problems in some edge cases. >From easiest to hardest: 1. I think that currently there is a LOR in usb_bus_shutdown. I think that the following patch should fix it: =========================================================================== --- a/sys/dev/usb/controller/usb_controller.c +++ b/sys/dev/usb/controller/usb_controller.c @@ -479,6 +481,7 @@ usb_bus_shutdown(struct usb_proc_msg *pm) bus_generic_shutdown(bus->bdev); + USB_BUS_UNLOCK(bus); usbd_enum_lock(udev); err = usbd_set_config_index(udev, USB_UNCONFIG_INDEX); @@ -497,6 +500,7 @@ usb_bus_shutdown(struct usb_proc_msg *pm) (bus->methods->set_hw_power_sleep) (bus, USB_HW_POWER_SHUTDOWN); usbd_enum_unlock(udev); + USB_BUS_LOCK(bus); } static void =========================================================================== Otherwise there are a lot of nasty reports like: lock order reversal: (sleepable after non-sleepable) 1st 0xffffff80006b0688 ohci0 (ohci0) @ /usr/src/sys/dev/usb/controller/usb_controller.c:336 2nd 0xfffffe00023cf070 USB config SX lock (USB config SX lock) @ /usr/src/sys/dev/usb/usb_device.c:2643 usbd_transfer_unsetup can sleep! with the following non-sleepable locks held: exclusive sleep mutex ohci0 (ohci0) r = 0 (0xffffff80006b0688) locked @ /usr/src/sys/dev/usb/controller/usb_controller.c:336 2. Somewhat related to the above. I think that because the USB subsystem implements the shutdown method and detaches all its drivers, then the ukbd driver won't be able to properly handle the 'shutdown -h' case where the kernel asks to "press any key to reboot" at the end. Depending on which thread wins the race (the one that executes the mainline shutdown code or the USB explore thread that detaches USB devices) there will either an immediate reboot or a later crash when any key is pressed. This is not critical, but OTOH perhaps the USB subsystem doesn't have to do the shutdown. As far as I can see a lot of the drivers just do nothing for the shutdown, for better or for worth. A side note: perhaps it would be a good idea to pass the 'how' value as an additional parameter to device_shutdown. 3. Looking at usbd_transfer_poll I see that it touches a lot of locks, including taking the bus lock. As we've discussed before, this is not safe in a particular context where the polling is supposed to be used - in the kdb/ddb context. If the lock is already taken by another thread, then instead of being able to use a USB keyboard a user would get even less debug-able crash. Also, it seems that usbd_transfer_poll calls into the usual state machine with various callbacks and dynamically made decisions about whether to execute some actions directly or defer their execution to a different thread. That code also touches locks in various places. I think that it would be more preferable to have a method that does the job in a more straight-forward way, without touching any locks, ignoring the usual code paths and assuming that no other treads are running in parallel. Ditto for the method to submit a request. As a side note: we probably need a flag to mark certain things such as e.g. the ukbd driver as "non recoverable", meaning that once those are used in the kdb context then there is no safe way to go back to normal system operation. What do you think? Thank you. -- Andriy Gapon From owner-freebsd-usb@FreeBSD.ORG Mon Dec 19 14:33:11 2011 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62E27106566C; Mon, 19 Dec 2011 14:33:11 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe05.c2i.net [212.247.154.130]) by mx1.freebsd.org (Postfix) with ESMTP id 6C1908FC14; Mon, 19 Dec 2011 14:33:09 +0000 (UTC) X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe05.swip.net (CommuniGate Pro SMTP 5.4.2) with ESMTPA id 216678899; Mon, 19 Dec 2011 15:33:07 +0100 From: Hans Petter Selasky To: Andriy Gapon Date: Mon, 19 Dec 2011 15:30:40 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <4EEF2B11.6080802@FreeBSD.org> In-Reply-To: <4EEF2B11.6080802@FreeBSD.org> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq,NwSZ4V" =?windows-1252?q?=7CLR=2E+tj=7Dg5=0A=09=25V?=,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( =?windows-1252?q?=0A=09=3AAuzV9=3A=2EhESm-x4h240C=609=3Dw?= MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201112191530.40526.hselasky@c2i.net> Cc: FreeBSD current , "freebsd-usb@FreeBSD.org" Subject: Re: a few usb issues related to edge cases X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2011 14:33:11 -0000 On Monday 19 December 2011 13:16:17 Andriy Gapon wrote: > Hans Petter, > > I think that I see some issues in the USB code that could cause problems in > some edge cases. > From easiest to hardest: > Hi, > 1. I think that currently there is a LOR in usb_bus_shutdown. I think > that the following patch should fix it: > =========================================================================== > --- a/sys/dev/usb/controller/usb_controller.c > +++ b/sys/dev/usb/controller/usb_controller.c > @@ -479,6 +481,7 @@ usb_bus_shutdown(struct usb_proc_msg *pm) > > bus_generic_shutdown(bus->bdev); > > + USB_BUS_UNLOCK(bus); > usbd_enum_lock(udev); > > err = usbd_set_config_index(udev, USB_UNCONFIG_INDEX); > @@ -497,6 +500,7 @@ usb_bus_shutdown(struct usb_proc_msg *pm) > (bus->methods->set_hw_power_sleep) (bus, USB_HW_POWER_SHUTDOWN); > > usbd_enum_unlock(udev); > + USB_BUS_LOCK(bus); > } > You are right! I believe my kernel tests were run without WITNESS. > 2. Somewhat related to the above. I think that because the USB subsystem > implements the shutdown method and detaches all its drivers, then the ukbd > driver won't be able to properly handle the 'shutdown -h' case where the > kernel asks to "press any key to reboot" at the end. Depending on which > thread wins the race (the one that executes the mainline shutdown code or > the USB explore thread that detaches USB devices) there will either an > immediate reboot or a later crash when any key is pressed. > This is not critical, but OTOH perhaps the USB subsystem doesn't have to do > the shutdown. As far as I can see a lot of the drivers just do nothing > for the shutdown, for better or for worth. > > A side note: perhaps it would be a good idea to pass the 'how' value as an > additional parameter to device_shutdown. The shutdown of USB is done to give USB devices at last chance to turn off or reduce their current consumption. In the old code the Host controller itself would be disabled, so keyboard wouldn't have worked I believe like you suggest. BTW: Shutdown should be executed after any "Press any key to reboot." and shutdown should be given time to complete, hence for USB this needs to happen in sync with the rest of the USB system. > 3. Looking at usbd_transfer_poll I see that it touches a lot of locks, > including taking the bus lock. As we've discussed before, this is not safe > in a particular context where the polling is supposed to be used - in the > kdb/ddb context. If the lock is already taken by another thread, then > instead of being able to use a USB keyboard a user would get even less > debug-able crash. Also, it seems that usbd_transfer_poll calls into the > usual state machine with various callbacks and dynamically made decisions > about whether to execute some actions directly or defer their execution to > a different thread. This is an optimisation. If the current thread can do the job without a LOR, then we do it right away. Else we let another thread do it. It is possible to have a more simple model, but then you will also get more task switches. > That code also touches locks in various places. I > think that it would be more preferable to have a method that does the job > in a more straight-forward way, without touching any locks, ignoring the > usual code paths and assuming that no other treads are running in > parallel. Ditto for the method to submit a request. The current USB code can be run fine without real locks, if you do a few tricks. I have a single-threaded BSD-kernel replacement for this which works like a charm for non-FreeBSD projects. I'm going to paste a few lines FYI: Why not extend "struct mtx" to have two fields which are only used in case of system polling (no scheduler running): struct mtx { xxx; int owned_polling = 0; struct mtx *parent_polling; }; void mtx_init(struct mtx *mtx, const char *name, const char *type, int opt) { mtx->owned = 0; mtx->parent = mtx; } void mtx_lock(struct mtx *mtx) { mtx = mtx->parent; mtx->owned++; } void mtx_unlock(struct mtx *mtx) { mtx = mtx->parent; mtx->owned--; } int mtx_owned(struct mtx *mtx) { mtx = mtx->parent; return (mtx->owned != 0); } void mtx_destroy(struct mtx *mtx) { /* NOP */ } Maybe mtx_init, mtx_lock, mtx_unlock mtx_owned, mtx_destroy, etc, could be function pointers, which are swapped at panic. USB is SMP! To run SMP code from a single thread, you need to create a hiherachy of the threads: 1) Callbacks (Giant) 2) Callbacks (non-Giant) 3) Control EP (non-Giant) 4) Explore thread (non-Giant) When the explore thread is busy, we look for work in the level above and so on. The USB stack implements this principle, which is maybe not documented anywhere btw. If you want more than code, you can hire me to do that. The mtx-code above I believe is far less work than to make new code which handles the polling case only. The reason for the parent mutex field, is to allow easy grouping of mutexes, so that USB easily can figure out what can run or not. > > As a side note: we probably need a flag to mark certain things such as e.g. > the ukbd driver as "non recoverable", meaning that once those are used in > the kdb context then there is no safe way to go back to normal system > operation. I think you need to do shutdown _after_ the "Press any key to reboot". A flag won't help. --HPS From owner-freebsd-usb@FreeBSD.ORG Mon Dec 19 14:59:59 2011 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE134106564A for ; Mon, 19 Dec 2011 14:59:59 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe01.c2i.net [212.247.154.2]) by mx1.freebsd.org (Postfix) with ESMTP id 51A718FC12 for ; Mon, 19 Dec 2011 14:59:58 +0000 (UTC) X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe01.swip.net (CommuniGate Pro SMTP 5.4.2) with ESMTPA id 220975721 for freebsd-usb@freebsd.org; Mon, 19 Dec 2011 15:59:45 +0100 From: Hans Petter Selasky To: "freebsd-usb@FreeBSD.org" Date: Mon, 19 Dec 2011 15:57:17 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201112191557.17762.hselasky@c2i.net> Subject: USB testers wanted for system suspend and resume X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2011 14:59:59 -0000 Hi, Can someone which have access to computer hardware which support system suspend and resume please test FreeBSD-10-current after this commit: http://svn.freebsd.org/changeset/base/228709 Part of the test: Remove any custom rc.d scripts which load/unload ehci/ohci/uhci/xhci during suspend and resume. --HPS From owner-freebsd-usb@FreeBSD.ORG Mon Dec 19 15:06:21 2011 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F7E61065680; Mon, 19 Dec 2011 15:06:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 57ABA8FC0A; Mon, 19 Dec 2011 15:06:19 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id RAA08656; Mon, 19 Dec 2011 17:06:15 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Rcen9-000G52-8n; Mon, 19 Dec 2011 17:06:15 +0200 Message-ID: <4EEF52E5.8020102@FreeBSD.org> Date: Mon, 19 Dec 2011 17:06:13 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111206 Thunderbird/8.0 MIME-Version: 1.0 To: Hans Petter Selasky References: <4EEF2B11.6080802@FreeBSD.org> <201112191530.40526.hselasky@c2i.net> In-Reply-To: <201112191530.40526.hselasky@c2i.net> X-Enigmail-Version: undefined Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: FreeBSD current , "freebsd-usb@FreeBSD.org" Subject: Re: a few usb issues related to edge cases X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2011 15:06:21 -0000 First replying just to couple of points where there seems to be a misunderstanding. on 19/12/2011 16:30 Hans Petter Selasky said the following: >> 2. Somewhat related to the above. I think that because the USB subsystem >> implements the shutdown method and detaches all its drivers, then the ukbd >> driver won't be able to properly handle the 'shutdown -h' case where the >> kernel asks to "press any key to reboot" at the end. Depending on which >> thread wins the race (the one that executes the mainline shutdown code or >> the USB explore thread that detaches USB devices) there will either an >> immediate reboot or a later crash when any key is pressed. >> This is not critical, but OTOH perhaps the USB subsystem doesn't have to do >> the shutdown. As far as I can see a lot of the drivers just do nothing >> for the shutdown, for better or for worth. >> >> A side note: perhaps it would be a good idea to pass the 'how' value as an >> additional parameter to device_shutdown. > > The shutdown of USB is done to give USB devices at last chance to turn off or > reduce their current consumption. > > In the old code the Host controller itself would be disabled, so keyboard > wouldn't have worked I believe like you suggest. I am not sure about the old code, I have never checked it. But the atkbd definitely works at this stage. > BTW: Shutdown should be executed after any "Press any key to reboot." and > shutdown should be given time to complete, hence for USB this needs to happen > in sync with the rest of the USB system. Have you actually ever done "shutdown -h"? In other words do you know what the "system halt" is? :) I am not sure if it would be a good idea to declare a system as "halted" before shutdown_final hooks are executed. I would rather sacrifice the whole "press a key" interactivity and simply executed hlt. That's because I think that the system halt has a very limited usage, mostly in combination with UPS, where interactivity via console/keyboard is not very important. BTW, the reason that I suggested to pass 'how' to device_shutdown is to give drivers some choice. E.g. USB could the whole shutdown thing for the cases of poweroff and reboot, but keep the devices going for halt. But probably right now we just need to make a decision whether ukbd is going to support system halt or not. If not, then I think that usb_shutdown() must wait until the explore_proc terminates. If yes, then usb_shutdown() should become a noop. Or it could become quite smart to detach/poweroff other devices in such a way that ukbd still stays usable. But that's probably harder to implement. [snip] >> As a side note: we probably need a flag to mark certain things such as e.g. >> the ukbd driver as "non recoverable", meaning that once those are used in >> the kdb context then there is no safe way to go back to normal system >> operation. > > I think you need to do shutdown _after_ the "Press any key to reboot". A flag > won't help. Umm, this suggestion was about entering and exiting KDB/DDB, not about shutdown/reboot. P.S. I've just looked at the code in stable/7 and it seems that it didn't actually unconfigured USB and detached device drivers. At least ohci_shutdown and ohci_shutdown are not called on FreeBSD. -- Andriy Gapon From owner-freebsd-usb@FreeBSD.ORG Mon Dec 19 15:13:47 2011 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAF641065677; Mon, 19 Dec 2011 15:13:46 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe08.c2i.net [212.247.154.226]) by mx1.freebsd.org (Postfix) with ESMTP id CB0F58FC0A; Mon, 19 Dec 2011 15:13:45 +0000 (UTC) X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe08.swip.net (CommuniGate Pro SMTP 5.4.2) with ESMTPA id 219701462; Mon, 19 Dec 2011 16:13:42 +0100 From: Hans Petter Selasky To: Andriy Gapon Date: Mon, 19 Dec 2011 16:11:15 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <4EEF2B11.6080802@FreeBSD.org> <201112191530.40526.hselasky@c2i.net> <4EEF52E5.8020102@FreeBSD.org> In-Reply-To: <4EEF52E5.8020102@FreeBSD.org> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201112191611.15432.hselasky@c2i.net> Cc: FreeBSD current , "freebsd-usb@FreeBSD.org" Subject: Re: a few usb issues related to edge cases X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2011 15:13:47 -0000 On Monday 19 December 2011 16:06:13 Andriy Gapon wrote: > First replying just to couple of points where there seems to be a > misunderstanding. > > on 19/12/2011 16:30 Hans Petter Selasky said the following: > >> 2. Somewhat related to the above. I think that because the USB > >> subsystem implements the shutdown method and detaches all its drivers, > >> then the ukbd driver won't be able to properly handle the 'shutdown -h' > >> case where the kernel asks to "press any key to reboot" at the end. > >> Depending on which thread wins the race (the one that executes the > >> mainline shutdown code or the USB explore thread that detaches USB > >> devices) there will either an immediate reboot or a later crash when > >> any key is pressed. > >> This is not critical, but OTOH perhaps the USB subsystem doesn't have to > >> do the shutdown. As far as I can see a lot of the drivers just do > >> nothing for the shutdown, for better or for worth. > >> > >> A side note: perhaps it would be a good idea to pass the 'how' value as > >> an additional parameter to device_shutdown. > > > > The shutdown of USB is done to give USB devices at last chance to turn > > off or reduce their current consumption. > > > > In the old code the Host controller itself would be disabled, so keyboard > > wouldn't have worked I believe like you suggest. > > I am not sure about the old code, I have never checked it. But the atkbd > definitely works at this stage. ATKBD is no comparison to UKBD :-) > > > BTW: Shutdown should be executed after any "Press any key to reboot." and > > shutdown should be given time to complete, hence for USB this needs to > > happen in sync with the rest of the USB system. > > Have you actually ever done "shutdown -h"? In other words do you know what > the "system halt" is? :) No, I'm usually "shutdown -p now". > I am not sure if it would be a good idea to declare a system as "halted" > before shutdown_final hooks are executed. I would rather sacrifice the > whole "press a key" interactivity and simply executed hlt. That's because > I think that the system halt has a very limited usage, mostly in > combination with UPS, where interactivity via console/keyboard is not very > important. > > BTW, the reason that I suggested to pass 'how' to device_shutdown is to > give drivers some choice. E.g. USB could the whole shutdown thing for the > cases of poweroff and reboot, but keep the devices going for halt. I see. > > But probably right now we just need to make a decision whether ukbd is > going to support system halt or not. > If not, then I think that usb_shutdown() must wait until the explore_proc > terminates. > If yes, then usb_shutdown() should become a noop. Or it could become quite > smart to detach/poweroff other devices in such a way that ukbd still stays > usable. But that's probably harder to implement. I will fix that. I see a missing wait there. Can I assume that we are allowed to sleep from device_shutdown() and that system timers still work? > P.S. I've just looked at the code in stable/7 and it seems that it didn't > actually unconfigured USB and detached device drivers. At least > ohci_shutdown and ohci_shutdown are not called on FreeBSD. Hmm. --HPS From owner-freebsd-usb@FreeBSD.ORG Mon Dec 19 17:34:09 2011 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8A11106564A; Mon, 19 Dec 2011 17:34:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id ED13C8FC1A; Mon, 19 Dec 2011 17:34:08 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA10851; Mon, 19 Dec 2011 19:34:04 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Rch6C-000GBf-FP; Mon, 19 Dec 2011 19:34:04 +0200 Message-ID: <4EEF758C.5090904@FreeBSD.org> Date: Mon, 19 Dec 2011 19:34:04 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111206 Thunderbird/8.0 MIME-Version: 1.0 To: Hans Petter Selasky References: <4EEF2B11.6080802@FreeBSD.org> <201112191530.40526.hselasky@c2i.net> <4EEF52E5.8020102@FreeBSD.org> <201112191611.15432.hselasky@c2i.net> In-Reply-To: <201112191611.15432.hselasky@c2i.net> X-Enigmail-Version: undefined Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: FreeBSD current , "freebsd-usb@FreeBSD.org" Subject: Re: a few usb issues related to edge cases X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2011 17:34:09 -0000 on 19/12/2011 17:11 Hans Petter Selasky said the following: > I will fix that. I see a missing wait there. Can I assume that we are allowed > to sleep from device_shutdown() and that system timers still work? I don't see any reason why either of these should be not true. Oh, and I see that you've already committed the change - thanks! -- Andriy Gapon From owner-freebsd-usb@FreeBSD.ORG Tue Dec 20 12:25:29 2011 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BF971065676; Tue, 20 Dec 2011 12:25:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 35FF98FC13; Tue, 20 Dec 2011 12:25:27 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id OAA29815; Tue, 20 Dec 2011 14:25:23 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Rcyl1-000JIh-47; Tue, 20 Dec 2011 14:25:23 +0200 Message-ID: <4EF07EB0.9000209@FreeBSD.org> Date: Tue, 20 Dec 2011 14:25:20 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111206 Thunderbird/8.0 MIME-Version: 1.0 To: Hans Petter Selasky References: <4EEF2B11.6080802@FreeBSD.org> <201112191530.40526.hselasky@c2i.net> In-Reply-To: <201112191530.40526.hselasky@c2i.net> X-Enigmail-Version: undefined Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: FreeBSD current , "freebsd-usb@FreeBSD.org" Subject: Re: a few usb issues related to edge cases X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2011 12:25:29 -0000 Now the juicy stuff :) on 19/12/2011 16:30 Hans Petter Selasky said the following: >> 3. Looking at usbd_transfer_poll I see that it touches a lot of locks, >> including taking the bus lock. As we've discussed before, this is not safe >> in a particular context where the polling is supposed to be used - in the >> kdb/ddb context. If the lock is already taken by another thread, then >> instead of being able to use a USB keyboard a user would get even less >> debug-able crash. Also, it seems that usbd_transfer_poll calls into the >> usual state machine with various callbacks and dynamically made decisions >> about whether to execute some actions directly or defer their execution to >> a different thread. > > This is an optimisation. If the current thread can do the job without a LOR, > then we do it right away. Else we let another thread do it. It is possible to > have a more simple model, but then you will also get more task switches. I think that you are speaking here about the code behavior in the general context. And I want to limit this part of discussion to the contexts where usbd_transfer_poll is actually used - kdb and panic. In those contexts there is one and only one thread that must do all the work. Other threads are stopped and "frozen" in the middle of whatever they were doing before kdb was entered or panic called (provided SCHEDULER_STOPPED() == true). >> That code also touches locks in various places. I >> think that it would be more preferable to have a method that does the job >> in a more straight-forward way, without touching any locks, ignoring the >> usual code paths and assuming that no other treads are running in >> parallel. Ditto for the method to submit a request. > > The current USB code can be run fine without real locks, if you do a few > tricks. I have a single-threaded BSD-kernel replacement for this which works > like a charm for non-FreeBSD projects. That's very cool. I believe that various implementations of USB stack for BIOS and similar are also non-threaded. > I'm going to paste a few lines FYI: > > Why not extend "struct mtx" to have two fields which are only used in case of > system polling (no scheduler running): > > struct mtx { > xxx; > int owned_polling = 0; > struct mtx *parent_polling; > }; > > void > mtx_init(struct mtx *mtx, const char *name, const char *type, int opt) > { > mtx->owned = 0; > mtx->parent = mtx; > } > > void > mtx_lock(struct mtx *mtx) > { > mtx = mtx->parent; > mtx->owned++; > } > > void > mtx_unlock(struct mtx *mtx) > { > mtx = mtx->parent; > mtx->owned--; > } > > int > mtx_owned(struct mtx *mtx) > { > mtx = mtx->parent; > return (mtx->owned != 0); > } > > void > mtx_destroy(struct mtx *mtx) > { > /* NOP */ > } > > Maybe mtx_init, mtx_lock, mtx_unlock mtx_owned, mtx_destroy, etc, could be > function pointers, which are swapped at panic. I am not sure if I got your idea right based on the pseudo-code above. Right now in the head we already skip all locks when SCHEDULER_STOPPED() is true. But, but, that doesn't cover all polling cases as the automatic lock skipping is _not_ done for kdb. There are various reasons for that. That's why the kdb_active flag should be checked by the code that can be executed in the kdb context when dealing with locking or shared resources in general. > USB is SMP! Right and that's good, but there are cases where SMP is effectively stopped. Those are panic and kdb. > To run SMP code from a single thread, you need to create a > hiherachy of the threads: > > 1) Callbacks (Giant) > 2) Callbacks (non-Giant) > 3) Control EP (non-Giant) > 4) Explore thread (non-Giant) > > When the explore thread is busy, we look for work in the level above and so > on. The USB stack implements this principle, which is maybe not documented > anywhere btw. If you want more than code, you can hire me to do that. > > The mtx-code above I believe is far less work than to make new code which > handles the polling case only. > > The reason for the parent mutex field, is to allow easy grouping of mutexes, > so that USB easily can figure out what can run or not. This all is really above my level of knowledge. Basically my current intention is the following: make ukbd/usb code work in panic+SCHEDULER_STOPPED case in the same way (or not worse, at least) as it currently works for the kdb case. I don't have enough knowledge (and time) to go beyond that. I just wanted to draw your attention to the fact that obtaining any locks in the kdb context (or USB polling code in general, even) is not a good idea. Chances of getting into trouble on those locks are probably quite moderate or even low, but they do exist. I am not sure if you are getting any bug reports about such troubles :-) Regular users probably do not use kdb too often and a panic for them is just a "crash", so they likely do not expect anything usable/debuggable after that :-) P.S. Since most (but not all) locking operations in the USB code are already wrapped under USB-specific macros, then probably it could make sense to implement your suggestion locally to the USB code. Just need to take some care to cover the cases that are not wrapped yet (direct calls to mtx_lock and similar) and to handle cases where important decisions are made based on mtx_owned return value (especially in loops). For example, below are some macros that I want to use in the ukbd code: #define KBD_LOCK() \ do { \ if (!kdb_active) \ mtx_lock(&Giant); \ } while (0) #define KBD_UNLOCK() \ do { \ if (!kdb_active) \ mtx_unlock(&Giant); \ } while (0) #ifdef INVARIANTS #define KBD_LOCK_ASSERT() \ do { \ if (!cold && !kdb_active && panicstr == NULL) \ mtx_assert(&Giant, MA_OWNED); \ } while (0) #else #define KBD_LOCK_ASSERT() (void)0 #endif P.P.S. Did you have a chance to look at http://wiki.freebsd.org/AvgSyscons yet? Thank you! -- Andriy Gapon From owner-freebsd-usb@FreeBSD.ORG Tue Dec 20 13:08:31 2011 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31DF2106566B for ; Tue, 20 Dec 2011 13:08:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 819388FC12 for ; Tue, 20 Dec 2011 13:08:30 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA00729; Tue, 20 Dec 2011 15:08:26 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1RczQf-000JKm-V9; Tue, 20 Dec 2011 15:08:25 +0200 Message-ID: <4EF088C8.8090906@FreeBSD.org> Date: Tue, 20 Dec 2011 15:08:24 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111206 Thunderbird/8.0 MIME-Version: 1.0 To: Hans Petter Selasky X-Enigmail-Version: undefined Content-Type: text/plain; charset=X-VIET-VPS Content-Transfer-Encoding: 7bit Cc: freebsd-usb@FreeBSD.org Subject: ukbd locking update X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2011 13:08:31 -0000 I completing a patch that changes some locking in ukbd to account for SCHEDULER_STOPPED and for other realities of the code. As a preview I would like to share couple of observations that had their effect on the patch. 1. Acquiring Giant in device_attach, _detach in similar newbus method implementations should be redundant because those are already executed with Giant held. That's done either by the general newbus code or via usbd_enum_lock() when the operations are executed in the USB explore thread. 2. As discussed before: if (!mutex_owned(&Giant)) mutex_lock(&Giant) this pattern does not make sense, because the Giant is recursive and can be simply acquired without any check. Do you agree? -- Andriy Gapon From owner-freebsd-usb@FreeBSD.ORG Tue Dec 20 14:25:54 2011 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72BEE106564A for ; Tue, 20 Dec 2011 14:25:54 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 0B83A8FC15 for ; Tue, 20 Dec 2011 14:25:53 +0000 (UTC) Received: by wgbdr11 with SMTP id dr11so12537122wgb.31 for ; Tue, 20 Dec 2011 06:25:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=WzZ8UZEsPNL2y3dL6ipucPAlaiKfVn6+bPyEa7fTrZg=; b=fVBBwEZ3eh7HqkuooLXPyK6gYCOUeWs6IQXcj1ihRKNce5Zy/Ey7PDwbVoOG1v5vjT nuH2Cjq0JbKzziegCwkIb2qPcmp4yiWZFk9mOqDnfqW1PSnADJeTODsFIknX/h248bau 0JxlhtrO4pOJfGuBgaqbw059lRtQpVav3Whig= MIME-Version: 1.0 Received: by 10.227.200.206 with SMTP id ex14mr2188715wbb.11.1324389604621; Tue, 20 Dec 2011 06:00:04 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.216.18.130 with HTTP; Tue, 20 Dec 2011 06:00:04 -0800 (PST) In-Reply-To: <4EF088C8.8090906@FreeBSD.org> References: <4EF088C8.8090906@FreeBSD.org> Date: Tue, 20 Dec 2011 15:00:04 +0100 X-Google-Sender-Auth: XZ0Di2mgYVE60oLjD1BkrRdRi7A Message-ID: From: Attilio Rao To: Andriy Gapon Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-usb@freebsd.org Subject: Re: ukbd locking update X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2011 14:25:54 -0000 2011/12/20 Andriy Gapon : > > I completing a patch that changes some locking in ukbd to account for > SCHEDULER_STOPPED and for other realities of the code. > > As a preview I would like to share couple of observations that had their = effect > on the patch. > > 1. Acquiring Giant in device_attach, _detach in similar newbus method > implementations should be redundant because those are already executed wi= th > Giant held. =C2=A0That's done either by the general newbus code or via > usbd_enum_lock() when the operations are executed in the USB explore thre= ad. That's right, however, if you plan to axe those because of the newbus assumption I'd prefer you add a comment for every function you touch saying that it needs to be Giant protected (in order to cope with them once newbus is made MPSAFE). Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-freebsd-usb@FreeBSD.ORG Tue Dec 20 14:41:01 2011 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF75F106566C for ; Tue, 20 Dec 2011 14:41:01 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from ms16-1.1blu.de (ms16-1.1blu.de [89.202.0.34]) by mx1.freebsd.org (Postfix) with ESMTP id 7DF048FC08 for ; Tue, 20 Dec 2011 14:41:01 +0000 (UTC) Received: from [82.113.119.229] (helo=tiny.Sisis.de) by ms16-1.1blu.de with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1Rd0sF-00030r-ME for freebsd-usb@freebsd.org; Tue, 20 Dec 2011 15:40:59 +0100 Received: from tiny.Sisis.de (localhost [127.0.0.1]) by tiny.Sisis.de (8.14.5/8.14.3) with ESMTP id pBKEetRr001243 for ; Tue, 20 Dec 2011 15:40:56 +0100 (CET) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by tiny.Sisis.de (8.14.5/8.14.3/Submit) id pBKEeSgl001242 for freebsd-usb@freebsd.org; Tue, 20 Dec 2011 15:40:28 +0100 (CET) (envelope-from guru@unixarea.de) X-Authentication-Warning: tiny.Sisis.de: guru set sender to guru@unixarea.de using -f Date: Tue, 20 Dec 2011 15:40:22 +0100 From: Matthias Apitz To: freebsd-usb@freebsd.org Message-ID: <20111220144022.GA1231@tiny> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: FreeBSD 10.0-CURRENT r226986 (i386) User-Agent: Mutt/1.5.21 (2010-09-15) X-Con-Id: 51246 X-Originating-IP: 82.113.119.229 Subject: webcamd && 0x046d:0x08f0 (Logitech Quickcam messenger) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Matthias Apitz List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2011 14:41:01 -0000 Hello, Is this webcam supported in 10-CURRENT (r226986, ports from November 1st): ugen0.2: at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON bLength = 0x0012 bDescriptorType = 0x0001 bcdUSB = 0x0200 bDeviceClass = 0x00ff bDeviceSubClass = 0x00ff bDeviceProtocol = 0x00ff bMaxPacketSize0 = 0x0008 idVendor = 0x046d idProduct = 0x08f0 bcdDevice = 0x0100 iManufacturer = 0x0000 iProduct = 0x0001 iSerialNumber = 0x0000 bNumConfigurations = 0x0001 webcamd(8) does not create a /dev/video0 device, for other cams it does; Google says that the cam is a "Logitech Quickcam messenger". Thanks matthias -- Matthias Apitz e - w http://www.unixarea.de/ UNIX since V7 on PDP-11, UNIX on mainframe since ESER 1055 (IBM /370) UNIX on x86 since SVR4.2 UnixWare 2.1.2, FreeBSD since 2.2.5 From owner-freebsd-usb@FreeBSD.ORG Tue Dec 20 14:59:06 2011 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EDA8106564A; Tue, 20 Dec 2011 14:59:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 267928FC13; Tue, 20 Dec 2011 14:59:04 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA02678; Tue, 20 Dec 2011 16:59:03 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Rd19j-000JQH-Ed; Tue, 20 Dec 2011 16:59:03 +0200 Message-ID: <4EF0A2B6.8050206@FreeBSD.org> Date: Tue, 20 Dec 2011 16:59:02 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111206 Thunderbird/8.0 MIME-Version: 1.0 To: Attilio Rao References: <4EF088C8.8090906@FreeBSD.org> In-Reply-To: X-Enigmail-Version: undefined Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-usb@FreeBSD.org Subject: Re: ukbd locking update X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2011 14:59:06 -0000 on 20/12/2011 16:00 Attilio Rao said the following: > 2011/12/20 Andriy Gapon : >> >> I completing a patch that changes some locking in ukbd to account for >> SCHEDULER_STOPPED and for other realities of the code. >> >> As a preview I would like to share couple of observations that had their effect >> on the patch. >> >> 1. Acquiring Giant in device_attach, _detach in similar newbus method >> implementations should be redundant because those are already executed with >> Giant held. That's done either by the general newbus code or via >> usbd_enum_lock() when the operations are executed in the USB explore thread. > > That's right, however, if you plan to axe those because of the newbus > assumption I'd prefer you add a comment for every function you touch > saying that it needs to be Giant protected (in order to cope with them > once newbus is made MPSAFE). I put mtx_assert there. I think that that should be sufficiently self-documenting and self-protecting too. -- Andriy Gapon From owner-freebsd-usb@FreeBSD.ORG Tue Dec 20 15:16:42 2011 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D57DD1065672; Tue, 20 Dec 2011 15:16:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id D5FE28FC17; Tue, 20 Dec 2011 15:16:41 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id RAA03060; Tue, 20 Dec 2011 17:16:37 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Rd1Qj-000JR2-70; Tue, 20 Dec 2011 17:16:37 +0200 Message-ID: <4EF0A6D4.2020107@FreeBSD.org> Date: Tue, 20 Dec 2011 17:16:36 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111206 Thunderbird/8.0 MIME-Version: 1.0 To: Hans Petter Selasky References: <4EF088C8.8090906@FreeBSD.org> In-Reply-To: <4EF088C8.8090906@FreeBSD.org> X-Enigmail-Version: undefined Content-Type: text/plain; charset=x-viet-vps Content-Transfer-Encoding: 7bit Cc: FreeBSD-Current , freebsd-usb@FreeBSD.org Subject: Re: ukbd locking update X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2011 15:16:42 -0000 And the new patch: http://people.freebsd.org/~avg/usb.new.diff -- Andriy Gapon From owner-freebsd-usb@FreeBSD.ORG Tue Dec 20 15:19:16 2011 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B0721065672; Tue, 20 Dec 2011 15:19:16 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id BACA18FC12; Tue, 20 Dec 2011 15:19:15 +0000 (UTC) Received: by faaf16 with SMTP id f16so5187823faa.13 for ; Tue, 20 Dec 2011 07:19:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=tqdebGASBqbmTlcsav1om9zeCqRNOzGZXOfvzTe8kns=; b=h6xOhjKUBYmUDISk76FJe526JRn5WzKmBiWBP9dkTBq0Rz7SObAjxwfMBgV70aC4yZ Yv/ZSglMKu0m2xe7QmPDui6CQcNTQUx8UsCw3xz7ToM1OMIMJv4rLt9N2jzGKz1DREKV DHoHfpZqZmm0M2sk6quyvv08QPNDTsQkSPyNg= MIME-Version: 1.0 Received: by 10.181.12.43 with SMTP id en11mr5668689wid.6.1324394354475; Tue, 20 Dec 2011 07:19:14 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.216.18.130 with HTTP; Tue, 20 Dec 2011 07:19:14 -0800 (PST) In-Reply-To: <4EF0A2B6.8050206@FreeBSD.org> References: <4EF088C8.8090906@FreeBSD.org> <4EF0A2B6.8050206@FreeBSD.org> Date: Tue, 20 Dec 2011 16:19:14 +0100 X-Google-Sender-Auth: fbwzJp9gmJoDR6_aCntkCjE87b8 Message-ID: From: Attilio Rao To: Andriy Gapon Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-usb@freebsd.org Subject: Re: ukbd locking update X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2011 15:19:16 -0000 2011/12/20 Andriy Gapon : > on 20/12/2011 16:00 Attilio Rao said the following: >> 2011/12/20 Andriy Gapon : >>> >>> I completing a patch that changes some locking in ukbd to account for >>> SCHEDULER_STOPPED and for other realities of the code. >>> >>> As a preview I would like to share couple of observations that had thei= r effect >>> on the patch. >>> >>> 1. Acquiring Giant in device_attach, _detach in similar newbus method >>> implementations should be redundant because those are already executed = with >>> Giant held. =C2=A0That's done either by the general newbus code or via >>> usbd_enum_lock() when the operations are executed in the USB explore th= read. >> >> That's right, however, if you plan to axe those because of the newbus >> assumption I'd prefer you add a comment for every function you touch >> saying that it needs to be Giant protected (in order to cope with them >> once newbus is made MPSAFE). > > I put mtx_assert there. =C2=A0I think that that should be sufficiently > self-documenting and self-protecting too. Yes, that looks good. Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-freebsd-usb@FreeBSD.ORG Tue Dec 20 16:43:47 2011 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA17A1065675; Tue, 20 Dec 2011 16:43:47 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe06.c2i.net [212.247.154.162]) by mx1.freebsd.org (Postfix) with ESMTP id CAF298FC29; Tue, 20 Dec 2011 16:43:46 +0000 (UTC) X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe06.swip.net (CommuniGate Pro SMTP 5.4.2) with ESMTPA id 218384289; Tue, 20 Dec 2011 17:43:44 +0100 From: Hans Petter Selasky To: Andriy Gapon Date: Tue, 20 Dec 2011 17:41:18 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <4EF088C8.8090906@FreeBSD.org> <4EF0A6D4.2020107@FreeBSD.org> In-Reply-To: <4EF0A6D4.2020107@FreeBSD.org> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201112201741.18428.hselasky@c2i.net> Cc: FreeBSD-Current , freebsd-usb@freebsd.org Subject: Re: ukbd locking update X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2011 16:43:47 -0000 On Tuesday 20 December 2011 16:16:36 Andriy Gapon wrote: > And the new patch: > http://people.freebsd.org/~avg/usb.new.diff Patch looks OK. I will give it a spin later today. Feel free to commit if you've tested the three use-cases I listed in a previous e-mail. --HPS From owner-freebsd-usb@FreeBSD.ORG Tue Dec 20 16:44:53 2011 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB4D3106567D; Tue, 20 Dec 2011 16:44:53 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe03.c2i.net [212.247.154.66]) by mx1.freebsd.org (Postfix) with ESMTP id 0263A8FC1B; Tue, 20 Dec 2011 16:44:52 +0000 (UTC) X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe03.swip.net (CommuniGate Pro SMTP 5.4.2) with ESMTPA id 52872170; Tue, 20 Dec 2011 17:44:50 +0100 From: Hans Petter Selasky To: Andriy Gapon Date: Tue, 20 Dec 2011 17:42:23 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <4EF088C8.8090906@FreeBSD.org> In-Reply-To: <4EF088C8.8090906@FreeBSD.org> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201112201742.23998.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org Subject: Re: ukbd locking update X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2011 16:44:53 -0000 On Tuesday 20 December 2011 14:08:24 Andriy Gapon wrote: > I completing a patch that changes some locking in ukbd to account for > SCHEDULER_STOPPED and for other realities of the code. > > As a preview I would like to share couple of observations that had their > effect on the patch. > > 1. Acquiring Giant in device_attach, _detach in similar newbus method > implementations should be redundant because those are already executed with > Giant held. That's done either by the general newbus code or via > usbd_enum_lock() when the operations are executed in the USB explore > thread. > > 2. As discussed before: > if (!mutex_owned(&Giant)) > mutex_lock(&Giant) > this pattern does not make sense, because the Giant is recursive and can be > simply acquired without any check. > > Do you agree? Yes! --HPS From owner-freebsd-usb@FreeBSD.ORG Tue Dec 20 16:46:25 2011 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FFAA106566B for ; Tue, 20 Dec 2011 16:46:25 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe03.c2i.net [212.247.154.66]) by mx1.freebsd.org (Postfix) with ESMTP id A8A798FC15 for ; Tue, 20 Dec 2011 16:46:24 +0000 (UTC) X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe03.swip.net (CommuniGate Pro SMTP 5.4.2) with ESMTPA id 52872758; Tue, 20 Dec 2011 17:46:21 +0100 From: Hans Petter Selasky To: freebsd-usb@freebsd.org, Matthias Apitz Date: Tue, 20 Dec 2011 17:43:55 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <20111220144022.GA1231@tiny> In-Reply-To: <20111220144022.GA1231@tiny> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq,NwSZ4V" =?iso-8859-1?q?=7CLR=2E+tj=7Dg5=0A=09=25V?=,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( =?iso-8859-1?q?=0A=09=3AAuzV9=3A=2EhESm-x4h240C=609=3Dw?= MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201112201743.55107.hselasky@c2i.net> Cc: Subject: Re: webcamd && 0x046d:0x08f0 (Logitech Quickcam messenger) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2011 16:46:25 -0000 On Tuesday 20 December 2011 15:40:22 Matthias Apitz wrote: > idVendor = 0x046d > idProduct = 0x08f0 Grep for the 4-digit hex-values above in the webcamd source code. If you find them: Yes Else No :-) --HPS From owner-freebsd-usb@FreeBSD.ORG Tue Dec 20 20:43:13 2011 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AA6B106566B; Tue, 20 Dec 2011 20:43:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id A17BF8FC12; Tue, 20 Dec 2011 20:43:12 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id WAA07645; Tue, 20 Dec 2011 22:43:07 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Rd6Wg-000Jdg-W2; Tue, 20 Dec 2011 22:43:07 +0200 Message-ID: <4EF0F359.3090008@FreeBSD.org> Date: Tue, 20 Dec 2011 22:43:05 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111206 Thunderbird/8.0 MIME-Version: 1.0 To: Hans Petter Selasky References: <4EF088C8.8090906@FreeBSD.org> <4EF0A6D4.2020107@FreeBSD.org> <201112201741.18428.hselasky@c2i.net> In-Reply-To: <201112201741.18428.hselasky@c2i.net> X-Enigmail-Version: undefined Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: FreeBSD-Current , freebsd-usb@FreeBSD.org Subject: Re: ukbd locking update X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2011 20:43:13 -0000 on 20/12/2011 18:41 Hans Petter Selasky said the following: > On Tuesday 20 December 2011 16:16:36 Andriy Gapon wrote: >> And the new patch: >> http://people.freebsd.org/~avg/usb.new.diff > > Patch looks OK. I will give it a spin later today. Feel free to commit if > you've tested the three use-cases I listed in a previous e-mail. Thank you for the quick review. My tests were all successful, including those 3 scenarios. Please let me know if you have any questions and how your testing goes. I will try to commit this tomorrow morning. -- Andriy Gapon From owner-freebsd-usb@FreeBSD.ORG Wed Dec 21 06:31:57 2011 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 552A91065672 for ; Wed, 21 Dec 2011 06:31:57 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from ms16-1.1blu.de (ms16-1.1blu.de [89.202.0.34]) by mx1.freebsd.org (Postfix) with ESMTP id 1326B8FC15 for ; Wed, 21 Dec 2011 06:31:56 +0000 (UTC) Received: from [93.104.76.83] (helo=localhost.my.domain) by ms16-1.1blu.de with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1RdFiU-00057O-9f; Wed, 21 Dec 2011 07:31:54 +0100 Received: from localhost.my.domain (localhost [127.0.0.1]) by localhost.my.domain (8.14.4/8.14.3) with ESMTP id pBL6VqXv003676; Wed, 21 Dec 2011 07:31:52 +0100 (CET) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by localhost.my.domain (8.14.4/8.14.3/Submit) id pBL6VpSb003675; Wed, 21 Dec 2011 07:31:51 +0100 (CET) (envelope-from guru@unixarea.de) X-Authentication-Warning: localhost.my.domain: guru set sender to guru@unixarea.de using -f Date: Wed, 21 Dec 2011 07:31:50 +0100 From: Matthias Apitz To: Hans Petter Selasky Message-ID: <20111221063150.GA3644@tinyCurrent> References: <20111220144022.GA1231@tiny> <201112201743.55107.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201112201743.55107.hselasky@c2i.net> X-Operating-System: FreeBSD 9.0-CURRENT r214444 (i386) User-Agent: Mutt/1.5.21 (2010-09-15) X-Con-Id: 51246 X-Originating-IP: 93.104.76.83 Cc: freebsd-usb@freebsd.org Subject: Re: webcamd && 0x046d:0x08f0 (Logitech Quickcam messenger) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Matthias Apitz List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2011 06:31:57 -0000 El día Tuesday, December 20, 2011 a las 05:43:55PM +0100, Hans Petter Selasky escribió: > On Tuesday 20 December 2011 15:40:22 Matthias Apitz wrote: > > idVendor = 0x046d > > idProduct = 0x08f0 > > Grep for the 4-digit hex-values above in the webcamd source code. If you find > them: > > Yes > > Else > > No Gives 'Yes': $ find . -type f -exec fgrep -i 08f0 {} /dev/null \; ./work/webcamd-3.0.0.2/man4/stv06xx.4:.It 046d:08f0 Ta "Logitech QuickCam Messenger" ... but does not work :-) matthias -- Matthias Apitz t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211 e - w http://www.unixarea.de/ UNIX since V7 on PDP-11 | UNIX on mainframe since ESER 1055 (IBM /370) UNIX on x86 since SVR4.2 UnixWare 2.1.2 | FreeBSD since 2.2.5 From owner-freebsd-usb@FreeBSD.ORG Wed Dec 21 06:52:49 2011 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10B16106566B for ; Wed, 21 Dec 2011 06:52:49 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe07.c2i.net [212.247.154.194]) by mx1.freebsd.org (Postfix) with ESMTP id 8C8688FC15 for ; Wed, 21 Dec 2011 06:52:48 +0000 (UTC) X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe07.swip.net (CommuniGate Pro SMTP 5.4.2) with ESMTPA id 219730752; Wed, 21 Dec 2011 07:52:46 +0100 From: Hans Petter Selasky To: Matthias Apitz Date: Wed, 21 Dec 2011 07:50:18 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <20111220144022.GA1231@tiny> <201112201743.55107.hselasky@c2i.net> <20111221063150.GA3644@tinyCurrent> In-Reply-To: <20111221063150.GA3644@tinyCurrent> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq,NwSZ4V" =?iso-8859-1?q?=7CLR=2E+tj=7Dg5=0A=09=25V?=,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( =?iso-8859-1?q?=0A=09=3AAuzV9=3A=2EhESm-x4h240C=609=3Dw?= MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <201112210750.19021.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org Subject: Re: webcamd && 0x046d:0x08f0 (Logitech Quickcam messenger) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2011 06:52:49 -0000 On Wednesday 21 December 2011 07:31:50 Matthias Apitz wrote: > El d=EDa Tuesday, December 20, 2011 a las 05:43:55PM +0100, Hans Petter=20 Selasky escribi=F3: > > On Tuesday 20 December 2011 15:40:22 Matthias Apitz wrote: > > > idVendor =3D 0x046d > > > idProduct =3D 0x08f0 > >=20 > > Grep for the 4-digit hex-values above in the webcamd source code. If you > > find them: > >=20 > > Yes > >=20 > > Else > >=20 > > No >=20 > Gives 'Yes': >=20 > $ find . -type f -exec fgrep -i 08f0 {} /dev/null \; > ./work/webcamd-3.0.0.2/man4/stv06xx.4:.It 046d:08f0 Ta "Logitech > QuickCam Messenger" ... >=20 > but does not work :-) >=20 > matthias Hi, There is a driver here: http://mag.cx/messenger/ You should either ask at the linux media mailing list for them to include t= his=20 driver or try to build it with webcamd. =2D-HPS From owner-freebsd-usb@FreeBSD.ORG Wed Dec 21 06:53:22 2011 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CFB51065677; Wed, 21 Dec 2011 06:53:22 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id D7F858FC12; Wed, 21 Dec 2011 06:53:21 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id pBL6rLxv005216; Wed, 21 Dec 2011 06:53:21 GMT (envelope-from remko@freefall.freebsd.org) Received: (from remko@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id pBL6rL1b005212; Wed, 21 Dec 2011 06:53:21 GMT (envelope-from remko) Date: Wed, 21 Dec 2011 06:53:21 GMT Message-Id: <201112210653.pBL6rL1b005212@freefall.freebsd.org> To: remko@FreeBSD.org, freebsd-i386@FreeBSD.org, freebsd-usb@FreeBSD.org From: remko@FreeBSD.org Cc: Subject: Re: kern/163091: [panic] Fatal trap 12: page fault while in kernel mode X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2011 06:53:22 -0000 Synopsis: [panic] Fatal trap 12: page fault while in kernel mode Responsible-Changed-From-To: freebsd-i386->freebsd-usb Responsible-Changed-By: remko Responsible-Changed-When: Wed Dec 21 06:53:06 UTC 2011 Responsible-Changed-Why: Reassign to USB team, the error might be in there. http://www.freebsd.org/cgi/query-pr.cgi?pr=163091 From owner-freebsd-usb@FreeBSD.ORG Wed Dec 21 08:50:11 2011 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE79C106566B for ; Wed, 21 Dec 2011 08:50:11 +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 AE24E8FC0A for ; Wed, 21 Dec 2011 08:50:11 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id pBL8oBhc035576 for ; Wed, 21 Dec 2011 08:50:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id pBL8oBFB035575; Wed, 21 Dec 2011 08:50:11 GMT (envelope-from gnats) Date: Wed, 21 Dec 2011 08:50:11 GMT Message-Id: <201112210850.pBL8oBFB035575@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: dfilter@FreeBSD.ORG (dfilter service) Cc: Subject: Re: kern/163091: commit references a PR X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dfilter service List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2011 08:50:11 -0000 The following reply was made to PR kern/163091; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/163091: commit references a PR Date: Wed, 21 Dec 2011 08:46:17 +0000 (UTC) Author: hselasky Date: Wed Dec 21 08:46:08 2011 New Revision: 228758 URL: http://svn.freebsd.org/changeset/base/228758 Log: Fix for race against user-space applications trying to change the configuration on USB HUBs. PR: kern/163091 MFC after: 1 week Modified: head/sys/dev/usb/usb_hub.c Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Wed Dec 21 02:45:51 2011 (r228757) +++ head/sys/dev/usb/usb_hub.c Wed Dec 21 08:46:08 2011 (r228758) @@ -707,6 +707,13 @@ uhub_explore(struct usb_device *udev) DPRINTF("Device is suspended!\n"); return (0); } + + /* + * Make sure we don't race against user-space applications + * like LibUSB: + */ + usbd_enum_lock(udev); + for (x = 0; x != hub->nports; x++) { up = hub->ports + x; portno = x + 1; @@ -784,6 +791,8 @@ uhub_explore(struct usb_device *udev) up->restartcnt = 0; } + usbd_enum_unlock(udev); + /* initial status checked */ sc->sc_flags |= UHUB_FLAG_DID_EXPLORE; _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-freebsd-usb@FreeBSD.ORG Wed Dec 21 11:29:56 2011 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 677191065670; Wed, 21 Dec 2011 11:29:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 7EE068FC14; Wed, 21 Dec 2011 11:29:55 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id NAA18620; Wed, 21 Dec 2011 13:29:50 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1RdKMo-000MV0-9f; Wed, 21 Dec 2011 13:29:50 +0200 Message-ID: <4EF1C32D.3070107@FreeBSD.org> Date: Wed, 21 Dec 2011 13:29:49 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111206 Thunderbird/8.0 MIME-Version: 1.0 To: Hans Petter Selasky References: <4EEF2B11.6080802@FreeBSD.org> <201112191530.40526.hselasky@c2i.net> <4EF07EB0.9000209@FreeBSD.org> In-Reply-To: <4EF07EB0.9000209@FreeBSD.org> X-Enigmail-Version: undefined Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: FreeBSD current , "freebsd-usb@FreeBSD.org" Subject: Re: a few usb issues related to edge cases X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2011 11:29:56 -0000 on 20/12/2011 14:25 Andriy Gapon said the following: > I just wanted to draw your attention to the fact that obtaining any locks in the > kdb context (or USB polling code in general, even) is not a good idea. > Chances of getting into trouble on those locks are probably quite moderate or > even low, but they do exist. I am not sure if you are getting any bug reports > about such troubles :-) Regular users probably do not use kdb too often and a > panic for them is just a "crash", so they likely do not expect anything > usable/debuggable after that :-) Looking some more at the code I just got myself confused as to how the dumping to a umass device could work when the scheduler is stopped. It seems that the umass_command_start -> usbd_transfer_start -> usbd_callback_ss_done_defer functions would always put a transfer request onto a queue and try to wake up a thread to process that queue and the request. But that's obviously not going to work when the other thread is not going to be run. Have I missed a code path that leads directly to the controller in this context? Thank you for your help. -- Andriy Gapon From owner-freebsd-usb@FreeBSD.ORG Wed Dec 21 16:41:05 2011 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC8C9106564A; Wed, 21 Dec 2011 16:41:05 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe06.c2i.net [212.247.154.162]) by mx1.freebsd.org (Postfix) with ESMTP id ED2418FC14; Wed, 21 Dec 2011 16:41:04 +0000 (UTC) X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe06.swip.net (CommuniGate Pro SMTP 5.4.2) with ESMTPA id 218858271; Wed, 21 Dec 2011 17:41:02 +0100 From: Hans Petter Selasky To: Andriy Gapon Date: Wed, 21 Dec 2011 17:38:36 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <4EEF2B11.6080802@FreeBSD.org> <4EF07EB0.9000209@FreeBSD.org> <4EF1C32D.3070107@FreeBSD.org> In-Reply-To: <4EF1C32D.3070107@FreeBSD.org> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201112211738.36126.hselasky@c2i.net> Cc: FreeBSD current , "freebsd-usb@FreeBSD.org" Subject: Re: a few usb issues related to edge cases X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2011 16:41:05 -0000 On Wednesday 21 December 2011 12:29:49 Andriy Gapon wrote: > on 20/12/2011 14:25 Andriy Gapon said the following: > > I just wanted to draw your attention to the fact that obtaining any locks > > in the kdb context (or USB polling code in general, even) is not a good > > idea. Chances of getting into trouble on those locks are probably quite > > moderate or even low, but they do exist. I am not sure if you are > > getting any bug reports about such troubles :-) Regular users probably > > do not use kdb too often and a panic for them is just a "crash", so they > > likely do not expect anything usable/debuggable after that :-) > > Looking some more at the code I just got myself confused as to how the > dumping to a umass device could work when the scheduler is stopped. > It seems that the umass_command_start -> usbd_transfer_start -> > usbd_callback_ss_done_defer functions would always put a transfer request > onto a queue and try to wake up a thread to process that queue and the > request. But that's obviously not going to work when the other thread is > not going to be run. Have I missed a code path that leads directly to the > controller in this context? Thank you for your help. Hi, Those threads should be polled when calling usbd_transfer_poll(). I.E. the wakeup should be stubbed in the !scheduler_running case. --HPS From owner-freebsd-usb@FreeBSD.ORG Wed Dec 21 18:27:00 2011 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15399106566C; Wed, 21 Dec 2011 18:27:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 2E2278FC0C; Wed, 21 Dec 2011 18:26:58 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA26655; Wed, 21 Dec 2011 20:26:54 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1RdQsP-000MrG-W6; Wed, 21 Dec 2011 20:26:54 +0200 Message-ID: <4EF224EC.9050101@FreeBSD.org> Date: Wed, 21 Dec 2011 20:26:52 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111206 Thunderbird/8.0 MIME-Version: 1.0 To: Hans Petter Selasky References: <4EEF2B11.6080802@FreeBSD.org> <4EF07EB0.9000209@FreeBSD.org> <4EF1C32D.3070107@FreeBSD.org> <201112211738.36126.hselasky@c2i.net> In-Reply-To: <201112211738.36126.hselasky@c2i.net> X-Enigmail-Version: undefined Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: FreeBSD current , "freebsd-usb@FreeBSD.org" Subject: Re: a few usb issues related to edge cases X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2011 18:27:00 -0000 on 21/12/2011 18:38 Hans Petter Selasky said the following: > On Wednesday 21 December 2011 12:29:49 Andriy Gapon wrote: >> on 20/12/2011 14:25 Andriy Gapon said the following: >>> I just wanted to draw your attention to the fact that obtaining any locks >>> in the kdb context (or USB polling code in general, even) is not a good >>> idea. Chances of getting into trouble on those locks are probably quite >>> moderate or even low, but they do exist. I am not sure if you are >>> getting any bug reports about such troubles :-) Regular users probably >>> do not use kdb too often and a panic for them is just a "crash", so they >>> likely do not expect anything usable/debuggable after that :-) >> >> Looking some more at the code I just got myself confused as to how the >> dumping to a umass device could work when the scheduler is stopped. >> It seems that the umass_command_start -> usbd_transfer_start -> >> usbd_callback_ss_done_defer functions would always put a transfer request >> onto a queue and try to wake up a thread to process that queue and the >> request. But that's obviously not going to work when the other thread is >> not going to be run. Have I missed a code path that leads directly to the >> controller in this context? Thank you for your help. > > Hi, > > Those threads should be polled when calling usbd_transfer_poll(). I.E. the > wakeup should be stubbed in the !scheduler_running case. Ah, that's what I missed! -- Andriy Gapon From owner-freebsd-usb@FreeBSD.ORG Thu Dec 22 20:36:14 2011 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A19C1065670 for ; Thu, 22 Dec 2011 20:36:14 +0000 (UTC) (envelope-from mailreturn@smtp.ymlp36.net) Received: from smtp.ymlp36.net (smtp.ymlp36.net [78.41.65.6]) by mx1.freebsd.org (Postfix) with SMTP id 482B48FC12 for ; Thu, 22 Dec 2011 20:36:12 +0000 (UTC) Received: (qmail 18804 invoked by uid 0); 22 Dec 2011 20:09:29 -0000 Date: Thu, 22 Dec 2011 21:09:29 +0100 To: freebsd-usb@freebsd.org From: Hosiery Street Message-ID: <22b6f90cbb01542558d721957ad8f92d@smtp.ymlp36.net> X-YMLPcode: 8ryt+206+93824 MIME-Version: 1.0 Content-Type: text/plain; charset = "utf-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Lingerie Sale - Limited Time Offer X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: sales@hosierystreet.com List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Dec 2011 20:36:14 -0000 --------------------------------------------------------------------------= ------ This email newsletter was sent to you in graphical HTML format. If you're seeing this version, your email program prefers plain text = emails. You can read the original version online: http://ymlp223.net/zTi0Mw --------------------------------------------------------------------------= ------ Dear Customer HAPPY HOLIDAYS AND A GREAT NEW YEAR!!! DUE TO THE GREAT SUCCESS OF OUR BLACK FRIDAY FREE SHIPPING SALE WE HAVE DECIDED TO RENEW OUR FREE SHIPPING THRU THE NEW YEAR TILL TUESDAY JANUARY 3rd 2012!!! THAT'S RIGHT! HOSIERYSTREET.com IS OFFERING FREE SHIPPING on all orders over $25 in contiguous US TILL TUESDAY JANUARY 3rd!!! This is our way of saying THANK YOU to all of our loyal customers for making us the GREATEST HOSIERY and LINGERIE website on the net. As in every email we would like to remind you first and foremost that if you don't want to be on our sale list please click below to unsubscribe and you will be removed from the email list immediately. We do not want to SPAM anyone. PLEASE DO NOT REPORT THIS AS SPAM. HAPPY HOLIDAYS!!! ( http://hosierystreet.com/&refer=3Dem_1222i ) The following is a few of our HOTTEST items you may be interested in: 5 HOTTEST DEALS FROM BESTFORM ( http://www.hosierystreet.com/system/scripts/search.cgi?&p=3D1&&Company=3DB= estform&Submit2=3DSearch&action=3Dsearch&per_page=3D90&sort_by=3DBrand#Sea= rch&refer=3Dem_1222i ). NOW ONLY: $7.99 Bestform Soft Cup Wide, camisole top band bottom . #6825 Click here for more info >>> ( http://www.hosierystreet.com/system/scripts/results_big.cgi?product=3Dbf68= 25&refer=3Dem_1222i )NOW ONLY: $6.99 Bestform BodyCottons Underwire # 6826 Click here for more info >>> ( http://www.hosierystreet.com/system/scripts/results_big.cgi?product=3Dbf68= 26&refer=3Dem_1222i ) NOW ONLY: $7.56 Bestform Relax Wear # 6088 Click here for more info >>> ( http://www.hosierystreet.com/system/scripts/results_big.cgi?product=3Dbf60= 88&refer=3Dem_1222i )NOW ONLY: $8.99 Bestform Shirred Front Sport Bra. #6040 Click here for more info >>> ( http://www.hosierystreet.com/system/scripts/results_big.cgi?product=3Dbef6= 040&refer=3Dem_1222i )NOW ONLY: $9.99 Bestform Posture back sport bra with double lined front Cris-Cross Click here for more info >>> ( http://www.hosierystreet.com/system/scripts/results_big.cgi?product=3Dbef6= 092x&refer=3Dem_1222i ) or click here for more BestForm Bras at Greatly Discounted Prices... ( http://www.hosierystreet.com/system/scripts/search.cgi?&p=3D1&&Company=3DB= estform&Submit2=3DSearch&action=3Dsearch&per_page=3D90&sort_by=3DBrand#Sea= rch&refer=3Dem_1222i ) DUE TO POULAR DEMAND NOW BACK IN STOCK!!! 2 HOT DEALS FROM Round the Clock ( http://www.hosierystreet.com/system/scripts/search.cgi?Company=3DRound+The= +Clock&Submit2=3DSearch&action=3Dsearch&refer=3Dem_1222i )! NOW ONLY: $12.99 Round The Clock Classic Sheer, Girdle at the Top # 135 Click here for more info >>> ( http://www.hosierystreet.com/system/scripts/results_big.cgi?product=3Drtc1= 35&refer=3Dem_1222i )NOW ONLY: $13.99 Round The Clock Girdle at the Top, Lycra Silky Sheer Leg Pantyhose # 137 Click here for more info >>> ( http://www.hosierystreet.com/system/scripts/results_big.cgi?product=3Drtc1= 37&refer=3Dem_1222i ) or click here for more Round The Clock Deals... ( http://www.hosierystreet.com/system/scripts/search.cgi?Company=3DRound+The= +Clock&Submit2=3DSearch&action=3Dsearch&refer=3Dem_1222i ) 6 MORE GREAT DEALS FROM VASSARETTE ( http://www.hosierystreet.com/system/scripts/search.cgi?&p=3D1&&txtSearch= =3D&search_type=3Din_all&category=3D21&Company=3DVassarette&price_from=3D&= price_to=3D&command=3Dadvance_search&action=3Dsearch&cmdGetCustomers=3DGet= +Result&per_page=3D90&sort_by=3DBrand#Search&refer=3Dem_1222i ). NOW ONLY: $3.49 Vassarette Light Control Hi-Cut Brief Click here for more info >>> ( http://www.hosierystreet.com/system/scripts/results_big.cgi?product=3D48-0= 01&refer=3Dem_1222i )NOW ONLY: $3.99 Vassarette Light Control Brief Click here for more info >>> ( http://www.hosierystreet.com/system/scripts/results_big.cgi?product=3D40-0= 01&refer=3Dem_1222i )NOW ONLY: $5.99 Vassarette Soft& Simple Bright Lines Soft Cup. #70-177 Click here for more info >>> ( http://www.hosierystreet.com/system/scripts/results_big.cgi?product=3D70-1= 77&refer=3Dem_1222i ) NOW ONLY: $9.89 Vassarette BodyCurves Microfiber Wireless Contour Click here for more info >>> ( http://www.hosierystreet.com/system/scripts/results_big.cgi?product=3D72-2= 39&refer=3Dem_1222i )NOW ONLY: $10.99 Vassarette RealSexy Her Secret Push Up UW Click here for more info >>> ( http://www.hosierystreet.com/system/scripts/results_big.cgi?product=3D75-3= 20&refer=3Dem_1222i ) NOW ONLY: $12.89 Vassarette BodyCurves Flir-T FF Contour UW. #75-818 Click here for more info >>> ( http://www.hosierystreet.com/system/scripts/results_big.cgi?product=3D75-8= 18&refer=3Dem_1222i ) or click here for more ON SALE Vassarette Bras... ( http://www.hosierystreet.com/system/scripts/search.cgi?&p=3D1&&txtSearch= =3D&search_type=3Din_all&category=3D21&Company=3DVassarette&price_from=3D&= price_to=3D&command=3Dadvance_search&action=3Dsearch&cmdGetCustomers=3DGet= +Result&per_page=3D90&sort_by=3DBrand#Search&refer=3Dem_1222i ) ------------------------- PLEASE CHECK OUT OUR VANITY FAIR BRA LINE!!! ( http://www.hosierystreet.com/system/scripts/search.cgi?txtSearch=3D&search= _type=3Din_all&category=3D21&Company=3DVanity+Fair&price_from=3D&price_to= =3D&command=3Dadvance_search&action=3Dsearch&cmdGetCustomers=3DGet+Result&= refer=3Dem_1222i ) MORE INFO >>> CLICK HERE >>> ( http://www.hosierystreet.com/system/scripts/search.cgi?txtSearch=3D&search= _type=3Din_all&category=3D21&Company=3DVanity+Fair&price_from=3D&price_to= =3D&command=3Dadvance_search&action=3Dsearch&cmdGetCustomers=3DGet+Result&= refer=3Dem_1222i ) _____________________________ Unsubscribe / Change Profile: http://ymlp223.net/ugmjwyjqgsgymqejgesh Powered by YourMailingListProvider