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

From: Anton Vorontsov <[email-masked]>
Date: Sun, 23 Dec 2007 15:17:35 +0300

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.

Much thanks,

-- 
Anton Vorontsov
email: [email-masked]
backup email: [email-masked]
irc://irc.freenode.net/bd2