1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>fence_wait_timeout</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Device Drivers"><link rel="up" href="ch02s03.html" title="Device Drivers DMA Management"><link rel="prev" href="API-fence-signal.html" title="fence_signal"><link rel="next" href="API-fence-enable-sw-signaling.html" title="fence_enable_sw_signaling"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">fence_wait_timeout</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-fence-signal.html">Prev</a> </td><th width="60%" align="center">Device Drivers DMA Management</th><td width="20%" align="right"> <a accesskey="n" href="API-fence-enable-sw-signaling.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-fence-wait-timeout"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>fence_wait_timeout — 2 sleep until the fence gets signaled or until timeout elapses 3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">signed long <b class="fsfunc">fence_wait_timeout </b>(</code></td><td>struct fence * <var class="pdparam">fence</var>, </td></tr><tr><td> </td><td>bool <var class="pdparam">intr</var>, </td></tr><tr><td> </td><td>signed long <var class="pdparam">timeout</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1110320468"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>fence</code></em></span></dt><dd><p> 4 [in] the fence to wait on 5 </p></dd><dt><span class="term"><em class="parameter"><code>intr</code></em></span></dt><dd><p> 6 [in] if true, do an interruptible wait 7 </p></dd><dt><span class="term"><em class="parameter"><code>timeout</code></em></span></dt><dd><p> 8 [in] timeout value in jiffies, or MAX_SCHEDULE_TIMEOUT 9 </p></dd></dl></div></div><div class="refsect1"><a name="idp1110324188"></a><h2>Description</h2><p> 10 Returns -ERESTARTSYS if interrupted, 0 if the wait timed out, or the 11 remaining timeout in jiffies on success. Other error values may be 12 returned on custom implementations. 13 </p><p> 14 15 Performs a synchronous wait on this fence. It is assumed the caller 16 directly or indirectly (buf-mgr between reservation and committing) 17 holds a reference to the fence, otherwise the fence might be 18 freed before return, resulting in undefined behavior. 19</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-fence-signal.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02s03.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-fence-enable-sw-signaling.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">fence_signal</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">fence_enable_sw_signaling</span></td></tr></table></div></body></html> 20