Re: primitive to be used in resume()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 11 Feb 2011, Oliver Neukum wrote:

> Hi,
> 
> I am looking at IO queued to be executed upon resumption failing.

Do you mean that the I/O fails or that the resume fails?  I'll assume 
the former.

> However usb_autopm_get_interface_async() was already called for
> it. How can I balance the PM counters from within resume()?

Let's see.  I/O was submitted while the device was suspended, and
usb_autopm_get_interface_async() was called.  The resume routine starts
the I/O and encounters a failure.  Since the I/O will never complete, 
you want the device to be suspended again as soon as possible.  Right?

The correct approach is to call usb_autopm_put_interface_no_suspend().  
The resume will complete normally, and then the PM core will see that
the usage_count is 0, so it will send an asynchronous idle notification
which will start an autosuspend.

usb_autopm_put_interface() and usb_autopm_put_interface_async() should
work too, but they will expend some futile extra effort (they will try
to send an immediate idle notification, which will fail because the
interface is in the wrong state).

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux