Re: 答复: make a confirm for [usb: dwc3: gadget: skip Set/Clear Halt when invalid]

2018-11-18 Thread Felipe Balbi
Hi, Thinh Nguyen writes: >>> It means that the mainline keep checking stall status first before >>> handle clear-halt request? as usb spec, it's actually okay to send >>> Clear Halt at any time. But dwc3 core hanging with macOS adb >>> application, so I think there is other rootcase why dwc3 ha

[PATCH] Revert "usb: dwc3: gadget: skip Set/Clear Halt when invalid"

2018-11-18 Thread Felipe Balbi
This reverts commit ffb80fc672c3a7b6afd0cefcb1524fb99917b2f3. Turns out that commit is wrong. Host controllers are allowed to use Clear Feature HALT as means to sync data toggle between host and periperal. Cc: Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 5 - 1 file changed,

[RFC PATCH v2 09/15] usb:cdns3: EpX operations part of the API

2018-11-18 Thread Pawel Laszczak
Patch implements callback functions for non-default endpoints defined in usb_ep_ops object. Signed-off-by: Pawel Laszczak --- drivers/usb/cdns3/ep0.c| 18 ++ drivers/usb/cdns3/gadget.c | 442 - drivers/usb/cdns3/gadget.h | 3 + 3 files changed, 461 inse

[RFC PATCH v2 00/15] Introduced new Cadence USBSS DRD Driver

2018-11-18 Thread Pawel Laszczak
This patch set introduce new Cadence USBSS DRD driver to linux kernel. The Cadence USBSS DRD Driver s a highly configurable IP Core which can be instantiated as Dual-Role Device (DRD), Peripheral Only and Host Only (XHCI) configurations. The current driver has been validated with FPGA burned. We

[RFC PATCH v2 14/15] usb:cdns3: Adds debugging function.

2018-11-18 Thread Pawel Laszczak
Patch implements some function used for debugging driver. Signed-off-by: Pawel Laszczak --- drivers/usb/cdns3/Makefile | 4 +- drivers/usb/cdns3/debug.c | 128 + drivers/usb/cdns3/ep0.c| 3 + drivers/usb/cdns3/gadget.c | 12 drivers/usb/cdns3/ga

[RFC PATCH v2 05/15] usb:cdns3: Added DRD support

2018-11-18 Thread Pawel Laszczak
Patch adds supports for detecting Host/Device mode. Controller has additional OTG register that allow implement even whole OTG functionality. At this moment patch adds support only for detecting the appropriate mode based on strap pins and ID pin. Signed-off-by: Pawel Laszczak --- drivers/usb/cd

[RFC PATCH v2 12/15] usb:cdns3: Adds enumeration related function.

2018-11-18 Thread Pawel Laszczak
Patch implements a set of function related to enumeration process. Some standard requests are handled on controller driver level and other are delegated to gadget core driver. All class requests are delegated to gadget core driver. Signed-off-by: Pawel Laszczak --- drivers/usb/cdns3/ep0.c| 4

[RFC PATCH v2 15/15] usb:cdns3: Feature for changing role

2018-11-18 Thread Pawel Laszczak
Patch adds feature that allow to change role from user space. Signed-off-by: Pawel Laszczak --- drivers/usb/cdns3/Makefile | 2 +- drivers/usb/cdns3/core.c| 2 + drivers/usb/cdns3/debugfs.c | 93 + drivers/usb/cdns3/drd.h | 3 ++ 4 files changed, 9

[RFC PATCH v2 10/15] usb:cdns3: Ep0 operations part of the API

2018-11-18 Thread Pawel Laszczak
Patch implements related to default endpoint callback functions defined in usb_ep_ops object Signed-off-by: Pawel Laszczak --- drivers/usb/cdns3/ep0.c| 191 - drivers/usb/cdns3/gadget.c | 8 ++ drivers/usb/cdns3/gadget.h | 10 ++ 3 files changed, 207 in

[RFC PATCH v2 13/15] usb:cdns3: Adds transfer related function.

2018-11-18 Thread Pawel Laszczak
Patch implements a set of function handling transfer on none-default endpoints. For handling transfer controller use cdns3_trb structure. Each transfer request block (TRB) contains data buffer address, length and some control bits. Each transfer can consist of many trbs. Such group of trbs is calle

[RFC PATCH v2 07/15] usb:cdns3: Adds Device mode support - initialization.

2018-11-18 Thread Pawel Laszczak
Patch implements a set of functions responsible for initialization, configuration, starting and stopping device mode. This patch also adds new ep0.c that holds all functions related to endpoint 0. Signed-off-by: Pawel Laszczak --- drivers/usb/cdns3/Kconfig | 10 + drivers/usb/cdns3/Make

[RFC PATCH v2 03/15] dt-bindings: add binding for USBSS-DRD controller.

2018-11-18 Thread Pawel Laszczak
Thsi patch aim at documenting USB related dt-bindings for the Cadence USBSS-DRD controller. Signed-off-by: Pawel Laszczak --- .../devicetree/bindings/usb/cdns3-usb.txt | 17 + 1 file changed, 17 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/cdns3-u

[RFC PATCH v2 01/15] usb:cdns3: add pci to platform driver wrapper.

2018-11-18 Thread Pawel Laszczak
Patch adds PCI specific glue driver that creates and registers in-system cdns-usb3 platform device. Thanks to that we will be able to use the cdns-usb3 platform driver for USBSS-DEV controller build on PCI board Signed-off-by: Pawel Laszczak --- drivers/usb/Kconfig| 2 + driver

[RFC PATCH v2 11/15] usb:cdns3: Implements ISR functionality.

2018-11-18 Thread Pawel Laszczak
Patch adds set of generic functions used for handling interrupts generated by controller. Interrupt related functions are divided into three groups. The first is related to ep0 and is placed in ep0.c. The second is responsible for non-default endpoints and is implemented in gadget.c file. The last

[RFC PATCH v2 06/15] usb:cdns3: Adds Host support

2018-11-18 Thread Pawel Laszczak
Patch adds host-export.h and host.c file and mplements functions that allow to initialize, start and stop XHCI host driver. Signed-off-by: Pawel Laszczak --- drivers/usb/cdns3/Kconfig | 10 ++ drivers/usb/cdns3/Makefile | 1 + drivers/usb/cdns3/core.c| 7 +- drivers/usb/c

[RFC PATCH v2 02/15] usb:cdns3: Device side header file.

2018-11-18 Thread Pawel Laszczak
Patch defines macros used by device side of controller, structures holding registers, and some other object used by device controller. Signed-off-by: Pawel Laszczak --- drivers/usb/cdns3/gadget.h | 1071 1 file changed, 1071 insertions(+) create mode 100644

[RFC PATCH v2 08/15] usb:cdns3: Implements device operations part of the API

2018-11-18 Thread Pawel Laszczak
Patch adds implementation callback function defined in usb_gadget_ops object. Signed-off-by: Pawel Laszczak --- drivers/usb/cdns3/gadget.c | 249 - 1 file changed, 247 insertions(+), 2 deletions(-) diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/g

[RFC PATCH v2 04/15] usb:cdns3: Driver initialization code.

2018-11-18 Thread Pawel Laszczak
Patch adds core.c and core.h file that implements initialization of platform driver and adds function responsible for selecting, switching and running appropriate Device/Host mode. Signed-off-by: Pawel Laszczak --- drivers/usb/cdns3/Makefile | 2 + drivers/usb/cdns3/core.c | 413

[PATCH 4/4] USB: omap_udc: fix USB gadget functionality on Palm Tungsten E

2018-11-18 Thread Aaro Koskinen
On Palm TE nothing happens when you try to use gadget drivers and plug the USB cable. Fix by adding the board to the vbus sense quirk list. Signed-off-by: Aaro Koskinen --- drivers/usb/gadget/udc/omap_udc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/gadget/udc/omap_udc.c b/

[PATCH 2/4] USB: omap_udc: fix crashes on probe error and module removal

2018-11-18 Thread Aaro Koskinen
We currently crash if usb_add_gadget_udc_release() fails, since the udc->done is not initialized until in the remove function. Furthermore, on module removal the udc data is accessed although the release function is already triggered by usb_del_gadget_udc() early in the function. Fix by releasing t

[PATCH 3/4] USB: omap_udc: fix omap_udc_start() on 15xx machines

2018-11-18 Thread Aaro Koskinen
On OMAP 15xx machines there are no transceivers, and omap_udc_start() always fails as it forgot to adjust the default return value. Signed-off-by: Aaro Koskinen --- drivers/usb/gadget/udc/omap_udc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/omap

[PATCH 1/4] USB: omap_udc: use devm_request_irq()

2018-11-18 Thread Aaro Koskinen
The current code fails to release the third irq on the error path (observed by reading the code), and we get also multiple WARNs with failing gadget drivers due to duplicate IRQ releases. Fix by using devm_request_irq(). Signed-off-by: Aaro Koskinen --- drivers/usb/gadget/udc/omap_udc.c | 37 +++