Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755427Ab3HXPf6 (ORCPT ); Sat, 24 Aug 2013 11:35:58 -0400 Received: from top.free-electrons.com ([176.31.233.9]:54639 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754675Ab3HXPf4 (ORCPT ); Sat, 24 Aug 2013 11:35:56 -0400 From: Ezequiel Garcia To: , Cc: Thomas Petazzoni , Gregory Clement , Lior Amsalem , Baruch Siach , Will Deacon , Sebastian Hesselbarth , Russell King , Catalin Marinas , Ezequiel Garcia Subject: [PATCH v4 4/4] watchdog: orion: Use atomic access for shared registers Date: Sat, 24 Aug 2013 12:35:32 -0300 Message-Id: <1377358532-23802-5-git-send-email-ezequiel.garcia@free-electrons.com> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1377358532-23802-1-git-send-email-ezequiel.garcia@free-electrons.com> References: <1377358532-23802-1-git-send-email-ezequiel.garcia@free-electrons.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1429 Lines: 42 Since the timer control register is shared with the clocksource driver, use the recently introduced atomic_io_clear_set() to access such register. Signed-off-by: Ezequiel Garcia --- drivers/watchdog/orion_wdt.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c index 4ea5fcc..cfc037d 100644 --- a/drivers/watchdog/orion_wdt.c +++ b/drivers/watchdog/orion_wdt.c @@ -73,9 +73,7 @@ static int orion_wdt_start(struct watchdog_device *wdt_dev) writel(~WDT_INT_REQ, BRIDGE_CAUSE); /* Enable watchdog timer */ - reg = readl(wdt_reg + TIMER_CTRL); - reg |= WDT_EN; - writel(reg, wdt_reg + TIMER_CTRL); + atomic_io_modify(wdt_reg + TIMER_CTRL, WDT_EN, WDT_EN); /* Enable reset on watchdog */ reg = readl(RSTOUTn_MASK); @@ -98,9 +96,7 @@ static int orion_wdt_stop(struct watchdog_device *wdt_dev) writel(reg, RSTOUTn_MASK); /* Disable watchdog timer */ - reg = readl(wdt_reg + TIMER_CTRL); - reg &= ~WDT_EN; - writel(reg, wdt_reg + TIMER_CTRL); + atomic_io_modify(wdt_reg + TIMER_CTRL, WDT_EN, 0); spin_unlock(&wdt_lock); return 0; -- 1.8.1.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/