From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.185]) by ozlabs.org (Postfix) with ESMTP id 4845EDDE07 for ; Sun, 23 Dec 2007 23:28:35 +1100 (EST) Received: by fk-out-0910.google.com with SMTP id z22so1722504fkz.9 for ; Sun, 23 Dec 2007 04:28:34 -0800 (PST) Date: Sun, 23 Dec 2007 15:17:35 +0300 From: Anton Vorontsov To: Stephen Rothwell Subject: Re: [PATCH 1/3] [POWERPC] FSL UPM: routines to manage FSL UPMs Message-ID: <20071223121735.GA5831@zarina> References: <20071221203552.GA4738@localhost.localdomain> <20071221203925.GA4829@localhost.localdomain> <20071223132457.a40e8100.sfr@canb.auug.org.au> <20071223115935.GB5643@zarina> MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 In-Reply-To: <20071223115935.GB5643@zarina> Cc: linuxppc-dev@ozlabs.org Reply-To: cbouatmailru@gmail.com List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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: cbou@mail.ru backup email: ya-cbou@yandex.ru irc://irc.freenode.net/bd2