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

2019-07-29 Thread John Stultz
On Tue, Jul 23, 2019 at 1:27 PM John Stultz wrote: > > From: 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 mu

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

2019-07-23 Thread John Stultz
Joglekar Reviewed-by: Thinh Nguyen Signed-off-by: Anurag Kumar Vulisha [jstultz: forward ported to mainline, added note to commit log] Signed-off-by: John Stultz --- Just wanted to send this out so we're all looking at the same thing. Not sure if its correct, but it seems to solve the adb s

Re: [PATCH v3] usb: dwc3: gadget: trb_dequeue is not updated properly

2019-07-23 Thread John Stultz
On Thu, Jul 18, 2019 at 6:12 PM Thinh Nguyen wrote: > fei.y...@intel.com wrote: > > From: Fei Yang > > > > If scatter-gather operation is allowed, a large USB request is split into > > multiple TRBs. These TRBs are chained up by setting DWC3_TRB_CTRL_CHN bit > > except the last one which has DWC3

Re: [PATCH 4.19.y v2 0/9] Fix scheduling while atomic in dwc3_gadget_ep_dequeue

2019-06-28 Thread John Stultz
On Fri, Jun 28, 2019 at 3:58 PM Sasha Levin wrote: > > On Fri, Jun 28, 2019 at 06:24:04PM +, John Stultz wrote: > >With recent changes in AOSP, adb is using asynchronous io, which > >causes the following crash usually on a reboot: > > > >[ 184.278302] BUG: sche

[PATCH 4.19.y v2 6/9] usb: dwc3: gadget: introduce cancelled_list

2019-06-28 Thread John Stultz
Balbi (cherry picked from commit d5443bbf5fc8f8389cce146b1fc2987cdd229d12) Signed-off-by: John Stultz --- 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 a/drivers/usb/dwc3/core.h b

[PATCH 4.19.y v2 8/9] usb: dwc3: gadget: remove wait_end_transfer

2019-06-28 Thread John Stultz
# 4.19.y Signed-off-by: Felipe Balbi (cherry picked from commit fec9095bdef4e7c988adb603d0d4f92ee735d4a1) Signed-off-by: John Stultz --- drivers/usb/dwc3/core.h | 3 --- drivers/usb/dwc3/gadget.c | 40 +-- 2 files changed, 1 insertion(+), 42 deletions(-) diff

[PATCH 4.19.y v2 7/9] usb: dwc3: gadget: move requests to cancelled_list

2019-06-28 Thread John Stultz
@vger.kernel.org Cc: sta...@vger.kernel.org # 4.19.y Signed-off-by: Felipe Balbi (cherry picked from commit d4f1afe5e896c18ae01099a85dab5e1a198bd2a8) Signed-off-by: John Stultz --- drivers/usb/dwc3/gadget.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers

[PATCH 4.19.y v2 1/9] Revert "usb: dwc3: gadget: Clear req->needs_extra_trb flag on cleanup"

2019-06-28 Thread John Stultz
: linux-usb@vger.kernel.org Cc: sta...@vger.kernel.org # 4.19.y Signed-off-by: John Stultz --- drivers/usb/dwc3/gadget.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 65ba1038b111..eaa78e6c972c 100644 --- a/drivers/usb/dwc3/gadget.c

[PATCH 4.19.y v2 9/9] usb: dwc3: gadget: Clear req->needs_extra_trb flag on cleanup

2019-06-28 Thread John Stultz
") Cc: Fei Yang Cc: Sam Protsenko Cc: Felipe Balbi Cc: linux-usb@vger.kernel.org Cc: sta...@vger.kernel.org # 4.19.y Signed-off-by: Jack Pham Signed-off-by: Felipe Balbi (cherry picked from commit bd6742249b9ca918565e4e3abaa06665e587f4b5) Signed-off-by: John Stultz --- drivers/usb/dwc3/ga

[PATCH 4.19.y v2 0/9] Fix scheduling while atomic in dwc3_gadget_ep_dequeue

2019-06-28 Thread John Stultz
usb: dwc3: gadget: extract dwc3_gadget_ep_skip_trbs() usb: dwc3: gadget: introduce cancelled_list usb: dwc3: gadget: move requests to cancelled_list usb: dwc3: gadget: remove wait_end_transfer Jack Pham (1): usb: dwc3: gadget: Clear req->needs_extra_trb flag on cleanup John Stultz (1): Rever

[PATCH 4.19.y v2 5/9] usb: dwc3: gadget: extract dwc3_gadget_ep_skip_trbs()

2019-06-28 Thread John Stultz
Protsenko Cc: Felipe Balbi Cc: linux-usb@vger.kernel.org Cc: sta...@vger.kernel.org # 4.19.y Signed-off-by: Felipe Balbi (cherry picked from commit 7746a8dfb3f9c91b3a0b63a1d5c2664410e6498d) Signed-off-by: John Stultz --- drivers/usb/dwc3/gadget.c | 61 +++ 1 file

[PATCH 4.19.y v2 3/9] usb: dwc3: gadget: track number of TRBs per request

2019-06-28 Thread John Stultz
rry picked from commit 09fe1f8d7e2f461275b1cdd832f2cfa5e9be346d) Signed-off-by: John Stultz --- 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 4872cba8699b..0de78cb29

[PATCH 4.19.y v2 4/9] usb: dwc3: gadget: use num_trbs when skipping TRBs on ->dequeue()

2019-06-28 Thread John Stultz
Cc: linux-usb@vger.kernel.org Cc: sta...@vger.kernel.org # 4.19.y Signed-off-by: Felipe Balbi (cherry picked from commit c3acd59014148470dc58519870fbc779785b4bf7) Signed-off-by: John Stultz --- drivers/usb/dwc3/gadget.c | 28 1 file changed, 4 insertions(+), 24

[PATCH 4.19.y v2 2/9] usb: dwc3: gadget: combine unaligned and zero flags

2019-06-28 Thread John Stultz
should be treated equally. Cc: Fei Yang Cc: Sam Protsenko Cc: Felipe Balbi Cc: linux-usb@vger.kernel.org Cc: sta...@vger.kernel.org # 4.19.y Signed-off-by: Felipe Balbi (cherry picked from commit 1a22ec643580626f439c8583edafdcc73798f2fb) Signed-off-by: John Stultz --- drivers/usb/dwc3/core.h

Re: [PATCH 4.19.y 0/9] Fix scheduling while atomic in dwc3_gadget_ep_dequeue

2019-06-28 Thread John Stultz
On Fri, Jun 28, 2019 at 3:10 AM Gopal, Saranya wrote: > > > With recent changes in AOSP, adb is using asynchronous io, which > > causes the following crash usually on a reboot: > > > > [ 184.278302] BUG: scheduling while atomic: ksoftirqd/0/9/0x0104 > > [ 184.284617] Modules linked in: wl18x

Re: [PATCH 4.19.y 8/9] Revert "usb: dwc3: gadget: Clear req->needs_extra_trb flag on cleanup"

2019-06-28 Thread John Stultz
On Thu, Jun 27, 2019 at 10:54 PM Jack Pham wrote: > On Thu, Jun 27, 2019 at 08:52:39PM +0000, John Stultz wrote: > > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c > > index 879f652c5580..843586f20572 100644 > > --- a/drivers/usb/dwc3/gadget.c >

[PATCH 4.19.y 8/9] Revert "usb: dwc3: gadget: Clear req->needs_extra_trb flag on cleanup"

2019-06-27 Thread John Stultz
-by: John Stultz --- drivers/usb/dwc3/gadget.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 879f652c5580..843586f20572 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -177,8 +177,6 @@ static void

[PATCH 4.19.y 7/9] usb: dwc3: gadget: remove wait_end_transfer

2019-06-27 Thread John Stultz
# 4.19.y Signed-off-by: Felipe Balbi (cherry picked from commit fec9095bdef4e7c988adb603d0d4f92ee735d4a1) Signed-off-by: John Stultz --- drivers/usb/dwc3/core.h | 3 --- drivers/usb/dwc3/gadget.c | 40 +-- 2 files changed, 1 insertion(+), 42 deletions(-) diff

[PATCH 4.19.y 2/9] usb: dwc3: gadget: track number of TRBs per request

2019-06-27 Thread John Stultz
rry picked from commit 09fe1f8d7e2f461275b1cdd832f2cfa5e9be346d) Signed-off-by: John Stultz --- 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 4872cba8699b..0de78cb29

[PATCH 4.19.y 1/9] usb: dwc3: gadget: combine unaligned and zero flags

2019-06-27 Thread John Stultz
should be treated equally. Cc: Fei Yang Cc: Sam Protsenko Cc: Felipe Balbi Cc: linux-usb@vger.kernel.org Cc: sta...@vger.kernel.org # 4.19.y Signed-off-by: Felipe Balbi (cherry picked from commit 1a22ec643580626f439c8583edafdcc73798f2fb) Signed-off-by: John Stultz --- drivers/usb/dwc3/core.h

[PATCH 4.19.y 3/9] usb: dwc3: gadget: use num_trbs when skipping TRBs on ->dequeue()

2019-06-27 Thread John Stultz
Cc: linux-usb@vger.kernel.org Cc: sta...@vger.kernel.org # 4.19.y Signed-off-by: Felipe Balbi (cherry picked from commit c3acd59014148470dc58519870fbc779785b4bf7) Signed-off-by: John Stultz --- drivers/usb/dwc3/gadget.c | 28 1 file changed, 4 insertions(+), 24

[PATCH 4.19.y 6/9] usb: dwc3: gadget: move requests to cancelled_list

2019-06-27 Thread John Stultz
@vger.kernel.org Cc: sta...@vger.kernel.org # 4.19.y Signed-off-by: Felipe Balbi (cherry picked from commit d4f1afe5e896c18ae01099a85dab5e1a198bd2a8) Signed-off-by: John Stultz --- drivers/usb/dwc3/gadget.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers

[PATCH 4.19.y 9/9] usb: dwc3: gadget: Clear req->needs_extra_trb flag on cleanup

2019-06-27 Thread John Stultz
") Cc: Fei Yang Cc: Sam Protsenko Cc: Felipe Balbi Cc: linux-usb@vger.kernel.org Cc: sta...@vger.kernel.org # 4.19.y Signed-off-by: Jack Pham Signed-off-by: Felipe Balbi (cherry picked from commit bd6742249b9ca918565e4e3abaa06665e587f4b5) Signed-off-by: John Stultz --- drivers/usb/dwc3/ga

[PATCH 4.19.y 4/9] usb: dwc3: gadget: extract dwc3_gadget_ep_skip_trbs()

2019-06-27 Thread John Stultz
Protsenko Cc: Felipe Balbi Cc: linux-usb@vger.kernel.org Cc: sta...@vger.kernel.org # 4.19.y Signed-off-by: Felipe Balbi (cherry picked from commit 7746a8dfb3f9c91b3a0b63a1d5c2664410e6498d) Signed-off-by: John Stultz --- drivers/usb/dwc3/gadget.c | 61 +++ 1 file

[PATCH 4.19.y 0/9] Fix scheduling while atomic in dwc3_gadget_ep_dequeue

2019-06-27 Thread John Stultz
wait_end_transfer Jack Pham (1): usb: dwc3: gadget: Clear req->needs_extra_trb flag on cleanup John Stultz (1): Revert "usb: dwc3: gadget: Clear req->needs_extra_trb flag on cleanup" drivers/usb/dwc3/core.h | 15 ++-- drivers/usb/dwc3/gadget.c | 158 +

[PATCH 4.19.y 5/9] usb: dwc3: gadget: introduce cancelled_list

2019-06-27 Thread John Stultz
Balbi (cherry picked from commit d5443bbf5fc8f8389cce146b1fc2987cdd229d12) Signed-off-by: John Stultz --- 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 a/drivers/usb/dwc3/core.h b

Re: [REGRESSION] usb: gadget: f_fs: Allow scatter-gather buffers

2019-05-13 Thread John Stultz
On Mon, May 13, 2019 at 7:08 AM Andrzej Pietrasiewicz wrote: > W dniu 09.05.2019 o 23:23, John Stultz pisze: > > So yes, the kzalloc/memset patch is a clear improvement, as it avoids > > the bootup crash on dwc2, and seems like it should go in. > > > > However, the

REGRESSION: dwc2: gadget: Add scatter-gather mode

2019-03-08 Thread John Stultz
Hey Andrzej, I just wanted to let you know, trying to boot linus/master on the hikey board today, I've been seeing lots of errors on boot (which sometimes crash the board, and sometimes doesn't). See the example below. I've bisected the issue down to 10209abe87f5 ("usb: dwc2: gadget: Add scatter

Re: [PATCH v3 10/12] hikey960: Support usb functionality of Hikey960

2019-03-03 Thread John Stultz
On Sat, Mar 2, 2019 at 4:05 AM Yu Chen wrote: > +static int hisi_hikey_usb_probe(struct platform_device *pdev) > +{ > + struct device *dev = &pdev->dev; > + struct device_node *root = dev->of_node; Minor nit: root is unused and generates build warnings. thanks -john

[RFC][PATCH] usb: f_fs: Avoid crash due to out-of-scope stack ptr access

2019-02-05 Thread John Stultz
er Cc: Andrzej Pietrasiewicz Cc: Greg Kroah-Hartman Cc: Linux USB List Suggested-by: Alan Stern Signed-off-by: John Stultz --- drivers/usb/gadget/function/f_fs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index 1e5

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

2019-02-04 Thread John Stultz
On Sat, Feb 2, 2019 at 9:00 AM Alan Stern wrote: > > On Fri, 1 Feb 2019, 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 >

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

2019-02-01 Thread John Stultz
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: gadget: remove wait_end_transfer"). > &g

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

2019-02-01 Thread John Stultz
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

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

2019-02-01 Thread John Stultz
On Fri, Feb 1, 2019 at 4:31 PM Thinh Nguyen wrote: > > 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 > &

Frequent dwc3 crashes on suspend or reboot since 5.0-rc1

2019-02-01 Thread John Stultz
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(): https://git.kernel.org/pub/scm/linux/ke

Re: [PATCH] usb: dwc2: Fix HiKey regression caused by power_down feature

2018-09-28 Thread John Stultz
On Thu, Sep 27, 2018 at 5:33 AM, Artur Petrosyan wrote: > We would like to buy the HiKey board to perform testes. > We found this HiKey LeMaker to have USB 2.0 ports > https://www.ebay.com/itm/HiKey-LeMaker-version-2GB-Kirin-620-SoC-8-core-ARM-Cortex-A53-CPU-ARM-Mali-450/263958047308?hash=item3d75

Re: [PATCH] usb: dwc2: Fix HiKey regression caused by power_down feature

2018-09-25 Thread John Stultz
On Tue, Sep 25, 2018 at 3:04 AM, Artur Petrosyan wrote: > Just a clarification by this commit "[PATCH] usb: dwc2: Fix HiKey > regression caused by power_down feature" > https://marc.info/?l=linux-usb&m=152669095513248&w=2 > > the power_down is disabled setting "p->power_down = false;" in > "dwc2_s

Re: [PATCH] usb: dwc2: Fix HiKey regression caused by power_down feature

2018-09-24 Thread John Stultz
On Sun, Sep 23, 2018 at 10:57 PM, Artur Petrosyan wrote: > Hi John, > > On 9/21/2018 05:05, John Stultz wrote: >> On Thu, Sep 20, 2018 at 7:17 AM, Artur Petrosyan >> wrote: >>> On 5/23/2018 01:57, John Stultz wrote: >>>> Its done automatically,

Re: [PATCH] usb: dwc2: Fix HiKey regression caused by power_down feature

2018-09-20 Thread John Stultz
On Thu, Sep 20, 2018 at 7:17 AM, Artur Petrosyan wrote: > On 5/23/2018 01:57, John Stultz wrote: >> Its done automatically, when the OTG cable is detected it the host >> ports are disabled and when the OTG port is empty the host ports are >> enabled. >> >> Let

Re: [PATCH] usb: dwc2: Fix HiKey regression caused by power_down feature

2018-05-22 Thread John Stultz
for the reset to complete and the mouse to be detected before re-plugging in the OTG port. > On 5/21/2018 11:41 PM, John Stultz wrote: >> On Mon, May 21, 2018 at 1:45 AM, Minas Harutyunyan >> wrote: >>> Hi John, >>> >>> On 5/19/2018 4:49 AM, John Stultz

[PATCH v2] usb: dwc2: Fix HiKey regression caused by power_down feature

2018-05-21 Thread John Stultz
gets thing working again. Cc: John Youn Cc: Minas Harutyunyan Cc: Artur Petrosyan Cc: Grigor Tovmasyan Cc: Felipe Balbi Cc: linux-usb@vger.kernel.org Signed-off-by: John Stultz --- v2: Use DWC2_POWER_DOWN_PARAM_NONE as suggested by Minas --- drivers/usb/dwc2/params.c | 1 + 1 file changed, 1

Re: [PATCH] usb: dwc2: Fix HiKey regression caused by power_down feature

2018-05-21 Thread John Stultz
On Mon, May 21, 2018 at 1:45 AM, Minas Harutyunyan wrote: > Hi John, > > On 5/19/2018 4:49 AM, John Stultz wrote: >> In 4.17-rc, commit 03ea6d6e9e1f ("usb: dwc2: Enable power down") >> caused the HiKey board to not correctly handle switching between

[PATCH] usb: dwc2: Fix HiKey regression caused by power_down feature

2018-05-18 Thread John Stultz
gets thing working again. Cc: John Youn Cc: Vardan Mikayelyan Cc: Artur Petrosyan Cc: Grigor Tovmasyan Cc: Felipe Balbi Cc: linux-usb@vger.kernel.org Signed-off-by: John Stultz --- drivers/usb/dwc2/params.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/dwc2/params.c b/driver

Re: [RESEND x2][PATCH 0/3] dwc2 fixes for edge cases on hikey

2017-10-23 Thread John Stultz
On Mon, Oct 23, 2017 at 1:41 PM, John Stultz wrote: > On Mon, Oct 23, 2017 at 2:19 AM, Minas Harutyunyan > wrote: >> Could you please verify on your setup follow patches: >> 1. Vardan's patch. >> 2. Patch for TOUTCAL&USBTRDTIM programming (new version see belo

[PATCH 3/3 v2] usb: dwc2: Fix UDC state tracking

2017-10-23 Thread John Stultz
Cc: Minas Harutyunyan Cc: Douglas Anderson Cc: Chen Yu Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Tested by: Minas Harutyunyan Reported-by: Amit Pundir Signed-off-by: John Stultz --- drivers/usb/dwc2/gadget.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/

[PATCH v2 0/3] dwc2 fixes for edge cases on hikey

2017-10-23 Thread John Stultz
Harutyunyan Cc: Douglas Anderson Cc: Chen Yu Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org John Stultz (3): usb: dwc2: Improve gadget state disconnection handling usb: dwc2: Error out of dwc2_hsotg_ep_disable() if we're in host mode usb: dwc2: Fix UDC state tr

[PATCH 1/3 v2] usb: dwc2: Improve gadget state disconnection handling

2017-10-23 Thread John Stultz
rtman Cc: linux-usb@vger.kernel.org Signed-off-by: John Stultz --- v2: Remove the extra dwc2_hsotg_core_init_disconnected() call I had added, as suggested by Minas. --- drivers/usb/dwc2/hcd.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/

[PATCH 2/3 v2] usb: dwc2: Error out of dwc2_hsotg_ep_disable() if we're in host mode

2017-10-23 Thread John Stultz
c: YongQin Liu Cc: John Youn Cc: Minas Harutyunyan Cc: Douglas Anderson Cc: Chen Yu Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Tested by: Minas Harutyunyan Reported-by: YongQin Liu Signed-off-by: John Stultz --- drivers/usb/dwc2/gadget.c | 5 + 1 file changed, 5

Re: [RESEND x2][PATCH 0/3] dwc2 fixes for edge cases on hikey

2017-10-23 Thread John Stultz
On Mon, Oct 23, 2017 at 2:19 AM, Minas Harutyunyan wrote: > Could you please verify on your setup follow patches: > 1. Vardan's patch. > 2. Patch for TOUTCAL&USBTRDTIM programming (new version see below). > 4. Your patch 2/3 to avoid "Mode Mismatch" interrupts. > 5. Your patch 3/3 to set udc state

Re: [RESEND x2][PATCH 0/3] dwc2 fixes for edge cases on hikey

2017-10-19 Thread John Stultz
On Wed, Oct 18, 2017 at 11:46 PM, Minas Harutyunyan wrote: > Could you please apply this patch. Please not apply your patch series > "[PATCH 0/3] dwc2 fixes for edge cases on hikey" to check only below patch. > If you confirm that this patch fix your issue with "Transaction Error" > and " ChHltd s

Re: [RESEND x2][PATCH 0/3] dwc2 fixes for edge cases on hikey

2017-10-19 Thread John Stultz
On Tue, Oct 17, 2017 at 1:41 AM, Minas Harutyunyan wrote: > On 10/17/2017 1:34 AM, John Stultz wrote: >> On Mon, Oct 16, 2017 at 1:36 AM, Minas Harutyunyan >> wrote: >>> On b-plug disconnect should asserted GOTGINT.SesEndDet interrupt. >>> According previously s

Re: [RESEND x2][PATCH 0/3] dwc2 fixes for edge cases on hikey

2017-10-16 Thread John Stultz
On Mon, Oct 16, 2017 at 1:36 AM, Minas Harutyunyan wrote: > On b-plug disconnect should asserted GOTGINT.SesEndDet interrupt. > According previously sent by you register dump (GHWCFG2 = 0x23affc70) > your core OTG_MODE=0. > Bellow fragment from programming guide on Device disconnect: > > "7.3Devic

Re: [RESEND x2][PATCH 0/3] dwc2 fixes for edge cases on hikey

2017-10-12 Thread John Stultz
On Thu, Oct 12, 2017 at 12:59 AM, Minas Harutyunyan wrote: > > 1. Vardan's patch fixing issue when dwc2 switched from host to device > mode. It's allow to make functional device after reconnecting without > tracking UDC state. While I'm sure Vardan's patch is useful, I worry that its resolving a

Re: [RESEND x2][PATCH 0/3] dwc2 fixes for edge cases on hikey

2017-10-09 Thread John Stultz
On Tue, Oct 3, 2017 at 2:58 AM, Minas Harutyunyan wrote: > > Could you please apply patch from Vardan Mikayelyan "usb: dwc2: Fix > dwc2_hsotg_core_init_disconnected()" submitted at 02/25/2017 > (https://marc.info/?l=linux-usb&m=148801589931039&w=2) instead of your > "usb: dwc2: Improve gadget stat

[RESEND x2][PATCH 3/3] usb: dwc2: Fix UDC state tracking

2017-09-20 Thread John Stultz
port to the UDC layer when the gadget device is disconnected. Cc: Wei Xu Cc: Guodong Xu Cc: Amit Pundir Cc: YongQin Liu Cc: John Youn Cc: Minas Harutyunyan Cc: Douglas Anderson Cc: Chen Yu Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Reported-by: Amit Pundir Sign

[RESEND x2][PATCH 2/3] usb: dwc2: Error out of dwc2_hsotg_ep_disable() if we're in host mode

2017-09-20 Thread John Stultz
put on what the right approach should be. Cc: Wei Xu Cc: Guodong Xu Cc: Amit Pundir Cc: YongQin Liu Cc: John Youn Cc: Minas Harutyunyan Cc: Douglas Anderson Cc: Chen Yu Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Reported-by: YongQin Liu Signed-off-by: John St

[RESEND x2][PATCH 0/3] dwc2 fixes for edge cases on hikey

2017-09-20 Thread John Stultz
Wei Xu Cc: Guodong Xu Cc: Amit Pundir Cc: YongQin Liu Cc: John Youn Cc: Minas Harutyunyan Cc: Douglas Anderson Cc: Chen Yu Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org John Stultz (3): usb: dwc2: Improve gadget state disconnection handling usb

[RESEND x2][PATCH 1/3] usb: dwc2: Improve gadget state disconnection handling

2017-09-20 Thread John Stultz
Cc: Chen Yu Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Signed-off-by: John Stultz --- drivers/usb/dwc2/hcd.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index c263114..df54428 100644 --

[RESEND][PATCH 1/3] usb: dwc2: Improve gadget state disconnection handling

2017-09-06 Thread John Stultz
Cc: Chen Yu Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Signed-off-by: John Stultz --- drivers/usb/dwc2/hcd.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index c263114..df54428 100644 --

[RESEND][PATCH 0/3] dwc2 fixes for edge cases on hikey

2017-09-06 Thread John Stultz
Wei Xu Cc: Guodong Xu Cc: Amit Pundir Cc: YongQin Liu Cc: John Youn Cc: Minas Harutyunyan Cc: Douglas Anderson Cc: Chen Yu Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org John Stultz (3): usb: dwc2: Improve gadget state disconnection handling usb

[RESEND][PATCH 2/3] usb: dwc2: Error out of dwc2_hsotg_ep_disable() if we're in host mode

2017-09-06 Thread John Stultz
put on what the right approach should be. Cc: Wei Xu Cc: Guodong Xu Cc: Amit Pundir Cc: YongQin Liu Cc: John Youn Cc: Minas Harutyunyan Cc: Douglas Anderson Cc: Chen Yu Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Reported-by: YongQin Liu Signed-off-by: John St

[RESEND][PATCH 3/3] usb: dwc2: Fix UDC state tracking

2017-09-06 Thread John Stultz
port to the UDC layer when the gadget device is disconnected. Cc: Wei Xu Cc: Guodong Xu Cc: Amit Pundir Cc: YongQin Liu Cc: John Youn Cc: Minas Harutyunyan Cc: Douglas Anderson Cc: Chen Yu Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Reported-by: Amit Pundir Sign

Re: [PATCH 1/3] usb: dwc2: Improve gadget state disconnection handling

2017-08-25 Thread John Stultz
On Thu, Aug 17, 2017 at 12:03 PM, John Stultz wrote: > In the earlier commit dad3f793f20f ("usb: dwc2: Make sure we > disconnect the gadget state"), I was trying to fix up the > fact that we somehow weren't disconnecting the gadget state, > so that when the OTG port was

[PATCH 3/3] usb: dwc2: Error out of dwc2_hsotg_ep_disable() if we're in host mode

2017-08-17 Thread John Stultz
put on what the right approach should be. Cc: Wei Xu Cc: Guodong Xu Cc: Amit Pundir Cc: YongQin Liu Cc: John Youn Cc: Minas Harutyunyan Cc: Douglas Anderson Cc: Chen Yu Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Reported-by: YongQin Liu Signed-off-by: John St

[PATCH 2/3] usb: dwc2: Fix UDC state tracking

2017-08-17 Thread John Stultz
port to the UDC layer when the gadget device is disconnected. Cc: Wei Xu Cc: Guodong Xu Cc: Amit Pundir Cc: YongQin Liu Cc: John Youn Cc: Minas Harutyunyan Cc: Douglas Anderson Cc: Chen Yu Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Reported-by: Amit Pundir Sign

[PATCH 1/3] usb: dwc2: Improve gadget state disconnection handling

2017-08-17 Thread John Stultz
Cc: Chen Yu Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Signed-off-by: John Stultz --- drivers/usb/dwc2/hcd.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 740c7e8..9fd84a9 100644 --

Re: unregister_netdevice: waiting for eth0 to become free. Usage count = 1

2017-08-11 Thread John Stultz
On Fri, Aug 11, 2017 at 5:31 PM, John Stultz wrote: > On Fri, Aug 11, 2017 at 5:10 PM, Wei Wang wrote: >>> If after Cong's fix, the issue still happens, could you help try the >>> patch attached and collect all logs when you try the reproduce the >>> issue?

Re: unregister_netdevice: waiting for eth0 to become free. Usage count = 1

2017-08-11 Thread John Stultz
On Fri, Aug 11, 2017 at 5:10 PM, Wei Wang wrote: >> If after Cong's fix, the issue still happens, could you help try the >> patch attached and collect all logs when you try the reproduce the >> issue? It would be great to have logs for both success case and the >> failure case. >> >> Thanks so muc

Re: unregister_netdevice: waiting for eth0 to become free. Usage count = 1

2017-08-10 Thread John Stultz
On Wed, Aug 9, 2017 at 10:41 PM, Wei Wang wrote: > Hi John, > > Is it possible to try the attached patch? Thanks so much for the quick turn around! So I dropped all the reverts you suggested, and applied this one against 4.13-rc4, but I'm still seeing the problematic behavior. > I am not sure i

[RFC][PATCH] usb: dwc2: Error out of dwc2_hsotg_ep_disable() if we're in host mode

2017-08-09 Thread John Stultz
out for input on what the right approach should be. Cc: Wei Xu Cc: Guodong Xu Cc: Amit Pundir Cc: YongQin Liu Cc: John Youn Cc: Minas Harutyunyan Cc: Douglas Anderson Cc: Chen Yu Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Reported-by: YongQin Liu Signed-off-by: Joh

Re: unregister_netdevice: waiting for eth0 to become free. Usage count = 1

2017-08-09 Thread John Stultz
On Wed, Aug 9, 2017 at 5:36 PM, Wei Wang wrote: > On Wed, Aug 9, 2017 at 4:44 PM, John Stultz wrote: >> On Wed, Aug 9, 2017 at 4:34 PM, Cong Wang wrote: >>> (Cc'ing Wei whose commit was blamed) >>> >>> On Mon, Aug 7, 2017 at 2:15 PM, John Stultz wrote:

Re: unregister_netdevice: waiting for eth0 to become free. Usage count = 1

2017-08-09 Thread John Stultz
On Wed, Aug 9, 2017 at 5:36 PM, Wei Wang wrote: > > Does your USB adapter get an IPv6 address? Yes, it does. > If you see the problem starts to happen on commit > 9514528d92d4cbe086499322370155ed69f5d06c, could you try reverting all > the following commits: > (from new to old) > 1eb04e7c9e63 net

Re: unregister_netdevice: waiting for eth0 to become free. Usage count = 1

2017-08-09 Thread John Stultz
On Wed, Aug 9, 2017 at 4:34 PM, Cong Wang wrote: > (Cc'ing Wei whose commit was blamed) > > On Mon, Aug 7, 2017 at 2:15 PM, John Stultz wrote: >> On Mon, Aug 7, 2017 at 2:05 PM, John Stultz wrote: >>> So, with recent testing with my HiKey board, I've been noti

Re: [PATCH] arm64: dts: hi6220: improve g-tx-fifo-size setting for usb device

2017-08-07 Thread John Stultz
, because even fifo entries for one EP exceeds the >total entries 1920. That's why we see the following fat warning from >function dwc2_hsotg_init_fifo(). The new g-tx-fifo-size settings >help to remove the warning as well. Nice! This has been bothering me for awhile, and your

Re: unregister_netdevice: waiting for eth0 to become free. Usage count = 1

2017-08-07 Thread John Stultz
On Mon, Aug 7, 2017 at 2:05 PM, John Stultz wrote: > So, with recent testing with my HiKey board, I've been noticing some > quirky behavior with my USB eth adapter. > > Basically, pluging the usb eth adapter in and then removing it, when > plugging it back in I often find t

unregister_netdevice: waiting for eth0 to become free. Usage count = 1

2017-08-07 Thread John Stultz
So, with recent testing with my HiKey board, I've been noticing some quirky behavior with my USB eth adapter. Basically, pluging the usb eth adapter in and then removing it, when plugging it back in I often find that its not detected, and the system slowly spits out the following message over and

[RFC][PATCH 1/2] usb: dwc2: Improve gadget state disconnection handling

2017-08-03 Thread John Stultz
: John Youn Cc: Minas Harutyunyan Cc: Douglas Anderson Cc: Chen Yu Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Signed-off-by: John Stultz --- drivers/usb/dwc2/hcd.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc2/hcd.c b/d

[RFC][PATCH 2/2] usb: dwc2: Fix UDC state tracking

2017-08-03 Thread John Stultz
Cc: linux-usb@vger.kernel.org Signed-off-by: John Stultz --- drivers/usb/dwc2/gadget.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index c4066cd..e6f2cd8 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -3202,6

Re: dwc2_hc_chhltd_intr_dma - ChHltd set errors?

2017-04-04 Thread John Stultz
On Tue, Apr 4, 2017 at 12:38 AM, Felipe Balbi wrote: > > Hi, > > Minas Harutyunyan writes: >>> We've noticed that when using usb ethernet adapters on HiKey, we >>> occasionally see errors like: >>> >>> dwc2 f72c.usb: dwc2_hc_chhltd_intr_dma: Channel 0 - ChHltd set, >>> b

Re: dwc2_hc_chhltd_intr_dma - ChHltd set errors?

2017-04-03 Thread John Stultz
On Mon, Apr 3, 2017 at 5:54 AM, Minas Harutyunyan wrote: > On 4/3/2017 9:23 AM, John Youn wrote: >> On 03/31/2017 04:04 PM, John Stultz wrote: >>> On Thu, Mar 2, 2017 at 12:00 PM, John Stultz wrote: >>>> Hey John, >>>> We've noticed tha

[PATCH v2] usb: dwc2: Make sure we disconnect the gadget state

2017-03-29 Thread John Stultz
rtman Cc: linux-usb@vger.kernel.org Acked-by: John Youn Signed-off-by: John Stultz --- v2: Minor typo fix suggested by Sergei Shtylyov --- drivers/usb/dwc2/hcd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index a73722e..91ed5b6 100644 --- a/drivers/

[PATCH] usb: dwc2: Make sure we disconnect the gadget state

2017-03-02 Thread John Stultz
rtman Cc: linux-usb@vger.kernel.org Acked-by: John Youn Signed-off-by: John Stultz --- drivers/usb/dwc2/hcd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index a73722e..91ed5b6 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c @@ -3264

[RFC][PATCH] usb: dwc2: Make sure we disconnect the gadget state

2017-02-13 Thread John Stultz
path so the state is properly cleared. With it, the gadget interface initializes properly on every plug in. Cc: Wei Xu Cc: Guodong Xu Cc: Amit Pundir Cc: Rob Herring Cc: John Youn Cc: Douglas Anderson Cc: Chen Yu Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.

Re: [PATCH 1/4 v3] usb: dwc2: Avoid sleeping while holding hsotg->lock

2017-01-16 Thread John Stultz
On Mon, Jan 16, 2017 at 12:57 PM, John Youn wrote: > > >> On Jan 16, 2017, at 12:37 PM, John Stultz wrote: >> >> On Mon, Jan 16, 2017 at 2:36 AM, Felipe Balbi >> wrote: >>> >>> Hi, >>> >>> John Stultz writes: >&

Re: [PATCH 1/4 v3] usb: dwc2: Avoid sleeping while holding hsotg->lock

2017-01-16 Thread John Stultz
On Mon, Jan 16, 2017 at 2:36 AM, Felipe Balbi wrote: > > Hi, > > John Stultz writes: >> Basically when plugging in various cables in different orders, I'm >> occasionally seeing the following BUG splat: >> >> [ 86.215403] BUG: scheduling

Re: [RFC][PATCH 0/5 v2] Fixes and workarounds for dwc2 on HiKey board

2017-01-16 Thread John Stultz
On Mon, Jan 16, 2017 at 2:29 AM, Felipe Balbi wrote: > > Hi, > > John Stultz writes: >> I just wanted to re-send my current queue of patches for dwc2 >> controller on the HiKey board, as my last patchset ended up >> colliding with a number of changes that landed

Re: [PATCH 0/4 v3] Fixes and workarounds for dwc2 on HiKey board (rebased to synopsys-usb/next)

2017-01-12 Thread John Stultz
On Thu, Jan 12, 2017 at 12:05 AM, Felipe Balbi wrote: > > Hi, > > John Youn writes: >> On 1/11/2017 4:22 PM, John Stultz wrote: >>> Just wanted to resend my patches for dwc2 controller on the >>> HiKey board for consideration for the 4.11 merge window. >

[PATCH 1/4 v3] usb: dwc2: Avoid sleeping while holding hsotg->lock

2017-01-11 Thread John Stultz
Cc: Wei Xu Cc: Guodong Xu Cc: Amit Pundir Cc: Rob Herring Cc: John Youn Cc: Douglas Anderson Cc: Chen Yu Cc: Vardan Mikayelyan Cc: Kishon Vijay Abraham I Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Signed-off-by: John Stultz --- v3: * Rebased to synopsys-usb/nex

[PATCH 0/4 v3] Fixes and workarounds for dwc2 on HiKey board (rebased to synopsys-usb/next)

2017-01-11 Thread John Stultz
licon Hi6220 John Stultz (2): usb: dwc2: Avoid sleeping while holding hsotg->lock usb: dwc2: Workaround case where GOTGCTL state is wrong drivers/usb/dwc2/core.c | 6 ++-- drivers/usb/dwc2/core.h | 9 +- drivers/usb/dwc2/gadget.c | 2 +- drivers/usb/dwc2/hcd.c

[PATCH 2/4 v3] usb: dwc2: Workaround case where GOTGCTL state is wrong

2017-01-11 Thread John Stultz
Youn Reviewed-by: Vardan Mikayelyan Signed-off-by: John Stultz --- v2: Rework goto logic suggested by Vardan, and add a comment v3: * Rebased to synopsys-usb/next branch --- drivers/usb/dwc2/hcd.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb

[PATCH 4/4 v3] usb: dwc2: Add a quirk to allow speed negotiation for Hisilicon Hi6220

2017-01-11 Thread John Stultz
vger.kernel.org Signed-off-by: Chen Yu [jstultz: Reworked to simplify the patch, and made commit log to be more specific about the issue] Signed-off-by: John Stultz --- v2: * Fix build issue reported by kbuildbot * Rework to avoid using new dts entry suggested by RobH * Further tweaks from Chen Yu to

[PATCH 3/4 v3] usb: dwc2: Force port resume on switching to device mode

2017-01-11 Thread John Stultz
u Cc: Amit Pundir Cc: Rob Herring Cc: John Youn Cc: Douglas Anderson Cc: Chen Yu Cc: Vardan Mikayelyan Cc: Kishon Vijay Abraham I Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Signed-off-by: Chen Yu Signed-off-by: John Stultz --- v3: * Rebased to synopsys-usb/next b

Re: [PATCH 0/5 v2] Fixes and workarounds for dwc2 on HiKey board

2017-01-11 Thread John Stultz
On Wed, Jan 11, 2017 at 2:58 PM, John Youn wrote: > On 1/11/2017 2:39 PM, John Stultz wrote: >> On Wed, Jan 11, 2017 at 2:08 PM, John Youn wrote: >>> On 1/3/2017 11:52 AM, John Stultz wrote: >>>> Hope everyone had a happy new years! >>>> >>>>

Re: [PATCH 0/5 v2] Fixes and workarounds for dwc2 on HiKey board

2017-01-11 Thread John Stultz
On Wed, Jan 11, 2017 at 2:08 PM, John Youn wrote: > On 1/3/2017 11:52 AM, John Stultz wrote: >> Hope everyone had a happy new years! >> >> I just wanted to send out my current queue of patches for dwc2 >> controller on the HiKey board for consideration for the 4.11

Re: [PATCH 2/3] usb: dwc2: gadget: Fix DMA memory freeing

2017-01-09 Thread John Stultz
On Mon, Jan 9, 2017 at 1:10 PM, John Youn wrote: > From: Vardan Mikayelyan > > Remove DMA memory free from EP disable flow by replacing > dma_alloc_coherent with dmam_alloc_coherent. > > Cc: John Stultz > Signed-off-by: Vardan Mikayelyan > Signed-off-by: John Youn Thi

Re: [PATCH] usb: dwc2: gadget: Fix DMA memory freeing

2017-01-06 Thread John Stultz
On Thu, Jan 5, 2017 at 6:01 PM, John Youn wrote: > From: Vardan Mikayelyan > > Remove DMA memory free from EP disable flow by replacing > dma_alloc_coherent with dmam_alloc_coherent. > > Cc: John Stultz > Signed-off-by: Vardan Mikayelyan > Signed-off-by: John Youn &g

Re: [PATCH] usb: dwc2: use u32 for DT binding parameters

2017-01-06 Thread John Stultz
it against Linus' HEAD and my tree is stale? Anyway, after re-applying it to my tree: Tested-by: John Stultz thanks -john -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] usb: dwc2: fix panic for coherent memory allocation

2017-01-06 Thread John Stultz
On Thu, Jan 5, 2017 at 6:50 PM, Leo Yan wrote: > When use configfs to configure USB port as as ethernet gadget, the > kernel has panic with below backtrace; it clearly indicates the > coherent memory allocation is happened in the interrupt context, > but the function __get_vm_area_node() is possib

Re: [PATCH 0/5 v2] Fixes and workarounds for dwc2 on HiKey board

2017-01-03 Thread John Stultz
On Tue, Jan 3, 2017 at 4:31 PM, John Youn wrote: > On 1/3/2017 12:05 PM, John Stultz wrote: >> On Tue, Jan 3, 2017 at 11:52 AM, John Stultz wrote: >>> Hope everyone had a happy new years! >>> >>> I just wanted to send out my current queue of patches for dwc2 &

Re: [PATCH 0/5 v2] Fixes and workarounds for dwc2 on HiKey board

2017-01-03 Thread John Stultz
On Tue, Jan 3, 2017 at 11:52 AM, John Stultz wrote: > Hope everyone had a happy new years! > > I just wanted to send out my current queue of patches for dwc2 > controller on the HiKey board for consideration for the 4.11 > merge window. > > This does exclude my patchset[1]

  1   2   >