Thread (8 messages) 8 messages, 3 authors, 2015-08-18

[PATCH v4 1/5] pwm: add the Berlin pwm controller driver

From: Russell King - ARM Linux <hidden>
Date: 2015-08-18 12:05:07
Also in: linux-pwm, lkml

On Tue, Aug 18, 2015 at 01:53:27PM +0200, Sebastian Hesselbarth wrote:
On 08/18/2015 01:38 PM, Antoine Tenart wrote:
quoted
+	val = berlin_pwm_readl(pwm, pwm_dev->hwpwm, BERLIN_PWM_CONTROL);
+	val &= ~BERLIN_PWM_PRESCALE_MASK;
+	val |= prescale;
+	berlin_pwm_writel(val, pwm, pwm_dev->hwpwm, BERLIN_PWM_CONTROL);
+
+	berlin_pwm_writel(duty, pwm, pwm_dev->hwpwm, BERLIN_PWM_DUTY);
+	berlin_pwm_writel(period, pwm, pwm_dev->hwpwm, BERLIN_PWM_TCNT);
The reason why I usually tend to _not_ use _relaxed() in low-performance
setup code is that you'll have to think about reordering issues when
using _relaxed ones.
If that is your concern, then you should read Documentation/memory-barriers.txt,
specifically the section on "ACQUIRES VS I/O ACCESSES".  Using the non-
relaxed accessors doesn't save you in every circumstance.
The question here is: Is it _guaranteed_ that above writel_relaxed()
will be issued _before_ actually releasing the spin_lock?
There is no guarantee on all hardware that writel() will be seen by the
hardware before other accesses within a separate spinlocked region
using the same lock.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help