[PATCH] Add support of TI ICDI to USB simple serial device

2018-10-13 Thread Da Shi Cao
In-Circuit Debug Interface is a debugging interface for TI ARM microcontrollers. It has three USB interfaces and two of them are presented as standard ACM serial device. The 3rd interface is the debugging interface and it can be driven as a Linux USB simple terminal. With it, debugging session and

[PATCH V6 05/10] usb: dwc3: make controller clear transfer resources after complete

2018-10-13 Thread Anurag Kumar Vulisha
To start transfer with another stream id, controller needs to free previously allocated transfer resource. This will be automatically done by the controller at the time of XferComplete Event. This patch updates the code to issue XferComplete event once all transfers are done by setting LST bit in t

[PATCH V6 02/10] usb: dwc3: gadget: Add stream timeout handler for avoiding deadlock

2018-10-13 Thread Anurag Kumar Vulisha
According to dwc3 databook when streams are enabled, it may be possible for the host and gadget to become out of sync, where gadget may wait for host to issue prime transcation and host may wait for gadget to issue ERDY. To avoid such potential deadlock conditions, a timer is implemented in udc/cor

[PATCH V6 10/10] usb: dwc3: Check MISSED ISOC bit only for ISOC endpoints

2018-10-13 Thread Anurag Kumar Vulisha
When streaming is enabled on BULK endpoints and LST bit is set observed MISSED ISOC bit set in event->status for BULK ep. Since this bit is only valid for isocronous endpoints, changed the code to check for isocrnous endpoints when MISSED ISOC bit is set. Signed-off-by: Anurag Kumar Vulisha Revie

[PATCH V6 03/10] usb: dwc3: gadget: Remove references to dep->stream_capable

2018-10-13 Thread Anurag Kumar Vulisha
As a part of adding stream timeout timer for stream capable endpoints stream_capable flag is added into struct usb_ep. Replace the usage of dep->stream_capable in with usb_ep->stream_capable. Signed-off-by: Anurag Kumar Vulisha --- Changes in v6: 1. This patch is newly added in this seri

[PATCH V6 07/10] usb: dwc3: check for requests in started list for stream capable endpoints

2018-10-13 Thread Anurag Kumar Vulisha
For stream capable endpoints, uas layer can queue mulpile requests on single ep with different stream ids. So, there can be multiple pending requests waiting to be transferred. This patch changes the code to check for any pending requests waiting to be transferred on ep started_list and calls __dwc

[PATCH V6 01/10] usb: gadget: udc: Add timer for stream capable endpoints

2018-10-13 Thread Anurag Kumar Vulisha
When bulk streams are enabled for an endpoint, there can be a condition where the gadget controller waits for the host to issue prime transaction and the host controller waits for the gadget to issue ERDY. This condition could create a deadlock. To avoid such potential deadlocks, a timer is started

[PATCH V6 09/10] usb: dwc3: Check for IOC/LST bit in both event->status and TRB->ctrl fields

2018-10-13 Thread Anurag Kumar Vulisha
The present code in dwc3_gadget_ep_reclaim_completed_trb() will check for IOC/LST bit in the event->status and returns if IOC/LST bit is set. This logic doesn't work if multiple TRBs are queued per request and the IOC/LST bit is set on the last TRB of that request. Consider an example where a queue

[PATCH V6 04/10] usb: dwc3: update stream id in depcmd

2018-10-13 Thread Anurag Kumar Vulisha
For stream capable endpoints, stream id related information needs to be updated into DEPCMD while issuing START TRANSFER. This patch does the same. Signed-off-by: Anurag Kumar Vulisha --- Changes in v6: 1. Used dep->endpoint.stream_capable instead of dep->stream_capable flag

[PATCH V6 08/10] usb: dwc3: Correct the logic for checking TRB full in __dwc3_prepare_one_trb()

2018-10-13 Thread Anurag Kumar Vulisha
Availability of TRB's is calculated using dwc3_calc_trbs_left(), which determines total available TRB's based on the HWO bit set in a TRB. In the present code, __dwc3_prepare_one_trb() is called with a TRB which needs to be prepared for transfer. This __dwc3_prepare_one_trb() calls dwc3_calc_trbs_

[PATCH V6 08/10] usb: dwc3: Correct the logic for checking TRB full in __dwc3_prepare_one_trb()

2018-10-13 Thread Anurag Kumar Vulisha
Availability of TRB's is calculated using dwc3_calc_trbs_left(), which determines total available TRB's based on the HWO bit set in a TRB. In the present code, __dwc3_prepare_one_trb() is called with a TRB which needs to be prepared for transfer. This __dwc3_prepare_one_trb() calls dwc3_calc_trbs_

[PATCH V6 00/10] usb: dwc3: Fix broken BULK stream support to dwc3 gadget driver

2018-10-13 Thread Anurag Kumar Vulisha
This patch series fixes the broken BULK streaming support in dwc3 gadget driver and also adds timer into udc/core.c to avoid deadlock for the endpoints which are bulk stream capable. Changes in v6: 1. Added timer into udc/core.c for stream capable endpoint as suggested by "Felip

[PATCH V6 06/10] usb: dwc3: don't issue no-op trb for stream capable endpoints

2018-10-13 Thread Anurag Kumar Vulisha
The stream capable endpoints require stream id to be given when issuing START TRANSFER. While issuing no-op trb the stream id is not yet known, so don't issue no-op trb's on stream capable endpoints. Signed-off-by: Anurag Kumar Vulisha --- Chnages in v6: 1. Replaced dep->stream_capable w

usbip_vudc: BUG kmalloc-2048 (Not tainted): Poison overwritten

2018-10-13 Thread Randy Dunlap
Kernel 4.19-rc7, on x86_64: Load usbip_vudc module, then unload (rmmod) it. Load it again: [ 169.042156] calling init+0x0/0x1000 [usbip_vudc] @ 1697 [ 169.042396] = [ 169.043678] probe of usbip-vudc.0 returned 1 aft