Re: [Bug] usb: dwc2: host function broken in OTG mode on bcm283x

2016-08-23 Thread John Youn
On 8/22/2016 9:41 PM, Stefan Wahren wrote: > Hi John, > >> John Youn <john.y...@synopsys.com> hat am 23. August 2016 um 00:08 >> geschrieben: >> >> >> On 8/22/2016 1:47 PM, Stefan Wahren wrote: >>> Hi John, >>> >>>

[PATCH v2 1/2] usb: dwc3: Add revision numbers for the USB 3.0 IP

2016-08-22 Thread John Youn
Add revision number constants for the 3.00a and 3.10a releases. Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc3/core.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 3d94acd..002e647 100644 --- a/drive

[PATCH v2 2/2] usb: dwc3: Add ENDXFER command polling

2016-08-22 Thread John Youn
on the DWC_usb31 (USB 3.1) IP. Signed-off-by: John Youn <johny...@synopsys.com> --- v2: * Remove polling as it is already done in dwc3_send_gadget_ep_cmd drivers/usb/dwc3/core.c | 11 +++ drivers/usb/dwc3/core.h | 4 drivers/usb/dwc3/gadget.c | 16 +++- 3 files chang

Re: [Bug] usb: dwc2: host function broken in OTG mode on bcm283x

2016-08-22 Thread John Youn
On 8/22/2016 1:47 PM, Stefan Wahren wrote: > Hi John, > >> John Youn <john.y...@synopsys.com> hat am 22. August 2016 um 22:06 >> geschrieben: >> >> >> On 8/20/2016 6:03 AM, Stefan Wahren wrote: >>> Hi John, >>> >>> &

Re: [Bug] usb: dwc2: host function broken in OTG mode on bcm283x

2016-08-22 Thread John Youn
On 8/20/2016 6:03 AM, Stefan Wahren wrote: > Hi John, > > on bcm2835 in OTG mode the USB host function broken (USB devices don't > enumerate) with the following settings: > > CONFIG_USB=y > CONFIG_USB_OTG=y > CONFIG_USB_DWC2=y > CONFIG_USB_DWC2_DUAL_ROLE=y > CONFIG_USB_PHY=y >

Re: [PATCH 2/2] usb: dwc3: Add ENDXFER command polling

2016-08-22 Thread John Youn
On 8/22/2016 12:49 AM, Felipe Balbi wrote: > > Hi, > > John Youn <johny...@synopsys.com> writes: >> ENDXFER polling is available on version 3.10a and later of the >> DWC_usb3 (USB 3.0) controller. With this feature, the software can poll >> the CMDACT bit

Re: [PATCH v4 10/10] usb: gadget: f_hid: use alloc_ep_req()

2016-08-19 Thread John Youn
On 8/8/2016 1:30 PM, Felipe F. Tonello wrote: > Use gadget's framework allocation function instead of directly calling > usb_ep_alloc_request(). > > Signed-off-by: Felipe F. Tonello > --- > drivers/usb/gadget/function/f_hid.c | 6 +- > 1 file changed, 1 insertion(+),

[PATCH 2/2] usb: dwc3: Add ENDXFER command polling

2016-08-19 Thread John Youn
on the DWC_usb31 (USB 3.1) IP. Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc3/core.c | 11 +++ drivers/usb/dwc3/core.h | 4 drivers/usb/dwc3/gadget.c | 31 ++- 3 files changed, 45 insertions(+), 1 deletion(-) diff --git a/drivers/us

[PATCH 1/2] usb: dwc3: Add revision numbers for the USB 3.0 IP

2016-08-19 Thread John Youn
Add revision number constants for the 3.00a and 3.10a releases. Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc3/core.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 3d94acd..002e647 100644 --- a/drive

Re: [PATCH V2 RFC 2/6] usb: dwc2: Add DT properties to specify fifo size in host/otg mode

2016-08-18 Thread John Youn
On 7/26/2016 11:54 AM, Stefan Wahren wrote: > Currently the fifo sizes for host/otg mode are defined per platform > and doesn't take the mode into account. So we will get errors > like this: > > dwc2 2098.usb: 256 invalid for host_nperio_tx_fifo_size. > dwc2 2098.usb: Setting

Re: [PATCH V2 RFC 6/6] ARM: dts: bcm2835: Add Raspberry Pi Zero

2016-08-18 Thread John Youn
On 8/18/2016 12:04 PM, Stefan Wahren wrote: > Hi John, > >> John Youn <john.y...@synopsys.com> hat am 18. August 2016 um 20:03 >> geschrieben: >> >> >> On 8/17/2016 3:17 PM, Stefan Wahren wrote: >>> Hi John, >>> >>>

Re: [PATCH V2 RFC 6/6] ARM: dts: bcm2835: Add Raspberry Pi Zero

2016-08-18 Thread John Youn
On 8/17/2016 3:17 PM, Stefan Wahren wrote: > Hi John, > >> John Youn <john.y...@synopsys.com> hat am 17. August 2016 um 23:21 >> geschrieben: >> >> >> ... >> Ok, yeah, that seems better. >> >> Can you check if applying just patch

Re: [PATCH V2 RFC 6/6] ARM: dts: bcm2835: Add Raspberry Pi Zero

2016-08-17 Thread John Youn
On 8/17/2016 12:11 PM, Stefan Wahren wrote: > Hi, > >> John Youn <john.y...@synopsys.com> hat am 17. August 2016 um 00:07 >> geschrieben: >> >> >> On 8/16/2016 12:58 PM, Stefan Wahren wrote: >>> Hi John, >>> ... >>> >>

Re: [PATCH V2 RFC 6/6] ARM: dts: bcm2835: Add Raspberry Pi Zero

2016-08-16 Thread John Youn
On 8/16/2016 12:58 PM, Stefan Wahren wrote: > Hi John, > >> John Youn <john.y...@synopsys.com> hat am 16. August 2016 um 21:30 >> geschrieben: >> >> >> On 7/26/2016 11:54 AM, Stefan Wahren wrote: >> ... >>> +/* >>> + * Settin

Re: [PATCH V2 RFC 6/6] ARM: dts: bcm2835: Add Raspberry Pi Zero

2016-08-16 Thread John Youn
On 7/26/2016 11:54 AM, Stefan Wahren wrote: > The Raspberry Pi Zero is a minified version of model A+. It's > notable there is no PWR LED and the ACT LED is inverted. > > Signed-off-by: Stefan Wahren > --- > arch/arm/boot/dts/Makefile |3 +- >

Re: [PATCH V2 RFC 1/6] usb: dwc2: core: Avoid nonsense error in gadget mode

2016-08-16 Thread John Youn
On 8/16/2016 9:44 AM, Stefan Wahren wrote: > Hi John, > >> John Youn <john.y...@synopsys.com> hat am 16. August 2016 um 03:30 >> geschrieben: >> >> >> On 7/26/2016 11:54 AM, Stefan Wahren wrote: >>> In gadget mode On bcm2835 platform the host t

Re: [PATCH 1/2] usb: dwc2: optionally assert phy "full reset" when waking up

2016-08-15 Thread John Youn
On 8/15/2016 6:11 PM, Randy Li wrote: > > > On 08/16/2016 06:19 AM, John Youn wrote: >> On 7/19/2016 5:06 AM, Randy Li wrote: >>> From: Doug Anderson <diand...@chromium.org> >>> >>> On the rk3288 USB host-only port (the one that's not the OTG-en

Re: [PATCH V2 RFC 1/6] usb: dwc2: core: Avoid nonsense error in gadget mode

2016-08-15 Thread John Youn
On 7/26/2016 11:54 AM, Stefan Wahren wrote: > In gadget mode On bcm2835 platform the host tx fifo size could be zero. > So add zero to range and avoid such nonsense errors: > > dwc2 2098.usb: 0 invalid for host_nperio_tx_fifo_size. > dwc2 2098.usb: Setting host_nperio_tx_fifo_size to 0 >

Re: [PATCH] usb: dwc2: Add reset control to dwc2

2016-08-15 Thread John Youn
Hi Felipe, On 8/10/2016 6:53 AM, Dinh Nguyen wrote: > From: Dinh Nguyen <dingu...@opensource.altera.com> > > Allow for platforms that have a reset controller driver in place to bring > the USB IP out of reset. > > Signed-off-by: Dinh Nguyen <dingu...@opensource.altera

Re: [PATCH 1/2] usb: dwc2: optionally assert phy "full reset" when waking up

2016-08-15 Thread John Youn
On 7/19/2016 5:06 AM, Randy Li wrote: > From: Doug Anderson > > On the rk3288 USB host-only port (the one that's not the OTG-enabled > port) the PHY can get into a bad state when a wakeup is asserted (not > just a wakeup from full system suspend but also a wakeup from >

Re: [PATCH] usb: dwc2: Remove deprecated create_singlethread_workqueue

2016-08-02 Thread John Youn
new workqueue and init work */ > retval = -ENOMEM; > - hsotg->wq_otg = create_singlethread_workqueue("dwc2"); > + hsotg->wq_otg = alloc_ordered_workqueue("dwc2", 0); > if (!hsotg->wq_otg) { > dev_err(hsotg->dev, "Failed to create workque

Re: [PATCH 1/3] usb: dwc2: Add support for STM32F429/439/469 USB OTG in FS mode with internal PHY

2016-06-29 Thread John Youn
On 6/29/2016 12:47 PM, Bruno Herrera wrote: > On Mon, Jun 27, 2016 at 7:51 PM, John Youn <john.y...@synopsys.com> wrote: >> On 6/21/2016 7:26 PM, Bruno Herrera wrote: >>> Signed-off-by: Bruno Herrera <bruherr...@gmail.com> >> >> Please add a commit mess

Re: [PATCH 1/1] usb: dwc2: add printf attribute to cat_printf()

2016-06-27 Thread John Youn
nst char *fmt, ...) > +static __printf(3, 4) > +void cat_printf(char **buf, size_t *size, const char *fmt, ...) > { > va_list args; > int i; > Acked-by: John Youn <johny...@synopsys.com> John -- To unsubscribe from this list: send the line "unsubscribe l

Re: [PATCH] USB: dwc2-usb: add USB_GADGET dependency

2016-06-27 Thread John Youn
depends on USB_GADGET || !USB_GADGET > default n > select NOP_USB_XCEIV > help > Acked-by: John Youn <johny...@synopsys.com> 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 1/3] usb: dwc2: Add support for STM32F429/439/469 USB OTG in FS mode with internal PHY

2016-06-27 Thread John Youn
On 6/21/2016 7:26 PM, Bruno Herrera wrote: > Signed-off-by: Bruno Herrera Please add a commit message describing the purpose of your changes, some information about the platform you're adding, and the special handling of the GGPIO. > --- > drivers/usb/dwc2/core.c | 18

Re: [RESEND PATCH] usb: dwc2: Add reset control to dwc2

2016-06-21 Thread John Youn
On 6/21/2016 1:06 AM, Felipe Balbi wrote: > > Hi, > > John Youn <john.y...@synopsys.com> writes: >> On 6/3/2016 8:59 AM, dingu...@opensource.altera.com wrote: >>> From: Dinh Nguyen <dingu...@opensource.altera.com> >>> >>> Allow for platfo

Re: [RESENDING] dwc2: Using internal phy (fs mode) for STM32F4x9 platform

2016-06-14 Thread John Youn
On 6/13/2016 8:21 AM, Bruno Herrera wrote: > Hi > > On Mon, Jun 13, 2016 at 9:19 AM, Maxime Coquelin > <mcoquelin.st...@gmail.com> wrote: >> Hi, >> >> 2016-06-10 8:56 GMT+02:00 Felipe Balbi <ba...@kernel.org>: >>> >>> Hi, >>>

Re: [PATCH v3 00/13] usb: dwc2: Fix up gadget isochronous support

2016-06-14 Thread John Youn
On 5/25/2016 6:06 PM, John Youn wrote: > The following patch series fixes up isochronous support for the dwc2 > gadget. The existing isochronous support lacked a few features. Most > notably it did not properly sync up with the first packet and it > didn't handle the Incomplet

Re: [RESENDING] dwc2: Using internal phy (fs mode) for STM32F4x9 platform

2016-06-09 Thread John Youn
On 6/9/2016 10:18 AM, Bruno Herrera wrote: > Hello all, > I'm bringing the linux kernel for the STM32F4 MCU (mmu-less). This MCU > has two DWC2 cores on it:one for USB OTG HS and one for USB OTG FS. > I was able to make the DWC2 driver to work in FS mode using a internal > phy in both cores (HS

Re: [PATCH 1/2] usb: dwc3: gadget: set xfer resource per endpoint

2016-06-03 Thread John Youn
On 6/3/2016 3:55 AM, Felipe Balbi wrote: > > Hi, > > John Youn <john.y...@synopsys.com> writes: >>>>> This reverts back to the original buggy behavior. This will fail when >>>>> a SET_INTERFACE occurs multiple times. >>>>> >>&

Re: [RESEND PATCH] usb: dwc2: Add reset control to dwc2

2016-06-03 Thread John Youn
nsource.altera.com> > Acked-by: John Youn <johny...@synopsys.com> > Tested-by: Stefan Wahren <stefan.wah...@i2se.com> > --- > v7: Use devm_reset_control_get_optional() > v6: fix 80 line checkpatch warning in dev_err print > v5: updated error conditions for not finding the re

Re: [PATCH 1/2] usb: dwc3: gadget: set xfer resource per endpoint

2016-06-02 Thread John Youn
On 6/2/2016 5:26 AM, Felipe Balbi wrote: > > hi, > > Felipe Balbi writes: >>> This reverts back to the original buggy behavior. This will fail when >>> a SET_INTERFACE occurs multiple times. >>> >>> You can run testusb to see the failure: >>> testusb -t 9 -c 5000

Re: [PATCH 1/2] usb: dwc3: gadget: set xfer resource per endpoint

2016-06-02 Thread John Youn
On 6/1/2016 11:38 PM, Felipe Balbi wrote: > > Hi, > > John Youn <john.y...@synopsys.com> writes: >>>> However, I'm not aware of any issue with END_TRANSFER, could you let >>>> me know how to reproduce it? >>> >>> it's a rare and di

Re: [PATCH 1/2] usb: dwc3: gadget: set xfer resource per endpoint

2016-06-02 Thread John Youn
On 6/1/2016 11:38 PM, Felipe Balbi wrote: > > Hi, > > John Youn <john.y...@synopsys.com> writes: >>>> However, I'm not aware of any issue with END_TRANSFER, could you let >>>> me know how to reproduce it? >>> >>> it's a rare and di

Re: [PATCH 1/2] usb: dwc3: gadget: set xfer resource per endpoint

2016-06-02 Thread John Youn
On 5/31/2016 11:52 PM, Felipe Balbi wrote: > > Hi, > > John Youn <john.y...@synopsys.com> writes: >> On 5/30/2016 7:19 AM, Felipe Balbi wrote: >>> Instead of looping through all endpoints when >>> enabling ep0, let's allow for each endpoint to set >&

Re: [PATCH 1/2] usb: dwc3: gadget: set xfer resource per endpoint

2016-06-01 Thread John Youn
On 5/31/2016 11:52 PM, Felipe Balbi wrote: > > Hi, > > John Youn <john.y...@synopsys.com> writes: >> On 5/30/2016 7:19 AM, Felipe Balbi wrote: >>> Instead of looping through all endpoints when >>> enabling ep0, let's allow for each endpoint to set >&

Re: [PATCH 60/62] usb: dwc3: gadget: disable XFER_NOT_READY

2016-06-01 Thread John Youn
On 5/30/2016 4:46 AM, Felipe Balbi wrote: > We don't need this IRQ anymore. > > Signed-off-by: Felipe Balbi > --- > drivers/usb/dwc3/gadget.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/dwc3/gadget.c

Re: [PATCH 1/2] usb: dwc3: gadget: set xfer resource per endpoint

2016-05-31 Thread John Youn
On 5/30/2016 7:19 AM, Felipe Balbi wrote: > Instead of looping through all endpoints when > enabling ep0, let's allow for each endpoint to set > its own xfer resource. This solves an issue which > happens when we issue END_TRANSFER due to a reset > interrupt. Endpoints will be left without a xfer

[PATCH v3] usb: dwc3: Set the ClearPendIN bit on Clear Stall EP command

2016-05-31 Thread John Youn
STAR 9000614252. Signed-off-by: John Youn <johny...@synopsys.com> --- Hi Felipe, I rebased this on your testing/fixes. You'll have to fix "usb: dwc3: gadget: pass dep as argument to endpoint command" on your testing/next. Or you can just apply v2 to your testing/next. It's

[PATCH v2] reset: Return -ENOTSUPP when not configured

2016-05-31 Thread John Youn
ns wrappers") Signed-off-by: John Youn <johny...@synopsys.com> --- Hi Philipp, Here are the changes as discussed previously. It just returns -ENOTSUPP directly when not configured. Tested and works with DWC2 driver with Dinh's patch that adds the reset controller, using a configuration

Re: [PATCH 00/13] usb: dwc2: Fix up gadget isochronous support

2016-05-31 Thread John Youn
On 5/31/2016 12:19 AM, Felipe Balbi wrote: > > Hi, > > John Youn <johny...@synopsys.com> writes: >> The following patch series fixes up isochronous support for the dwc2 >> gadget. The existing isochronous support lacked a few features. Most >> notably it did

Re: [PATCH v2] usb: dwc3: Set the ClearPendIN bit on Clear Stall EP command

2016-05-31 Thread John Youn
On 5/31/2016 12:09 AM, Felipe Balbi wrote: > > Hi John, > > John Youn <johny...@synopsys.com> writes: >> As of core revision 2.60a the recommended programming model is to set >> the ClearPendIN bit when issuing a Clear Stall EP command for IN >> endpoints. Th

Re: [PATCH] reset: Put back *_optional variants

2016-05-30 Thread John Youn
e error code in that case, as long as we return >>> an error. >>> >>> Also note that even before my patch things were already inconsistent >>> with the of_...get... functions already always returning >>> -ENOTSUPP when CONFIG_RESET_CONTROLLER was not

[PATCH v2] usb: dwc3: Set the ClearPendIN bit on Clear Stall EP command

2016-05-26 Thread John Youn
STAR 9000614252. Signed-off-by: John Youn <johny...@synopsys.com> --- v2: * Removed the call to dwc3_is_usb31(). We set the high bit in the version for USB 31 IP so that we can just do a comparison for these cases. * Rewrote the commit message. * Added comment drivers/usb/dwc3/core.h

Re: [PATCH] reset: Put back *_optional variants

2016-05-26 Thread John Youn
On 5/26/2016 1:25 PM, Hans de Goede wrote: > Hi, > > On 26-05-16 03:15, John Youn wrote: >> Prior to commit 6c96f05c8bb8 ("reset: Make [of_]reset_control_get[_foo] >> functions wrappers"), the optional variants returned -ENOTSUPP when >> CONFIG_RESET_CONTR

Re: [PATCHv2 0/4] usb: dwc3: get rid of platform data

2016-05-25 Thread John Youn
-- > drivers/usb/dwc3/platform_data.h | 53 - > 3 files changed, 38 insertions(+), 134 deletions(-) > delete mode 100644 drivers/usb/dwc3/platform_data.h > Tested-by: John Youn <johny...@synopsys.com> I tested patch 3 and 4 against linux-next

[PATCH] usb: dwc3: Set the ClearPendIN bit on Clear Stall EP command

2016-05-25 Thread John Youn
. Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc3/core.h | 1 + drivers/usb/dwc3/gadget.c | 23 +-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 74dff47..dcdba14 100644 --- a/d

[PATCH] reset: Put back *_optional variants

2016-05-25 Thread John Youn
t an error occurred when CONFIG_RESET_CONTROLLER is not set. Fixes: 6c96f05c8bb8 ("reset: Make [of_]reset_control_get[_foo] functions wrappers") Signed-off-by: John Youn <johny...@synopsys.com> --- Hi Philipp, Hans, The commit referenced above breaks an upcoming patch for the dwc2 dr

[PATCH v3 06/13] usb: dwc2: gadget: Add dwc2_gadget_incr_frame_num()

2016-05-25 Thread John Youn
verrun: Indicates SOF number overrun in DSTS Tested-by: John Keeping <j...@metanate.com> Signed-off-by: Vardan Mikayelyan <mvar...@synopsys.com> Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc2/core.h | 5 + drivers/usb/dwc2/gadget.c | 19

[PATCH v3 08/13] usb: dwc2: gadget: Add dwc2_gadget_read_ep_interrupts function

2016-05-25 Thread John Youn
From: Vardan Mikayelyan <mvar...@synopsys.com> Reads and returns interrupts for given endpoint, by masking epint_reg with corresponding mask. Tested-by: John Keeping <j...@metanate.com> Signed-off-by: Vardan Mikayelyan <mvar...@synopsys.com> Signed-off-by: John Youn <

[PATCH v3 09/13] usb: dwc2: gadget: Add dwc2_gadget_start_next_request function

2016-05-25 Thread John Youn
to do resynchronization. Tested-by: John Keeping <j...@metanate.com> Signed-off-by: Vardan Mikayelyan <mvar...@synopsys.com> Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc2/gadget.c | 51 +++ 1 file changed, 38 insertions(+

[PATCH v3 11/13] usb: dwc2: gadget: Add Incomplete ISO IN/OUT Interrupt handlers

2016-05-25 Thread John Youn
John Keeping <j...@metanate.com> Signed-off-by: Vardan Mikayelyan <mvar...@synopsys.com> Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc2/gadget.c | 173 +- 1 file changed, 124 insertions(+), 49 deletions(-) diff --git a/drive

[PATCH v3 13/13] usb: dwc2: gadget: Final fixes for BDMA ISOC

2016-05-25 Thread John Youn
now I have added mechanism to set pid and excluded all code where this flag was set. Tested-by: John Keeping <j...@metanate.com> Signed-off-by: Vardan Mikayelyan <mvar...@synopsys.com> Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc2/core.h | 1 - driver

[PATCH v3 10/13] usb: dwc2: gadget: Add OUTTKNEPDIS and NAKINTRPT handlers

2016-05-25 Thread John Youn
m> Signed-off-by: Vardan Mikayelyan <mvar...@synopsys.com> Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc2/gadget.c | 94 +++ 1 file changed, 94 insertions(+) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc

[PATCH v3 12/13] usb: dwc2: gadget: Add EP disabled interrupt handler

2016-05-25 Thread John Youn
ing <j...@metanate.com> Reviewed-by: Vahram Aharonyan <vahr...@synopsys.com> Signed-off-by: Vardan Mikayelyan <mvar...@synopsys.com> Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc2/gadget.c | 87 ++- 1 file changed,

[PATCH v3 01/13] usb: dwc2: Add missing register field definitions

2016-05-25 Thread John Youn
From: Vardan Mikayelyan <mvar...@synopsys.com> Added register field definitions, register names are according DWC-OTG databook. Tested-by: John Keeping <j...@metanate.com> Signed-off-by: Vardan Mikayelyan <mvar...@synopsys.com> Signed-off-by: John Youn <johny...@synopsys.

[PATCH v3 02/13] usb: dwc2: gadget: Remove unnecessary line

2016-05-25 Thread John Youn
From: Vardan Mikayelyan <mvar...@synopsys.com> Removed "ctrl |= DXEPCTL_USBACTEP" from dwc2_hsotg_start_req() function because this step is done in dwc2_hsotg_ep_enable(). Tested-by: John Keeping <j...@metanate.com> Signed-off-by: Vardan Mikayelyan <mvar...@synopsys.com&

[PATCH v3 04/13] usb: dwc2: gadget: Corrected field names

2016-05-25 Thread John Youn
From: Vardan Mikayelyan <mvar...@synopsys.com> No-op change. Changed field names to prevent misunderstanding. Tested-by: John Keeping <j...@metanate.com> Signed-off-by: Vardan Mikayelyan <mvar...@synopsys.com> Signed-off-by: John Youn <johny...@synopsys.com> --- drive

[PATCH v3 03/13] usb: dwc2: gadget: Remove unnecessary code

2016-05-25 Thread John Youn
sys.com> Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc2/gadget.c | 8 1 file changed, 8 deletions(-) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 5521c70..e9595be 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/ga

[PATCH v3 07/13] usb: dwc2: gadget: Corrected interval calculation

2016-05-25 Thread John Youn
From: Vardan Mikayelyan <mvar...@synopsys.com> Calculate the interval according to the USB 2.0 specification section 9.6.6. Tested-by: John Keeping <j...@metanate.com> Signed-off-by: Vardan Mikayelyan <mvar...@synopsys.com> Signed-off-by: John Youn <johny...@synopsys.com&g

[PATCH v3 05/13] usb: dwc2: gadget: Fix transfer stop programming for out endpoint

2016-05-25 Thread John Youn
ication must enable Global OUT NAK mode, so if this mode is enabled we can continue without this step. Tested-by: John Keeping <j...@metanate.com> Signed-off-by: Vardan Mikayelyan <mvar...@synopsys.com> Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc2/gadge

[PATCH v3 00/13] usb: dwc2: Fix up gadget isochronous support

2016-05-25 Thread John Youn
The following patch series fixes up isochronous support for the dwc2 gadget. The existing isochronous support lacked a few features. Most notably it did not properly sync up with the first packet and it didn't handle the Incomplete ISO IN/OUT interrupts. These patches have been sitting in our

[PATCH 2/2] usb: dwc2: gadget: Do not halt isochronous endpoints

2016-05-23 Thread John Youn
From: Vahram Aharonyan <vahr...@synopsys.com> Add a check in dwc2_hsotg_ep_sethalt() so that it does not halt isochronous endpoints. Signed-off-by: Vahram Aharonyan <vahr...@synopsys.com> Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc2/gadget.c | 5 +

[PATCH 1/2] usb: dwc2: gadget: Do not halt endpoint if active

2016-05-23 Thread John Youn
Vahram Aharonyan <vahr...@synopsys.com> Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc2/gadget.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 4c5e300..e4e2a90 100644 ---

[PATCH 0/2] usb: dwc2: Fixes for endpoint halt

2016-05-23 Thread John Youn
A couple of small fixes for endpoint halt. This can be queued for 4.7-rc Regards, John Vahram Aharonyan (2): usb: dwc2: gadget: Do not halt endpoint if active usb: dwc2: gadget: Do not halt isochronous endpoints drivers/usb/dwc2/gadget.c | 24 1 file changed, 20

[PATCH 5/5] usb: dwc3: Endianness issue on dwc3_log_ctrl

2016-05-23 Thread John Youn
Sparse complains even though it looks ok. Probably it cannot detect that the wValue, wIndex, and wLength are declared __le16 due to the macro magic. Redeclare them as CPU endianness and make the conversion on assignment. Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/us

[PATCH 2/5] usb: dwc3: ep0: Use the correct type for SET_SEL data

2016-05-23 Thread John Youn
u2sel and u2pel should be __le16. Doesn't fix any issue. Found with sparse. Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc3/ep0.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index 9dd4355..1

[PATCH 0/5] usb: dwc3: Fix sparse issues

2016-05-23 Thread John Youn
This series fixes several issues found with sparse. The first patch in the series is an actual issue. The rest just clean up the warnings. John Youn (5): usb: dwc3: ep0: Fix endianness of wIndex passed to dwc3_wIndex_to_dep usb: dwc3: ep0: Use the correct type for SET_SEL data usb: dwc3

[PATCH 3/5] usb: dwc3: gadget: Fix usage of bitwise operator

2016-05-23 Thread John Youn
Cleans up the sparse warning: warning: dubious: x | !y Since we do want a bitwise OR here, don't use a logical (true/false) value. Probably is not a real issue but it cleans up the warning. Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc3/gadget.c | 2 +- 1 file chan

[PATCH 1/5] usb: dwc3: ep0: Fix endianness of wIndex passed to dwc3_wIndex_to_dep

2016-05-23 Thread John Youn
The wIndex passed in here is CPU endianness, but the function expects little endian. Found with sparse. Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc3/ep0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3

[PATCH 4/5] usb: dwc3: gadget: Fix truncated cast issue

2016-05-23 Thread John Youn
>From sparse: warning: cast truncates bits from constant value (100 becomes 0) The DWC3_TRB_NUM constant is too big for u8. Do the calculation a slightly different way that should still be optimized out for the case where DWC3_TRB_NUM == 256. Signed-off-by: John Youn <johny...@synops

[PATCH 1/2] usb: dwc3: Fix DWC3_USB31_REVISION_110A definition

2016-05-20 Thread John Youn
The DWC3_USB31_REVISION_110A macro uses an invalid constant name in its definition. This is currently not used. Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc3/core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/core.h b/drive

[PATCH 2/2] usb: dwc3: Use the correct speed macros for DSTS/DCFG

2016-05-20 Thread John Youn
Correct the use of the DWC3_DSTS_XXX_SPEED and DWC3_DCFG_XXX_SPEED macros. The wrong set of macros were being used in a few places. This is only a cosmetic change as the values for both sets are identical. Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc3/gadget.

[PATCH v2 09/13] usb: dwc2: gadget: Add dwc2_gadget_start_next_request function

2016-05-20 Thread John Youn
to do resynchronization. Tested-by: John Keeping <j...@metanate.com> Signed-off-by: Vardan Mikayelyan <mvar...@synopsys.com> Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc2/gadget.c | 51 +++ 1 file changed, 38 insertions(+

[PATCH v2 06/13] usb: dwc2: gadget: Add dwc2_gadget_incr_frame_num()

2016-05-20 Thread John Youn
verrun: Indicates SOF number overrun in DSTS Tested-by: John Keeping <j...@metanate.com> Signed-off-by: Vardan Mikayelyan <mvar...@synopsys.com> Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc2/core.h | 5 + drivers/usb/dwc2/gadget.c | 19

[PATCH v2 10/13] usb: dwc2: gadget: Add OUTTKNEPDIS and NAKINTRPT handlers

2016-05-20 Thread John Youn
m> Signed-off-by: Vardan Mikayelyan <mvar...@synopsys.com> Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc2/gadget.c | 94 +++ 1 file changed, 94 insertions(+) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc

[PATCH v2 05/13] usb: dwc2: gadget: Fix transfer stop programming for out endpoint

2016-05-20 Thread John Youn
ication must enable Global OUT NAK mode, so if this mode is enabled we can continue without this step. Tested-by: John Keeping <j...@metanate.com> Signed-off-by: Vardan Mikayelyan <mvar...@synopsys.com> Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc2/gadge

[PATCH v2 08/13] usb: dwc2: gadget: Add dwc2_gadget_read_ep_interrupts function

2016-05-20 Thread John Youn
From: Vardan Mikayelyan <mvar...@synopsys.com> Reads and returns interrupts for given endpoint, by masking epint_reg with corresponding mask. Tested-by: John Keeping <j...@metanate.com> Signed-off-by: Vardan Mikayelyan <mvar...@synopsys.com> Signed-off-by: John Youn <

[PATCH v2 07/13] usb: dwc2: gadget: Corrected interval calculation

2016-05-20 Thread John Youn
From: Vardan Mikayelyan <mvar...@synopsys.com> Calculate the interval according to the USB 2.0 specification section 9.6.6. Tested-by: John Keeping <j...@metanate.com> Signed-off-by: Vardan Mikayelyan <mvar...@synopsys.com> Signed-off-by: John Youn <johny...@synopsys.com&g

[PATCH v2 13/13] usb: dwc2: gadget: Final fixes for BDMA ISOC

2016-05-20 Thread John Youn
now I have added mechanism to set pid and excluded all code where this flag was set. Tested-by: John Keeping <j...@metanate.com> Signed-off-by: Vardan Mikayelyan <mvar...@synopsys.com> Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc2/core.h | 1 - driver

[PATCH v2 11/13] usb: dwc2: gadget: Add Incomplete ISO IN/OUT Interrupt handlers

2016-05-20 Thread John Youn
John Keeping <j...@metanate.com> Signed-off-by: Vardan Mikayelyan <mvar...@synopsys.com> Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc2/gadget.c | 173 +- 1 file changed, 124 insertions(+), 49 deletions(-) diff --git a/drive

[PATCH v2 12/13] usb: dwc2: gadget: Add EP disabled interrupt handler

2016-05-20 Thread John Youn
ing <j...@metanate.com> Reviewed-by: Vahram Aharonyan <vahr...@synopsys.com> Signed-off-by: Vardan Mikayelyan <mvar...@synopsys.com> Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc2/gadget.c | 87 ++- 1 file changed,

[PATCH v2 02/13] usb: dwc2: gadget: Remove unnecessary line

2016-05-20 Thread John Youn
From: Vardan Mikayelyan <mvar...@synopsys.com> Removed "ctrl |= DXEPCTL_USBACTEP" from dwc2_hsotg_start_req() function because this step is done in dwc2_hsotg_ep_enable(). Tested-by: John Keeping <j...@metanate.com> Signed-off-by: Vardan Mikayelyan <mvar...@synopsys.com&

[PATCH v2 04/13] usb: dwc2: gadget: Corrected field names

2016-05-20 Thread John Youn
From: Vardan Mikayelyan <mvar...@synopsys.com> No-op change. Changed field names to prevent misunderstanding. Tested-by: John Keeping <j...@metanate.com> Signed-off-by: Vardan Mikayelyan <mvar...@synopsys.com> Signed-off-by: John Youn <johny...@synopsys.com> --- drive

[PATCH v2 01/13] usb: dwc2: Add missing register field definitions

2016-05-20 Thread John Youn
From: Vardan Mikayelyan <mvar...@synopsys.com> Added register field definitions, register names are according DWC-OTG databook. Tested-by: John Keeping <j...@metanate.com> Signed-off-by: Vardan Mikayelyan <mvar...@synopsys.com> Signed-off-by: John Youn <johny...@synopsys.

[PATCH v2 03/13] usb: dwc2: gadget: Remove unnecessary code

2016-05-20 Thread John Youn
sys.com> Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc2/gadget.c | 8 1 file changed, 8 deletions(-) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 5521c70..e9595be 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/ga

[PATCH v2 00/13] usb: dwc2: Fix up gadget isochronous support

2016-05-20 Thread John Youn
The following patch series fixes up isochronous support for the dwc2 gadget. The existing isochronous support lacked a few features. Most notably it did not properly sync up with the first packet and it didn't handle the Incomplete ISO IN/OUT interrupts. These patches have been sitting in our

[PATCH v2 2/6] usb: dwc3: gadget: Initialize the TRB ring

2016-05-19 Thread John Youn
Clears out all the TRBs in the ring to clean up any stale data that might be in them from the previous time the endpoint was enabled. Also removed the existing clear of the LINK trb since the entire ring is cleard just before. Signed-off-by: John Youn <johny...@synopsys.com> --- drive

[PATCH v2 6/6] usb: dwc3: gadget: Handle TRB index 0 when full or empty

2016-05-19 Thread John Youn
If the trb->enqueue == trb->dequeue, then it could be full or empty. This could also happen at TRB index 0, so modify the check to handle that condition. At index 0, the previous TRB is the one just before the link TRB. Signed-off-by: John Youn <johny...@synopsys.com> --- driv

[PATCH v2 1/6] usb: dwc3: gadget: Simplify skipping of link TRBs

2016-05-19 Thread John Youn
Make the skipping of the link TRBS built-in to the increment operation. This simplifies the code wherever we increment the trb index and ensures that we never end up pointing to a link trb. Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc3/gadget.

[PATCH v2 0/6] usb: dwc3: gadget: TRB ring handling fixes

2016-05-19 Thread John Youn
it. - Removed the existing memset() of the link TRB. John Youn (6): usb: dwc3: gadget: Simplify skipping of link TRBs usb: dwc3: gadget: Initialize the TRB ring usb: dwc3: gadget: Don't prepare TRBs if no space usb: dwc3: gadget: Account for max size in TRB space usb: dwc3: gadget: Account

[PATCH v2 3/6] usb: dwc3: gadget: Don't prepare TRBs if no space

2016-05-19 Thread John Youn
If trbs_left == 0, we don't have any space left in the TRB ring so don't prepare anything. Signed-off-by: John Youn <johny...@synopsys.com> --- 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 c

[PATCH v2 5/6] usb: dwc3: gadget: Account for link TRB in TRBs left

2016-05-19 Thread John Youn
The TRBs left calculation didn't account for the link TRB taking up one spot. If the trb_dequeue < trb_enqueue, then the result includes the link TRB slot so it must be adjusted. Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc3/gadget.c | 3 +++ 1 file changed, 3 i

[PATCH v2 4/6] usb: dwc3: gadget: Account for max size in TRB space

2016-05-19 Thread John Youn
result by DWC3_TRB_NUM. For example the same calculation with DWC3_TRB_NUM = 8, results in: 255 % 6 = 7 TRBs left. Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc3/gadget.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/gadget

Re: [PATCH 2/2] usb: dwc3: gadget: Various fixes to trbs_left calculation

2016-05-19 Thread John Youn
On 5/19/2016 12:51 AM, Felipe Balbi wrote: > > Hi, > > John Youn <johny...@synopsys.com> writes: >> This patch fixes up some issues related to the trb_left calculation. >> >> This calculation sometimes included the link trb slot in the trbs_left >

[PATCH 2/2] usb: dwc3: gadget: Various fixes to trbs_left calculation

2016-05-19 Thread John Youn
EP is enabled, initialized the TRB pool to clean up any stale data. When the previous TRB was not properly cleaned up on disconnect, the empty/full checking logic sometimes failed causing the EP to stop processing requests. Signed-off-by: John Youn <johny...@synopsys.com> --- drivers/usb/dwc3

[PATCH 0/2] dwc3: gadget: Fix trbs left fixes

2016-05-19 Thread John Youn
with the trbs_left calculation. Regards, John John Youn (2): usb: dwc3: gadget: Simplify skipping of link TRBs usb: dwc3: gadget: Various fixes to trbs_left calculation drivers/usb/dwc3/gadget.c | 63 +-- 1 file changed, 39 insertions(+), 24 deletions

Re: [PATCH 10/22] usb: dwc3: gadget: initialize NUMP based on RxFIFO Size

2016-05-18 Thread John Youn
On 5/18/2016 1:35 AM, Felipe Balbi wrote: > Instead of using burst size to configure NUMP, we > should be using RxFIFO Size instead. DWC3 is smart > enough to know that it shouldn't burst in case burst > size is 0. > > Reported-by: John Youn <johny...@synopsys.com> >

Re: [PATCH 07/13] usb: dwc2: gadget: Corrected interval calculation

2016-05-18 Thread John Youn
On 5/18/2016 4:32 AM, Sergei Shtylyov wrote: > Hello. > > On 5/18/2016 2:16 AM, John Youn wrote: > >> From: Vardan Mikayelyan <mvar...@synopsys.com> >> >> According "Table 9-13" of USB2 Specification > > According to. > >>

Re: usb: dwc2: regression on MyBook Live Duo / Canyonlands since 4.3.0-rc4

2016-05-18 Thread John Youn
On 5/18/2016 12:15 PM, Christian Lamparter wrote: > On Tuesday, May 17, 2016 04:50:48 PM John Youn wrote: >> On 5/14/2016 6:11 AM, Christian Lamparter wrote: >>> On Thursday, May 12, 2016 11:40:28 AM John Youn wrote: >>>> On 5/12/2016 6:30 AM, Christian Lamparter wr

<    1   2   3   4   5   6   7   8   9   10   >