From owner-freebsd-current@FreeBSD.ORG Wed Dec 21 11:29:56 2011 Return-Path: Delivered-To: freebsd-current@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-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current 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