linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: dan.j.williams@intel.com (Dan Williams)
To: linux-arm-kernel@lists.infradead.org
Subject: DMA Engine API performance issues
Date: Thu, 15 Apr 2010 08:58:47 -0700	[thread overview]
Message-ID: <v2he9c3a7c21004150858t917f44d6q15b5eaa3247d6fff@mail.gmail.com> (raw)
In-Reply-To: <j2i121039231004150213i76ecc96ahb5d9af96c46b27ae@mail.gmail.com>

On Thu, Apr 15, 2010 at 2:13 AM, melwyn lobo <linux.melwyn@gmail.com> wrote:
> Thanks so much for your explanation.
> OK..Looking at IPU implementation, irq handling is enrtirely in the
> interrupt routine, therefore no need for spin_lock_bh stuff.
> But for lower interrupt latency reasons we need to stick with the
> tasklet handling for processing interrupts.
>
> We were contemplating another solution for locking at our end for DMA
> implementation
> For locking
> if(irqs_disabled())
> ? ?spin_lock(&chan->lock);
> else
> ? ?spin_lock_bh(&chan->lock);
>
> for unlocking:
> if(irqs_disabled())
> ? ?spin_unlock(&chan->lock);
> else
> ? ?spin_unlock_bh(&chan->lock);
>
> Although this works ?fine, but will this be OK when we submit the driver.
>

This won't work and lockdep should complain about this situation.  The
minute you need to take the lock in the interrupt handler then all
other occurrences of the lock need to be promoted to _irq or
_irqsave() [1].

--
Dan

[1]: http://www.kernel.org/pub/linux/kernel/people/rusty/kernel-locking/c214.html

      reply	other threads:[~2010-04-15 15:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <x2i121039231004132342sa230bfd4k832950fce534113f@mail.gmail.com>
     [not found] ` <p2q121039231004132344pae57964atbd6587f6ed38c471@mail.gmail.com>
2010-04-14  6:46   ` DMA Engine API performance issues melwyn lobo
2010-04-15  0:08 ` Dan Williams
2010-04-15  9:13   ` melwyn lobo
2010-04-15 15:58     ` Dan Williams [this message]

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=v2he9c3a7c21004150858t917f44d6q15b5eaa3247d6fff@mail.gmail.com \
    --to=dan.j.williams@intel.com \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).