RE: [PATCH 1/1] usb: lpm: add boot flag to disable lpm

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

 



I've prepared some updated results.

If I use an older, USB2.0 model of one of these cameras, it has a single
endpoint, with a BULK IN and a BULK OUT endpoint. These interfaces are
used to read/write config data, registers, etc, and the sole BULK IN
interface is also used to acquire streaming image data. Both with and
without the high-frequency claim/release code, the camera works fine,
regardless of whether LPM is enabled.

With a newer, USB3.0 model camera, which has one interface with two
endpoints for control read/writes, and a second dedicated interface with
a single BULK IN endpoint for acquiring streaming image data, the
behavior is as follows:
* Frequent claim/release, multiprocess mutex left in place, LPM enabled:
non-responsive.
* Frequent claim/release, multiprocess mutex left in place, LPM
disabled: working fine.
* Disable frequent claim/release, multiprocess mutex left in place, LPM
enabled: working fine.

I'm concerned with removing the claim/release interface logic, as I
encountered numerous problems on Ubuntu 12.04 LTS and Ubuntu 14.10 where
the application or sometimes the entire system would freeze unless I
used the claim/release calls. Also, if we have a use case where 16
separate processes load an instance of my library, with one instance
streaming data and 15 others controlling certain aspects of the camera,
auto-claiming will start causing similar behavior to occur. Having
deterministic behavior across Ubuntu releases is critical in my case.

With this in mind, I'm still in favor of somehow disabling LPM. At this
point, I'm already contemplating custom kernel builds for customers.

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

> -------- Original Message --------
> Subject: RE: [PATCH 1/1] usb: lpm: add boot flag to disable lpm
> From: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
> Date: Thu, April 14, 2016 10:31 am
> To: Matthew Giassa <matthew@xxxxxxxxxx>
> Cc: Mathias Nyman <mathias.nyman@xxxxxxxxxxxxxxx>, Greg KH
> <gregkh@xxxxxxxxxxxxxxxxxxx>, <linux-usb@xxxxxxxxxxxxxxx>
> 
> 
> On Thu, 14 Apr 2016, Alan Stern wrote:
> 
> > On Thu, 14 Apr 2016, Matthew Giassa wrote:
> > 
> > > Replying in-line:
> > > 
> > > > > You are correct: the software claims and releases certain interfaces
> > > > > frequently. 
> > > > 
> > > > How frequently?  The usbmon log you attached to the Bugzilla report
> > > > shows it happening at intervals of approximately 20-40 ms (sometimes
> > > > longer) -- and often with no messages sent in between.  Does that seem
> > > > at all reasonable?
> > > That polling interval you describe is the extreme case, but its not that
> > > uncommon. It just depends what "metrics" are enabled by the "gathering"
> > > thread. The case of no messages being passed does not seem reasonable.
> > > Data is expected to be transferred between each claim/release.
> > 
> > You should track that down; it sounds like a bug in your program.
> 
> My mistake.  The kernel is responsible for this, not your program.  For 
> each claim_interface it disables and then enables LPM, and the same for 
> each release_interface.  That explains (partly) the pattern of activity 
> seen in the usbmon trace.
> 
> 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
--
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