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:	Wed, 11 Mar 2009 11:01:51 +1100
From:	Benjamin Herrenschmidt <benh@...nel.crashing.org>
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
Cc:	Timur Tabi <timur@...escale.com>, linux-kernel@...r.kernel.org,
	rdreier@...co.com, jirislaby@...il.com, peterz@...radead.org,
	will.newton@...il.com, hancockrwd@...il.com, jeremy@...p.org
Subject: Re: [PATCH v4] introduce macro spin_event_timeout()

On Tue, 2009-03-10 at 15:35 +0000, Alan Cox wrote:
> > This primary purpose of this macro is to poll on a hardware register until a
> > status bit changes.  The timeout ensures that the loop still terminates if the
> > bit doesn't change as expected.  This macro makes it easier for driver
> > developers to perform this kind of operation properly.
> 
> NAK this - on a lot of platforms 1uS is the wrong timescale. Also we
> shouldn't be encouraging this kind of polling by making it very easy to
> write.
> 
> It might be a useful internal macro for some freescale drivers but if so
> it doesn't belong in the core headers

I don't totally agree with your reasoning here Alan.

A simple fact of life is that drivers -will- do that sort spinning. They
don't always have a choice. Now do we want all drivers to do it
differently and get it wrong (such as not having timeouts etc...) or do
we provide a helper that has the added advantage of allowing us a lot
more easily to audit them ?

Hell, we can even make the helper warn if called with a too high timeout
value or that sort of thing...

I think it's all benefit to move that sort of cruft to a generic helper
like that in the long run.

Cheers,
Ben.
 

--
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