From: Eric Anholt <eric@anholt.net> To: Florian Fainelli <f.fainelli@gmail.com>, Rob Herring <robh+dt@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Wim Van Sebroeck <wim@linux-watchdog.org>, Guenter Roeck <linux@roeck-us.net>, 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 <stefan.wahren@i2se.com>, bcm-kernel-feedback-list@broadcom.com, Eric Anholt <eric@anholt.net> Subject: [PATCH 3/8] soc: bcm: bcm2835-pm: Stop using _relaxed mmio accessors. Date: Tue, 20 Nov 2018 09:19:55 -0800 [thread overview] Message-ID: <20181120172000.15102-4-eric@anholt.net> (raw) In-Reply-To: <20181120172000.15102-1-eric@anholt.net> 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 <eric@anholt.net> --- 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
WARNING: multiple messages have this Message-ID (diff)
From: eric@anholt.net (Eric Anholt) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/8] soc: bcm: bcm2835-pm: Stop using _relaxed mmio accessors. Date: Tue, 20 Nov 2018 09:19:55 -0800 [thread overview] Message-ID: <20181120172000.15102-4-eric@anholt.net> (raw) In-Reply-To: <20181120172000.15102-1-eric@anholt.net> 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 <eric@anholt.net> --- 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
next prev parent reply other threads:[~2018-11-20 17:20 UTC|newest] Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-11-20 17:19 [PATCH 0/8] BCM2835 PM driver Eric Anholt 2018-11-20 17:19 ` Eric Anholt 2018-11-20 17:19 ` [PATCH 1/8] watchdog: bcm2835: Move the driver to the soc/ directory Eric Anholt 2018-11-20 17:19 ` Eric Anholt 2018-11-20 17:29 ` Guenter Roeck 2018-11-20 17:29 ` Guenter Roeck 2018-11-20 17:19 ` [PATCH 2/8] soc: bcm: bcm2835-pm: Rename the driver to its new "PM" name Eric Anholt 2018-11-20 17:19 ` Eric Anholt 2018-11-20 17:19 ` Eric Anholt [this message] 2018-11-20 17:19 ` [PATCH 3/8] soc: bcm: bcm2835-pm: Stop using _relaxed mmio accessors Eric Anholt 2018-11-20 17:19 ` [PATCH 4/8] soc: bcm: bcm2835-pm: Make some little accessor macros for the mmio area Eric Anholt 2018-11-20 17:19 ` Eric Anholt 2018-11-20 17:19 ` [PATCH 5/8] dt-bindings: soc: Add a new binding for the BCM2835 PM node Eric Anholt 2018-11-20 17:19 ` Eric Anholt 2018-11-20 17:19 ` [PATCH 6/8] soc: bcm: bcm2835-pm: Add support for power domains under a new binding Eric Anholt 2018-11-20 17:19 ` Eric Anholt 2018-11-20 17:19 ` [PATCH 7/8] ARM: bcm283x: Extend the WDT DT node out to cover the whole PM block Eric Anholt 2018-11-20 17:19 ` Eric Anholt 2018-11-20 17:20 ` [PATCH 8/8] ARM: bcm283x: Switch V3D over to using the PM driver instead of firmware Eric Anholt 2018-11-20 17:20 ` Eric Anholt 2018-11-20 17:49 ` [PATCH 0/8] BCM2835 PM driver Stefan Wahren 2018-11-20 17:49 ` Stefan Wahren 2018-11-20 21:34 ` Eric Anholt 2018-11-20 21:34 ` Eric Anholt 2018-11-20 21:39 ` Arnd Bergmann 2018-11-20 21:39 ` Arnd Bergmann 2018-11-20 21:39 ` Arnd Bergmann
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20181120172000.15102-4-eric@anholt.net \ --to=eric@anholt.net \ --cc=bcm-kernel-feedback-list@broadcom.com \ --cc=f.fainelli@gmail.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-rpi-kernel@lists.infradead.org \ --cc=linux-watchdog@vger.kernel.org \ --cc=linux@roeck-us.net \ --cc=mark.rutland@arm.com \ --cc=robh+dt@kernel.org \ --cc=stefan.wahren@i2se.com \ --cc=wim@linux-watchdog.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.