I will look into doing that. I think it would be preferable to add some
functionality to mark all devices matching a certain VendorID rather
than dumping the entire device table into `quirks.c', as I'd have to
routinely update it every time we release a new product.

In the meantime, if there's a way to disable LPM from within my
software, I'd prefer to take that route as I could build, test, and ship
a new version of my software to customers before end-of-week and not
require them to build/use a custom kernel until the patch finds its way
into production Ubuntu kernels.

============================================================
Matthew Giassa, MASc, BASc, EIT
Security and Embedded Systems Specialist
linkedin: https://ca.linkedin.com/in/giassa
e-mail:   matt...@giassa.net
website:  www.giassa.net

> -------- Original Message --------
> Subject: RE: USB xHCI regression after upgrading from kernel 3.19.0-51
> to 4.2.0-34.]
> From: Alan Stern <st...@rowland.harvard.edu>
> Date: Wed, April 13, 2016 10:55 am
> To: Matthew Giassa <matt...@giassa.net>
> Cc: Felipe Balbi <felipe.ba...@linux.intel.com>,     Mathias Nyman
> <mathias.ny...@linux.intel.com>,      <linux-usb@vger.kernel.org>
> 
> 
> On Wed, 13 Apr 2016, Matthew Giassa wrote:
> 
> > Hi Felipe, Mathias;
> > 
> > I pulled a clean copy of v4.5 and applied the patch suggested by Felipe,
> > and the issue is no longer present. I would like to disable this
> > behavior via changes to my software instead of requiring customers to
> > build a custom kernel. What would be the ideal solution to this issue?
> > Would it be acceptable to wrap the lines of code with an if-else using a
> > new kernel boot parameter?
> > 
> > Mathias also provided a suggestion that I could put in to my code:
> > > If that is the issue then adding pm_runtime_get_xxx() will increase the 
> > > device
> > > usage count before you know you are going to use a device. It prevents 
> > > runtime suspend.
> > > Then once you know the device is going to be idle, decrease the referece 
> > > cound
> > > with a pm_runtime_put().
> > 
> > May I please request a short code snippet on how I could get the `struct
> > device*' handle, assuming I have a libusb_device_handle and the bus/dev
> > number of the camera in use? I'm not very familiar with the core USB
> > API, and would just need to know how to do the set/reset logic to
> > prevent runtime suspend.
> 
> It is possible to disable LPM for one particular device, based on the 
> vendor and product IDs.  To do so would require a kernel patch, but 
> this patch would be accepted for the mainline kernel and therefore 
> would be available to everyone using these devices, not just the people 
> running your software.
> 
> To write such a patch yourself, edit the drivers/core/usb/quirks.c 
> file and copy one of the entries for the Blackmagic Design devices, 
> changing the ID numbers as appropriate.  The USB_QUIRK_NO_LPM flag is 
> the important factor.
> 
> Alan Stern
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to