Skip to contentSkip to conversation

spin_lock_irqsave and ISP interrupts on OMAP 3530

DISCUSSION Adam Wozniak 1 participant 2 messages Feb 3, 2011 – Feb 10, 2011

lore
Share & tools
lore
#0 lore raw

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);
}
#1 lore raw

No one can confirm this?

Quoted 26 lines · Adam Wozniak

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);
}
Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html