lkml.org 
[lkml]   [2014]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv8 1/2] pwm: Add Allwinner SoC support
Hi,

On 20/10/2014 at 00:22:57 +0300, Vladimir Zapolskiy wrote :
> > +struct sun4i_pwm_chip {
> > + struct pwm_chip chip;
> > + struct clk *clk;
> > + void __iomem *base;
> > + struct mutex ctrl_lock;
>
> why do you use mutex? I haven't found any blocking subcalls under
> protection, a spinlock seems to fit better here.
>

A mutex here will do the right thing. The lock is never taken in
interrupt context and a mutex is spinning for a few cycles before
putting the thread to sleep. I'm not sure why you feel a spinlock would
be better here.

--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


\
 
 \ /
  Last update: 2014-10-20 12:41    [W:0.073 / U:0.604 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site