[PATCH 8/8] usb: dwc3: gadget: remove wait_end_transfer

2018-11-04 Thread Felipe Balbi
Now that we have a list of cancelled requests, we can skip over TRBs when END_TRANSFER command completes. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.h | 3 --- drivers/usb/dwc3/gadget.c | 40 +-- 2 files changed, 1 insertion(+), 42 deletions(-)

[PATCH 1/8] usb: dwc3: gadget: fix ISOC TRB type on unaligned transfers

2018-11-04 Thread Felipe Balbi
When chaining ISOC TRBs together, only the first ISOC TRB should be of type ISOC_FIRST, all others should be of type ISOC. This patch fixes that. Fixes: c6267a51639b ("usb: dwc3: gadget: align transfers to wMaxPacketSize") Cc: # v4.11+ Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c

[PATCH 3/8] usb: dwc3: gadget: track number of TRBs per request

2018-11-04 Thread Felipe Balbi
This will help us remove the wait_event() from our ->dequeue(). Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.h | 3 +++ drivers/usb/dwc3/gadget.c | 6 ++ 2 files changed, 9 insertions(+) diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index

[PATCH 2/8] usb: dwc3: gadget: combine unaligned and zero flags

2018-11-04 Thread Felipe Balbi
Both flags are used for the same purpose in dwc3: appending an extra TRB at the end to deal with controller requirements. By combining both flags into one, we make it clear that the situation is the same and that they should be treated equally. Signed-off-by: Felipe Balbi ---

[PATCH 4/8] usb: dwc3: gadget: use num_trbs when skipping TRBs on ->dequeue()

2018-11-04 Thread Felipe Balbi
Now that we track how many TRBs a request uses, it's easier to skip over them in case of a call to usb_ep_dequeue(). Let's do so and simplify the code a bit. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 28 1 file changed, 4 insertions(+), 24

[PATCH 6/8] usb: dwc3: gadget: introduce cancelled_list

2018-11-04 Thread Felipe Balbi
This list will host cancelled requests who still have TRBs being processed. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.h | 2 ++ drivers/usb/dwc3/gadget.c | 1 + drivers/usb/dwc3/gadget.h | 15 +++ 3 files changed, 18 insertions(+) diff --git

[PATCH 5/8] usb: dwc3: gadget: extract dwc3_gadget_ep_skip_trbs()

2018-11-04 Thread Felipe Balbi
Extract the logic for skipping over TRBs to its own function. This makes the code slightly more readable and makes it easier to move this call to its final resting place as a following patch. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 61 +++

[PATCH 7/8] usb: dwc3: gadget: move requests to cancelled_list

2018-11-04 Thread Felipe Balbi
Whenever we have a request in flight, we can move it to the cancelled list and later simply iterate over that list and skip over any TRBs we find. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git

[PATCH] usb: dwc2: Fix ep disable spinlock flow.

2018-11-04 Thread Minas Harutyunyan
Changed spinlock flow to fix smatch warnings. Fixes: dccf1bad4be7 ("usb: dwc2: Disable all EP's on disconnect") Signed-off-by: Minas Harutyunyan --- drivers/usb/dwc2/gadget.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc2/gadget.c

RE: USB Type C ptn5110

2018-11-04 Thread Jun Li
Hi Angus > -Original Message- > From: Angus Ainslie > Sent: 2018年11月1日 21:53 > To: Jun Li > Subject: USB Type C ptn5110 > > Hi Li, > > We have a custom PCB that has a PTN5110 on it. The board can power from the > USB C no problem but we are starting to look into the data modes and