Re: [PATCH 1/6] dt-bindings: usb: dwc3: Document usb-soc-be property

2025-04-25 Thread Wesley Cheng
Q6USB backend DAI and the vendor USB offload driver. Reduces the need to add more properties. Thanks Wesley Cheng > > Cc: Wesley Cheng > Signed-off-by: Luca Weiss > --- > Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml | 4 > 1 file changed, 4 inserti

[PATCH] usb: gadget: Fix double free of device descriptor pointers

2021-04-19 Thread Wesley Cheng
speed plus desc still holds the stale (already freed) pointer. Fix this issue by setting all descriptor pointers to NULL after freeing them in usb_free_all_descriptors(). Signed-off-by: Hemant Kumar Signed-off-by: Wesley Cheng --- drivers/usb/gadget/config.c | 4 1 file changed, 4 insertions

Re: [PATCH] usb: dwc3: gadget: Avoid canceling current request for queuing error

2021-04-19 Thread Wesley Cheng
On 4/15/2021 12:28 PM, Thinh Nguyen wrote: > Thinh Nguyen wrote: >> Wesley Cheng wrote: >>> >>> >>> On 4/14/2021 11:26 PM, Felipe Balbi wrote: >>>> Wesley Cheng writes: >>>> >>>>> If an error is received when issuin

Re: [PATCH] usb: dwc3: gadget: Avoid canceling current request for queuing error

2021-04-15 Thread Wesley Cheng
On 4/14/2021 11:26 PM, Felipe Balbi wrote: > Wesley Cheng writes: > >> If an error is received when issuing a start or update transfer >> command, the error handler will stop all active requests (including >> the current USB request), and call dwc3_gadget_giveback

[PATCH] usb: dwc3: gadget: Avoid canceling current request for queuing error

2021-04-14 Thread Wesley Cheng
request which is trying to be queued, as the function driver will handle the EP queue error accordingly. Simply unmap the request as it was done before, and allow previously started transfers to be cleaned up. Signed-off-by: Wesley Cheng --- drivers/usb/dwc3/gadget.c | 5 + 1 file changed, 5

Re: [PATCH] Revert "usb: dwc3: gadget: Prevent EP queuing while stopping transfers"

2021-04-01 Thread Wesley Cheng
martin > Hi Martin, This has been fixed with the below: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/commit/?h=usb-linus&id=5aef629704ad4d983ecf5c8a25840f16e45b6d59 Can you pull that in and give it a try? Thanks Wesley Cheng > > > > [ 51.148220

Re: [PATCH v3 2/2] usb: dwc3: Fix DRD mode change sequence following programming guide

2021-03-30 Thread Wesley Cheng
On 3/29/2021 6:19 PM, Thinh Nguyen wrote: > Wesley Cheng wrote: >> >> >> On 3/6/2021 3:39 PM, Thinh Nguyen wrote: >>> Wesley Cheng wrote: >>>> >>>> On 1/7/2021 5:51 PM, John Stultz wrote: >>>>> In reviewing the previous pa

Re: [PATCH v3 1/2] usb: dwc3: Trigger a GCTL soft reset when switching modes in DRD

2021-03-29 Thread Wesley Cheng
On 3/29/2021 3:20 PM, John Stultz wrote: > On Mon, Mar 29, 2021 at 3:15 PM Wesley Cheng wrote: >> >> >> >> On 3/19/2021 4:09 PM, Thinh Nguyen wrote: >>> Wesley Cheng wrote: >>>> >>>> >>>> On 3/8/2021 10:33 PM, Wesle

Re: [PATCH v3 2/2] usb: dwc3: Fix DRD mode change sequence following programming guide

2021-03-29 Thread Wesley Cheng
On 3/6/2021 3:39 PM, Thinh Nguyen wrote: > Wesley Cheng wrote: >> >> On 1/7/2021 5:51 PM, John Stultz wrote: >>> In reviewing the previous patch, Thinh Nguyen pointed out that >>> the DRD mode change sequence should be like the following when >>> swit

Re: [PATCH v3 1/2] usb: dwc3: Trigger a GCTL soft reset when switching modes in DRD

2021-03-29 Thread Wesley Cheng
On 3/19/2021 4:09 PM, Thinh Nguyen wrote: > Wesley Cheng wrote: >> >> >> On 3/8/2021 10:33 PM, Wesley Cheng wrote: >>> >>> >>> On 3/8/2021 7:05 PM, Thinh Nguyen wrote: >>>> Wesley Cheng wrote: >>>>> >>>>>

[PATCH] usb: dwc3: gadget: Clear DEP flags after stop transfers in ep disable

2021-03-24 Thread Wesley Cheng
ko Tested-by: Marek Szyprowski Signed-off-by: Wesley Cheng --- drivers/usb/dwc3/gadget.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index e1442fc..2c4d201 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/

Re: [PATCH v3] usb: dwc3: gadget: Prevent EP queuing while stopping transfers

2021-03-23 Thread Wesley Cheng
On 3/23/2021 10:27 AM, Andy Shevchenko wrote: > On Tue, Mar 23, 2021 at 1:19 AM Wesley Cheng wrote: >> >> Hi Andy, >> >> On 3/22/2021 2:14 PM, Andy Shevchenko wrote: >>> On Mon, Mar 22, 2021 at 10:06 PM Wesley Cheng wrote: >>>> >>>&g

Re: [PATCH v3] usb: dwc3: gadget: Prevent EP queuing while stopping transfers

2021-03-23 Thread Wesley Cheng
On 3/23/2021 10:27 AM, Andy Shevchenko wrote: > On Tue, Mar 23, 2021 at 1:19 AM Wesley Cheng wrote: >> >> Hi Andy, >> >> On 3/22/2021 2:14 PM, Andy Shevchenko wrote: >>> On Mon, Mar 22, 2021 at 10:06 PM Wesley Cheng wrote: >>>> >>>&g

Re: [PATCH] usb: gadget: Stall OS descriptor request for unsupported functions

2021-03-22 Thread Wesley Cheng
On 3/22/2021 11:25 PM, Jack Pham wrote: > Hi Wesley, > > On Mon, Mar 22, 2021 at 06:50:17PM -0700, Wesley Cheng wrote: >> From: Chandana Kishori Chiluveru >> >> Hosts which request "OS descriptors" from gadgets do so during >> the enumeration pha

[PATCH] usb: gadget: Stall OS descriptor request for unsupported functions

2021-03-22 Thread Wesley Cheng
valid info host resetting the bus and never selecting the configuration and leading enumeration issue. Fix this by bailing out from the OS descriptor setup request handling if the functions does not have OS descriptors compatibleID. Signed-off-by: Chandana Kishori Chiluveru Signed-off-b

Re: [PATCH v3] usb: dwc3: gadget: Prevent EP queuing while stopping transfers

2021-03-22 Thread Wesley Cheng
Hi Andy, On 3/22/2021 2:14 PM, Andy Shevchenko wrote: > On Mon, Mar 22, 2021 at 10:06 PM Wesley Cheng wrote: >> >> Hi Andy, >> >> On 3/22/2021 12:34 PM, Andy Shevchenko wrote: >>> On Mon, Mar 22, 2021 at 8:49 PM Wesley Cheng wrote: >>>> &g

Re: [PATCH v3] usb: dwc3: gadget: Prevent EP queuing while stopping transfers

2021-03-22 Thread Wesley Cheng
Hi Andy, On 3/22/2021 12:34 PM, Andy Shevchenko wrote: > On Mon, Mar 22, 2021 at 8:49 PM Wesley Cheng wrote: >> >> Hi Andy, >> >> On 3/22/2021 5:48 AM, Andy Shevchenko wrote: >>> On Fri, Mar 12, 2021 at 2:01 AM Wesley Cheng wrote: >>>> >>&

Re: [PATCH v3] usb: dwc3: gadget: Prevent EP queuing while stopping transfers

2021-03-22 Thread Wesley Cheng
Hi Andy, On 3/22/2021 5:48 AM, Andy Shevchenko wrote: > On Fri, Mar 12, 2021 at 2:01 AM Wesley Cheng wrote: >> >> In the situations where the DWC3 gadget stops active transfers, once >> calling the dwc3_gadget_giveback(), there is a chance where a function >> driver

Re: [PATCH 2/2] usb: dwc3: gadget: Ignore EP queue requests during bus reset

2021-03-19 Thread Wesley Cheng
Hi Thinh, On 3/19/2021 7:01 PM, Thinh Nguyen wrote: > Wesley Cheng wrote: >> >> >> On 3/19/2021 5:40 PM, Thinh Nguyen wrote: >>> Hi, >>> >>> Wesley Cheng wrote: >>>> The current dwc3_gadget_reset_interrupt() will stop any active >>

Re: [PATCH 2/2] usb: dwc3: gadget: Ignore EP queue requests during bus reset

2021-03-19 Thread Wesley Cheng
On 3/19/2021 5:40 PM, Thinh Nguyen wrote: > Hi, > > Wesley Cheng wrote: >> The current dwc3_gadget_reset_interrupt() will stop any active >> transfers, but only addresses blocking of EP queuing for while we are >> coming from a disconnected scenario, i.e. aft

Re: [PATCH v3 1/2] usb: dwc3: Trigger a GCTL soft reset when switching modes in DRD

2021-03-19 Thread Wesley Cheng
On 3/8/2021 10:33 PM, Wesley Cheng wrote: > > > On 3/8/2021 7:05 PM, Thinh Nguyen wrote: >> Wesley Cheng wrote: >>> >>> On 3/6/2021 3:41 PM, Thinh Nguyen wrote: >>>> Wesley Cheng wrote: >>>>> On 1/8/2021 4:44 PM, Thinh Nguyen wrote

[PATCH 1/2] usb: dwc3: gadget: Avoid continuing preparing TRBs during teardown

2021-03-19 Thread Wesley Cheng
TRB, which will be removed by the pullup disable routine. Signed-off-by: Wesley Cheng --- drivers/usb/dwc3/gadget.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 4a337f3..6e14fdc 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/driv

[PATCH 0/2] Fix allowing of ep queuing while stopping transfers

2021-03-19 Thread Wesley Cheng
he EP disable call, but for some function drivers, this does not occur synchronously in their disable() callback. These functions would rely on the stop active transfers in the reset handler to issue the endxfer cmd. Wesley Cheng (2): usb: dwc3: gadget: Avoid continuing preparing TRBs du

[PATCH 2/2] usb: dwc3: gadget: Ignore EP queue requests during bus reset

2021-03-19 Thread Wesley Cheng
still be set to true, allowing for EP queuing to continue while we are disabling the functions. To avoid this, set the connected flag to false until the stop active transfers is complete. Signed-off-by: Wesley Cheng --- drivers/usb/dwc3/gadget.c | 9 + 1 file changed, 9 insertions

[PATCH v3] usb: dwc3: gadget: Prevent EP queuing while stopping transfers

2021-03-11 Thread Wesley Cheng
rs to prevent EP queuing are set before calling the stop active transfers API. Fixes: ae7e86108b12 ("usb: dwc3: Stop active transfers before halting the controller") Signed-off-by: Wesley Cheng --- Changes since V2: - Removed duplicate dwc->connected = false setting in pullup routine

Re: [PATCH v2] usb: dwc3: gadget: Prevent EP queuing while stopping transfers

2021-03-11 Thread Wesley Cheng
On 3/11/2021 3:18 PM, Thinh Nguyen wrote: > Wesley Cheng wrote: >> In the situations where the DWC3 gadget stops active transfers, once >> calling the dwc3_gadget_giveback(), there is a chance where a function >> driver can queue a new USB request in between the time where

[PATCH v2] usb: dwc3: gadget: Prevent EP queuing while stopping transfers

2021-03-11 Thread Wesley Cheng
rs to prevent EP queuing are set before calling the stop active transfers API. Fixes: ae7e86108b12 ("usb: dwc3: Stop active transfers before halting the controller") Signed-off-by: Wesley Cheng --- Changes since V1: - Added Fixes tag to point to the commit this is addressing drivers/us

[PATCH] usb: dwc3: gadget: Prevent EP queuing while stopping transfers

2021-03-10 Thread Wesley Cheng
rs to prevent EP queuing are set before calling the stop active transfers API. Signed-off-by: Wesley Cheng --- drivers/usb/dwc3/gadget.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 4780983..4d98fbf 100644

Re: [PATCH v3 1/2] usb: dwc3: Trigger a GCTL soft reset when switching modes in DRD

2021-03-08 Thread Wesley Cheng
On 3/8/2021 7:05 PM, Thinh Nguyen wrote: > Wesley Cheng wrote: >> >> On 3/6/2021 3:41 PM, Thinh Nguyen wrote: >>> Wesley Cheng wrote: >>>> On 1/8/2021 4:44 PM, Thinh Nguyen wrote: >>>>> Hi, >>>>> >>>>> John St

Re: [PATCH v3 1/2] usb: dwc3: Trigger a GCTL soft reset when switching modes in DRD

2021-03-07 Thread Wesley Cheng
On 3/6/2021 3:41 PM, Thinh Nguyen wrote: > Wesley Cheng wrote: >> >> On 1/8/2021 4:44 PM, Thinh Nguyen wrote: >>> Hi, >>> >>> John Stultz wrote: >>>> On Fri, Jan 8, 2021 at 4:26 AM Felipe Balbi wrote: >>>>> Hi, >>>&g

Re: [PATCH v3 1/2] usb: dwc3: Trigger a GCTL soft reset when switching modes in DRD

2021-03-06 Thread Wesley Cheng
021181803.79650-1-john.stu...@linaro.org/__;!!A4F2R9G_pg!LNzuprAeg-O80SgolYkIkW4-ne-M-yLWCDUY9MygAIrQC398Z6gRJ9wnRWITZfc$ >> >> >> That way folks can enable it for devices as they need? >> >> Again, I'm not trying to force this in as-is, just mostly sending it >> out again for discussion to understand what other approach might work. >> >> thanks >> -john > > A quirk would imply something is broken/diverged from the design right? > But it's not the case here, and at least this is needed for HiKey960. > Also, I think Rob will be ok with not adding 1 more quirk to the dwc3 > devicetree. :) > > BR, > Thinh > Hi All, Sorry for jumping in, but I checked the SNPS v1.90a databook, and that seemed to remove the requirement for the GCTL.softreset before writing to PRTCAPDIR. Should we consider adding a controller version/IP check? Thanks Wesley Cheng -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project

Re: [PATCH v3 2/2] usb: dwc3: Fix DRD mode change sequence following programming guide

2021-03-06 Thread Wesley Cheng
owever, can we consider moving the core soft reset outside the spinlock? At least with our PHY init routines, we have some msleep() calls for waiting for the PHYs to be ready, which will end up as a sleeping while atomic bug. (not sure if PHY init is required to be called in atomic context) Thanks Wesley Cheng -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project

Re: [PATCH v7 4/5] usb: dwc3: dwc3-qcom: Enable tx-fifo-resize property by default

2021-02-17 Thread Wesley Cheng
On 2/2/2021 8:23 AM, Bjorn Andersson wrote: > On Thu 28 Jan 22:46 CST 2021, Wesley Cheng wrote: > >> In order to take advantage of the TX fifo resizing logic, manually add >> these properties to the DWC3 child node by default. This will allow >> the DWC3 gadget to res

Re: usb: dwc3: gadget: Change runtime pm function for DWC3 runtime suspend

2021-02-16 Thread Wesley Cheng
B disconnected > 2. UDC unbinded > 3. DWC3 runtime suspend > 4. UDC binded unexpectedly > 5. DWC3 runtime resume (pm_runtime_get_sync) > 6. DWC3 runtime idle (pm_runtime_put) >-> DWC3 runtime suspend again (pm_runtime_put_sync_suspend) > > I've talked with We

Re: [PATCH v7 4/5] usb: dwc3: dwc3-qcom: Enable tx-fifo-resize property by default

2021-01-29 Thread Wesley Cheng
On 1/29/2021 1:24 AM, Jack Pham wrote: > Hi Wesley, > > On Thu, Jan 28, 2021 at 08:46:43PM -0800, Wesley Cheng wrote: >> In order to take advantage of the TX fifo resizing logic, manually add >> these properties to the DWC3 child node by default. This will allow >>

[PATCH v7 5/5] dt-bindings: usb: dwc3: Update dwc3 TX fifo properties

2021-01-28 Thread Wesley Cheng
Update the tx-fifo-resize property with a better description, while adding the tx-fifo-max-num, which is a new parameter allowing adjustments for the maximum number of packets the txfifo resizing logic can account for while resizing the endpoints. Signed-off-by: Wesley Cheng --- Documentation

[PATCH v7 2/5] usb: gadget: configfs: Check USB configuration before adding

2021-01-28 Thread Wesley Cheng
Ensure that the USB gadget is able to support the configuration being added based on the number of endpoints required from all interfaces. This is for accounting for any bandwidth or space limitations. Signed-off-by: Wesley Cheng --- drivers/usb/gadget/configfs.c | 22 ++ 1

[PATCH v7 4/5] usb: dwc3: dwc3-qcom: Enable tx-fifo-resize property by default

2021-01-28 Thread Wesley Cheng
In order to take advantage of the TX fifo resizing logic, manually add these properties to the DWC3 child node by default. This will allow the DWC3 gadget to resize the TX fifos for the IN endpoints, which help with performance. Signed-off-by: Wesley Cheng --- drivers/usb/dwc3/dwc3-qcom.c | 10

[PATCH v7 3/5] usb: dwc3: Resize TX FIFOs to meet EP bursting requirements

2021-01-28 Thread Wesley Cheng
helps ensure that the resizing logic can fulfill the configuration(s), or return an error to the gadget layer otherwise during bind time. Signed-off-by: Wesley Cheng --- drivers/usb/dwc3/core.c | 9 ++ drivers/usb/dwc3/core.h | 15 drivers/usb/dwc3/ep0.c| 2 + drivers/usb/dwc3

[PATCH v7 1/5] usb: gadget: udc: core: Introduce check_config to verify USB configuration

2021-01-28 Thread Wesley Cheng
: Wesley Cheng --- drivers/usb/gadget/udc/core.c | 25 + include/linux/usb/gadget.h| 5 + 2 files changed, 30 insertions(+) diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c index 4173acd..81252e5 100644 --- a/drivers/usb/gadget/udc/core.c

[PATCH v7 0/5] Re-introduce TX FIFO resize for larger EP bursting

2021-01-28 Thread Wesley Cheng
t (in MB/s) --- Sequential|1 GB x | Read |9 loops| 287.35 | | 304.94 | | 289.64 | | 293.61 ------- Wesley Cheng (5): usb: gadget: udc: core: Introduce check

Re: [PATCH v6 3/4] usb: dwc3: Resize TX FIFOs to meet EP bursting requirements

2021-01-28 Thread Wesley Cheng
On 1/25/2021 9:15 PM, Bjorn Andersson wrote: > On Mon 25 Jan 22:32 CST 2021, Wesley Cheng wrote: >> On 1/25/2021 5:55 PM, Bjorn Andersson wrote: >>> On Mon 25 Jan 19:14 CST 2021, Wesley Cheng wrote: >>> >>>> >>>> >>>> On 1/22/202

Re: [PATCH v6 3/4] usb: dwc3: Resize TX FIFOs to meet EP bursting requirements

2021-01-26 Thread Wesley Cheng
On 1/26/2021 12:43 PM, Thinh Nguyen wrote: > Wesley Cheng wrote: >> >> On 1/22/2021 4:15 PM, Thinh Nguyen wrote: >>> Hi, >>> >>> Wesley Cheng wrote: >>>> Some devices have USB compositions which may require multiple endpoints >>&g

Re: usb: dwc3: gadget: skip pullup and set_speed after suspend

2021-01-26 Thread Wesley Cheng
On 1/21/2021 11:15 PM, Jung Daehwan wrote: > On Fri, Jan 22, 2021 03:32, Wesley cheng wrote: >> Hi Daehwan, >> >> If this is an unexpected event where userspace initiates the UDC bind >> sequence, then after the above sequence occurs, the DWC3 device should >>

Re: [PATCH v6 3/4] usb: dwc3: Resize TX FIFOs to meet EP bursting requirements

2021-01-26 Thread Wesley Cheng
On 1/22/2021 4:15 PM, Thinh Nguyen wrote: > Hi, > > Wesley Cheng wrote: >> Some devices have USB compositions which may require multiple endpoints >> that support EP bursting. HW defined TX FIFO sizes may not always be >> sufficient for these compositions. By

Re: [PATCH v6 3/4] usb: dwc3: Resize TX FIFOs to meet EP bursting requirements

2021-01-26 Thread Wesley Cheng
On 1/25/2021 5:55 PM, Bjorn Andersson wrote: > On Mon 25 Jan 19:14 CST 2021, Wesley Cheng wrote: > >> >> >> On 1/22/2021 9:12 AM, Bjorn Andersson wrote: >>> On Thu 21 Jan 22:01 CST 2021, Wesley Cheng wrote: >>> >> >> Hi Bjorn, >>&

Re: [PATCH v6 1/4] usb: gadget: udc: core: Introduce check_config to verify USB configuration

2021-01-26 Thread Wesley Cheng
On 1/21/2021 9:17 PM, Jack Pham wrote: > Hi Wesley, > > On Thu, Jan 21, 2021 at 08:01:37PM -0800, Wesley Cheng wrote: >> Some UDCs may have constraints on how many high bandwidth endpoints it can >> support in a certain configuration. This API allows for the composite &

Re: [PATCH v6 3/4] usb: dwc3: Resize TX FIFOs to meet EP bursting requirements

2021-01-26 Thread Wesley Cheng
On 1/22/2021 9:12 AM, Bjorn Andersson wrote: > On Thu 21 Jan 22:01 CST 2021, Wesley Cheng wrote: > Hi Bjorn, > > Under what circumstances should we specify this? And in particular are > there scenarios (in the Qualcomm platforms) where this must not be set? >The TXFIFO dyn

Re: [PATCH v6 1/4] usb: gadget: udc: core: Introduce check_config to verify USB configuration

2021-01-26 Thread Wesley Cheng
On 1/22/2021 8:24 AM, Alan Stern wrote: > On Thu, Jan 21, 2021 at 08:01:37PM -0800, Wesley Cheng wrote: >> Some UDCs may have constraints on how many high bandwidth endpoints it can >> support in a certain configuration. This API allows for the composite >> driver to pass

[PATCH v3 1/2] lib/cmdline: add new function get_option_ull()

2021-01-22 Thread Wesley Zhao
In the future we would pass the unsigned long long parameter like(0x123456781234) in cmdline on the 64bit platform, so add a new option parse function get_option_ull() Signed-off-by: Wesley Zhao --- include/linux/kernel.h | 2 ++ lib/cmdline.c | 94

[PATCH v3 2/2] resource: Make it possible to reserve memory on 64bit platform

2021-01-22 Thread Wesley Zhao
For now "reserve=" is limitied to 32bit,not available on 64bit platform,so we change the get_option() to get_option_ull(added in patch: commit 4b6bfe96265e ("lib/cmdline: add new function get_option_ull()")) Signed-off-by: Wesley Zhao --- kernel/resource.c | 6 +++--

[PATCH v3 0/2] Make it possible to reserve memory on 64bit platform

2021-01-22 Thread Wesley Zhao
the /proc/iomem with 18000-180123455 : reserved. And some other tests with the get_option with the parameter(-12345678) and so on Wesley Zhao (2): lib/cmdline: add new function get_option_ull() resource: Make it possible to reserve memory on 64bit platform include/linux/kern

[PATCH v6 0/4] Re-introduce TX FIFO resize for larger EP bursting

2021-01-21 Thread Wesley Cheng
t (in MB/s) --- Sequential|1 GB x | Read |9 loops| 287.35 | | 304.94 | | 289.64 | | 293.61 ------- Wesley Cheng (4): usb: gadget: udc: core: Introduce check

[PATCH v6 1/4] usb: gadget: udc: core: Introduce check_config to verify USB configuration

2021-01-21 Thread Wesley Cheng
: Wesley Cheng --- drivers/usb/gadget/udc/core.c | 9 + include/linux/usb/gadget.h| 2 ++ 2 files changed, 11 insertions(+) diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c index 4173acd..469962f 100644 --- a/drivers/usb/gadget/udc/core.c +++ b/drivers/usb

[PATCH v6 2/4] usb: gadget: configfs: Check USB configuration before adding

2021-01-21 Thread Wesley Cheng
Ensure that the USB gadget is able to support the configuration being added based on the number of endpoints required from all interfaces. This is for accounting for any bandwidth or space limitations. Signed-off-by: Wesley Cheng --- drivers/usb/gadget/configfs.c | 22 ++ 1

[PATCH v6 3/4] usb: dwc3: Resize TX FIFOs to meet EP bursting requirements

2021-01-21 Thread Wesley Cheng
helps ensure that the resizing logic can fulfill the configuration(s), or return an error to the gadget layer otherwise during bind time. Signed-off-by: Wesley Cheng --- drivers/usb/dwc3/core.c | 2 + drivers/usb/dwc3/core.h | 8 ++ drivers/usb/dwc3/ep0.c| 2 + drivers/usb/dwc3/gadget.c

[PATCH v6 4/4] arm64: boot: dts: qcom: sm8150: Enable dynamic TX FIFO resize logic

2021-01-21 Thread Wesley Cheng
Enable the flexible TX FIFO resize logic on SM8150. Using a larger TX FIFO SZ can help account for situations when system latency is greater than the USB bus transmission latency. Signed-off-by: Wesley Cheng --- arch/arm64/boot/dts/qcom/sm8150.dtsi | 1 + 1 file changed, 1 insertion(+) diff

Re: usb: dwc3: gadget: skip pullup and set_speed after suspend

2021-01-21 Thread Wesley Cheng
On 1/21/2021 12:13 AM, Jung Daehwan wrote: > On Wed, Jan 20, 2021 at 11:44:05PM -0800, Wesley Cheng wrote: >> >> >> On 1/20/2021 10:49 PM, Jung Daehwan wrote: >>> Hi, >>> >>> On Thu, Jan 21, 2021 at 01:00:32AM +, Thinh Nguyen wrote: >&g

Re: usb: dwc3: gadget: skip pullup and set_speed after suspend

2021-01-20 Thread Wesley Cheng
long flags; >>> u32 reg; >>> >>> + if (pm_runtime_suspended(dwc->dev)) >>> + return; >>> + >>> spin_lock_irqsave(&dwc->lock, flags); >>> reg = dwc3_readl(dwc->regs

[PATCH v2 2/2] resource: Make it possible to reserve memory on 64bit platform

2021-01-16 Thread Wesley Zhao
For now "reserve=" is limitied to 32bit,not available on 64bit platform,so we change the get_option() to get_option_ull(added in patch: commit 4b6bfe96265e ("lib/cmdline: add new function get_option_ull()")) Signed-off-by: Wesley Zhao --- kernel/resource.c | 6 +++--

[PATCH v2 0/2] Make it possible to reserve memory on 64bit platform

2021-01-16 Thread Wesley Zhao
the /proc/iomem with 18000-180123455 : reserved. And some other tests with the get_option with the parameter(-12345678) and so on Wesley Zhao (2): lib/cmdline: add new function get_option_ull() resource: Make it possible to reserve memory on 64bit platform include/linux/kern

[PATCH v2 1/2] lib/cmdline: add new function get_option_ull()

2021-01-16 Thread Wesley Zhao
In the future we would pass the unsigned long long parameter like(0x123456781234) in cmdline on the 64bit platform, so add a new option parse function get_option_ull() Signed-off-by: Wesley Zhao --- include/linux/kernel.h | 2 ++ lib/cmdline.c | 94

[PATCH 2/2] resource: Make it possible to reserve memory on 64bit platform

2021-01-11 Thread Wesley Zhao
From: "Wesley.Zhao" For now "reserve=" is limitied to 32bit,not available on 64bit platform,so we change the get_option() to get_option_ull(added in patch: commit 4b6bfe96265e ("lib/cmdline: add new function get_option_ull()")) Signed-off-by: Wesley.Zhao --- kernel/resource.c | 6 +++--- 1 fil

[PATCH 1/2] lib/cmdline: add new function get_option_ull()

2021-01-11 Thread Wesley Zhao
From: "Wesley.Zhao" In the future we would pass the unsigned long long parameter like(0x123456781234) in cmdline on the 64bit platform, so add a new option parse function get_option_ull() Signed-off-by: Wesley.Zhao --- include/linux/kernel.h | 1 + lib/cmdline.c | 35

Re: [PATCH 3/3] usb: gadget: configfs: Add a specific configFS reset callback

2021-01-04 Thread Wesley Cheng
On 1/4/2021 7:45 AM, Greg KH wrote: > On Tue, Dec 29, 2020 at 03:03:31PM -0800, Wesley Cheng wrote: >> In order for configFS based USB gadgets to set the proper charge current >> for bus reset scenarios, expose a separate reset callback to set the >> current to 100mA bas

[PATCH] PCI:tegra:Correct typo for PCIe endpoint mode in Tegra194

2020-12-30 Thread Wesley Sheng
In config PCIE_TEGRA194_EP the mode incorrectly referred to host mode. Signed-off-by: Wesley Sheng --- drivers/pci/controller/dwc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/Kconfig b/drivers/pci/controller/dwc/Kconfig index

[PATCH v2 0/2] Allow DWC3 runtime suspend if UDC is unbinded

2020-12-29 Thread Wesley Cheng
set_speed() to save the speed being requested, and program it during dwc3_gadget_run_stop(), which is executed during PM runtime resume. If not, previous setting will be overridden as we execute a DWC3 controller reset during PM runtime resume. Wesley Cheng (2): usb: dwc3: gadget: Allow runtime

[PATCH v2 2/2] usb: dwc3: gadget: Preserve UDC max speed setting

2020-12-29 Thread Wesley Cheng
The USB gadget/UDC driver can restrict the DWC3 controller speed using dwc3_gadget_set_speed(). Store this setting into a variable, in order for this setting to persist across controller resets due to runtime PM. Signed-off-by: Wesley Cheng --- drivers/usb/dwc3/core.h | 1 + drivers/usb

[PATCH 3/3] usb: gadget: configfs: Add a specific configFS reset callback

2020-12-29 Thread Wesley Cheng
In order for configFS based USB gadgets to set the proper charge current for bus reset scenarios, expose a separate reset callback to set the current to 100mA based on the USB battery charging specification. Reviewed-by: Peter Chen Signed-off-by: Wesley Cheng --- drivers/usb/gadget/configfs.c

[PATCH v2 1/2] usb: dwc3: gadget: Allow runtime suspend if UDC unbinded

2020-12-29 Thread Wesley Cheng
controller is halted and a disconnect event is never generated. Set the connected flag to false if issuing a device initiated disconnect to allow the controller to be suspended. Signed-off-by: Wesley Cheng --- drivers/usb/dwc3/gadget.c | 13 + 1 file changed, 13 insertions(+) diff --git a

[PATCH 1/3] usb: dwc3: gadget: Introduce a DWC3 VBUS draw callback

2020-12-29 Thread Wesley Cheng
notifier block. Reviewed-by: Peter Chen Signed-off-by: Wesley Cheng --- drivers/usb/dwc3/gadget.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index c145da1d8ba5..69122f66978e 100644 --- a/drivers/usb/dwc3/gadget.c +++ b

[PATCH 2/3] usb: gadget: composite: Split composite reset and disconnect

2020-12-29 Thread Wesley Cheng
100 mA in the connected and UNCONFIGURED state. Reviewed-by: Peter Chen Signed-off-by: Wesley Cheng --- drivers/usb/gadget/composite.c | 21 +++-- include/linux/usb/composite.h | 2 ++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/composite.c

[PATCH 0/3] Add vbus draw support to DWC3

2020-12-29 Thread Wesley Cheng
BC1.2 specification states that this is the max current draw possible when in the connected and unconfigured state. Wesley Cheng (3): usb: dwc3: gadget: Introduce a DWC3 VBUS draw callback usb: gadget: composite: Split composite reset and disconnect usb: gadget: configfs: Add a specific

[PATCH] usb: dwc3: gadget: Restart DWC3 gadget when enabling pullup

2020-12-29 Thread Wesley Cheng
t;usb: dwc3: Stop active transfers before halting the controller") Tested-by: Michael Tretter Reported-by: Michael Tretter Signed-off-by: Wesley Cheng --- drivers/usb/dwc3/gadget.c | 14 +++--- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c

[PATCH] usb: dwc3: gadget: Restart DWC3 gadget when enabling pullup

2020-11-19 Thread Wesley Cheng
t;usb: dwc3: Stop active transfers before halting the controller") Reported-by: Michael Tretter Signed-off-by: Wesley Cheng --- drivers/usb/dwc3/gadget.c | 14 +++--- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadg

Re: [PATCH v4] usb: dwc3: Stop active transfers before halting the controller

2020-11-18 Thread Wesley Cheng
On 11/18/2020 2:14 AM, Michael Tretter wrote: > Hello, > > On Mon, 28 Sep 2020 17:20:59 -0700, Wesley Cheng wrote: >> In the DWC3 databook, for a device initiated disconnect or bus reset, the >> driver is required to send dependxfer commands for any pending transfers. &

[PATCH 3/3] usb: gadget: configfs: Add a specific configFS reset callback

2020-11-14 Thread Wesley Cheng
In order for configFS based USB gadgets to set the proper charge current for bus reset scenarios, expose a separate reset callback to set the current to 100mA based on the USB battery charging specification. Signed-off-by: Wesley Cheng --- drivers/usb/gadget/configfs.c | 24

[PATCH 0/3] Add vbus draw support to DWC3

2020-11-14 Thread Wesley Cheng
BC1.2 specification states that this is the max current draw possible when in the connected and unconfigured state. Wesley Cheng (3): usb: dwc3: gadget: Introduce a DWC3 VBUS draw callback usb: gadget: composite: Split composite reset and disconnect usb: gadget: configfs: Add a specific

[PATCH 1/3] usb: dwc3: gadget: Introduce a DWC3 VBUS draw callback

2020-11-14 Thread Wesley Cheng
notifier block. Signed-off-by: Wesley Cheng --- drivers/usb/dwc3/gadget.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index c145da1d8ba5..69122f66978e 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c

[PATCH 2/3] usb: gadget: composite: Split composite reset and disconnect

2020-11-14 Thread Wesley Cheng
100 mA in the connected and UNCONFIGURED state. Signed-off-by: Wesley Cheng --- drivers/usb/gadget/composite.c | 21 +++-- include/linux/usb/composite.h | 2 ++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget

[PATCH v2 2/2] usb: dwc3: gadget: Preserve UDC max speed setting

2020-11-05 Thread Wesley Cheng
The USB gadget/UDC driver can restrict the DWC3 controller speed using dwc3_gadget_set_speed(). Store this setting into a variable, in order for this setting to persist across controller resets due to runtime PM. Signed-off-by: Wesley Cheng --- drivers/usb/dwc3/core.h | 1 + drivers/usb

[PATCH v2 1/2] usb: dwc3: gadget: Allow runtime suspend if UDC unbinded

2020-11-05 Thread Wesley Cheng
controller is halted and a disconnect event is never generated. Set the connected flag to false if issuing a device initiated disconnect to allow the controller to be suspended. Signed-off-by: Wesley Cheng --- drivers/usb/dwc3/gadget.c | 13 + 1 file changed, 13 insertions(+) diff --git a

[PATCH v2 0/2] Allow DWC3 runtime suspend if UDC is unbinded

2020-11-05 Thread Wesley Cheng
set_speed() to save the speed being requested, and program it during dwc3_gadget_run_stop(), which is executed during PM runtime resume. If not, previous setting will be overridden as we execute a DWC3 controller reset during PM runtime resume. Wesley Cheng (2): usb: dwc3: gadget: Allow runtime

Re: [PATCH 1/2] usb: dwc3: gadget: Allow runtime suspend if UDC unbinded

2020-11-03 Thread Wesley Cheng
On 11/3/2020 12:07 PM, Alan Stern wrote: > On Tue, Nov 03, 2020 at 11:02:25AM -0800, Wesley Cheng wrote: >> >> >> On 10/28/2020 6:07 PM, Alan Stern wrote: >>>> --- a/drivers/usb/dwc3/gadget.c >>>> +++ b/drivers/usb/dwc3/gadget.c >>>> @@

Re: [PATCH 1/2] usb: dwc3: gadget: Allow runtime suspend if UDC unbinded

2020-11-03 Thread Wesley Cheng
On 10/28/2020 6:07 PM, Alan Stern wrote: > On Wed, Oct 28, 2020 at 04:43:10PM -0700, Wesley Cheng wrote: >> The DWC3 runtime suspend routine checks for the USB connected parameter to >> determine if the controller can enter into a low power state. The >> connected state

Re: [PATCH 2/2] usb: dwc3: gadget: Preserve UDC max speed setting

2020-10-28 Thread Wesley Cheng
On 10/28/2020 5:43 PM, Thinh Nguyen wrote: > Hi, > > Wesley Cheng wrote: >> The USB gadget/UDC driver can restrict the DWC3 controller speed using >> dwc3_gadget_set_speed(). Store this setting into a variable, in order for >> this setting to persist across controll

[PATCH 1/2] usb: dwc3: gadget: Allow runtime suspend if UDC unbinded

2020-10-28 Thread Wesley Cheng
controller is halted and a disconnect event is never generated. Set the connected flag to false if issuing a device initiated disconnect to allow the controller to be suspended. Signed-off-by: Wesley Cheng --- drivers/usb/dwc3/gadget.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers

[PATCH 0/2] Allow DWC3 runtime suspend if UDC is unbinded

2020-10-28 Thread Wesley Cheng
me. If not, previous setting will be overridden as we execute a DWC3 controller reset during PM runtime resume. Wesley Cheng (2): usb: dwc3: gadget: Allow runtime suspend if UDC unbinded usb: dwc3: gadget: Preserve UDC max speed setting drivers/usb/dwc3/core.h | 1 + dr

[PATCH 2/2] usb: dwc3: gadget: Preserve UDC max speed setting

2020-10-28 Thread Wesley Cheng
The USB gadget/UDC driver can restrict the DWC3 controller speed using dwc3_gadget_set_speed(). Store this setting into a variable, in order for this setting to persist across controller resets due to runtime PM. Signed-off-by: Wesley Cheng --- drivers/usb/dwc3/core.h | 1 + drivers/usb

Re: [PATCH v10 4/4] arm64: boot: dts: qcom: pm8150b: Add DTS node for PMIC VBUS booster

2020-10-14 Thread Wesley Cheng
On 10/13/2020 8:03 AM, Rob Herring wrote: > On Thu, Oct 08, 2020 at 04:59:34PM -0700, Wesley Cheng wrote: >> Add the required DTS node for the USB VBUS output regulator, which is >> available on PM8150B. This will provide the VBUS source to connected >> peripherals. >&g

Re: [PATCH v10 2/4] dt-bindings: usb: Add Qualcomm PMIC type C controller dt-binding

2020-10-14 Thread Wesley Cheng
On 10/13/2020 8:00 AM, Rob Herring wrote: > On Thu, Oct 08, 2020 at 04:59:32PM -0700, Wesley Cheng wrote: >> Introduce the dt-binding for enabling USB type C orientation and role >> detection using the PM8150B. The driver will be responsible for receiving >> the interrupt

[PATCH v2 0/4] Enable USB type C support on SM8150

2020-10-09 Thread Wesley Cheng
. This event will then be propagated down to the DWC3 core driver, by the DWC3 QCOM getting a handle to the DWC3 core's role switch. Wesley Cheng (4): arm64: boot: dts: qcom: sm8150: Add nodes for PMIC based typec detection phy: qcom-qmp: Register as a typec switch for orientation dete

[PATCH v2 4/4] usb: dwc3: dwc3-qcom: Fix typo in the dwc3 vbus override API

2020-10-09 Thread Wesley Cheng
There was an extra character in the dwc3_qcom_vbus_override_enable() function. Removed the extra character. Signed-off-by: Wesley Cheng --- drivers/usb/dwc3/dwc3-qcom.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb

[PATCH v2 2/4] phy: qcom-qmp: Register as a typec switch for orientation detection

2020-10-09 Thread Wesley Cheng
The lane select switch for USB typec orientation is within the USB QMP PHY. the current device. It could be connected through an endpoint, to an independent device handling the typec detection, ie the QCOM SPMI typec driver. Signed-off-by: Wesley Cheng --- drivers/phy/qualcomm/Kconfig

[PATCH v2 1/4] arm64: boot: dts: qcom: sm8150: Add nodes for PMIC based typec detection

2020-10-09 Thread Wesley Cheng
Introduce required child nodes to enable the PMIC based USB type C driver. This consits of connector and endpoint nodes to drivers, which manage the type C mux and the USB role switch. Signed-off-by: Wesley Cheng --- arch/arm64/boot/dts/qcom/sm8150-mtp.dts | 40 - 1 file

[PATCH v2 3/4] usb: dwc3: dwc3-qcom: Find USB connector and register role switch

2020-10-09 Thread Wesley Cheng
well as attain a reference to the DWC3 core role switch to pass the event down. Signed-off-by: Wesley Cheng --- drivers/usb/dwc3/dwc3-qcom.c | 120 ++- 1 file changed, 118 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3

[PATCH v10 2/4] dt-bindings: usb: Add Qualcomm PMIC type C controller dt-binding

2020-10-08 Thread Wesley Cheng
include a role switch node and a type C switch. Signed-off-by: Wesley Cheng --- .../bindings/usb/qcom,pmic-typec.yaml | 115 ++ 1 file changed, 115 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml diff --git a/Documentation/devicetree

[PATCH v10 1/4] usb: typec: Add QCOM PMIC typec detection driver

2020-10-08 Thread Wesley Cheng
it can enable/disable the VBUS source when acting as a host/device. Signed-off-by: Wesley Cheng Acked-by: Heikki Krogerus Reviewed-by: Stephen Boyd --- drivers/usb/typec/Kconfig | 12 ++ drivers/usb/typec/Makefile | 1 + drivers/usb/typec/qcom-pmic-typec.c | 262

[PATCH v10 4/4] arm64: boot: dts: qcom: pm8150b: Add DTS node for PMIC VBUS booster

2020-10-08 Thread Wesley Cheng
Add the required DTS node for the USB VBUS output regulator, which is available on PM8150B. This will provide the VBUS source to connected peripherals. Signed-off-by: Wesley Cheng --- arch/arm64/boot/dts/qcom/pm8150b.dtsi | 6 ++ arch/arm64/boot/dts/qcom/sm8150-mtp.dts | 4 2 files

[PATCH v10 0/4] Introduce PMIC based USB type C detection

2020-10-08 Thread Wesley Cheng
C type C driver will register itself as a type C port w/ a registered type C switch for orientation, and will fetch a USB role switch handle for the role notifications. It will also have the ability to enable the VBUS output to any connected devices based on if the device is behaving as a UFP or DF

  1   2   3   4   >