From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755841Ab1KWVL5 (ORCPT ); Wed, 23 Nov 2011 16:11:57 -0500 Received: from mail-bw0-f46.google.com ([209.85.214.46]:60097 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753393Ab1KWVL4 (ORCPT ); Wed, 23 Nov 2011 16:11:56 -0500 Message-ID: <4ECD6198.20309@suse.cz> Date: Wed, 23 Nov 2011 22:11:52 +0100 From: Jiri Slaby User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111114 Thunderbird/9.0 MIME-Version: 1.0 To: Havard Skinnemoen CC: Jiri Slaby , Dave Jones , Linux Kernel , Greg Kroah-Hartman , Alan Cox Subject: Re: [RFC] cdc-acm: Fix potential deadlock (lockdep warning) References: <1322074412-10873-1-git-send-email-hskinnemoen@google.com> <4ECD4FCD.7040602@suse.cz> In-Reply-To: X-Enigmail-Version: 1.3.4 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/23/2011 10:08 PM, Havard Skinnemoen wrote: > tty_port_close_start() takes port->lock, so if we try to do that, > we'll turn a potential deadlock into a real one. Or did you mean > something else? I mean the other uses of port->count in your driver. > I think I'll try to follow Alan's advice and use tty_port_close() > instead of the split functions. Yes, that's indeed the best approach. However you have to use them all: tty_port_open, tty_port_hangup, tty_port_close. OR you would have to do the locking of count properly. thanks, -- js suse labs