From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S264595AbTLKJpT (ORCPT ); Thu, 11 Dec 2003 04:45:19 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S264598AbTLKJpT (ORCPT ); Thu, 11 Dec 2003 04:45:19 -0500 Received: from massena-4-82-67-197-146.fbx.proxad.net ([82.67.197.146]:1436 "EHLO perso.free.fr") by vger.kernel.org with ESMTP id S264595AbTLKJpM (ORCPT ); Thu, 11 Dec 2003 04:45:12 -0500 From: Duncan Sands To: Oliver Neukum , Alan Stern Subject: Re: [linux-usb-devel] Re: [OOPS, usbcore, releaseintf] 2.6.0-test10-mm1 Date: Thu, 11 Dec 2003 10:45:11 +0100 User-Agent: KMail/1.5.4 Cc: David Brownell , Vince , "Randy.Dunlap" , , , , USB development list References: <200312101749.17173.baldrick@free.fr> <200312101758.02334.oliver@neukum.org> In-Reply-To: <200312101758.02334.oliver@neukum.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200312111045.11275.baldrick@free.fr> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org > > > > __usb_set_configuration - lockless version > > > > usb_set_configuration - locked version > > > > > > Partially done. > > > That's what the _physical version of usb_reset_device() is about. > > > > Unfortunately, usb_physical_reset_device calls usb_set_configuration > > which takes dev->serialize. > > That is bad, but the solution is obvious. > All such operations need a _physical version. > At first sight this may look less elegant than some lock dropping schemes, > but it is a solution that produces obviously correct code paths with > respect to locking. Hi Oliver, I agree, except that there are several layers of locking: dev->serialize but also the bus rwsem. So does "physical" mean no subsys.rwsem or no dev->serialize or both? Ciao, Duncan. int usb_reset_device(struct usb_device *udev) { struct device *gdev = &udev->dev; int r; down_read(&gdev->bus->subsys.rwsem); r = usb_physical_reset_device(udev); up_read(&gdev->bus->subsys.rwsem); return r; }