public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb•de>
To: linuxppc-embedded@ozlabs•org
Cc: Clifford Wolf <clifford@clifford•at>
Subject: Re: Mem-2-Mem DMA - Generalized API
Date: Sat, 7 Jul 2007 15:28:00 +0200	[thread overview]
Message-ID: <200707071528.00449.arnd@arndb.de> (raw)
In-Reply-To: <20070707132748.GB32740@clifford.at>

On Saturday 07 July 2007, Clifford Wolf wrote:
> > > +=A0=A0=A0// make sure all pending requests have finished before retu=
rning
> > > +=A0=A0=A0down_write(&backend->unreg_sem);
> > > +=A0=A0=A0up_write(&backend->unreg_sem);
> > > +}
> >=20
> > This usage of rw semaphores looks fishy.=20
>=20
> yep. do you have a better idea how to implement this easily?
>=20

I'd guess what you really want is reference counting. Every request
that gets assigned to a backend should get a kref on that backend
and give that up once it gets released itself.

I guess you can then have one more reference that you get in
dmatransfer_register_backend and release in dmatransfer_unregister_backend.
When you release the last reference, you call complete(),
and dmatransfer_unregister_backend() ends with a wait_for_completion().

	Arnd <><

  reply	other threads:[~2007-07-07 13:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-24 19:39 Mem-2-Mem DMA - Generalized API Clifford Wolf
2007-06-24 20:21 ` Arnd Bergmann
2007-06-25  8:03   ` Clifford Wolf
2007-06-25 11:03   ` Matt Sealey
2007-06-25 12:53     ` Clemens Koller
2007-06-25 14:31       ` Matt Sealey
2007-06-25 17:00         ` Olof Johansson
2007-06-25 17:48           ` Clifford Wolf
2007-06-25 18:01         ` Clifford Wolf
2007-06-25 21:20           ` Matt Sealey
2007-07-04  9:05           ` Clifford Wolf
2007-07-04 10:11             ` Clemens Koller
2007-07-07  5:24             ` Timur Tabi
2007-07-07  8:41               ` Clifford Wolf
2007-07-07 13:08             ` Arnd Bergmann
2007-07-07 13:27               ` Clifford Wolf
2007-07-07 13:28                 ` Arnd Bergmann [this message]
2007-07-07 13:34               ` Clifford Wolf
2007-07-11  9:35               ` Clifford Wolf

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=200707071528.00449.arnd@arndb.de \
    --to=arnd@arndb$(echo .)de \
    --cc=clifford@clifford$(echo .)at \
    --cc=linuxppc-embedded@ozlabs$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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