be suspended
Webcams with microphones are composite devices, and autosuspend is set
at the device level. If uvcvideo is probed after snd-usb-audio, the effect
of the quirk applied by snd-usb-audio is undone by uvcvideo's global
application of autosuspend.
Incrementing the interface's PM refcount in such cases prevents runtime PM
from happening, thus the device is left active.
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
if (ignore_ctl_error)
chip->quirk_flags |= QUIRK_FLAG_IGNORE_CTL_ERROR;
- if (chip->quirk_flags & QUIRK_FLAG_DISABLE_AUTOSUSPEND)
+ if (chip->quirk_flags & QUIRK_FLAG_DISABLE_AUTOSUSPEND) {
+ /*
+ * Grab the interface, because on a webcam uvcvideo may race
+ * with snd-usb-audio during probe and re-enable autosuspend.
+ */
+ usb_autopm_get_interface(intf);
usb_disable_autosuspend(interface_to_usbdev(intf));
+ }
/*
* For devices with more than one control interface, we assume the