[PATCH 1/3] [POWERPC] FSL UPM: routines to manage FSL UPMs

Anton Vorontsov cbouatmailru at gmail.com
Sun Dec 23 23:25:08 EST 2007


On Sun, Dec 23, 2007 at 03:17:35PM +0300, Anton Vorontsov wrote:
> On Sun, Dec 23, 2007 at 02:59:35PM +0300, Anton Vorontsov wrote:
> [..]
> > > > +static inline void fsl_upm_start_pattern(struct fsl_upm *upm, u32 pat_offset)
> > > > +{
> > > > +	spin_lock_irqsave(&upm_lock, upm_lock_flags);
> > > 
> > > I may be wrong, but don't we need the "flags" argument to
> > > spin_lock_irqsave to be on the stack?  And the save and restore to be in
> > > the same function?
> > 
> > In general case, yes. Here, not exactly. We have to grab a lock at the
> > start(), do runs(), and release a lock at the end():
> 
> Ugh, that's stupid of course. flags are indeed should be on the stack.
> So, what I can use here is a mutex, and thus forbid using these
> routines from the isrs. Another option would be disabling interrupts
> and getting plain lock, but that is ugly. So will use a mutex.

Ignore me please, I should had more sleep today. For God's sake,
why I've just said a "mutex"?.. I should just get a plain lock and
forget about isrs.

-- 
Anton Vorontsov
email: cbou at mail.ru
backup email: ya-cbou at yandex.ru
irc://irc.freenode.net/bd2



More information about the Linuxppc-dev mailing list