From: Felipe Contreras <felipe.contreras@gmail.com>
To: Ohad Ben-Cohen <ohad@wizery.com>
Cc: Felipe Contreras <felipe.contreras@nokia.com>,
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
Subject: Re: [PATCH v2] staging: tidspbridge: protect dmm_map properly
Date: Wed, 29 Dec 2010 11:39:05 +0200 [thread overview]
Message-ID: <AANLkTimMe97QECEJ+T6Eh7SFKqOi8xo08ZB+S+8Yzuww@mail.gmail.com> (raw)
In-Reply-To: <AANLkTi=wBG9AXvDva-_uNjGbRphrb356gZ6ChMJjP8aL@mail.gmail.com>
On Tue, Dec 28, 2010 at 2:37 PM, Ohad Ben-Cohen <ohad@wizery.com> wrote:
> On Tue, Dec 28, 2010 at 2:24 PM, Felipe Contreras
> <felipe.contreras@gmail.com> 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.
> If that user thread will crash, drv_remove_all_resources() will clean
> up all map_obj's.
Not if a proc_*_dma() is still running.
There's a very narrow timing window where this could happen, but it is there.
--
Felipe Contreras
next prev parent reply other threads:[~2010-12-29 9:39 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-20 18:43 Felipe Contreras
2010-12-21 14:06 ` Ohad Ben-Cohen
2010-12-21 16:44 ` Felipe Contreras
2010-12-27 10:29 ` Ohad Ben-Cohen
2010-12-27 13:55 ` Felipe Contreras
2010-12-28 6:33 ` Ohad Ben-Cohen
2010-12-28 10:36 ` Felipe Contreras
2010-12-28 10:56 ` Ohad Ben-Cohen
2010-12-28 12:12 ` Felipe Contreras
2010-12-28 12:18 ` Ohad Ben-Cohen
2010-12-28 12:24 ` Felipe Contreras
2010-12-28 12:37 ` Ohad Ben-Cohen
2010-12-29 9:39 ` Felipe Contreras [this message]
2010-12-29 9:46 ` Ohad Ben-Cohen
2010-12-29 10:06 ` Felipe Contreras
2010-12-28 14:48 ` Ohad Ben-Cohen
2010-12-29 9:42 ` Felipe Contreras
2010-12-29 9:51 ` Ohad Ben-Cohen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTimMe97QECEJ+T6Eh7SFKqOi8xo08ZB+S+8Yzuww@mail.gmail.com \
--to=felipe.contreras@gmail.com \
--cc=ameya.palande@nokia.com \
--cc=felipe.contreras@nokia.com \
--cc=fernando.lugo@ti.com \
--cc=greg@kroah.com \
--cc=h-kanigeri2@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=nm@ti.com \
--cc=ohad@wizery.com \
--cc=omar.ramirez@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®