[PATCH 1/3] usb: gadget: rndis: use rndis_params instead of configNr

2015-03-20 Thread Andrzej Pietrasiewicz
RNDIS function has a limitation on the number of allowed instances. So far it has been RNDIS_MAX_CONFIGS, which happens to be one. In order to eliminate this kind of arbitrary limitation we should not preallocate a predefined (RNDIS_MAX_CONFIGS) array of struct rndis_params instances but instead al

Re: [RFC][PATCH 2/9] usb: gadget: add usb_gadget_start/stop()

2015-03-20 Thread Peter Chen
On Thu, Mar 19, 2015 at 04:50:31PM +0200, Roger Quadros wrote: > On 19/03/15 16:09, Li Jun wrote: > > On Thu, Mar 19, 2015 at 12:14:39PM +0200, Roger Quadros wrote: > >> On 19/03/15 05:30, Peter Chen wrote: > >>> On Wed, Mar 18, 2015 at 03:55:56PM +0200, Roger Quadros wrote: > The OTG state ma

Re: [RFC 01/19] extcon: add extcon-odroid-usbotg driver

2015-03-20 Thread Robert Baldyga
Hi Chanwoo, On 03/19/2015 09:50 PM, Chanwoo Choi wrote: > Hi Roger, > > On Thu, Mar 19, 2015 at 11:45 PM, Roger Quadros wrote: >> On 19/03/15 14:19, George Cherian wrote: >>> Hi Robert, >>> >>> +Roger >>> On Thu, Mar 19, 2015 at 5:37 PM, Robert Baldyga >>> wrote: Hi George, On 0

Re: [RFC 01/19] extcon: add extcon-odroid-usbotg driver

2015-03-20 Thread Chanwoo Choi
Hi Robert, On 03/20/2015 04:25 PM, Robert Baldyga wrote: > Hi Chanwoo, > > On 03/19/2015 09:50 PM, Chanwoo Choi wrote: >> Hi Roger, >> >> On Thu, Mar 19, 2015 at 11:45 PM, Roger Quadros wrote: >>> On 19/03/15 14:19, George Cherian wrote: Hi Robert, +Roger On Thu, Mar 19, 2015

Re: [RFC][PATCH 3/9] usb: otg: add OTG core

2015-03-20 Thread Peter Chen
On Thu, Mar 19, 2015 at 12:18:55PM +0200, Roger Quadros wrote: > On 19/03/15 05:40, Peter Chen wrote: > > On Wed, Mar 18, 2015 at 03:55:57PM +0200, Roger Quadros wrote: > >> The OTG core instantiates the OTG Finite State Machine > >> per OTG controller and manages starting/stopping the > >> host an

[PATCH] cdc-acm: fix race between callback and unthrottle

2015-03-20 Thread Oliver Neukum
Abn URB may be may marked free only after the buffer has been processed or there is a small window during which it could be submitted on another CPU and overwrite an unprocessed buffer Signed-off-by: Oliver Neukum --- drivers/usb/class/cdc-acm.c | 12 ++-- 1 file changed, 10 insertions(+

[PATCH 3/5] usb: chipidea: use hrtimer for otg fsm timers

2015-03-20 Thread Peter Chen
From: Li Jun Current otg fsm timers are using controller 1ms irq and count it, this patch is to replace it with hrtimer solution, use one hrtimer for all otg timers. Signed-off-by: Li Jun Signed-off-by: Peter Chen --- drivers/usb/chipidea/ci.h | 10 +- drivers/usb/chipidea/otg_fsm.c | 3

[PATCH 1/5] usb: chipidea: otg: remove unnecessary B_SESS_VLD timer

2015-03-20 Thread Peter Chen
From: Li Jun Since BSV irq is enabled for B-device all the time, so B_SESS_VLD timer is not required, and also no need to check BSV status when B_ASE0_BRST timer timeout. Signed-off-by: Li Jun Signed-off-by: Peter Chen --- drivers/usb/chipidea/otg_fsm.c | 31 +-- d

[PATCH 2/5] usb: otg-fsm: move 2 otg fsm timers definition to otg_fsm_timer

2015-03-20 Thread Peter Chen
From: Li Jun B_DATA_PLS(data-line pulse time) and B_SSEND_SRP(session end to SRP init) are also from OTG&EH 2.0 Specification and they are not chipidea specific. Signed-off-by: Li Jun Signed-off-by: Peter Chen --- drivers/usb/chipidea/otg_fsm.c | 8 drivers/usb/chipidea/otg_fsm.h |

[PATCH 4/5] chipidea: introduce specific Kconfig options for glue drivers

2015-03-20 Thread Peter Chen
From: Andy Shevchenko This patch introduces USB_CHIPIDEA_PCI and USB_CHIPIDEA_OF Kconfig options, one per each specific glue driver. This is needed to provide different dependencies they have. Signed-off-by: Andy Shevchenko Signed-off-by: Peter Chen --- drivers/usb/chipidea/Kconfig | 10

[PATCH 0/5] chipidea patches for v4.1 (for building error)

2015-03-20 Thread Peter Chen
Hi Greg, There are two updates in this set, one for build error found by kbuild test robot, the other is using hrtimer to replace hardware 1ms timer for OTG fsm. Andy Shevchenko (2): chipidea: introduce specific Kconfig options for glue drivers chipidea: pci: make it depends on NOP_USB_XCEIV

[PATCH 5/5] chipidea: pci: make it depends on NOP_USB_XCEIV

2015-03-20 Thread Peter Chen
From: Andy Shevchenko After commit ba1aff67f99a (chipidea: pci: register nop PHY) the PCI glue driver requires nop-PHY to be selected. Thus, make it an explicit dependency. Reported-by: kbuild test robot Fixes: ba1aff67f99a (chipidea: pci: register nop PHY) Signed-off-by: Andy Shevchenko Signe

Re: [RFC 01/19] extcon: add extcon-odroid-usbotg driver

2015-03-20 Thread Roger Quadros
Chanwoo & Robert, On 20/03/15 09:45, Chanwoo Choi wrote: > Hi Robert, > > On 03/20/2015 04:25 PM, Robert Baldyga wrote: >> Hi Chanwoo, >> >> On 03/19/2015 09:50 PM, Chanwoo Choi wrote: >>> Hi Roger, >>> >>> On Thu, Mar 19, 2015 at 11:45 PM, Roger Quadros wrote: On 19/03/15 14:19, George Che

Re: [PATCH] usb: Add driver for Altus Metrum ChaosKey device (v2)

2015-03-20 Thread Oliver Neukum
On Thu, 2015-03-19 at 20:36 -0700, Keith Packard wrote: > This is a hardware random number generator. The driver provides both a > /dev/chaoskeyX entry and hooks the entropy source up to the kernel > hwrng interface. More information about the device can be found at It looks good to me. R

Re: [RFC][PATCH 3/9] usb: otg: add OTG core

2015-03-20 Thread Roger Quadros
On 20/03/15 09:45, Peter Chen wrote: > On Thu, Mar 19, 2015 at 12:18:55PM +0200, Roger Quadros wrote: >> On 19/03/15 05:40, Peter Chen wrote: >>> On Wed, Mar 18, 2015 at 03:55:57PM +0200, Roger Quadros wrote: The OTG core instantiates the OTG Finite State Machine per OTG controller and ma

RE: [RFC][PATCH 3/9] usb: otg: add OTG core

2015-03-20 Thread Peter Chen
> > - Registering an OTG capable controller > - Registering Host and Gadget controllers to OTG core > - Providing inputs to and kicking the OTG state machine > > TODO: > - sysfs interface to allow application inputs to OTG state machine > - otg class? > >>>

Re: [PATCH] usb: Add driver for Altus Metrum ChaosKey device

2015-03-20 Thread Oliver Neukum
On Thu, 2015-03-19 at 20:25 -0700, Keith Packard wrote: > > That is a violation of the DMA rules on non-coherent architectures. > > The buffer must be allocated separately. > > Ok, I'm not sure I understand the reasoning given that both come from > kmalloc, but that's easy to do. That happens on

Re: [RFC][PATCH 2/9] usb: gadget: add usb_gadget_start/stop()

2015-03-20 Thread Roger Quadros
On 20/03/15 09:18, Peter Chen wrote: > On Thu, Mar 19, 2015 at 04:50:31PM +0200, Roger Quadros wrote: >> On 19/03/15 16:09, Li Jun wrote: >>> On Thu, Mar 19, 2015 at 12:14:39PM +0200, Roger Quadros wrote: On 19/03/15 05:30, Peter Chen wrote: > On Wed, Mar 18, 2015 at 03:55:56PM +0200, Roge

Re: [RFC][PATCH 1/9] usb: hcd: Introduce usb_start/stop_hcd()

2015-03-20 Thread Roger Quadros
On 20/03/15 08:32, Peter Chen wrote: > On Thu, Mar 19, 2015 at 01:38:32PM +0200, Roger Quadros wrote: >> On 18/03/15 21:49, Alan Stern wrote: >>> On Wed, 18 Mar 2015, Roger Quadros wrote: >>> To support OTG we want a mechanism to start and stop the HCD from the OTG state machine. Add usb_

[PATCH] cdc-acm: surpress misleading message

2015-03-20 Thread Oliver Neukum
During the entry intro suspend a misleading message can be printed. Surpress it by checking the specific error. Signed-off-by: Oliver Neukum 0 --- drivers/usb/class/cdc-acm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-ac

[PATCH] cdc-acm: convert to not directly using urb->status

2015-03-20 Thread Oliver Neukum
A step on the road to passing status as a parameter Signed-off-by: Oliver Neukum --- drivers/usb/class/cdc-acm.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 43cb058..3e15add 100644 --- a/drivers/usb/cl

Re: [RFC][PATCH 2/9] usb: gadget: add usb_gadget_start/stop()

2015-03-20 Thread Roger Quadros
On 20/03/15 11:46, Roger Quadros wrote: > On 20/03/15 09:18, Peter Chen wrote: >> On Thu, Mar 19, 2015 at 04:50:31PM +0200, Roger Quadros wrote: >>> On 19/03/15 16:09, Li Jun wrote: On Thu, Mar 19, 2015 at 12:14:39PM +0200, Roger Quadros wrote: > On 19/03/15 05:30, Peter Chen wrote: >>

[PATCH] usb: isp1760: fix spin unlock in the error path of isp1760_udc_start

2015-03-20 Thread Sudeep Holla
Commit a124820de5fd ("usb: isp1760: fix possible deadlock in isp1760_udc_irq") replaced spin_{un,}lock with spin_{un,}lock_irq{save,restore}. However it missed an error path resulting in the smatch warning as below: drivers/usb/isp1760/isp1760-udc.c:1230 isp1760_udc_start() warn: inconsistent ret

[PATCHv3 01/12] usb: add bus type for USB ULPI

2015-03-20 Thread Heikki Krogerus
UTMI+ Low Pin Interface (ULPI) is a commonly used PHY interface for USB 2.0. The ULPI specification describes a standard set of registers which the vendors can extend for their specific needs. ULPI PHYs provide often functions such as charger detection and ADP sensing and probing. There are two ma

[PATCHv3 09/12] usb: dwc3: pci: add quirk for Baytrails

2015-03-20 Thread Heikki Krogerus
On some BYT platforms the USB2 PHY needs to be put into operational mode by the controller driver with GPIOs controlling the PHYs reset and cs signals. Signed-off-by: Heikki Krogerus --- drivers/usb/dwc3/dwc3-pci.c | 35 +++ 1 file changed, 35 insertions(+) diff

[PATCHv3 10/12] usb: dwc3: add ULPI interface support

2015-03-20 Thread Heikki Krogerus
Registers DWC3's ULPI interface with the ULPI bus when it's available. Signed-off-by: Heikki Krogerus --- drivers/usb/dwc3/Kconfig | 7 drivers/usb/dwc3/Makefile | 4 +++ drivers/usb/dwc3/core.c | 14 drivers/usb/dwc3/core.h | 14 drivers/usb/dwc3/ulpi.c | 91

[PATCH 1/3] cdc-wdm: return correct error codes

2015-03-20 Thread Oliver Neukum
Lieing to user space is wrong. The real reason for a failure to write should be returned to user space. Signed-off-by: Oliver Neukum 0 --- drivers/usb/class/cdc-wdm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c inde

[PATCH 2/3] cdc-wdm: unify error handling in write

2015-03-20 Thread Oliver Neukum
This makes sure the error handling path is the same for all error conditions, thus reducing code duplication. Signed-off-by: Oliver Neukum 0 --- drivers/usb/class/cdc-wdm.c | 31 --- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/drivers/usb/class/cdc-

[PATCH 3/3] cdc-wdm: fix endianness bug in debug statements

2015-03-20 Thread Oliver Neukum
Values directly from descriptors given in debug statements must be converted to native endianness. Signed-off-by: Oliver Neukum CC: sta...@vger.kernel.org --- drivers/usb/class/cdc-wdm.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/usb/class/cdc-wdm.c

RE: [PATCH v1 18/20] usb: dwc2: host: don't use dma_alloc_coherent with irqs disabled

2015-03-20 Thread Kaukab, Yousaf
> -Original Message- > From: jwer...@google.com [mailto:jwer...@google.com] On Behalf Of Julius > Werner > Sent: Wednesday, March 18, 2015 11:43 PM > To: Kaukab, Yousaf > Cc: linux-usb@vger.kernel.org; Felipe Balbi; john.y...@synopsys.com; Herrero, > Gregory; r.bald...@samsung.com; Dinh N

Re: [PATCH 2/3] cdc-wdm: unify error handling in write

2015-03-20 Thread Bjørn Mork
Oliver Neukum writes: > This makes sure the error handling path is the same for > all error conditions, thus reducing code duplication. Great! This looks like I nice cleanup. Will test it out. Just a quick comment based on the first glance: > outnl: > return rv < 0 ? rv : count; How

RE: [PATCH v1 00/20] usb: third series of updates for dwc2 driver

2015-03-20 Thread Kaukab, Yousaf
> -Original Message- > From: John Youn [mailto:john.y...@synopsys.com] > Sent: Thursday, March 19, 2015 11:55 PM > To: Kaukab, Yousaf; John Youn; linux-usb@vger.kernel.org; ba...@ti.com > Cc: Herrero, Gregory; r.bald...@samsung.com; > dingu...@opensource.altera.com; zhangfei@linaro.or

Errata for Freescale root-hub TT?

2015-03-20 Thread Alan Stern
Peter: Are there any known errata for the root-hub Transaction Translator in the Freescale host controllers? When debugging some problems in an i.MX51 system, I found that the host controller would never issue more than 4 full-speed isochronous packets in any frame, no matter how many siTDs were

Re: [PATCH] usb: isp1760: fix spin unlock in the error path of isp1760_udc_start

2015-03-20 Thread Laurent Pinchart
Hi Sudeep, Thank you for the patch. On Friday 20 March 2015 11:42:17 Sudeep Holla wrote: > Commit a124820de5fd ("usb: isp1760: fix possible deadlock in > isp1760_udc_irq") replaced spin_{un,}lock with > spin_{un,}lock_irq{save,restore}. However it missed an error path resulting > in the smatch wa

Re: [PATCH 2/3] cdc-wdm: unify error handling in write

2015-03-20 Thread Oliver Neukum
On Fri, 2015-03-20 at 15:02 +0100, Bjørn Mork wrote: > Oliver Neukum writes: > > > This makes sure the error handling path is the same for > > all error conditions, thus reducing code duplication. > > Great! This looks like I nice cleanup. Will test it out. Just a quick > comment based on the

[PATCH RESEND] usb: gadget: configfs: Fix interfaces array NULL-termination

2015-03-20 Thread Krzysztof Opasiak
memset() to 0 interfaces array before reusing usb_configuration structure. This commit fix bug: ln -s functions/acm.1 configs/c.1 ln -s functions/acm.2 configs/c.1 ln -s functions/acm.3 configs/c.1 echo "UDC name" > UDC echo "" > UDC rm configs/c.1/acm.* rmdir functions/* mkdir functions/ecm.usb0

Re: [PATCH] usb: isp1760: fix spin unlock in the error path of isp1760_udc_start

2015-03-20 Thread Sudeep Holla
Hi Laurent, On 20/03/15 14:20, Laurent Pinchart wrote: Hi Sudeep, Thank you for the patch. On Friday 20 March 2015 11:42:17 Sudeep Holla wrote: Commit a124820de5fd ("usb: isp1760: fix possible deadlock in isp1760_udc_irq") replaced spin_{un,}lock with spin_{un,}lock_irq{save,restore}. However

Re: [PATCH 2/3] cdc-wdm: unify error handling in write

2015-03-20 Thread Bjørn Mork
Oliver Neukum writes: > On Fri, 2015-03-20 at 15:02 +0100, Bjørn Mork wrote: >> Oliver Neukum writes: >> >> > This makes sure the error handling path is the same for >> > all error conditions, thus reducing code duplication. >> >> Great! This looks like I nice cleanup. Will test it out. Jus

[PATCH v2 00/22] usb: third series of updates for dwc2 driver

2015-03-20 Thread Mian Yousaf Kaukab
Hi, This patchset consists of some bug fixes and feature enhancements for the dwc2 driver. All the patches are verified on dwc2 v3.0a with dedicated fifos. Main focus of testing was with dma enabled. Although basic testing without dma was also done. This is based on testing/next branch in Felipe's

[PATCH v2 02/22] usb: dwc2: debugfs: add support for complete register dump

2015-03-20 Thread Mian Yousaf Kaukab
Dump all registers to take a complete snapshot of dwc2 state. Code is inspired by dwc3/debugfs.c Signed-off-by: Mian Yousaf Kaukab --- drivers/usb/dwc2/core.h| 1 + drivers/usb/dwc2/debugfs.c | 357 + 2 files changed, 358 insertions(+) diff --gi

[PATCH v2 01/22] usb: dwc2: move debugfs code to a separate file

2015-03-20 Thread Mian Yousaf Kaukab
Prepare to add more debug code. Moreover, don't save dentry * for each file in struct dwc2_hsotg as clean up is done with debugfs_remove_recursive(). s3c_hsotg_delete_debug() is removed altogether for the same reason. Signed-off-by: Mian Yousaf Kaukab --- drivers/usb/dwc2/Makefile | 4 + dri

[PATCH v2 03/22] usb: dwc2: add controller hibernation support

2015-03-20 Thread Mian Yousaf Kaukab
From: Gregory Herrero When suspending usb bus, phy driver may disable controller power. In this case, registers need to be saved on suspend and restored on resume. Signed-off-by: Gregory Herrero --- drivers/usb/dwc2/core.c | 377 drivers/usb/dwc

[PATCH v2 05/22] usb: dwc2: controller must update lx_state before releasing lock

2015-03-20 Thread Mian Yousaf Kaukab
From: Gregory Herrero During suspend, there could a race condition between ep_queue and suspend interrupt if lx_state is updated after releasing spinlock in call_gadget(hsotg, suspend). Signed-off-by: Gregory Herrero --- drivers/usb/dwc2/core_intr.c | 11 --- 1 file changed, 8 insertio

[PATCH v2 04/22] usb: dwc2: implement hibernation during bus suspend/resume

2015-03-20 Thread Mian Yousaf Kaukab
From: Gregory Herrero Allow controller to enter in hibernation during usb bus suspend and inform both phy and gadget about the suspended state. While in hibernation, the controller can't detect the resume condition. An external mechanism must call usb_phy_set_suspend on resume. Exit hibernation w

[PATCH v2 22/22] usb: dwc2: allow dwc2_pci to be a module even when dwc2 is statically linked

2015-03-20 Thread Mian Yousaf Kaukab
There is no need for dwc2_pci to depend on dwc2 configuration Signed-off-by: Mian Yousaf Kaukab --- drivers/usb/dwc2/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc2/Makefile b/drivers/usb/dwc2/Makefile index 1547002..de65b94 100644 --- a/drivers/usb/

[PATCH v2 09/22] usb: dwc2: gadget: ignore pm suspend/resume in L2

2015-03-20 Thread Mian Yousaf Kaukab
From: Gregory Herrero Nothing to be done in pm suspend/resume when controller is in L2. Don't disconnect or reset. State is already saved when putting controller in hibernation and will be restored on USB bus resume. Signed-off-by: Gregory Herrero --- drivers/usb/dwc2/gadget.c | 6 ++ 1 fi

[PATCH v2 07/22] usb: dwc2: set parameter values in probe function

2015-03-20 Thread Mian Yousaf Kaukab
So the parameters can be used in both host and gadget modes. Also consolidate param functions in the core.h Signed-off-by: Mian Yousaf Kaukab --- drivers/usb/dwc2/core.c | 19 +++ drivers/usb/dwc2/core.h | 13 ++--- drivers/usb/dwc2/hcd.c | 36 +--

[PATCH v2 14/22] usb: dwc2: host: register handle to the phy

2015-03-20 Thread Mian Yousaf Kaukab
If phy driver is present register hcd handle to it. Signed-off-by: Mian Yousaf Kaukab --- drivers/usb/dwc2/hcd.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index cc6f394..36f0c69 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/

[PATCH v2 17/22] usb: dwc2: host: spinlock urb_enqueue

2015-03-20 Thread Mian Yousaf Kaukab
From: Gregory Herrero During urb_enqueue, if the urb can't be queued to the endpoint, the urb is freed without any spinlock protection. This leads to memory corruption when concurrent urb_dequeue try to free same urb->hcpriv. Thus, ensure the whole urb_enqueue in spinlocked. Signed-off-by: Grego

[PATCH v2 08/22] usb: dwc2: gadget: use reset detect interrupt

2015-03-20 Thread Mian Yousaf Kaukab
From: Gregory Herrero ResetDet interrupt is used to detect a reset of the bus while the controller is suspended. This may happens for example when using Command Verifier. Signed-off-by: Gregory Herrero --- drivers/usb/dwc2/gadget.c | 19 --- 1 file changed, 16 insertions(+), 3

[PATCH v2 18/22] usb: dwc2: host: don't use dma_alloc_coherent with irqs disabled

2015-03-20 Thread Mian Yousaf Kaukab
From: Gregory Herrero Align buffer must be allocated using kmalloc since irqs are disabled. Coherency is handled through dma_map_single which can be used with irqs disabled. Signed-off-by: Gregory Herrero --- drivers/usb/dwc2/hcd.c | 8 +--- drivers/usb/dwc2/hcd_intr.c | 10 +++

[PATCH v2 13/22] usb: dwc2: gadget: remove s3c_hsotg_ep_disable_force

2015-03-20 Thread Mian Yousaf Kaukab
Force argument is not used anymore. Clean up leftovers from https://lkml.org/lkml/2014/12/9/283 Signed-off-by: Mian Yousaf Kaukab --- drivers/usb/dwc2/gadget.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index bbc

[PATCH v2 15/22] usb: dwc2: host: add bus_suspend/bus_resume callback

2015-03-20 Thread Mian Yousaf Kaukab
From: Gregory Herrero Signed-off-by: Gregory Herrero --- drivers/usb/dwc2/hcd.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 36f0c69..0213763 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c @@ -23

[PATCH v2 11/22] usb: dwc2: gadget: powerup controller if needed

2015-03-20 Thread Mian Yousaf Kaukab
From: Gregory Herrero During vbus session, usb controller needs to exit hibernation if it was previously in suspend state. Since controller will be resetted and configured, there is no need to restore registers. Moreover, set lx_state to L0 on B session. vbus_session callback may not be used by

[PATCH v2 21/22] usb: dwc2: add hibernation core parameter

2015-03-20 Thread Mian Yousaf Kaukab
From: Gregory Herrero dwc2 may not be able to exit from hibernation if the hardware does not provide a way to detect resume signalling in this state. Thus, add the possibility to disable hibernation feature. Signed-off-by: Gregory Herrero --- drivers/usb/dwc2/core.c | 24 +

[PATCH v2 19/22] usb: dwc2: host: implement test mode

2015-03-20 Thread Mian Yousaf Kaukab
From: Jingwu Lin Add support for SetPortFeature(PORT_TEST) for root port. Signed-off-by: Jingwu Lin --- drivers/usb/dwc2/hcd.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 3c8f68c..c8a5005 100644 --- a/drivers/usb/dwc2/hcd.c

[PATCH v2 12/22] usb: dwc2: gadget: enable otg flag in dual role configuration

2015-03-20 Thread Mian Yousaf Kaukab
From: Gregory Herrero Signed-off-by: Gregory Herrero --- drivers/usb/dwc2/gadget.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index d94d0e8..bbc25ec 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -3525,6

[PATCH v2 20/22] usb: dwc2: remove dwc2_platform.ko

2015-03-20 Thread Mian Yousaf Kaukab
As dwc2 pci module is now exporting dwc2 platform device, include platform.o in dwc2-y and remove USB_DWC2_PLATFORM configuration option. Driver will be built as two modules, dwc2.ko and dwc2_pci.ko. dwc2.ko is the new platform driver. Remove all EXPORT_SYMBOL_GPL as they are not needed any more.

[PATCH v2 16/22] usb: dwc2: host: resume root hub on port connect

2015-03-20 Thread Mian Yousaf Kaukab
From: Gregory Herrero Once hub is runtime suspended, dwc2 must resume it on port connect event. Else, roothub will stay in suspended state and will not resume transfers. Signed-off-by: Gregory Herrero --- drivers/usb/dwc2/hcd_intr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/driver

[PATCH v2 10/22] usb: dwc2: gadget: prevent new request submission during suspend

2015-03-20 Thread Mian Yousaf Kaukab
From: Gregory Herrero If usb controller is in partial power down, any write to registers may cause unpredictable behavior. Thus, prevent any new request submission once controller is in partial power down. Signed-off-by: Gregory Herrero --- drivers/usb/dwc2/gadget.c | 7 +++ 1 file changed

[PATCH v2 06/22] usb: dwc2: add external_id_pin_ctl core parameter

2015-03-20 Thread Mian Yousaf Kaukab
From: Gregory Herrero This is required due to an Intel specific hardware issue. Where id- pin setup causes glitches on the interrupt line when CONIDSTSCHG interrupt is enabled. Specify external_id_pin_ctl when an external driver (for example phy) can handle id change, so that CONIDSTSCHG interru

Re: [PATCH v2 08/22] usb: dwc2: gadget: use reset detect interrupt

2015-03-20 Thread Sergei Shtylyov
Hello. On 03/20/2015 06:36 PM, Mian Yousaf Kaukab wrote: From: Gregory Herrero ResetDet interrupt is used to detect a reset of the bus while the controller is suspended. This may happens for example when using Command Verifier. Signed-off-by: Gregory Herrero --- drivers/usb/dwc2/gadge

Re: [PATCH v1 18/20] usb: dwc2: host: don't use dma_alloc_coherent with irqs disabled

2015-03-20 Thread Julius Werner
>> > - qh->dw_align_buf = dma_alloc_coherent(hsotg->dev, buf_size, >> > - >> > &qh->dw_align_buf_dma, >> > - GFP_ATOMIC); >> > + qh->dw_align_buf = kzalloc(buf_size,

Re: [PATCH v3 1/2] make xhci platform driver use 64 bit or 32 bit DMA

2015-03-20 Thread Feng Kan
On Tue, Nov 25, 2014 at 1:19 PM, Mark Langsdorf wrote: > The xhci platform driver needs to work on systems that either only > support 64-bit DMA or only support 32-bit DMA. Attempt to set a > coherent dma mask for 64-bit DMA, and attempt again with 32-bit > DMA if that fails. > > Signed-off-by: Ma

[PATCH v2 00/13] musb: Add support for the Allwinner sunxi musb controller

2015-03-20 Thread Hans de Goede
Hi All, Here is v2 of my patch-set to add support for the musb variant found on Allwinner sunxi SoCs. Changes since the original posting: -Removed the sunxi specific phy functions, instead the id / vbus gpio polling has been moved to the phy-sun4i-usb driver and their status is exported through

[PATCH v2 04/13] musb: Do not use musb_read[b|w] / _write[b|w] wrappers in generic fifo functions

2015-03-20 Thread Hans de Goede
The generic fifo functions already use non wrapped accesses in various cases through the iowrite#_rep functions, and all platforms which override the default musb_read[b|w] / _write[b|w] functions also provide their own fifo access functions, so we can safely drop the unnecessary indirection from t

[PATCH v2 05/13] musb: Fix platform code being unable to override ep access ops

2015-03-20 Thread Hans de Goede
musb-core was setting the ops to the default indexed or flat handlers after checking for platform overrides. Reverse the order of this so that platform overrides actually work. Signed-off-by: Hans de Goede --- drivers/usb/musb/musb_core.c | 13 ++--- 1 file changed, 6 insertions(+), 7 de

[PATCH v2 03/13] musb: Make busctl_offset an io-op rather then a define

2015-03-20 Thread Hans de Goede
The Allwinner (sunxi) implementation of the musb has its busctl registers indexed by the MUSB_INDEX register rather then in a flat address space. This commit turns MUSB_BUSCTL_OFFSET from a macro into an io-op which can be overridden from the platform ops. Signed-off-by: Hans de Goede --- drive

[PATCH v2 01/13] phy-sun4i-usb: Add full support for usb0 phy / OTG

2015-03-20 Thread Hans de Goede
The usb0 phy is connected to an OTG controller, and as such needs some special handling: 1) It allows explicit control over the pullups, enable these on phy_init and disable them on phy_exit. 2) It has bits to signal id and vbus detect to the musb-core, add support for for monitoring id and vbus

[PATCH v2 13/13] ARM: dts: sun7i: Enable USB DRC on A20-OLinuxIno-Lime

2015-03-20 Thread Hans de Goede
Enable the otg/drc usb controller on the A20-OLinuxIno-Lime. Signed-off-by: Hans de Goede --- arch/arm/boot/dts/sun7i-a20-olinuxino-lime.dts | 28 ++ 1 file changed, 28 insertions(+) diff --git a/arch/arm/boot/dts/sun7i-a20-olinuxino-lime.dts b/arch/arm/boot/dts/sun7i-a

[PATCH v2 12/13] ARM: dts: sun7i: Enable USB DRC on Cubietruck

2015-03-20 Thread Hans de Goede
From: Roman Byshko Enable the otg/drc usb controller on the cubietruck. Signed-off-by: Hans de Goede --- arch/arm/boot/dts/sun7i-a20-cubietruck.dts | 23 +++ 1 file changed, 23 insertions(+) diff --git a/arch/arm/boot/dts/sun7i-a20-cubietruck.dts b/arch/arm/boot/dts/sun7i

[PATCH v2 07/13] ARM: dts: sun4i: Add USB Dual Role Controller

2015-03-20 Thread Hans de Goede
Add a node for the otg/drc usb controller to sun4i-a10.dtsi. Signed-off-by: Hans de Goede --- arch/arm/boot/dts/sun4i-a10.dtsi | 11 +++ 1 file changed, 11 insertions(+) diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi index a932c1c..88f57b4 100644 --- a/

[PATCH v2 09/13] ARM: dts: sun7i: Add USB Dual Role Controller

2015-03-20 Thread Hans de Goede
From: Roman Byshko Add a node for the otg/drc usb controller to sun7i-a20.dtsi Signed-off-by: Hans de Goede --- arch/arm/boot/dts/sun7i-a20.dtsi | 11 +++ 1 file changed, 11 insertions(+) diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi index fb911c9..7

[PATCH v2 02/13] musb: Make musb_write_rxfun* and musb_write_rxhub* work like their tx versions

2015-03-20 Thread Hans de Goede
For some reason the musb_write_rxfun* and musb_write_rxhub* functions had a different function prototype and some extra magic needed on the caller side compared to their tx counterparts, this commit makes them work the same as their tx counterparts. Signed-off-by: Hans de Goede --- drivers/usb/m

[PATCH v2 11/13] ARM: dts: sun5i: Enable USB DRC on UTOO P66

2015-03-20 Thread Hans de Goede
Enable the OTG controller on the UTOO P66 tablet. Signed-off-by: Hans de Goede --- arch/arm/boot/dts/sun5i-a13-utoo-p66.dts | 23 +++ 1 file changed, 23 insertions(+) diff --git a/arch/arm/boot/dts/sun5i-a13-utoo-p66.dts b/arch/arm/boot/dts/sun5i-a13-utoo-p66.dts index d1d4

[PATCH v2 06/13] musb: Add support for the Allwinner sunxi musb controller

2015-03-20 Thread Hans de Goede
This is based on initial code to get the Allwinner sunxi musb controller supported by Chen-Yu Tsai and Roman Byshko. This adds support for the Allwinner sunxi musb controller in both host only and otg mode. Peripheral only mode is not supported, as no boards use that. This has been tested on a cu

[PATCH v2 08/13] ARM: dts: sun5i: Add USB Dual Role Controller

2015-03-20 Thread Hans de Goede
Add a node for the otg/drc usb controller to sun5i-a1*.dtsi. Signed-off-by: Hans de Goede --- arch/arm/boot/dts/sun5i.dtsi | 11 +++ 1 file changed, 11 insertions(+) diff --git a/arch/arm/boot/dts/sun5i.dtsi b/arch/arm/boot/dts/sun5i.dtsi index c3e11ec..eb5bce5 100644 --- a/arch/arm/boo

[PATCH v2 10/13] ARM: dts: sun4i: Enable USB DRC on Chuwi V7 CW0825

2015-03-20 Thread Hans de Goede
Enable the otg/drc usb controller on the Chuwi V7 CW0825 tablet. Signed-off-by: Hans de Goede --- arch/arm/boot/dts/sun4i-a10-chuwi-v7-cw0825.dts | 31 + 1 file changed, 31 insertions(+) diff --git a/arch/arm/boot/dts/sun4i-a10-chuwi-v7-cw0825.dts b/arch/arm/boot/dts/su

Re: [PATCH 2/3] cdc-wdm: unify error handling in write

2015-03-20 Thread Oliver Neukum
On Fri, 2015-03-20 at 16:11 +0100, Bjørn Mork wrote: > Anyway, the "outnl" is only ever used with rv < 0, and with your > changes > all other cases where rv < 0 will jump to some other label. So I > don't > think it makes much sense to keep the "return rv < 0 ? rv : count" > even > if you don't wa

[PATCH 0/3] Add devm_of_phy_get_by_index and update platform drivers

2015-03-20 Thread Arun Ramamurthy
This patch set adds a new API to get phy by index when multiple phys are present. This patch is based on discussion with Arnd Bergmann about dt bindings for multiple phys. Arun Ramamurthy (3): phy: core: Add devm_of_phy_get_by_index to phy-core usb: ehci-platform: Use devm_of_phy_get_by_inde

[PATCH 2/3] usb: ehci-platform: Use devm_of_phy_get_by_index

2015-03-20 Thread Arun Ramamurthy
Getting phys by index instead of phy names so that the dt bindings phy-names remain consistent when multiple phys are present Reviewed-by: Ray Jui Reviewed-by: Scott Branden Signed-off-by: Arun Ramamurthy --- drivers/usb/host/ehci-platform.c | 20 1 file changed, 4 inserti

[PATCH 3/3] usb: ohci-platform: Use devm_of_phy_get_by_index

2015-03-20 Thread Arun Ramamurthy
Getting phys by index instead of phy names so that the dt bindings phy-names remain consistent when multiple phys are present Reviewed-by: Ray Jui Reviewed-by: Scott Branden Signed-off-by: Arun Ramamurthy --- drivers/usb/host/ohci-platform.c | 20 1 file changed, 4 inserti

[PATCH 1/3] phy: core: Add devm_of_phy_get_by_index to phy-core

2015-03-20 Thread Arun Ramamurthy
Adding devm_of_phy_get_by_index to get phys by supplying an index and not a phy name when multiple phys are declared Reviewed-by: Ray Jui Reviewed-by: Scott Branden Signed-off-by: Arun Ramamurthy --- drivers/phy/phy-core.c | 30 ++ include/linux/phy/phy.h | 2 ++

Re: [PATCH 1/3] phy: core: Add devm_of_phy_get_by_index to phy-core

2015-03-20 Thread Dmitry Torokhov
Hi Arun, On Fri, Mar 20, 2015 at 02:07:08PM -0700, Arun Ramamurthy wrote: > Adding devm_of_phy_get_by_index to get phys by supplying an index > and not a phy name when multiple phys are declared > > Reviewed-by: Ray Jui > Reviewed-by: Scott Branden > Signed-off-by: Arun Ramamurthy > --- > dri

Re: [PATCH 1/3] phy: core: Add devm_of_phy_get_by_index to phy-core

2015-03-20 Thread Arun Ramamurthy
On 15-03-20 02:26 PM, Dmitry Torokhov wrote: Hi Arun, On Fri, Mar 20, 2015 at 02:07:08PM -0700, Arun Ramamurthy wrote: Adding devm_of_phy_get_by_index to get phys by supplying an index and not a phy name when multiple phys are declared Reviewed-by: Ray Jui Reviewed-by: Scott Branden Signed

Re: [PATCH 2/3] usb: ehci-platform: Use devm_of_phy_get_by_index

2015-03-20 Thread Dmitry Torokhov
Hi Arun, On Fri, Mar 20, 2015 at 02:07:09PM -0700, Arun Ramamurthy wrote: > Getting phys by index instead of phy names so that the dt > bindings phy-names remain consistent when multiple phys are present > > Reviewed-by: Ray Jui > Reviewed-by: Scott Branden > Signed-off-by: Arun Ramamurthy > -

[PATCH] usb: musb: only set test mode once

2015-03-20 Thread Bin Liu
The MUSB test mode register can only be set once, otherwise the result is undefined. This prevents the debugfs testmode entry to set the register more than once which causes test failure. Signed-off-by: Bin Liu --- drivers/usb/musb/musb_debugfs.c | 6 ++ 1 file changed, 6 insertions(+) dif

RE: [PATCH] usb: musb: only set test mode once

2015-03-20 Thread Liu, Bin
Sorry, please ignore this one. Forgot to rebase. Regards, -Bin. > -Original Message- > From: Liu, Bin > Sent: Friday, March 20, 2015 4:45 PM > To: linux-usb@vger.kernel.org > Cc: Balbi, Felipe; Liu, Bin > Subject: [PATCH] usb: musb: only set test mode once > > The MUSB test mode register

[PATCH] usb: musb: only set test mode once

2015-03-20 Thread Bin Liu
The MUSB test mode register can only be set once, otherwise the result is undefined. This prevents the debugfs testmode entry to set the register more than once which causes test failure. Signed-off-by: Bin Liu --- drivers/usb/musb/musb_debugfs.c | 6 ++ 1 file changed, 6 insertions(+) dif

[PATCH] usb: gadget: Check for NULL pointer in disconnect

2015-03-20 Thread Badhri Jagan Sridharan
Added a safety net to make sure that composite_disconnect does not end up disconneting a NULL device. Prevents NULL pointer crash. Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/gadget/composite.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/usb/gadget/composite.c b/dr

Re: Errata for Freescale root-hub TT?

2015-03-20 Thread Peter Chen
On Fri, Mar 20, 2015 at 10:16:49AM -0400, Alan Stern wrote: > Peter: > > Are there any known errata for the root-hub Transaction Translator in > the Freescale host controllers? > > When debugging some problems in an i.MX51 system, I found that the host > controller would never issue more than 4

Re: [PATCH v2 00/22] usb: third series of updates for dwc2 driver

2015-03-20 Thread John Youn
On 3/20/2015 8:35 AM, Mian Yousaf Kaukab wrote: > Hi, > This patchset consists of some bug fixes and feature enhancements for > the dwc2 driver. All the patches are verified on dwc2 v3.0a with > dedicated fifos. Main focus of testing was with dma enabled. Although > basic testing without dma was al

Re: [RFC][PATCH 2/9] usb: gadget: add usb_gadget_start/stop()

2015-03-20 Thread Peter Chen
On Fri, Mar 20, 2015 at 01:08:25PM +0200, Roger Quadros wrote: > On 20/03/15 11:46, Roger Quadros wrote: > > On 20/03/15 09:18, Peter Chen wrote: > >> On Thu, Mar 19, 2015 at 04:50:31PM +0200, Roger Quadros wrote: > >>> On 19/03/15 16:09, Li Jun wrote: > On Thu, Mar 19, 2015 at 12:14:39PM +020

Re: [PATCH v2 06/13] musb: Add support for the Allwinner sunxi musb controller

2015-03-20 Thread Chen-Yu Tsai
Hi, On Sat, Mar 21, 2015 at 3:11 AM, Hans de Goede wrote: > This is based on initial code to get the Allwinner sunxi musb controller > supported by Chen-Yu Tsai and Roman Byshko. > > This adds support for the Allwinner sunxi musb controller in both host only > and otg mode. Peripheral only mode i