1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>usb_queue_reset_device</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="The Linux-USB Host Side API"><link rel="up" href="usbcore.html" title="Chapter&#160;5.&#160;USB Core APIs"><link rel="prev" href="API-usb-reset-device.html" title="usb_reset_device"><link rel="next" href="API-usb-hub-find-child.html" title="usb_hub_find_child"></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">usb_queue_reset_device</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-usb-reset-device.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;5.&#160;USB Core APIs</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-usb-hub-find-child.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-usb-queue-reset-device"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>usb_queue_reset_device &#8212; 
2     Reset a USB device from an atomic context
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">void <b class="fsfunc">usb_queue_reset_device </b>(</code></td><td>struct usb_interface * <var class="pdparam">iface</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1116688780"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>iface</code></em></span></dt><dd><p>
4     USB interface belonging to the device to reset
5    </p></dd></dl></div></div><div class="refsect1"><a name="idp1116690420"></a><h2>Description</h2><p>
6   This function can be used to reset a USB device from an atomic
7   context, where <code class="function">usb_reset_device</code> won't work (as it blocks).
8   </p><p>
9
10   Doing a reset via this method is functionally equivalent to calling
11   <code class="function">usb_reset_device</code>, except for the fact that it is delayed to a
12   workqueue. This means that any drivers bound to other interfaces
13   might be unbound, as well as users from usbfs in user space.
14</p></div><div class="refsect1"><a name="idp1116692252"></a><h2>Corner cases</h2><p>
15   </p><p>
16
17   - Scheduling two resets at the same time from two different drivers
18   attached to two different interfaces of the same device is
19   possible; depending on how the driver attached to each interface
20   handles -&gt;<code class="function">pre_reset</code>, the second reset might happen or not.
21   </p><p>
22
23   - If the reset is delayed so long that the interface is unbound from
24   its driver, the reset will be skipped.
25   </p><p>
26
27   - This function can be called during .<code class="function">probe</code>.  It can also be called
28   during .<code class="function">disconnect</code>, but doing so is pointless because the reset
29   will not occur.  If you really want to reset the device during
30   .<code class="function">disconnect</code>, call <code class="function">usb_reset_device</code> directly -- but watch out
31   for nested unbinding issues!
32</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-usb-reset-device.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="usbcore.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-usb-hub-find-child.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">usb_reset_device</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span class="phrase">usb_hub_find_child</span></td></tr></table></div></body></html>
33