From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Vladimir Zapolskiy <vz@mleia.com>,
linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org,
Thierry Reding <thierry.reding@gmail.com>,
jonsmirl@gmail.com, Simon <longsleep@gmail.com>,
Maxime Ripard <maxime.ripard@free-electrons.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCHv8 1/2] pwm: Add Allwinner SoC support
Date: Mon, 20 Oct 2014 18:36:01 +0100 [thread overview]
Message-ID: <20141020173601.GX27405@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20141020170603.GG10616@piout.net>
On Mon, Oct 20, 2014 at 07:06:04PM +0200, Alexandre Belloni wrote:
> Because the PWM is getting configured from either a kernel thread or a
> userspace thread accessing /sys. So you probably want the current thread
> to sleep so the other thread accessing the register can finish. Unless
> you are on smp and then, the mutex will spin for some time and your
> other cpu will be finished by then.
I agree with Vladimir. A spinlock would be better here. You're only
needing to sleep for a short time (the time it takes to complete the
register accesses) and to have a competing thread go through a context
switch twice is stupidly expensive compared to having it wait a short
time for the spinlock to be released.
What the driver could do with is using the relaxed IO accessors too,
if you care about eliminating the unnecessary barriers in there.
--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
next prev parent reply other threads:[~2014-10-20 17:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-19 18:28 [PATCHv8 0/2] Add Allwinner SoCs PWM support Alexandre Belloni
2014-10-19 18:28 ` [PATCHv8 1/2] pwm: Add Allwinner SoC support Alexandre Belloni
2014-10-19 21:22 ` Vladimir Zapolskiy
2014-10-20 10:29 ` Alexandre Belloni
2014-10-20 13:10 ` Vladimir Zapolskiy
2014-10-20 17:06 ` Alexandre Belloni
2014-10-20 17:36 ` Russell King - ARM Linux [this message]
2014-10-20 17:44 ` Vladimir Zapolskiy
2014-10-19 18:28 ` [PATCHv8 2/2] pwm: sunxi: document OF bindings Alexandre Belloni
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=20141020173601.GX27405@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=alexandre.belloni@free-electrons.com \
--cc=jonsmirl@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=longsleep@gmail.com \
--cc=maxime.ripard@free-electrons.com \
--cc=thierry.reding@gmail.com \
--cc=vz@mleia.com \
/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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox