From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH v2 02/15] clocksource: orion: Use atomic access for shared registers Date: Tue, 21 Jan 2014 10:46:38 +0100 Message-ID: <5118193.GjKusj569J@wuerfel> References: <1390295561-3466-1-git-send-email-ezequiel.garcia@free-electrons.com> <1390295561-3466-3-git-send-email-ezequiel.garcia@free-electrons.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Return-path: In-Reply-To: <1390295561-3466-3-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org Cc: Ezequiel Garcia , linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Lior Amsalem , Thomas Petazzoni , Jason Cooper , Tawfik Bayouk , Andrew Lunn , Jason Gunthorpe , Wim Van Sebroeck , Gregory Clement , Sebastian Hesselbarth List-Id: devicetree@vger.kernel.org On Tuesday 21 January 2014 06:12:28 Ezequiel Garcia wrote: > -/* > - * Thread-safe access to TIMER_CTRL register > - * (shared with watchdog timer) > - */ > -void orion_timer_ctrl_clrset(u32 clr, u32 set) > -{ > - spin_lock(&timer_ctrl_lock); > - writel((readl(timer_base + TIMER_CTRL) & ~clr) | set, > - timer_base + TIMER_CTRL); > - spin_unlock(&timer_ctrl_lock); > -} > -EXPORT_SYMBOL(orion_timer_ctrl_clrset); I don't understand what's wrong with this function, it seems like a cleaner approach than touching the register directly from two different drivers. Is this something that would only work on orion but not on armadaxp? Arnd -- 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