Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754655Ab3CCXSg (ORCPT ); Sun, 3 Mar 2013 18:18:36 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:46100 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753027Ab3CCXSe (ORCPT ); Sun, 3 Mar 2013 18:18:34 -0500 Message-ID: <5133DA12.8020907@oracle.com> Date: Sun, 03 Mar 2013 18:17:38 -0500 From: Sasha Levin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130227 Thunderbird/17.0.3 MIME-Version: 1.0 To: David Miller CC: samuel@sortiz.org, gregkh@linuxfoundation.org, jslaby@suse.cz, peter@hurleysoftware.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ircomm: release tty before sleeping potentially indefintely References: <1362350153-26225-1-git-send-email-sasha.levin@oracle.com> <20130303.174739.1195645942179862011.davem@davemloft.net> In-Reply-To: <20130303.174739.1195645942179862011.davem@davemloft.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Source-IP: acsinet21.oracle.com [141.146.126.237] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1294 Lines: 35 On 03/03/2013 05:47 PM, David Miller wrote: > From: Sasha Levin > Date: Sun, 3 Mar 2013 17:35:53 -0500 > >> ircomm_tty_block_til_ready would hold tty lock while blocking. Since the sleep >> might take a long time we can prevent other processes from accessing the tty, >> causing hung tasks and a dead tty. >> >> Diagnosed-by: Peter Hurley >> Signed-off-by: Sasha Levin > > But then you invalidate all of the tty state tests made under > the lock at the beginning of this function, before enterring > the loop. If you drop the lock, those pieces of state could > change. > > I'm not applying this. I'm unsure. A similar patch was applied back in 2010 that does the same thing to a bunch of drivers, including the core tty code (e142a31da "tty: release BTM while sleeping in block_til_ready"). This IR code looks very much like tty_port_block_til_ready() where it was okay to do that change, so I should be the same with ircomm_tty_block_til_ready. Thanks, Sasha -- 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/