Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934341AbZJGSYc (ORCPT ); Wed, 7 Oct 2009 14:24:32 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758373AbZJGSYb (ORCPT ); Wed, 7 Oct 2009 14:24:31 -0400 Received: from earthlight.etchedpixels.co.uk ([81.2.110.250]:56254 "EHLO www.etchedpixels.co.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757348AbZJGSYb (ORCPT ); Wed, 7 Oct 2009 14:24:31 -0400 Date: Wed, 7 Oct 2009 19:25:07 +0100 From: Alan Cox To: Alan Stern Cc: Oliver Neukum , Greg KH , Kernel development list , USB list Subject: Re: [PATCH 4/5] usb_serial: Kill port mutex Message-ID: <20091007192507.2784266a@lxorguk.ukuu.org.uk> In-Reply-To: References: <20091007174611.439a7a5a@lxorguk.ukuu.org.uk> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.14.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1199 Lines: 23 > > 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 ? > Does this imply that unthrottle should try to autoresume? There does > appear to be a potential race between unthrottle and autosuspend. The more I look at it the more it implies to me that the ldiscs doing this should instead be taught some better manners instead. The real nasty is that a driver might not have initialised the locking it needs do that exclusion until open occurs. I think n_tty is probably the only offender and if so I'd rather fix that and make it a rule that you don't do that, trying to fix it other ways is going to be more horrible I imagine. -- 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/