All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adam Wozniak <awozniak@irobot.com>
To: linux-omap@vger.kernel.org
Subject: Re: spin_lock_irqsave and ISP interrupts on OMAP 3530
Date: Thu, 10 Feb 2011 09:15:54 -0800	[thread overview]
Message-ID: <4D541D4A.7060301@irobot.com> (raw)
In-Reply-To: <4D4AD877.8070702@irobot.com>

No one can confirm this?

On 02/03/2011 08:31 AM, Adam Wozniak wrote:
> I'm hoping I'm just not understanding something and this isn't as 
> broke as I fear it is.
>
> I'm using the ISP on an OMAP3530, linux 2.6.32.  I've got some kernel 
> code I want to lock in both the process context and the ISP interrupt 
> context, so I'm using a spinlock.  As I understand it, locking the 
> spinlock should disable all interrupts.  However, I'm still seeing the 
> ISP interrupt happen when I've got the spinlock locked in the process 
> context.
>
> i.e. somewhere I've got the code below, and my Warning is tripping.  
> Is this broken, or am I not understanding something?
>
> int am_i_locked = 0;
> spinlock_t my_spinlock = SPIN_LOCK_UNLOCKED;
>
> void foo(void) {
>     /* function could be called from process context, or could be 
> called from omap34xx_isp_isr (interrupt context) */
>     unsigned long flags;
>     spin_lock_irqsave(&my_spinlock, flags);
>     WARN_ON(am_i_locked);
>     am_i_locked++;
>
>     /* do some stuff */
>
>     am_i_locked--;
>     spin_unlock_irqrestore(&my_spinlock, flags);
> }
> -- 
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


      reply	other threads:[~2011-02-10 17:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-03 16:31 spin_lock_irqsave and ISP interrupts on OMAP 3530 Adam Wozniak
2011-02-10 17:15 ` Adam Wozniak [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=4D541D4A.7060301@irobot.com \
    --to=awozniak@irobot.com \
    --cc=linux-omap@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.