Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1100908imu; Tue, 20 Nov 2018 11:42:11 -0800 (PST) X-Google-Smtp-Source: AFSGD/WzDNbfhzKsaVj9qn4z8D/Kx4rnlJ2uzP9wQqhKBzJ3FZ61LbsVqd1+AmzfqK7G2JnD4wnS X-Received: by 2002:a63:4456:: with SMTP id t22mr3225291pgk.0.1542742931915; Tue, 20 Nov 2018 11:42:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542742931; cv=none; d=google.com; s=arc-20160816; b=RA3hRuCFDkgatwKSsAkwuEy4AI3UhCQgyCscODjiGS+aGcv/fgA4h7BnAT75J42uxa 5+Y4lbb6oGJD6Kz0lISk+EueC7A3DWWFU0x7fkRZ+iUH+YhDYZk+wAnNw/9qce3uj2qA 19bHDwjZIJvojRk6WInb1Hm2aJM/2QXNTddUyeUaaFAmyDh6H54A+6B/dvdtaEUn/PKb HzQac6TIquQssrO2FtU/PdGTdltnG5tiQNCXeLh5LaGbOsaxGHV7mIILuj1AOLsR4crY i/WHpngXmcQvf17djIxZ6j/P4ne1XlX0EaNzlPrSuACgZYu2nMNIXwg5aQwY5VxxwWHj cQ/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=1xaQuwzOK01yR5zg/FdKTmt2WjfyvNXBqSiks767HOo=; b=GGiaM9MaPDpvaHQ/LFD5uYTv7bMidiS/AXd2/b+tWWLElKSx5ADd6cWwa52j85enzT MsL0A8PIRz81cy+urXYvsPo+QxlmHCfUjIqW8/pNSFjmsih1mdLqFHyNOzSW/xajFS2M YrfnYym82omA0wTKxgYw7Y9p6Us8SK+OV+sQFs5PcDjs0WFXFdqqAXKMwBAflKmcfQoP OCGT6lRQz+nqfQbeAD8rxsstS505lvHRLRPuR11q2+4AIzDDDV1sA7NSveN55tPkS724 lxzG8CF3NRUvueYf9W3Yv5btFVDt6vyB1C6vfchaBPlCYy9z+2wckij0Xw56fjHkiYGm uddg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u184si42397563pgd.93.2018.11.20.11.41.56; Tue, 20 Nov 2018 11:42:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730489AbeKUDuV (ORCPT + 99 others); Tue, 20 Nov 2018 22:50:21 -0500 Received: from anholt.net ([50.246.234.109]:50686 "EHLO anholt.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730458AbeKUDuU (ORCPT ); Tue, 20 Nov 2018 22:50:20 -0500 Received: from localhost (localhost [127.0.0.1]) by anholt.net (Postfix) with ESMTP id D1A0810A0B73; Tue, 20 Nov 2018 09:20:06 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at anholt.net Received: from anholt.net ([127.0.0.1]) by localhost (kingsolver.anholt.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id U9zRuxXkSd8t; Tue, 20 Nov 2018 09:20:05 -0800 (PST) Received: from eliezer.anholt.net (localhost [127.0.0.1]) by anholt.net (Postfix) with ESMTP id 53A8B10A15B1; Tue, 20 Nov 2018 09:20:01 -0800 (PST) Received: by eliezer.anholt.net (Postfix, from userid 1000) id 14F862FE1FE9; Tue, 20 Nov 2018 09:20:00 -0800 (PST) From: Eric Anholt To: Florian Fainelli , Rob Herring , Mark Rutland , Wim Van Sebroeck , Guenter Roeck , linux-watchdog@vger.kernel.org Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Stefan Wahren , bcm-kernel-feedback-list@broadcom.com, Eric Anholt Subject: [PATCH 3/8] soc: bcm: bcm2835-pm: Stop using _relaxed mmio accessors. Date: Tue, 20 Nov 2018 09:19:55 -0800 Message-Id: <20181120172000.15102-4-eric@anholt.net> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181120172000.15102-1-eric@anholt.net> References: <20181120172000.15102-1-eric@anholt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We definitely don't want I/O to be reordered here (like the setting of the WDT timeout before enabling the WDT). None of this is performance critical, anyway. Signed-off-by: Eric Anholt --- drivers/soc/bcm/bcm2835-pm.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/soc/bcm/bcm2835-pm.c b/drivers/soc/bcm/bcm2835-pm.c index ca37145e4e40..decc316fbe40 100644 --- a/drivers/soc/bcm/bcm2835-pm.c +++ b/drivers/soc/bcm/bcm2835-pm.c @@ -67,11 +67,11 @@ static int bcm2835_wdt_start(struct watchdog_device *wdog) spin_lock_irqsave(&pm->lock, flags); - writel_relaxed(PM_PASSWORD | (SECS_TO_WDOG_TICKS(wdog->timeout) & - PM_WDOG_TIME_SET), pm->base + PM_WDOG); - cur = readl_relaxed(pm->base + PM_RSTC); - writel_relaxed(PM_PASSWORD | (cur & PM_RSTC_WRCFG_CLR) | - PM_RSTC_WRCFG_FULL_RESET, pm->base + PM_RSTC); + writel(PM_PASSWORD | (SECS_TO_WDOG_TICKS(wdog->timeout) & + PM_WDOG_TIME_SET), pm->base + PM_WDOG); + cur = readl(pm->base + PM_RSTC); + writel(PM_PASSWORD | (cur & PM_RSTC_WRCFG_CLR) | + PM_RSTC_WRCFG_FULL_RESET, pm->base + PM_RSTC); spin_unlock_irqrestore(&pm->lock, flags); @@ -82,7 +82,7 @@ static int bcm2835_wdt_stop(struct watchdog_device *wdog) { struct bcm2835_pm *pm = watchdog_get_drvdata(wdog); - writel_relaxed(PM_PASSWORD | PM_RSTC_RESET, pm->base + PM_RSTC); + writel(PM_PASSWORD | PM_RSTC_RESET, pm->base + PM_RSTC); return 0; } @@ -90,7 +90,7 @@ static unsigned int bcm2835_wdt_get_timeleft(struct watchdog_device *wdog) { struct bcm2835_pm *pm = watchdog_get_drvdata(wdog); - uint32_t ret = readl_relaxed(pm->base + PM_WDOG); + uint32_t ret = readl(pm->base + PM_WDOG); return WDOG_TICKS_TO_SECS(ret & PM_WDOG_TIME_SET); } @@ -99,11 +99,11 @@ static void __bcm2835_restart(struct bcm2835_pm *pm) u32 val; /* use a timeout of 10 ticks (~150us) */ - writel_relaxed(10 | PM_PASSWORD, pm->base + PM_WDOG); - val = readl_relaxed(pm->base + PM_RSTC); + writel(10 | PM_PASSWORD, pm->base + PM_WDOG); + val = readl(pm->base + PM_RSTC); val &= PM_RSTC_WRCFG_CLR; val |= PM_PASSWORD | PM_RSTC_WRCFG_FULL_RESET; - writel_relaxed(val, pm->base + PM_RSTC); + writel(val, pm->base + PM_RSTC); /* No sleeping, possibly atomic. */ mdelay(1); @@ -159,9 +159,9 @@ static void bcm2835_power_off(void) * from the normal (full) reset. bootcode.bin will not reboot after a * hard reset. */ - val = readl_relaxed(pm->base + PM_RSTS); + val = readl(pm->base + PM_RSTS); val |= PM_PASSWORD | PM_RSTS_RASPBERRYPI_HALT; - writel_relaxed(val, pm->base + PM_RSTS); + writel(val, pm->base + PM_RSTS); /* Continue with normal reset mechanism */ __bcm2835_restart(pm); -- 2.19.1