From: Ricardo Ribalda <ribalda@chromium.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Yunke Cao <yunkec@chromium.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH RESEND] media: uvcvideo: Disable autosuspend for Insta360 Link
Date: Thu, 9 Mar 2023 00:12:27 +0100 [thread overview]
Message-ID: <CANiDSCtfPO+O=uLTAAiLDrmvcRigi1weAih_+et5iwFy5Joamw@mail.gmail.com> (raw)
In-Reply-To: <1298c83f-695a-4356-aa2e-22b0e6629610@rowland.harvard.edu>
Hi Alan
On Thu, 9 Mar 2023 at 00:02, Alan Stern <stern@rowland.harvard.edu> wrote:
>
> On Wed, Mar 08, 2023 at 11:43:09PM +0100, Ricardo Ribalda wrote:
> > On Wed, 1 Mar 2023 at 10:04, Ricardo Ribalda <ribalda@chromium.org> wrote:
> > >
> > > Hi Laurent
> > >
> > > We are back to this issue.
> > >
> > >
> > > On Thu, 29 Dec 2022 at 03:22, Laurent Pinchart
> > > <laurent.pinchart@ideasonboard.com> wrote:
> > > >
> > > > Hi Ricardo,
> > > >
> > > > Thank you for the patch.
> > > >
> > > > 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@chromium.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!
>
> If userspace is enabling autosuspend, then any misbehavior isn't the
> kernel's fault. :-)
>
> Alan Stern
--
Ricardo Ribalda
next prev parent reply other threads:[~2023-03-08 23:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-02 16:48 [PATCH RESEND] media: uvcvideo: Disable autosuspend for Insta360 Link Ricardo Ribalda
2022-12-29 2:22 ` Laurent Pinchart
2023-03-01 9:04 ` Ricardo Ribalda
2023-03-08 22:43 ` Ricardo Ribalda
2023-03-08 23:02 ` Alan Stern
2023-03-08 23:12 ` Ricardo Ribalda [this message]
2024-03-22 12:08 ` Laurent Pinchart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CANiDSCtfPO+O=uLTAAiLDrmvcRigi1weAih_+et5iwFy5Joamw@mail.gmail.com' \
--to=ribalda@chromium.org \
--cc=gregkh@linuxfoundation.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=stern@rowland.harvard.edu \
--cc=yunkec@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).