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, 09 Mar 2009 13:47:50 -0700
From:	Jeremy Fitzhardinge <jeremy@...p.org>
To:	Timur Tabi <timur@...escale.com>
CC:	Roland Dreier <rdreier@...co.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] add function spin_event_timeout()

Timur Tabi wrote:
> On Fri, Mar 6, 2009 at 7:11 PM, Roland Dreier <rdreier@...co.com> wrote:
>   
>>  > The function spin_event_timeout() takes a condition and timeout value
>>  > (in jiffies) as parameters.  It spins until either the condition is true
>>  > or the timeout expires.  It returns non-zero if the condition is true,
>>  > zero otherwise.
>>
>> What's the motivation for this?  Where do you plan to use it?
>>     
>
> I expect it would be useful for drivers that need to wait until a
> specific register has changed its value, but don't want to risk an
> infinite loop if the hardware is not functioning.  For example, to
> replace the while loop and subsequent check in this code:
>   

A jiffy is a really long time to be spinning, let alone liffies plural.  
In this use case are you expecting that the loop will iterate a very 
small number of times before returning, and the timeout case is a very 
unlikely error condition?

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