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