From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthias Brugger Subject: Re: [PATCH v3 2/4] clk: mediatek: Add initial common clock support for Mediatek SoCs. Date: Tue, 20 Jan 2015 13:39:03 +0100 Message-ID: References: <1420601123-25859-1-git-send-email-jamesjj.liao@mediatek.com> <1420601123-25859-3-git-send-email-jamesjj.liao@mediatek.com> <1420685701.27952.44.camel@mtksdaap41> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: In-Reply-To: <1420685701.27952.44.camel@mtksdaap41> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: James Liao Cc: Rob Herring , Mike Turquette , srv_heupstream , Sascha Hauer , huang eddie , HenryC Chen , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Russell King , Catalin Marinas , Vladimir Murzin , Ashwin Chaugule , "Joe.C" , "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org" List-Id: devicetree@vger.kernel.org 2015-01-08 3:55 GMT+01:00 James Liao : > Hi Matthias, > > On Wed, 2015-01-07 at 18:22 +0100, Matthias Brugger wrote: >> 2015-01-07 4:25 GMT+01:00 James Liao : [...] >> > + >> > +extern spinlock_t *get_mtk_clk_lock(void); >> > + >> > +#define mtk_clk_lock(flags) spin_lock_irqsave(get_mtk_clk_lock(), flags) >> > +#define mtk_clk_unlock(flags) \ >> > + spin_unlock_irqrestore(get_mtk_clk_lock(), flags) >> >> Please use the spinlock directly without this akward defines. > > Do you mean we should export clk_ops_lock (from clk-mtk.c) directly > instead of get_mtk_clk_lock()? Or simply remove mtk_clk_lock/unlock()? > I think you should use spin_lock_irqsave(&clk_ops_lock, flags) instead of mtk_clk_lock. In any case I think you should define a spinlock in clk-mt8135.c and pass a reference of it in the init functions. See drivers/clk/berlin as a good example. Thanks, Matthias -- motzblog.wordpress.com -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html