Re: spin_lock_irq / spin_lock_irqsave ??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> This helps prevent deadlocks where the code is potentially accessed
> from interrupt context also.

do you mean to say if I write some code like this ...

spin_lock_t lock = SPIN_LOCK_UNLOCKED ;

void some_function(void)
{
   spin_lock_irq(&lock);
    do_some_thing;
    spin_unlock_irq(&lock);
}

int intr_handler(XXXX)
{
spin_lock_irq(&lock);
do_some_thing;
spin_unlock_irq(&lock);
}
  
will it cause deadlock?


> Spinlocks are used in the kernel only, so I kinda missed the point here.
> Can you rephrase?

Actually I thought that spin_lock_irqsave will save the total context.
I understood it now.

-Mahesh.


Download prohibited? No problem! CHAT from any browser, without download.

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux