[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240322120810.GA648@pendragon.ideasonboard.com>
Date: Fri, 22 Mar 2024 14:08:10 +0200
From: Laurent Pinchart <laurent.pinchart@...asonboard.com>
To: Ricardo Ribalda <ribalda@...omium.org>
Cc: Alan Stern <stern@...land.harvard.edu>, Yunke Cao <yunkec@...omium.org>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
linux-kernel@...r.kernel.org, linux-media@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH RESEND] media: uvcvideo: Disable autosuspend for Insta360
Link
Hi Ricardo,
On Thu, Mar 09, 2023 at 12:12:27AM +0100, Ricardo Ribalda wrote:
> On Thu, 9 Mar 2023 at 00:02, Alan Stern wrote:
> > On Wed, Mar 08, 2023 at 11:43:09PM +0100, Ricardo Ribalda wrote:
> > > On Wed, 1 Mar 2023 at 10:04, Ricardo Ribalda wrote:
> > > > On Thu, 29 Dec 2022 at 03:22, Laurent Pinchart wrote:
> > > > > On Fri, Dec 02, 2022 at 05:48:52PM +0100, Ricardo Ribalda wrote:
> > > > > > When the device suspends, it keeps power-cycling.
> > > > > >
> > > > > > The user notices it because the LED constanct oscillate between
> > > > > > blue (ready) and no LED (off).
> >
> > > > > > Signed-off-by: Ricardo Ribalda <ribalda@...omium.org>
> > > > > > ---
> > > > > > media: uvcvideo: Disable autosuspend for Insta360
> > > > > >
> > > > > > The device does not handle properly the USB suspend and makes it barely usable.
> > > > >
> > > > > Isn't this best handled with a quirk in the USB core ? Autosuspend is a
> > > > > device feature, not an interface feature, so if the USB sound driver is
> > > > > loaded but uvcvideo isn't, the kernel may still attempt to autosuspend
> > > > > the device.
> > > > >
> > > >
> > > > Seems like USB_QUIRK_NO_AUTOSUSPEND was gone for a long time
> > > >
> > > > https://lore.kernel.org/lkml/20071115064457.GU19218@kroah.com/
> > > >
> > > > under the assumption that autosuspend was off by default and user
> > > > space should only enable autosuspend on the devices that support it
> > > > (if I understand it correctly).
> > > >
> > > > There are two other quirks still available: USB_QUIRK_RESET_RESUME and
> > > > USB_QUIRK_DISCONNECT_SUSPEND, but they do not seem to work for this
> > > > device (Yunke, thanks for looking into this)
> > > >
> > > > If we are explicitly enabling autosuspend on the driver, shouldn't we
> > > > make sure that the device supports it?
> > > >
> > >
> > > Alan, Greg, any idea about what is the best way to proceed here from a
> > > USB perspective?
> >
> > How is autosuspend getting enabled for this device? It is disabled by
> > default for non-hub USB devices.
>
> It is enabled on the driver via usb_enable_autosuspend()
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/media/usb/uvc/uvc_driver.c#n2211
>
> > If the uvcvideo or USB sound driver is enabling autosuspend, the driver
> > should be fixed. Perhaps by adding a quirk bit for this purpose.
>
> This is what I tried with this patch :). Laurent, could you please
> take a second look to it?
> Thanks!
Done, and
Reviewed-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>
> > If userspace is enabling autosuspend, then any misbehavior isn't the
> > kernel's fault. :-)
--
Regards,
Laurent Pinchart
Powered by blists - more mailing lists