[PATCH] dwc3: gadget: Introduce dwc3_endpoint_xfer_xxx() to check endpoint type

2016-05-25 Thread Baolin Wang
When handling the endpoint interrupt handler, it maybe disable the endpoint from another core user to set the USB endpoint descriptor pointor to be NULL while issuing usb_gadget_giveback_request() function to release lock. So it will be one bug to check the endpoint type by usb_endpoint_xfer_xxx()

RE: [RFT PATCH] xhci: Fix handling timeouted commands on hosts in weird states.

2016-05-25 Thread Rajesh Bhagat
> -Original Message- > From: Joe Lawrence [mailto:joe.lawre...@stratus.com] > Sent: Wednesday, May 25, 2016 9:04 PM > To: Mathias Nyman > Cc: linux-usb@vger.kernel.org; derek.sh...@stratus.com; Rajesh Bhagat > ; stable

Re: [PATCHv2 0/4] usb: dwc3: get rid of platform data

2016-05-25 Thread John Youn
On 4/22/2016 1:18 AM, Heikki Krogerus wrote: > Changes since v1: > - Slit the refactoring and cleanup into separate patches > > > Heikki Krogerus (4): > usb: dwc3: pci: make build-in device properties available > usb: dwc3: pci: pass the platform device as a parameter to >

RE: [PATCH] usb: core: add debugobjects support for urb object

2016-05-25 Thread Du, Changbin
> On Tue, May 24, 2016 at 03:53:53PM +0800, changbin...@intel.com wrote: > > From: "Du, Changbin" > > > > Add debugobject support to track the life time of struct urb. > > This feature help us detect violation of urb operations by > > generating a warning message from

[PATCH] usb: dwc3: Set the ClearPendIN bit on Clear Stall EP command

2016-05-25 Thread John Youn
As of core revision 2.60a the recommended programming model is to set the ClearPendIN bit when issuing a Clear Stall EP command for IN endpoints. This is to prevent an issue where some hosts may not send ACK TPs for pending IN transfers due to various error conditions. Synopsys STAR 9000614252.

[PATCH] reset: Put back *_optional variants

2016-05-25 Thread John Youn
Prior to commit 6c96f05c8bb8 ("reset: Make [of_]reset_control_get[_foo] functions wrappers"), the optional variants returned -ENOTSUPP when CONFIG_RESET_CONTROLLER was not set. This patch reverts to this behavior. Otherwise those calls will return -EINVAL causing users to think that an error

[PATCH v3 06/13] usb: dwc2: gadget: Add dwc2_gadget_incr_frame_num()

2016-05-25 Thread John Youn
From: Vardan Mikayelyan Increases and checks targeted frame number of current ep if overrun happened, sets flag and masks with DSTS_SOFFN_LIMIT Added following fields to struct dwc2_hsotg_ep -target_frame: Targeted frame num to setup next ISOC transfer -frame_overrun:

[PATCH v3 08/13] usb: dwc2: gadget: Add dwc2_gadget_read_ep_interrupts function

2016-05-25 Thread John Youn
From: Vardan Mikayelyan Reads and returns interrupts for given endpoint, by masking epint_reg with corresponding mask. Tested-by: John Keeping Signed-off-by: Vardan Mikayelyan Signed-off-by: John Youn ---

[PATCH v3 09/13] usb: dwc2: gadget: Add dwc2_gadget_start_next_request function

2016-05-25 Thread John Youn
From: Vardan Mikayelyan Replaced repeating code with function call. Starts next request from ep queue. If queue is empty and ep is isoc -In case of OUT-EP unmasks OUTTKNEPDIS. OUTTKNEPDIS is masked in it's handler, so we need to unmask it here to be able to do

[PATCH v3 11/13] usb: dwc2: gadget: Add Incomplete ISO IN/OUT Interrupt handlers

2016-05-25 Thread John Youn
From: Vardan Mikayelyan Incomplete ISO IN interrupt indicates one of the following conditions occurred while transmitting an ISOC transaction. - Corrupted IN Token for ISOC EP. - Packet not complete in FIFO. Incomplete ISO OUT indicates that there is at least one

[PATCH v3 13/13] usb: dwc2: gadget: Final fixes for BDMA ISOC

2016-05-25 Thread John Youn
From: Vardan Mikayelyan Done fixes and tested hsotg gadget's BDMA mode. Tested Control, Bulk, Isoc, Inter transfers. Added code for isoc transfers, removed unusable code, done minor fixes. Affected functions and IRQ handlers: - dwc2_hsotg_start_req(), -

[PATCH v3 10/13] usb: dwc2: gadget: Add OUTTKNEPDIS and NAKINTRPT handlers

2016-05-25 Thread John Youn
From: Vardan Mikayelyan NAKINTRPT interrupt is starting point for isoc-in transfer, synchronization done with first in token received from host, core asserts this interrupt when responds with 0 length data to in token, received from host. The first IN token is asynchronous

[PATCH v3 12/13] usb: dwc2: gadget: Add EP disabled interrupt handler

2016-05-25 Thread John Youn
From: Vardan Mikayelyan Reimplemented EP disabled interrupt handler and moved to corresponding function. This interrupt indicates that the endpoint has been disabled per the application's request. For IN endpoints flushes txfifo, in case of BULK clears DCTL_CGNPINNAK, in

[PATCH v3 01/13] usb: dwc2: Add missing register field definitions

2016-05-25 Thread John Youn
From: Vardan Mikayelyan Added register field definitions, register names are according DWC-OTG databook. Tested-by: John Keeping Signed-off-by: Vardan Mikayelyan Signed-off-by: John Youn ---

[PATCH v3 02/13] usb: dwc2: gadget: Remove unnecessary line

2016-05-25 Thread John Youn
From: Vardan Mikayelyan Removed "ctrl |= DXEPCTL_USBACTEP" from dwc2_hsotg_start_req() function because this step is done in dwc2_hsotg_ep_enable(). Tested-by: John Keeping Signed-off-by: Vardan Mikayelyan Signed-off-by: John Youn

[PATCH v3 04/13] usb: dwc2: gadget: Corrected field names

2016-05-25 Thread John Youn
From: Vardan Mikayelyan No-op change. Changed field names to prevent misunderstanding. Tested-by: John Keeping Signed-off-by: Vardan Mikayelyan Signed-off-by: John Youn --- drivers/usb/dwc2/gadget.c | 6

[PATCH v3 03/13] usb: dwc2: gadget: Remove unnecessary code

2016-05-25 Thread John Youn
From: Vardan Mikayelyan This chunk is not needed here. There is no functionality depend on this, so if no-op, I think we do not need to have this interrupt unmasked. Tested-by: John Keeping Signed-off-by: Vardan Mikayelyan

[PATCH v3 07/13] usb: dwc2: gadget: Corrected interval calculation

2016-05-25 Thread John Youn
From: Vardan Mikayelyan Calculate the interval according to the USB 2.0 specification section 9.6.6. Tested-by: John Keeping Signed-off-by: Vardan Mikayelyan Signed-off-by: John Youn ---

[PATCH v3 05/13] usb: dwc2: gadget: Fix transfer stop programming for out endpoint

2016-05-25 Thread John Youn
From: Vardan Mikayelyan According DWC-OTG databook, "GOUTNakEff" is read only and can be cleared only by "DCTL.CGOUTNak", but here we do not need to clear it because DWC-OTG programming guide says that before disabling any OUT endpoint, the application must enable Global

[PATCH v3 00/13] usb: dwc2: Fix up gadget isochronous support

2016-05-25 Thread John Youn
The following patch series fixes up isochronous support for the dwc2 gadget. The existing isochronous support lacked a few features. Most notably it did not properly sync up with the first packet and it didn't handle the Incomplete ISO IN/OUT interrupts. These patches have been sitting in our

Re: [PATCH v8 2/7] usb: mux: add generic code for dual role port mux

2016-05-25 Thread Lu Baolu
Hi Heikki, On 05/25/2016 07:06 PM, Heikki Krogerus wrote: > Hi Baolu, > > Sorry to comment this so late, but we got hardware that needs to > configure the mux in OS, and I noticed some problem. Comments are always welcome. :-) > We are missing > means to bind a port to the correct mux on

Re: [PATCH V3 0/2] usb: musb: fix dropped packets

2016-05-25 Thread Bin Liu
Hi, On Tue, May 24, 2016 at 09:22:32AM +0100, Andrew Goodbody wrote: > The musb driver can drop rx packets when heavily loaded. These two > patches address two issues that can cause this. Both issues arose > when an endpoint was reprogrammed. The first patch is a logic bug > that resulted in a

Re: [PATCH] drivers: usb: dwc3 : Configure DMA properties and ops from DT

2016-05-25 Thread Leo Li
On Wed, May 4, 2016 at 2:57 AM, Felipe Balbi wrote: > > Hi, > > Rajesh Bhagat writes: >> On certain platforms (e.g. ARM64) the dma_ops needs to be explicitly set >> to be able to do DMA allocations, so use the of_dma_configure() helper >> to

Re: [PATCH v2] usb: gadget: fix spinlock dead lock in gadgetfs

2016-05-25 Thread Bin Liu
On Wed, May 25, 2016 at 02:18:34PM -0500, Bin Liu wrote: > [ 40.467381] = > [ 40.473013] [ INFO: possible recursive locking detected ] > [ 40.478651] 4.6.0-08691-g7f3db9a #37 Not tainted > [ 40.483466]

[PATCH v2] usb: gadget: fix spinlock dead lock in gadgetfs

2016-05-25 Thread Bin Liu
[ 40.467381] = [ 40.473013] [ INFO: possible recursive locking detected ] [ 40.478651] 4.6.0-08691-g7f3db9a #37 Not tainted [ 40.483466] - [ 40.489098] usb/733 is trying to acquire lock: [

Re: [PATCH] usb: gadget: fix spinlock dead lock in gadgetfs

2016-05-25 Thread Alan Stern
On Wed, 25 May 2016, Bin Liu wrote: > [ 40.467381] = > [ 40.473013] [ INFO: possible recursive locking detected ] > [ 40.478651] 4.6.0-08691-g7f3db9a #37 Not tainted > [ 40.483466] - > [ 40.489098]

[RFC PATCH] usb: typec: Various API updates and fixes

2016-05-25 Thread Guenter Roeck
From: Guenter Roeck New API functions (calls into class code) typec_set_usb_role() typec_set_pwr_role() typec_set_vconn_role() typec_set_pwr_opmode() Modified API functions (calls into class code): typec_register_port(dev, cap) ->

[PATCH] usb: gadget: fix spinlock dead lock in gadgetfs

2016-05-25 Thread Bin Liu
[ 40.467381] = [ 40.473013] [ INFO: possible recursive locking detected ] [ 40.478651] 4.6.0-08691-g7f3db9a #37 Not tainted [ 40.483466] - [ 40.489098] usb/733 is trying to acquire lock: [

Re: [PATCH] Re: Endless "supply vcc not found, using dummy regulator"

2016-05-25 Thread Steinar H. Gunderson
On Wed, May 25, 2016 at 05:46:51PM +0530, Anand Moon wrote: > Actually their are some missing patches to tune the usb3 phy. > > https://lkml.org/lkml/2014/10/31/266 This explains why the default networking speed refused to go above ~300 Mbit/sec! What happened to the patches, I wonder? /*

Re: [RFT PATCH] xhci: Fix handling timeouted commands on hosts in weird states.

2016-05-25 Thread Joe Lawrence
On 05/12/2016 07:57 AM, Mathias Nyman wrote: > If commands timeout we mark them for abortion, then stop the command > ring, and turn the commands to no-ops and finally restart the command > ring. > > If the host is working properly the no-op commands will finish and > pending completions are

Re: [PATCH] chaoskey: Be conservative with the initial estimate of quality.

2016-05-25 Thread Keith Packard
Oliver Neukum writes: > To guard the entropy pool against malicious spoof we assume > the quality of an unverified source's entropy to be 0. This removes most of the utility of the device, which is to provide entropy to a system early in the boot process. If you have physical

Re: [RFC PATCHv2] usb: USB Type-C Connector Class

2016-05-25 Thread Guenter Roeck
On Wed, May 25, 2016 at 02:28:46PM +0300, Heikki Krogerus wrote: > Hi, > > On Tue, May 24, 2016 at 02:51:40PM +0200, Oliver Neukum wrote: > > On Thu, 2016-05-19 at 15:44 +0300, Heikki Krogerus wrote: > > > > Hi, > > > > as this discussion seems to go in circles, I am starting anew > > at the

Re: [RFC PATCHv2] usb: USB Type-C Connector Class

2016-05-25 Thread Guenter Roeck
On Wed, May 25, 2016 at 04:20:56PM +0200, Oliver Neukum wrote: > On Wed, 2016-05-25 at 17:04 +0300, Heikki Krogerus wrote: > > > I'm not against leaving the responsibility of registering the alternate > > modes to the drivers. I'm a little bit worried about relying then on > > the drivers to also

RE: [PATCH v8 08/14] usb: otg: add OTG/dual-role core

2016-05-25 Thread Jun Li
Hi Roger > >> > >> Here, we should be checking if user needs to disable any OTG > >> features. So, > >> > >>if (dev->of_node) > >>of_usb_update_otg_caps(dev->of_node, >caps); > >> > >> Do you agree? > >> This means we need to change otg->caps from 'struct usb_otg_caps > *caps;' >

Re: [RFC PATCHv2] usb: USB Type-C Connector Class

2016-05-25 Thread Oliver Neukum
On Wed, 2016-05-25 at 17:04 +0300, Heikki Krogerus wrote: > I'm not against leaving the responsibility of registering the alternate > modes to the drivers. I'm a little bit worried about relying then on > the drivers to also handle the unregistering accordingly, but I can > live with that. But we

Re: usb 1-2: reset high-speed USB device number 3 using ehci-pci

2016-05-25 Thread Alan Stern
On Wed, 25 May 2016, Mathieu Malaterre wrote: > Hi, > > I am trying to track down an issue that happen during Debian > Installation from a USB key onto a Mac Mini G4 (PPC) [*]. > > Basically the USB key is working nicely (`badblocks` is fine), however > under this specific circumstances, the

Re: [PATCH] USB: uas: Fix slave queue_depth not being set

2016-05-25 Thread Tom Yan
What if a UAS bridge requires specific SCSI command (e.g. UNMAP) to be issued unqueued/untagged? Would track_queue_depth help? On 25 May 2016 at 19:04, Hans de Goede wrote: > Hi, > > > On 24-05-16 14:44, James Bottomley wrote: >> >> On Tue, 2016-05-24 at 08:53 +0200, Hans de

Re: [RFC PATCHv2] usb: USB Type-C Connector Class

2016-05-25 Thread Heikki Krogerus
On Wed, May 25, 2016 at 06:21:54AM -0700, Guenter Roeck wrote: > On 05/25/2016 04:51 AM, Heikki Krogerus wrote: > > On Tue, May 24, 2016 at 12:28:26PM -0700, Guenter Roeck wrote: > > > On Thu, May 19, 2016 at 03:44:54PM +0300, Heikki Krogerus wrote: > > > > The purpose of this class is to provide

Re: [RFC PATCHv2] usb: USB Type-C Connector Class

2016-05-25 Thread Guenter Roeck
On 05/25/2016 04:51 AM, Heikki Krogerus wrote: On Tue, May 24, 2016 at 12:28:26PM -0700, Guenter Roeck wrote: On Thu, May 19, 2016 at 03:44:54PM +0300, Heikki Krogerus wrote: The purpose of this class is to provide unified interface for user space to get the status and basic information about

Re: [RFC PATCHv2] usb: USB Type-C Connector Class

2016-05-25 Thread Guenter Roeck
On 05/25/2016 04:30 AM, Heikki Krogerus wrote: Hi, On Tue, May 24, 2016 at 06:42:09AM -0700, Guenter Roeck wrote: +struct typec_capability { + enum typec_data_rolerole; + unsigned intusb_pd:1; + struct typec_altmode*alt_modes; + unsigned int

Re: [PATCH v8 08/14] usb: otg: add OTG/dual-role core

2016-05-25 Thread Roger Quadros
On 25/05/16 06:19, Jun Li wrote: > > >> -Original Message- >> From: Peter Chen [mailto:hzpeterc...@gmail.com] >> Sent: Wednesday, May 25, 2016 10:44 AM >> To: Roger Quadros >> Cc: peter.c...@freescale.com; ba...@kernel.org; t...@atomide.com; >> gre...@linuxfoundation.org;

Re: [PATCH v8 08/14] usb: otg: add OTG/dual-role core

2016-05-25 Thread Roger Quadros
On 25/05/16 05:44, Peter Chen wrote: > On Tue, May 24, 2016 at 12:45:46PM +0300, Roger Quadros wrote: >> Hi Peter, >> >> I have one question here. Please see below. >> >> On 13/05/16 13:03, Roger Quadros wrote: >>> It provides APIs for the following tasks >>> >>> - Registering an OTG/dual-role

Re: [PATCH] Re: Endless "supply vcc not found, using dummy regulator"

2016-05-25 Thread Anand Moon
Hi Steinar, On 25 May 2016 at 00:54, Steinar H. Gunderson wrote: > On Tue, May 24, 2016 at 05:53:34PM +0200, Krzysztof Kozlowski wrote: >> exynos->clk = devm_clk_get(dev, "usbdrd30"); >> if (IS_ERR(exynos->clk)) { >> + // On each error path

Re: [RFC PATCHv2] usb: USB Type-C Connector Class

2016-05-25 Thread Heikki Krogerus
On Tue, May 24, 2016 at 12:28:26PM -0700, Guenter Roeck wrote: > On Thu, May 19, 2016 at 03:44:54PM +0300, Heikki Krogerus wrote: > > The purpose of this class is to provide unified interface for user > > space to get the status and basic information about USB Type-C > > Connectors in the system,

Re: [RFC PATCHv2] usb: USB Type-C Connector Class

2016-05-25 Thread Heikki Krogerus
Hi, On Tue, May 24, 2016 at 06:42:09AM -0700, Guenter Roeck wrote: > > +struct typec_capability { > > + enum typec_data_rolerole; > > + unsigned intusb_pd:1; > > + struct typec_altmode*alt_modes; > > + unsigned intaudio_accessory:1; > > + unsigned int

Re: [RFC PATCHv2] usb: USB Type-C Connector Class

2016-05-25 Thread Heikki Krogerus
Hi, On Tue, May 24, 2016 at 02:51:40PM +0200, Oliver Neukum wrote: > On Thu, 2016-05-19 at 15:44 +0300, Heikki Krogerus wrote: > > Hi, > > as this discussion seems to go in circles, I am starting anew > at the top. > > > Like I've told some of you guys, I'm trying to implement a bus for > >

Re: [PATCH v5 0/5] da8xx USB PHY platform devices and clocks (was "da8xx UBS clocks")

2016-05-25 Thread Sekhar Nori
On Monday 23 May 2016 08:44 PM, David Lechner wrote: > On 05/09/2016 06:46 PM, David Lechner wrote: >> v5 changes: renamed "usbphy" to "usb_phy" or "usb-phy" as appropriate >> >> David Lechner (5): >>ARM: davinci: da8xx: add usb phy clocks >>ARM: davinci: da8xx: Add CFGCHIP syscon platform

Re: [PATCH v5 2/5] ARM: davinci: da8xx: Add CFGCHIP syscon platform declaration.

2016-05-25 Thread Sekhar Nori
On Tuesday 10 May 2016 10:14 PM, David Lechner wrote: > On 05/10/2016 06:26 AM, Sergei Shtylyov wrote: >> On 5/10/2016 2:46 AM, David Lechner wrote: >> >>> The CFGCHIP registers are used by a number of devices, so using a syscon >>> device to share them. The first consumer of this will by the >>>

Re: [PATCH v8 2/7] usb: mux: add generic code for dual role port mux

2016-05-25 Thread Heikki Krogerus
Hi Baolu, Sorry to comment this so late, but we got hardware that needs to configure the mux in OS, and I noticed some problem. We are missing means to bind a port to the correct mux on multiport systems. That we need to solve later in any case, but there is an other issue related to the fact

Re: [PATCH] USB: uas: Fix slave queue_depth not being set

2016-05-25 Thread Hans de Goede
Hi, On 24-05-16 14:44, James Bottomley wrote: On Tue, 2016-05-24 at 08:53 +0200, Hans de Goede wrote: Hi, On 23-05-16 19:36, James Bottomley wrote: On Mon, 2016-05-23 at 13:49 +0200, Hans de Goede wrote: Commit 198de51dbc34 ("USB: uas: Limit qdepth at the scsi-host level") removed the

[PATCH] chaoskey: Be conservative with the initial estimate of quality.

2016-05-25 Thread Oliver Neukum
There is a principal problem with randomness gained from wired USB devices. The kernel needs to be sure that the device actually is what it claims to be. (Wirebound) USB by itself does not provide a means of authentication. Anything connected is trusted. Making sure that a device really is what

Re: AW: ffs-test fails with warning (-19) No such device

2016-05-25 Thread Krzysztof Opasiak
On 05/24/2016 05:31 PM, jan.hu...@k2l.de wrote: >> You shouldn't use epX where X != 0 until you get enable event. You may >> refer to ffs-aio examples which have a suitable flag to wait for that event. > > I got the ffs-aio example (simple and multibuff) to work. > I also used the ffs-aio

Re: [PATCH v2 5/5] usb: dwc3: rockchip: add devicetree bindings documentation

2016-05-25 Thread William Wu
Hi Felipe & Rob, On 05/25/2016 04:04 PM, Felipe Balbi wrote: Hi, William Wu writes: Hi Felipe, On 05/24/2016 05:32 PM, Felipe Balbi wrote: Hi, William Wu writes: This patch documents the device tree documentation required for Rockchip

Re: [PATCH v4] input: tablet: add Pegasus Notetaker tablet driver

2016-05-25 Thread Oliver Neukum
On Wed, 2016-05-25 at 09:44 +0200, Martin Kepplinger wrote: > This adds a driver for the Pegasus Notetaker Pen. When connected, > this uses the Pen as an input tablet. > > This device was sold in various different brandings, for example > "Pegasus Mobile Notetaker M210", > "Genie

usb 1-2: reset high-speed USB device number 3 using ehci-pci

2016-05-25 Thread Mathieu Malaterre
Hi, I am trying to track down an issue that happen during Debian Installation from a USB key onto a Mac Mini G4 (PPC) [*]. Basically the USB key is working nicely (`badblocks` is fine), however under this specific circumstances, the USB key needs to be physically removed and then re-plugged so

Re: [PATCH] dwc3-exynos: Fix deferred probing storm.

2016-05-25 Thread Krzysztof Kozlowski
On 05/24/2016 08:13 PM, Steinar H. Gunderson wrote: > dwc3-exynos has two problems during init if the regulators are slow > to come up (for instance if the I2C bus driver is not on the initramfs) > and return probe deferral. First, every time this happens, the driver > leaks the USB phys created;

[PATCH v4] input: tablet: add Pegasus Notetaker tablet driver

2016-05-25 Thread Martin Kepplinger
This adds a driver for the Pegasus Notetaker Pen. When connected, this uses the Pen as an input tablet. This device was sold in various different brandings, for example "Pegasus Mobile Notetaker M210", "Genie e-note The Notetaker", "Staedtler Digital ballpoint pen 990 01",