lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 20 Oct 2014 18:36:01 +0100
From:	Russell King - ARM Linux <linux@....linux.org.uk>
To:	Alexandre Belloni <alexandre.belloni@...e-electrons.com>
Cc:	Vladimir Zapolskiy <vz@...ia.com>, linux-pwm@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Thierry Reding <thierry.reding@...il.com>, jonsmirl@...il.com,
	Simon <longsleep@...il.com>,
	Maxime Ripard <maxime.ripard@...e-electrons.com>,
	linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCHv8 1/2] pwm: Add Allwinner SoC support

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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ