Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759469AbZJGSxB (ORCPT ); Wed, 7 Oct 2009 14:53:01 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754590AbZJGSxA (ORCPT ); Wed, 7 Oct 2009 14:53:00 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:49203 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754180AbZJGSw7 (ORCPT ); Wed, 7 Oct 2009 14:52:59 -0400 Date: Wed, 7 Oct 2009 14:52:21 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Alan Cox cc: Oliver Neukum , Greg KH , Kernel development list , USB list Subject: Re: [PATCH 4/5] usb_serial: Kill port mutex In-Reply-To: <20091007192507.2784266a@lxorguk.ukuu.org.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1139 Lines: 28 On Wed, 7 Oct 2009, Alan Cox wrote: > > > It would probably be cleaner if they could lock against each other > > > > What you mean isn't clear. After all, open sometimes has to call > > resume. So how could resume lock against open? > > Probably it needs a counting lock as the code is currently structured - > which is a bit ugly. What paths do we end up going through the device > open method into resume in the same thread ? Currently there are no such paths. I keep forgetting that the resume is done in serial_install() rather than serial_open(). Eventually the tty_port reorganization will probably force the resume to move into the activate method. However in the option and sierra drivers there is a perverse path from close to resume: Both their close methods call usb_autopm_get_interface(). This could be removed without much trouble; perhaps we should do so. Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/