From owner-freebsd-current@FreeBSD.ORG Tue Aug 18 13:14:32 2009 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41A58106568C for ; Tue, 18 Aug 2009 13:14:32 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-fx0-f205.google.com (mail-fx0-f205.google.com [209.85.220.205]) by mx1.freebsd.org (Postfix) with ESMTP id BFECC8FC15 for ; Tue, 18 Aug 2009 13:14:31 +0000 (UTC) Received: by fxm1 with SMTP id 1so2806011fxm.7 for ; Tue, 18 Aug 2009 06:14:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=8x+UMUp4qoQMHpU6smkqZrbIlSQMJU5SWVJswSeP0hU=; b=uw6xVYdZgnBpWz8t24OoUPP8UpFLrbtbruTODGcKW6nxjnLFYB7wK6kYJwOyfirqxx kOKoapzLubcIkEupji3Bax+KbkB4CjFGK9YMYhhflFYcyTLfJc8nEJX9VVWF2LrLsqWr F1C3BfBykS5C7ziWYrA2fdC49KLM2vwSnS+78= DomainKey-Signature: a=rsa-sha1; c=nofws; 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; b=L6jrSqD/YiyGkgpXtVIQjugeYLXT9nuj54KuS69yIfbzTE9domudMAtHRzmPpBahit tqyIOv7lxVD/3y4pnt/FLgo4rCsZoNwUVFmAbQIOOmkXVad1VRttU9FdC2iaXKOpcPM7 l+0xY59Q3TBCwsAQBX5pDBFDEzuNEAYX+uRes= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.223.134.68 with SMTP id i4mr1139557fat.101.1250601270635; Tue, 18 Aug 2009 06:14:30 -0700 (PDT) In-Reply-To: <1280352d0908180604s6b3bf050l9bde52f3c57a5a75@mail.gmail.com> References: <1280352d0908180604s6b3bf050l9bde52f3c57a5a75@mail.gmail.com> Date: Tue, 18 Aug 2009 15:14:29 +0200 X-Google-Sender-Auth: ff7350f5449b36de Message-ID: <3bbf2fe10908180614r16c86cb6q2a42f1856b6a0cc7@mail.gmail.com> From: Attilio Rao To: Andrew Thompson Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: current , Hans Petter Selasky Subject: Re: USB newbus livelock 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: Tue, 18 Aug 2009 13:14:32 -0000 2009/8/18 Andrew Thompson : > Hi Attilio, > > > At the moment usb controller modules can not be unloaded due to a > newbus locking problem, roughly... > > # kldunload ehci > syscall() > driver_module_handler() > --> newbus xlock (subr_bus.c:4127) > usb_detach() > usb_proc_mwait() <- wakeup, detach and drain the usb thread > > > [usb thread, detaching...] > usb_bus_detach() > --> newbus xlock (livelock, the kldunload process has this) > > Hans has made some changes WRT this, perforce changes 167093 and > possibly 167087. Do you want to review this or maybe go for a similar > fix? The other and me are alredy aware of such a problem. Actually, the right fix is to have attach/detach virtual functions to be called completely locklessly (in particular the detach() path). This also means a lot of work atm. This is why the newbus locking change will be backed out for 8.0-REL (just backported to 8.1 proabilly though). Attilio -- Peace can only be achieved by understanding - A. Einstein