Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757627AbZJHLgW (ORCPT ); Thu, 8 Oct 2009 07:36:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757045AbZJHLgV (ORCPT ); Thu, 8 Oct 2009 07:36:21 -0400 Received: from smtp-out003.kontent.com ([81.88.40.217]:50174 "EHLO smtp-out003.kontent.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756771AbZJHLgV convert rfc822-to-8bit (ORCPT ); Thu, 8 Oct 2009 07:36:21 -0400 From: Oliver Neukum To: Alan Stern Subject: Re: [PATCH 4/5] usb_serial: Kill port mutex Date: Thu, 8 Oct 2009 13:37:09 +0200 User-Agent: KMail/1.10.3 (Linux/2.6.31-rc9-0.1-default; KDE/4.1.3; x86_64; ; ) Cc: Alan Cox , Greg KH , Kernel development list , USB list References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT Content-Disposition: inline Message-Id: <200910081337.10275.oliver@neukum.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1210 Lines: 27 Am Mittwoch, 7. Oktober 2009 19:23:59 schrieb Alan Stern: > > We can take the port->mutex lock in the throttle/unthrottle methods as > > far as I can see - there are no obvious problem cases. We do call > > ->throttle and ->unthrottle from the ldisc open but this occurs outside > > of any call to the tty driver open/close method so I don't see any > > deadlock. > > > > It adds an ordering of termios lock before port mutex when taking both > > but that's not a problem and really implicit in the structure of the code > > anyway. > > Does this imply that unthrottle should try to autoresume? ?There does > appear to be a potential race between unthrottle and autosuspend. The race exists. But I don't think unthrottle should autoresume. It would be better to just set a flag and defer this to resume. If the device supports remote wakeup there'll be no need to autoresume, if not, throttle/unthrottle are too rare to justify the complexity. Regards Oliver -- 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/