Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751760Ab0L2KG2 (ORCPT ); Wed, 29 Dec 2010 05:06:28 -0500 Received: from mail-fx0-f46.google.com ([209.85.161.46]:44334 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750867Ab0L2KG0 (ORCPT ); Wed, 29 Dec 2010 05:06:26 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=xH9GHEt66sKX2TzYX0tvY68OrkLFkJGAaelM3SQFUlwX311yWyqtKM9ijJbjohVt1q BI1+OF9g4Z6ELRUjwXUFBEUjTy5HVvYMnB8CDQ6irn8lNQ2coZLcbwJm7/3oIQCpbO53 CJ3c4Aym2RLFSGe6VGILdXrAbnnFITFA1szHA= MIME-Version: 1.0 In-Reply-To: References: <1292870624-25450-1-git-send-email-felipe.contreras@nokia.com> <1293452486-notmuch-felipe.contreras@nokia.com> Date: Wed, 29 Dec 2010 12:06:24 +0200 Message-ID: Subject: Re: [PATCH v2] staging: tidspbridge: protect dmm_map properly From: Felipe Contreras To: Ohad Ben-Cohen Cc: Felipe Contreras , linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, greg@kroah.com, omar.ramirez@ti.com, fernando.lugo@ti.com, nm@ti.com, ameya.palande@nokia.com, h-kanigeri2@ti.com Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1717 Lines: 40 On Wed, Dec 29, 2010 at 11:46 AM, Ohad Ben-Cohen wrote: > On Wed, Dec 29, 2010 at 11:39 AM, Felipe Contreras > wrote: >> On Tue, Dec 28, 2010 at 2:37 PM, Ohad Ben-Cohen wrote: >>> On Tue, Dec 28, 2010 at 2:24 PM, Felipe Contreras >>> wrote: >>>> user-space crashed, not kernel-space; the code would continue to run >>>> and eventually release the lock. >>> >>> So you'll have to be more specific about the scenario you are describing. >>> >>> If there's a user thread that is still running the proc_*_dma() >>> function, and we agree that this thread keeps running until completion >>> and then returns to user space, what's the problem ? >> >> The problem is if the user-space process crashes exactly in the middle >> of it, *before* completing. With locks there's no problem, as >> proc_un_map() would wait for the lock in my patch. In your patch it >> would not wait, just return -EBUSY. > > We have two threads. > > One called proc_un_map(), and one called proc_begin_dma(). > > The first crashed, but the second didn't. it still holds the bridge > device open. When it will exit, and release the device, then > drv_remove_all_resources() will be called, and all the map_obj's will > be cleaned. I'm not familiar how crashes are handled; if you say as long as one task is still running the device release is not called, then I guess there's no issue. -- Felipe Contreras -- 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/