Re: Inconsistent use of spinlocks in serial interrupts

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

 



On Tue, Aug 04, 2015 at 10:23:12AM +1200, Charles Manning wrote:
> I am debugging an issue on the OMAP where the serial irq processing is
> normally low (around 1%) but can sometimes rise to much higher (well
> over 10%).
> 
> This lead me to sniff around the locking....
> 
> I notice that in some drivers eg. omap-serial.c the whole interrupt
> handling loop is locked via spin_lock().
> 
> However, other drivers such as serial-tegra.c use spin_lock_irqsave()
> for a loop that pretty much has the same form.
> 
> Why is it that they don't use the same locking strategy? What would be better?

If something can be accessed from in interrupt, you have to use
spin_lock_irqsave everywhere else for that same lock to properly protect
the data.

So it depends on the hardware implementation here, both are probably
necessary because of that.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux