[PATCH 2/3] usb: dwc3: Add a property to disable USB2 LPM

2018-11-07 Thread Thinh Nguyen
Add an option to disable USB2 LPM from host. There maybe cases where the user does not want to enable USB2 LPM (e.g. USB2 LPM is broken). Signed-off-by: Thinh Nguyen --- Documentation/devicetree/bindings/usb/dwc3.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree

[PATCH 1/3] usb: dwc3: Set GUSB2PHYCFG.ENBLSLPM

2018-11-07 Thread Thinh Nguyen
GUSB2PHYCFG.ENBLSLPM enables the controller to assert low power signals to the PHY. Unless disabled via device property, explicitly set GUSB2PHYCFG.ENBLSLPM as it may not be set by default. Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/core.c | 2 ++ 1 file changed, 2 insertions(+) diff

[PATCH 1/2] usb: gadget: Add start_frame to usb_request

2018-11-07 Thread Thinh Nguyen
Similar to URB's start_frame, add a field start_frame to the usb_request to report the scheduled (micro)frame number of an isochronous transfer. This option is useful for debugging purposes. Signed-off-by: Thinh Nguyen --- include/linux/usb/gadget.h | 3 +++ 1 file changed, 3 inser

[PATCH 2/2] usb: dwc3: gadget: Report isoc scheduled frame number

2018-11-07 Thread Thinh Nguyen
Report the scheduled frame number of an isochronous request. Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/gadget.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 679c12e14522..34540b661592 100644 --- a/drivers/usb/dwc3

[PATCH v2 2/2] usb: dwc3: gadget: Report isoc scheduled frame number

2018-11-07 Thread Thinh Nguyen
Report the scheduled frame number of an isochronous request. Signed-off-by: Thinh Nguyen --- Change in v2: - Capture frame number at request cleanup drivers/usb/dwc3/gadget.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index

[PATCH v2 1/2] usb: gadget: Add start_frame to usb_request

2018-11-07 Thread Thinh Nguyen
Similar to URB's start_frame, add a field start_frame to the usb_request to report the scheduled (micro)frame number of an isochronous transfer. This option is useful for debugging purposes. Signed-off-by: Thinh Nguyen --- Change in v2: - None include/linux/usb/gadget.h | 3 +++ 1

[PATCH v5 3/3] usb: dwc3: Add workaround for isoc start transfer failure

2018-11-07 Thread Thinh Nguyen
t1 passes, BIT[15:14] is 'b00 Synopsys STAR 9001202023: Wrong microframe number for isochronous IN endpoints. Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/core.c | 2 + drivers/usb/dwc3/core.h | 14 + drivers/usb/dwc3/gadget.c | 132

[PATCH v5 0/3] usb: dwc3: Workaround isoc start_transfer failure

2018-11-07 Thread Thinh Nguyen
in v2: - None Thinh Nguyen (3): usb: dwc3: Track DWC_usb31 VERSIONTYPE usb: dwc3: Add disabling of start_transfer failure quirk usb: dwc3: Add workaround for isoc start transfer failure Documentation/devicetree/bindings/usb/dwc3.txt | 3 + drivers/usb/dwc3/core.c

[PATCH v5 2/3] usb: dwc3: Add disabling of start_transfer failure quirk

2018-11-07 Thread Thinh Nguyen
microframe number for isochronous IN endpoints. Signed-off-by: Thinh Nguyen --- Documentation/devicetree/bindings/usb/dwc3.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt index 636630fb92d7

[PATCH v5 1/3] usb: dwc3: Track DWC_usb31 VERSIONTYPE

2018-11-07 Thread Thinh Nguyen
Add a new field to dwc3 structure to track VERSIONTYPE. The VERSIONTYPE is represented in ASCII in the 32-bit VERSIONTYPE register. In DWC_usb31, sub releases for each version are tracked with VERSIONTYPE such as "ea01" and "ea02". Signed-off-by: Thinh Nguyen --- drivers

Re: [PATCH 1/2] usb: gadget: Add start_frame to usb_request

2018-11-08 Thread Thinh Nguyen
Hi, On 11/7/2018 11:03 PM, Felipe Balbi wrote: > Hi, > > Thinh Nguyen writes: >> Similar to URB's start_frame, add a field start_frame to the usb_request >> to report the scheduled (micro)frame number of an isochronous transfer. >> This option is useful for debu

Re: [PATCH v2 2/2] usb: dwc3: gadget: Report isoc scheduled frame number

2018-11-08 Thread Thinh Nguyen
Hi, On 11/7/2018 11:08 PM, Felipe Balbi wrote: > Hi, > > Thinh Nguyen writes: >> Report the scheduled frame number of an isochronous request. >> >> Signed-off-by: Thinh Nguyen >> --- >> Change in v2: >> - Capture frame number at request cleanup &g

Re: [PATCH v5 1/3] usb: dwc3: Track DWC_usb31 VERSIONTYPE

2018-11-08 Thread Thinh Nguyen
Hi Felipe, On 11/7/2018 11:10 PM, Felipe Balbi wrote: > Hi, > > Thinh Nguyen writes: >> Add a new field to dwc3 structure to track VERSIONTYPE. The VERSIONTYPE >> is represented in ASCII in the 32-bit VERSIONTYPE register. In >> DWC_usb31, sub releases for ea

Re: [PATCH 1/3] usb: dwc3: Add reference clock properties

2018-11-08 Thread Thinh Nguyen
Hi Felipe, On 11/7/2018 11:17 PM, Felipe Balbi wrote: > Hi, > > Thinh Nguyen writes: >>>>>> diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt >>>>>> b/Documentation/devicetree/bindings/usb/dwc3.txt >>>>>> index 636630fb

[PATCH v6 1/3] usb: dwc3: Track DWC_usb31 VERSIONTYPE

2018-11-08 Thread Thinh Nguyen
Add a new field to dwc3 structure to track VERSIONTYPE. The VERSIONTYPE is represented in ASCII in the 32-bit VERSIONTYPE register. In DWC_usb31, sub releases for each version are tracked with VERSIONTYPE such as "ea01" and "ea02". Signed-off-by: Thinh Nguyen --- drivers/

[PATCH v6 2/3] usb: dwc3: Add disabling of start_transfer failure quirk

2018-11-08 Thread Thinh Nguyen
microframe number for isochronous IN endpoints. Signed-off-by: Thinh Nguyen --- Documentation/devicetree/bindings/usb/dwc3.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt index 636630fb92d7

[PATCH v6 3/3] usb: dwc3: Add workaround for isoc start transfer failure

2018-11-08 Thread Thinh Nguyen
t1 passes, BIT[15:14] is 'b00 Synopsys STAR 9001202023: Wrong microframe number for isochronous IN endpoints. Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/core.c | 2 + drivers/usb/dwc3/core.h | 13 + drivers/usb/dwc3/gadget.c | 131

[PATCH v6 0/3] usb: dwc3: Workaround isoc start_transfer failure

2018-11-08 Thread Thinh Nguyen
workaround for isoc start transfer failure" Change in v5: - Splitted and resent from an old patch series - Cleanup and fixed review issues Change in v4: - None Change in v3: - None Change in v2: - None Thinh Nguyen (3): usb: dwc3: Track DWC_usb31 VERSIONTYPE usb: dwc3: Add disabli

Re: [PATCH 4/4] usb: dwc3: gadget: check if dep->frame_number is still valid

2018-11-08 Thread Thinh Nguyen
Hi Felipe, On 11/7/2018 10:58 PM, Felipe Balbi wrote: > Gadget driver may take an unbounded amount of time to queue requests > after XferNotReady. This is important for isochronous endpoints which > need to be started for a specific (micro-)frame. > > Before kicking the transfer, let's check how m

Re: [PATCH 4/4] usb: dwc3: gadget: check if dep->frame_number is still valid

2018-11-08 Thread Thinh Nguyen
Hi Felipe, On 11/8/2018 11:11 PM, Felipe Balbi wrote: > Hi, > > Thinh Nguyen writes: >> On 11/7/2018 10:58 PM, Felipe Balbi wrote: >>> Gadget driver may take an unbounded amount of time to queue requests >>> after XferNotReady. This is important for isochrono

Re: [PATCH 1/3] usb: dwc3: Add reference clock properties

2018-11-08 Thread Thinh Nguyen
Hi Felipe, On 11/8/2018 11:14 PM, Felipe Balbi wrote: > Hi, > > Thinh Nguyen writes: >>> Thinh Nguyen writes: >>>>>>>> diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt >>>>>>>> b/Documentation/devicetree/bind

Re: [PATCH 4/4] usb: dwc3: gadget: check if dep->frame_number is still valid

2018-11-11 Thread Thinh Nguyen
Hi Felipe, On 11/9/2018 3:04 AM, Felipe Balbi wrote: > Hi again, > > Felipe Balbi writes: >> In the case of interval of 1ms, it will start on the next interval. >>> frame_number + max(4, interval) will start at least 4 uframes in the future. >>> >>> In any case, what about immediately retry the S

Re: [PATCH 3/3] usb: dwc3: Support option to disable USB2 LPM

2018-11-11 Thread Thinh Nguyen
Hi Roger, On 11/9/2018 3:58 AM, Roger Quadros wrote: > Hi, > > On 08/11/18 04:10, Thinh Nguyen wrote: >> Support the option to disable USB2 LPM. Set xhci "usb2-lpm-disable" >> property via "snps,usb2-lpm-disable" property. >> >> Signed-off-by:

Re: [PATCH 4/4] usb: dwc3: gadget: check if dep->frame_number is still valid

2018-11-14 Thread Thinh Nguyen
On 11/14/2018 12:42 AM, Felipe Balbi wrote: > Hi, > > Thinh Nguyen writes: >>> Felipe Balbi writes: >>>> In the case of interval of 1ms, it will start on the next interval. >>>>> frame_number + max(4, interval) will start at least 4 uframes in the

[PATCH v7 0/2] usb: dwc3: Workaround isoc start_transfer failure

2018-11-14 Thread Thinh Nguyen
" - Minor cleanup/fix in "usb: dwc3: Add workaround for isoc start transfer failure" Change in v5: - Splitted and resent from an old patch series - Cleanup and fixed review issues Change in v4: - None Change in v3: - None Change in v2: - None Thinh Nguyen (2): usb: dwc3: Add di

[PATCH v7 1/2] usb: dwc3: Add disabling of start_transfer failure quirk

2018-11-14 Thread Thinh Nguyen
microframe number for isochronous IN endpoints. Signed-off-by: Thinh Nguyen Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/usb/dwc3.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb

[PATCH v7 2/2] usb: dwc3: Add workaround for isoc start transfer failure

2018-11-14 Thread Thinh Nguyen
t1 passes, BIT[15:14] is 'b00 Synopsys STAR 9001202023: Wrong microframe number for isochronous IN endpoints. Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/core.c | 2 + drivers/usb/dwc3/core.h | 13 + drivers/usb/dwc3/gadget.c | 131

Re: [PATCH v6 2/3] usb: dwc3: Add disabling of start_transfer failure quirk

2018-11-14 Thread Thinh Nguyen
Hi, On 11/14/2018 3:41 AM, Felipe Balbi wrote: > Thinh Nguyen writes: > >> DWC_usb31 peripheral v1.70a-ea06 and prior needs a SW workaround for >> isoc START TRANSFER command failure. However, some affected versions may >> have RTL patches to fix this without a SW worka

Re: [PATCH 1/2] usb: gadget: Add start_frame to usb_request

2018-11-14 Thread Thinh Nguyen
Hi Felipe, On 11/7/2018 11:03 PM, Felipe Balbi wrote: > Hi, > > Thinh Nguyen writes: >> Similar to URB's start_frame, add a field start_frame to the usb_request >> to report the scheduled (micro)frame number of an isochronous transfer. >> This option

[PATCH v3 2/2] usb: dwc3: gadget: Report isoc transfer frame number

2018-11-15 Thread Thinh Nguyen
Implement the new frame_number API to report the isochronous interval frame number. This patch checks and reports the interval in which the isoc transfer was transmitted or received via the Isoc-First TRB SOF number field. Signed-off-by: Thinh Nguyen --- Change in v3: - Implement the change with

[PATCH v3 1/2] usb: gadget: Introduce frame_number to usb_request

2018-11-15 Thread Thinh Nguyen
Add a field frame_number to the usb_request to report the interval number in (micro)frames in which the isochronous transfer was transmitted or received. The gadget driver can use this knowledge to synchronize with the host. Also, this option is useful for debugging purposes. Signed-off-by: Thinh

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

2018-11-16 Thread Thinh Nguyen
Hi Felipe, On 6/28/2018 11:24 PM, Felipe Balbi wrote: > (no top-posting!!) > > liangshengjun writes: > >> Hi balbi, >> >> 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 c

Re: [PATCH] usb: dwc3: debug: Print register name

2018-11-28 Thread Thinh Nguyen
Hi Felipe, On 11/27/2018 11:16 PM, Felipe Balbi wrote: > Hi, > > Tejas Joglekar writes: >> From: Thinh Nguyen >> >> This commit adds a new debugging option CONFIG_USB_DWC3_DEBUG_REG_PRINT >> to enable printing of register names to tracepoints for >>

Re: [PATCH v3 2/2] usb: dwc3: gadget: Report isoc transfer frame number

2018-12-05 Thread Thinh Nguyen
Hi Felipe, On 12/5/2018 1:15 AM, Felipe Balbi wrote: > Hi, > > Thinh Nguyen writes: >> Implement the new frame_number API to report the isochronous interval >> frame number. This patch checks and reports the interval in which the >> isoc transfer was transmitted or

Re: [PATCH v3 2/2] usb: dwc3: gadget: Report isoc transfer frame number

2018-12-07 Thread Thinh Nguyen
Hi Felipe, On 12/6/2018 10:01 PM, Felipe Balbi wrote: > Hi, > > Thinh Nguyen writes: >>>> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c >>>> index 679c12e14522..2de563124fc1 100644 >>>> --- a/drivers/usb/dwc3/gadget.c >>

Re: [PATCH 1/3] usb: dwc3: Add reference clock properties

2018-12-07 Thread Thinh Nguyen
Hi Felipe, On 11/9/2018 12:54 AM, Felipe Balbi wrote: > Hi, > > Thinh Nguyen writes: >>> Thinh Nguyen writes: >>>>> Thinh Nguyen writes: >>>>>>>>>> diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt >>>&

[PATCH v2 0/4] usb: dwc3: Introduce refclk lpm

2018-12-07 Thread Thinh Nguyen
s - Remove reference clock period validation in since DWC_usb3 can support more periods than DWC_usb31 - Rename property snps,enable-refclk-lpm to snps,enable-refclk-sof Thinh Nguyen (4): usb: dwc3: Add property snps,refclk-period-ns usb: dwc3: Set the reference clock period usb: dwc3: Add pro

[PATCH v2 1/4] usb: dwc3: Add property snps,refclk-period-ns

2018-12-07 Thread Thinh Nguyen
ontrol the reference clock rate. The controller uses this value to perform internal timing calculations that are based on the reference clock. Signed-off-by: Thinh Nguyen --- Changes in v2: - Split from "usb: dwc3: Add reference clock properties" - Revise commit message and property descrip

[PATCH v2 2/4] usb: dwc3: Set the reference clock period

2018-12-07 Thread Thinh Nguyen
. Signed-off-by: Thinh Nguyen --- Changes in v2: - Remove reference clock period validations - Revise commit message drivers/usb/dwc3/core.c | 9 + drivers/usb/dwc3/core.h | 4 2 files changed, 13 insertions(+) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index

[PATCH v2 3/4] usb: dwc3: Add property snps,enable-refclk-sof

2018-12-07 Thread Thinh Nguyen
isochronous endpoints. Signed-off-by: Thinh Nguyen --- Changes in v2: - Revise property description - Rename property from snps,enable-refclk-lpm to snps,enable-refclk-sof Documentation/devicetree/bindings/usb/dwc3.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree

[PATCH v2 4/4] usb: dwc3: Enable frame number tracking based on reference clock

2018-12-07 Thread Thinh Nguyen
the controller from suspending the USB2 PHY when the device goes into low power. This feature allows the controller to suspend the USB2 PHY when the device enters low power. This improves power saving for devices that have isochronous endpoints. Signed-off-by: Thinh Nguyen --- Changes in v2

Re: [PATCH 2/2] pci: quirks: Override Synopsys USB 3.x HAPS device driver

2018-12-07 Thread Thinh Nguyen
Hi Bjorn, On 11/6/2018 12:44 AM, Felipe Balbi wrote: > Thinh Nguyen writes: > >> ++ linux-usb >> ++ Greg >> >> On 11/2/2018 6:47 PM, Thinh Nguyen wrote: >>> Synopsys USB 3.x host HAPS platform has a class code of >>> PCI_CLASS_SERIAL_USB_XH

Re: [PATCH v2 1/8] usb: dwc3: Correct the logic for checking TRB full in __dwc3_prepare_one_trb()

2018-09-04 Thread Thinh Nguyen
Hi Anurag, On 8/17/2018 5:25 AM, Anurag Kumar Vulisha wrote: > Availability of TRB's are calculated using dwc3_calc_trbs_left(), which > determines available TRB's based on the HWO bit set in a TRB. > > __dwc3_prepare_one_trb() is called with a TRB which needs to be prepared > for transfer. This _

Re: [PATCH v2 3/8] usb: dwc3: make controller clear transfer resources after complete

2018-09-04 Thread Thinh Nguyen
On 8/17/2018 5:26 AM, Anurag Kumar Vulisha wrote: > 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

Re: [PATCH v2 4/8] usb: dwc3: implement stream transfer timeout

2018-09-04 Thread Thinh Nguyen
On 8/17/2018 5:25 AM, Anurag Kumar Vulisha wrote: > According to dwc3 databook when streams are used, it may be possible > for the host and device become out of sync, where device may wait for > host to issue prime transcation and host may wait for device to issue > erdy. To avoid such deadlock, ti

Re: [PATCH v2 1/8] usb: dwc3: Correct the logic for checking TRB full in __dwc3_prepare_one_trb()

2018-09-05 Thread Thinh Nguyen
Hi, On 9/5/2018 2:19 AM, Anurag Kumar Vulisha wrote: > Hi Thinh, > > Thanks for spending your time in reviewing this code, please find my comments > inline > >> -Original Message- >> From: Thinh Nguyen [mailto:thinh.ngu...@synopsys.com] >> Sent: Wedne

Re: [PATCH v2 1/8] usb: dwc3: Correct the logic for checking TRB full in __dwc3_prepare_one_trb()

2018-09-06 Thread Thinh Nguyen
Hi Anurag, On 9/6/2018 8:12 AM, Anurag Kumar Vulisha wrote: > Hi Thinh, > >> -Original Message----- >> From: Thinh Nguyen [mailto:thinh.ngu...@synopsys.com] >> Sent: Thursday, September 06, 2018 7:28 AM >> To: Anurag Kumar Vulisha ; Thinh Ngu

Re: [PATCH v3 4/8] usb: dwc3: implement stream transfer timeout

2018-09-07 Thread Thinh Nguyen
uch deadlock, timeout needs to be implemented. After > timeout occurs, device will first stop transfer and restart the transfer > again. This patch does the same. > > Signed-off-by: Anurag Kumar Vulisha > Reviewed-by: Thinh Nguyen > --- > Changes in v3: > 1. Added th

Re: [PATCH v3 1/8] usb: dwc3: Correct the logic for checking TRB full in __dwc3_prepare_one_trb()

2018-09-07 Thread Thinh Nguyen
mit message to reflect your new change. > > Signed-off-by: Anurag Kumar Vulisha > Reviewed-by: Thinh Nguyen > --- > Changes in v3: > 1. Corrected the logic for setting HWO bit as suggested by "Thinh > Nguyen" > > Changes in v2: > 1. Ch

Re: [PATCH v4 6/8] usb: dwc3: check for requests in started list for stream capable endpoints

2018-09-10 Thread Thinh Nguyen
ly need further explanation. (e.g. Why wait to call __dwc3_gadget_kick_transfer() on XferComplete event rather than sending a START_TRANSFER command for every prepared TRB whenever we do __dwc3_gadget_kick_transfer()?). Thanks, Thinh > > Signed-off-by: Anurag Kumar Vulisha > R

Re: [PATCH v4 6/8] usb: dwc3: check for requests in started list for stream capable endpoints

2018-09-10 Thread Thinh Nguyen
Hi, On 9/10/2018 1:13 PM, Thinh Nguyen wrote: > Hi Anurag, > > On 9/8/2018 8:03 AM, Anurag Kumar Vulisha wrote: >> For stream capable endpoints, uas layer can queue mulpile requests on >> single ep with different stream ids. So, there can be multiple pending >> request

Re: [PATCH v4 4/8] usb: dwc3: implement stream transfer timeout

2018-09-13 Thread Thinh Nguyen
o avoid such deadlock, timeout needs to be implemented. After > timeout occurs, device will first stop transfer and restart the transfer > again. This patch does the same. > > Signed-off-by: Anurag Kumar Vulisha > Reviewed-by: Thinh Nguyen > --- > Chnages in v4: > 1.

Re: [PATCH 1/2] pci: pci_ids: Move Synopsys HAPS platform device IDs

2018-12-10 Thread Thinh Nguyen
Hi Bjorn, On 12/10/2018 10:49 AM, Bjorn Helgaas wrote: > On Fri, Nov 02, 2018 at 06:47:38PM -0700, Thinh Nguyen wrote: >> Move Synopsys HAPS platform device IDs to pci_ids.h. >> >> Signed-off-by: Thinh Nguyen > 1) Run "git log --oneline include/linux/pci_ids.h"

Re: [PATCH 2/2] pci: quirks: Override Synopsys USB 3.x HAPS device driver

2018-12-10 Thread Thinh Nguyen
Hi Bjorn, On 12/10/2018 10:54 AM, Bjorn Helgaas wrote: > On Sat, Dec 08, 2018 at 02:49:09AM +0000, Thinh Nguyen wrote: >> Hi Bjorn, >> >> On 11/6/2018 12:44 AM, Felipe Balbi wrote: >>> Thinh Nguyen writes: >>> >>>> ++ linux-usb >>>

[PATCH v2 1/2] PCI: Move Synopsys HAPS platform device IDs

2018-12-10 Thread Thinh Nguyen
Move Synopsys HAPS platform device IDs to pci_ids.h so that both drivers/pci/quirks.c and dwc3-haps driver can reference these IDs. Signed-off-by: Thinh Nguyen Acked-by: Felipe Balbi --- Change in v2: - Revise title to fit PCI patches' convention - Revise commit message to include the c

[PATCH v2 2/2] PCI: Override Synopsys USB 3.x HAPS device class

2018-12-10 Thread Thinh Nguyen
ff-by: Thinh Nguyen --- Change in v2: - Revise title to fit PCI patches' convention - Override pci class instead of driver drivers/pci/quirks.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 4700d24e5d55..c8

Re: [PATCH] usb: dwc3: gadget: fix miss isoc issue introduced by IRQ latency

2018-12-14 Thread Thinh Nguyen
Hi Zengtao, On 12/14/2018 3:24 AM, Felipe Balbi wrote: > Hi, > > "Zengtao (B)" writes: >>> -Original Message- >>> From: Felipe Balbi [mailto:ba...@kernel.org] >>> Sent: Friday, December 14, 2018 4:52 PM >>> To: Zengtao (B) >>> Cc: liangshengjun ; Zengtao (B) >>> ; Greg Kroah-Hartman >>>

Re: [PATCH] usb: dwc3: gadget: fix miss isoc issue introduced by IRQ latency

2018-12-17 Thread Thinh Nguyen
Hi Zengtao, On 12/16/2018 5:45 PM, Zengtao (B) wrote: >> If it's a busy system, some times when we start an isoc transfer, >> the framenumber get from the event buffer may be already elasped, >> in this case, we will get all the packets dropped due to miss isoc. >> And we turn into

Re: [PATCH v2 3/4] usb: dwc3: Add property snps,enable-refclk-sof

2018-12-18 Thread Thinh Nguyen
Hi Rob, On 12/18/2018 8:41 AM, Rob Herring wrote: > On Fri, Dec 07, 2018 at 06:27:43PM -0800, Thinh Nguyen wrote: >> This patch adds a property to enable the controller to track the >> frame number based on the reference clock. >> >> When operating in USB 2.0 mode, the

Re: [PATCH v2 1/4] usb: dwc3: Add property snps,refclk-period-ns

2018-12-18 Thread Thinh Nguyen
Hi Rob, On 12/18/2018 8:39 AM, Rob Herring wrote: > On Fri, Dec 07, 2018 at 06:27:30PM -0800, Thinh Nguyen wrote: >> This patch introduces property "snps,refclk-period-ns" to inform the >> controller of the reference clock period. If the reference clock period >>

Re: [PATCH v2 1/4] usb: dwc3: Add property snps,refclk-period-ns

2018-12-19 Thread Thinh Nguyen
Hi Rob, On 12/19/2018 5:18 AM, Rob Herring wrote: > On Tue, Dec 18, 2018 at 6:22 PM Thinh Nguyen > wrote: >> Hi Rob, >> >> On 12/18/2018 8:39 AM, Rob Herring wrote: >>> On Fri, Dec 07, 2018 at 06:27:30PM -0800, Thinh Nguyen wrote: >>>> This patch i

Re: [PATCH v2 1/4] usb: dwc3: Add property snps,refclk-period-ns

2018-12-20 Thread Thinh Nguyen
Hi, On 12/19/2018 10:48 PM, Felipe Balbi wrote: > Hi, > > Thinh Nguyen writes: >>>> On 12/18/2018 8:39 AM, Rob Herring wrote: >>>>> On Fri, Dec 07, 2018 at 06:27:30PM -0800, Thinh Nguyen wrote: >>>>>> This patch introduces property "sn

Re: [PATCH v2 1/4] usb: dwc3: Add property snps,refclk-period-ns

2018-12-21 Thread Thinh Nguyen
Hi, On 12/21/2018 9:12 AM, Rob Herring wrote: > On Thu, Dec 20, 2018 at 6:22 PM Thinh Nguyen > wrote: >> Hi, >> >> On 12/19/2018 10:48 PM, Felipe Balbi wrote: >>> Hi, >>> >>> Thinh Nguyen writes: >>>>>> On 12/18/2018 8:39 AM

Re: [PATCH 10/14] usb: dwc3: gadget: remove wait_end_transfer

2019-01-21 Thread Thinh Nguyen
Hi Felipe, On 1/21/2019 4:15 AM, Felipe Balbi wrote: > Hi > > Felipe Balbi writes: >> Hi, >> >> Felipe Balbi writes: >>> Hi again, >>> >>> Felipe Balbi writes: >>> >>> >>> Try to dequeue a request that was already completed. Odd. Why are we missing a call to giveback?? >>> Got a litt

Re: [PATCH 1/4] usb: dwc3: gadget: clear DWC3_EP_TRANSFER_STARTED on cmd complete

2019-01-31 Thread Thinh Nguyen
get.c > break; This patch series has been running fine on my testing setup. Tested-by: Thinh Nguyen Thanks, Thinh

Re: Frequent dwc3 crashes on suspend or reboot since 5.0-rc1

2019-02-01 Thread Thinh Nguyen
Hi John, John Stultz wrote: > Hey all, > Since the 5.0 merge window opened, I've been tripping on frequent > dwc3 crashes on reboot and suspend, which I've added an example to the > bottom of this mail. > > I've dug in a little bit and sort of have a sense of whats going on. > > In ffs_epfile_io

Re: Frequent dwc3 crashes on suspend or reboot since 5.0-rc1

2019-02-01 Thread Thinh Nguyen
Hi John, John Stultz wrote: > On Fri, Feb 1, 2019 at 4:18 PM John Stultz wrote: >> Hey all, >> Since the 5.0 merge window opened, I've been tripping on frequent >> dwc3 crashes on reboot and suspend, which I've added an example to the >> bottom of this mail. >> >> I've dug in a little bit and s

Re: Frequent dwc3 crashes on suspend or reboot since 5.0-rc1

2019-02-01 Thread Thinh Nguyen
John Stultz wrote: > On Fri, Feb 1, 2019 at 4:46 PM Thinh Nguyen wrote: >> John Stultz wrote: >>> On Fri, Feb 1, 2019 at 4:18 PM John Stultz wrote: >>> Bisecting the changes down, it seems like its due to commit >>> fec9095bdef4e ("usb: dwc3: gadge

Re: [PATCH v2 2/2] PCI: Override Synopsys USB 3.x HAPS device class

2019-02-04 Thread Thinh Nguyen
Hi Trent, Trent Piepho wrote: > On Mon, 2018-12-10 at 14:08 -0800, Thinh Nguyen wrote: >> Synopsys USB 3.x host HAPS platform has a class code of >> PCI_CLASS_SERIAL_USB_XHCI, and xhci driver can claim it. However, these >> devices should use dwc3-haps driver. Change these d

[PATCH] usb: dwc3: haps: Workaround matching VID PID

2019-02-06 Thread Thinh Nguyen
: Thinh Nguyen --- drivers/usb/dwc3/dwc3-haps.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/usb/dwc3/dwc3-haps.c b/drivers/usb/dwc3/dwc3-haps.c index 02d57d98ef9b..3cecbf169452 100644 --- a/drivers/usb/dwc3/dwc3-haps.c +++ b/drivers/usb/dwc3/dwc3-haps.c @@ -106,6 +106,15

Re: [PATCH] usb: dwc3: haps: Workaround matching VID PID

2019-02-07 Thread Thinh Nguyen
Hi Felipe, Felipe Balbi wrote: > Hi, > > Thinh Nguyen writes: >> i.MX6QP and i.MX7D platform use a PCIe controller with the same VID and >> PID as this USB controller. The system may incorrectly match this driver >> to that PCIe controller. To workaround this, specifi

Re: [PATCH 1/4] usb: dwc3: gadget: clear DWC3_EP_TRANSFER_STARTED on cmd complete

2019-02-12 Thread Thinh Nguyen
Hi Felipe, Felipe Balbi wrote: > Hi, > > Thinh Nguyen writes: >> Hi Felipe, >> >> Felipe Balbi wrote: >>> We must wait until End Transfer completes in order to clear >>> DWC3_EP_TRANSFER_STARTED, otherwise we may confuse the driver. >>&g

[PATCH] usb: dwc3: Reset num_trbs after skipping

2019-02-12 Thread Thinh Nguyen
m. Fixes: c3acd5901414 ("usb: dwc3: gadget: use num_trbs when skipping TRBs on ->dequeue()") Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/gadget.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index e83f84e07f18..a19

[PATCH 0/4] usb: gadget: Report recommended BESL

2019-08-19 Thread Thinh Nguyen
This patch series add an option for the gadget driver to export recommended BESL value to improve power saving for devices operating with LPM feature. Thinh Nguyen (4): usb: gadget: Export recommended BESL values usb: dwc3: Separate field holding multiple properties usb: dwc3: gadget: Set

[PATCH 1/4] usb: gadget: Export recommended BESL values

2019-08-19 Thread Thinh Nguyen
value in the BOS descriptor. Signed-off-by: Thinh Nguyen --- include/linux/usb/gadget.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index fb19141151d8..124462d65eac 100644 --- a/include/linux/usb/gadget.h +++ b/include/linu

[PATCH 2/4] usb: dwc3: Separate field holding multiple properties

2019-08-19 Thread Thinh Nguyen
dwc->hird_threshold field should store "snps,hird_threshold" property only and not a combination of multiple properties. Remove the value of "snps,is-utmi-l1-suspend" property from the field dwc->hird_threshold. Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/core.c

[PATCH 3/4] usb: dwc3: gadget: Set BESL config parameter

2019-08-19 Thread Thinh Nguyen
asserted. Set the recommended deep BESL equal to the controller's DCTL.HIRD_Thres[3:0] setting, and set the baseline BESL to 0 for the shallow low-power signal. This maximizes the opportunity for L1 residency and optimizes power savings. Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/gadget.c

[PATCH 4/4] usb: gadget: composite: Set recommended BESL values

2019-08-19 Thread Thinh Nguyen
Set the recommended BESL deep and baseline values based on the gadget's configuration parameters to the extended BOS descriptor. This feature helps to optimize power savings by maximizing the opportunity for longer L1 residency time. Signed-off-by: Thinh Nguyen --- drivers/usb/g

[PATCH] usb: dwc3: gadget: Workaround Mirosoft's BESL check

2019-08-28 Thread Thinh Nguyen
against Windows 10 build 18956. Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/gadget.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 7b58e0e1e438..9ef2259829ba 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/d

[PATCH v2] usb: dwc3: gadget: Workaround Mirosoft's BESL check

2019-08-29 Thread Thinh Nguyen
against Windows 10 build 18956. Signed-off-by: Thinh Nguyen --- changes in v2: - Add comment in code for the new change drivers/usb/dwc3/gadget.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c ind

Re: [PATCH] usb: dwc3: reset the address and run_stop on init

2019-09-05 Thread Thinh Nguyen
Hi, Roman Kapl wrote: > The address should be set to zero during reset according to the > documentation. That is for usb reset and not core soft reset, and dwc3 already handles that case. > Clearing RunStop ensures that the host disconnects from > the device (it was not cleared by CSFTRST, at l

Re: [PATCH] usb: dwc3: reset the address and run_stop on init

2019-09-09 Thread Thinh Nguyen
Hi, Roman Kapl wrote: > Hello, > > On 9/5/19 8:57 PM, Thinh Nguyen wrote: >> Hi, >> >> Roman Kapl wrote: >>> The address should be set to zero during reset according to the >>> documentation. >> >> That is for usb reset and not core soft re

[PATCH 1/2] usb: dwc3: Fix GTXFIFOSIZ.TXFDEP macro name

2019-09-09 Thread Thinh Nguyen
Change the macro name DWC3_GTXFIFOSIZ_TXFDEF to DWC3_GTXFIFOSIZ_TXFDEP to match with the register name GTXFIFOSIZ.TXFDEP. Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/core.h | 4 ++-- drivers/usb/dwc3/gadget.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a

[PATCH 2/2] usb: dwc3: gadget: Properly set maxpacket limit

2019-09-09 Thread Thinh Nguyen
s the MaxPacketSize limit for OUT endpoints. Reference: Databook 3.30a section 3.2.2 and 3.2.3 Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/core.h | 4 drivers/usb/dwc3/gadget.c | 52 +-- 2 files changed, 45 insertions(+), 11 deletions(-) diff

[PATCH 1/4] usb: dwc3: gadget: Don't send unintended link state change

2019-10-22 Thread Thinh Nguyen
DCTL.ULSTCHNGREQ is a write-only field. When doing a read-modify-write to DCTL, the driver must make sure that there's no unintended link state change request from whatever is read from DCTL.ULSTCHNGREQ. Set link state change to no-action when the driver writes to DCTL. Signed-off-by:

[PATCH 3/4] usb: dwc3: gadget: Clear DCTL.ULSTCHNGREQ before set

2019-10-22 Thread Thinh Nguyen
Send a no-action link state change request before the actual request so DWC3 can send the same request whenever we call dwc3_gadget_set_link_state(). Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/gadget.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/dwc3/gadget.c b

[PATCH 2/4] usb: dwc3: gadget: Set link state to RX_Detect on disconnect

2019-10-22 Thread Thinh Nguyen
When DWC3 receives disconnect event, it needs to set the link state to RX_Detect. DWC_usb3 3.30a programming guide 4.1.7 Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/gadget.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index

[PATCH 4/4] usb: dwc3: debug: Remove newline printout

2019-10-22 Thread Thinh Nguyen
The newline from the unknown link state tracepoint doesn't follow the other tracepoints, and it looks unsightly. Let's remove it. Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/debug.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/debug.h

[PATCH 0/4] usb: gadget: Link state changes

2019-10-22 Thread Thinh Nguyen
This patch series adds some fixes to how dwc3 handles cases related to link state changes. Thinh Nguyen (4): usb: dwc3: gadget: Don't send unintended link state change usb: dwc3: gadget: Set link state to RX_Detect on disconnect usb: dwc3: gadget: Clear DCTL.ULSTCHNGREQ before set

<    1   2   3