public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: linux-sh@vger.kernel.org
Subject: Re: [RFC][PATCH] sh: override DMA interrupt handler to dma-sh driver
Date: Mon, 20 Oct 2008 04:24:45 +0000	[thread overview]
Message-ID: <20081020042445.GC20044@linux-sh.org> (raw)

On Mon, Sep 29, 2008 at 06:26:45PM +0900, Nobuhiro Iwamatsu wrote:
> Dma-sh has fixed interrupt handler and cannot register
> an interrupt for exclusive use of the device with dma.
> 
> I added a handler to sh_dmac_request_dma and reviced it
> to be able to appoint a handler.
> 
> Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@nigauri.org>

While I don't have anything against the idea, I don't care for the
approach. It is not acceptable to break the API every time you wish to
extend soem basic functionality. The addition of request_dma_bycap()
itself should have been a good indicator of this, as we didn't simply
hack request_dma() in-place. Part of the reason for this is also because
request_dma()/free_dma() are legacy interfaces from the ISA DMA days, and
are virtually consistent across the entire tree.

Having said that, wanting to register data with a channel or set a
specific handler for it is perfectly reasonable, but this is something
you ought to model after the generic hardirq layer and driver model, have
special routines that set/get a private data pointer and one for setting
the IRQ handler. The other thing to note is that you do not want to blow
away the existing IRQ handler in the controller driver either, since that
contains logic relative to your channel anyways (ie, TEI handling). You
are likely better off introducing a new capability that takes priority
over TEI handling and requires a special handler, but note that CHCR
handling itself should only be done by the controller driver. If you wish
to make use of a DMA channel in a generic driver, that is perfectly fine,
but you should not be exposing _any_ dma-sh internals there, especially
for the IRQ top half.

             reply	other threads:[~2008-10-20  4:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-20  4:24 Paul Mundt [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-09-29  9:26 [RFC][PATCH] sh: override DMA interrupt handler to dma-sh driver Nobuhiro Iwamatsu

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=20081020042445.GC20044@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=linux-sh@vger.kernel.org \
    /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