[PATCH 9/9] usb: dwc2: gadget: Add handler for WkupAlert interrupt

2018-08-29 Thread Grigor Tovmasyan
Added interrupt handler for WkupAlert interrupt. This interrupt should initiate Remote Wake up. Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/gadget.c | 25 + 1 file changed, 25 insertions(+) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c

[PATCH 8/9] usb: dwc2: gadget: enable WKUP_ALERT interrupt

2018-08-29 Thread Grigor Tovmasyan
host frame number. Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/gadget.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 66401ffeb5a2..4f99f2e44a5b 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c

[PATCH 7/9] usb: dwc2: gadget: Program GREFCLK register

2018-08-29 Thread Grigor Tovmasyan
Added dwc2_gadget_program_ref_clk function to program GREFCLK register in device mode. Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.h | 2 ++ drivers/usb/dwc2/gadget.c | 23 +++ 2 files changed, 25 insertions(+) diff --git a/drivers/usb/dwc2/core.h b/drivers

[PATCH 6/9] usb: dwc2: gadget: Add parameters for GREFCLK register

2018-08-29 Thread Grigor Tovmasyan
Added ref_clk_per and sof_cnt_wkup_alert parameters in dwc2_core_params struct and set default values. Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.h | 18 ++ drivers/usb/dwc2/params.c | 2 ++ 2 files changed, 20 insertions(+) diff --git a/drivers/usb/dwc2

[PATCH 4/9] usb: dwc2: Update target (u)frame calculation

2018-08-29 Thread Grigor Tovmasyan
In service interval based scheduling target (u)frame must be set as a last frame in this the service interval. Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/gadget.c | 17 + 1 file changed, 17 insertions(+) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2

[PATCH 5/9] usb: dwc2: Add definitions for new registers

2018-08-29 Thread Grigor Tovmasyan
New registers were added to dwc otg core. GREFCLK - This register used to control ref_clk parameters. GINTSTS2 - New WKUP_ALERT interrupt was added. GINTMSK2 - Mask register for GINTSTS2. Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/hw.h | 13 + 1 file changed, 13

[PATCH 3/9] usb: dwc2: Add dwc2_gadget_dec_frame_num_by_one() function

2018-08-29 Thread Grigor Tovmasyan
Added dwc2_gadget_dec_frame_num_by_one() function in gadget.c. This function will be used to calculate descriptor frame number field value. For service interval mode frame number in descriptor should point to last (u)frame in the interval. Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2

[PATCH 2/9] usb: dwc2: Add core parameter for service interval support

2018-08-29 Thread Grigor Tovmasyan
Added core parameter for service interval based scheduling. Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.h| 9 + drivers/usb/dwc2/debugfs.c | 1 + drivers/usb/dwc2/gadget.c | 4 drivers/usb/dwc2/params.c | 4 4 files changed, 18 insertions(+) diff --git a

[PATCH 1/9] usb: dwc2: Update registers definitions to support service interval

2018-08-29 Thread Grigor Tovmasyan
Added GHWCFG4_SERVICE_INTERVAL_SUPPORTED and DCTL_SERVICE_INTERVAL_SUPPORTED bits definitions to support service interval based scheduling. Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/hw.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/dwc2/hw.h b/drivers/usb/dwc2

[PATCH 0/9] usb: dwc2: device: Add service interval support

2018-08-29 Thread Grigor Tovmasyan
. Because of some inaccuracies of reference clock new interrupt was added to initiate remote wake up and keep sync with the host frame number. The new interrupt register were added GINTSTS2 for that interrupt. Grigor Tovmasyan (9): usb: dwc2: Update registers definitions to support service

Re: Possible race condition in f_mass_storage gadget during deinitialization. Kernel warning issued

2018-08-20 Thread Grigor Tovmasyan
Hi On 8/20/2018 15:20, Felipe Balbi wrote: > > Hi, > > Adrian Ambrożewicz writes: >> Hello, >> >> I'm consistently observing kernel warnings related to Mass Storage USB >> Gadget de-initialization flow. After investigation I believe that I've >> found root cause of these warnings, however I'm u

Re: [PATCH v2 3/3] usb: dwc2: Make dwc2_readl/writel functions endianness-agnostic.

2018-07-27 Thread Grigor Tovmasyan
Hi Felipe, On 7/27/2018 12:26, Gevorg Sahakyan wrote: > Declared dwc2_check_core_endianness() function for dynamicly check > core endianness. > Added needs_byte_swap flag to hsotg structure, and depending on > flag swap value inside dwc2_readl/writel functions. > > Signed-off-by: Gevorg Sahakyan

Re: [PATCH v2 2/4] usb: dwc2: Modify dwc2_readl/writel functions prototype

2018-07-26 Thread Grigor Tovmasyan
On 7/26/2018 16:10, Felipe Balbi wrote: > > Hi, > > Grigor Tovmasyan writes: >>>> Added hsotg argument to dwc2_readl/writel function prototype, >>>> and also instead of address pass offset of register. >>>> hsotg will contain flag field for endian

Re: [PATCH v2 2/4] usb: dwc2: Modify dwc2_readl/writel functions prototype

2018-07-26 Thread Grigor Tovmasyan
Hi Felipe, On 7/26/2018 14:43, Felipe Balbi wrote: > Gevorg Sahakyan writes: > >> Added hsotg argument to dwc2_readl/writel function prototype, >> and also instead of address pass offset of register. >> hsotg will contain flag field for endianness. >> >> Also customized dwc2_set_bit and dwc2_cle

Re: [PATCH] usb: gadget: dwc2: fix memory leak in gadget_init()

2018-05-24 Thread Grigor Tovmasyan
Hi Stefan, Marek Please test this patch and tell if it will cause any problem. Thanks, Grigor On 5/24/2018 6:22 PM, Grigor Tovmasyan wrote: > Freed allocated request for ep0 to prevent memory leak in case when > dwc2_driver_probe() failed. > > Signed-off-by: Grigor Tovmasyan

[PATCH] usb: gadget: dwc2: fix memory leak in gadget_init()

2018-05-24 Thread Grigor Tovmasyan
Freed allocated request for ep0 to prevent memory leak in case when dwc2_driver_probe() failed. Signed-off-by: Grigor Tovmasyan Cc: Stefan Wahren Cc: Marek Szyprowski --- drivers/usb/dwc2/gadget.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc2

Re: usb: dwc2: gadget: Fix memory leak in dwc2_gadget_init()

2018-05-17 Thread Grigor Tovmasyan
dering usb_add_gadget_udc() call. The issue happens if DWC2 > driver is initialized from deferred probe (in such case the gadget driver > is already registered). > > Felipe: please drop or revert this patch in your -next branch. > > > Best regards > Marek Szyprowski, PhD &g

Re: [PATCH v3] usb: dwc2: Fix kernel doc's warnings.

2018-05-16 Thread Grigor Tovmasyan
Hi Felipe, I rebase this patch to your current testing/next (3196f73ff844) BR, Grigor. On 5/16/2018 12:04 PM, Grigor Tovmasyan wrote: > Added descriptions for all not described parameters. > Fix all kernel doc's warnings. > > Signed-off-by: Grigor Tovmasyan > --- >

[PATCH v3] usb: dwc2: Fix kernel doc's warnings.

2018-05-16 Thread Grigor Tovmasyan
Added descriptions for all not described parameters. Fix all kernel doc's warnings. Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.c | 7 ++ drivers/usb/dwc2/core.h | 170 ++- drivers/usb/dwc2/debug.h | 2 +- drivers/usb

Re: dwc2 device testing with Service Interval plus LPM

2018-05-11 Thread Grigor Tovmasyan
On 5/11/2018 2:42 PM, Felipe Balbi wrote: > > Hi, > > Grigor Tovmasyan writes: > >> Hi all, >> >> I want to test a new feature of HSOTG core: Service Interval + LPM support >> in device mode. >> What I need to use from host side to be able generat

dwc2 device testing with Service Interval plus LPM

2018-05-11 Thread Grigor Tovmasyan
Hi all, I want to test a new feature of HSOTG core: Service Interval + LPM support in device mode. What I need to use from host side to be able generate appropriate ISOC IN traffic? Thanks, Grigor. -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message

[PATCH] usb: dwc2: Add Interpacket Gap(IPG) feature support

2018-05-05 Thread Grigor Tovmasyan
Added GHWCFG4_IPG_ISOC_SUPPORTED and DCFG_IPG_ISOC_SUPPORDED bits definitions to enable/disable IPG feature. Added ipg_isoc_en core parameter which will indicate IPG support enable/disable and initialize it. Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.h| 11

Re: [PATCH v1 0/2] usb: dwc2: gadget: Fixes for LPM

2018-05-02 Thread Grigor Tovmasyan
Hi Simon, On 4/21/2018 4:52 PM, Simon Shields wrote: > Hi Grigor, > > On Fri, Apr 20, 2018 at 01:00:16PM +0000, Grigor Tovmasyan wrote: >> Hi Simon, >> >> On 4/19/2018 8:31 PM, Simon Shields wrote: >>> Hi all, >>> >>> On 10/04/2018 10:21 PM,

Re: [PATCH] usb: dwc2: gadget: Fix memory leak in dwc2_gadget_init()

2018-04-23 Thread Grigor Tovmasyan
Hi Stefan, On 4/18/2018 1:11 AM, Stefan Wahren wrote: > Hi Grigor, > >> Grigor Tovmasyan hat am 16. April 2018 um >> 12:16 geschrieben: >> >> >> In dwc2_gadget_init() we allocate EP0 request via >> dwc2_hsotg_ep_alloc_request(). After that there

Re: [PATCH v1 0/2] usb: dwc2: gadget: Fixes for LPM

2018-04-20 Thread Grigor Tovmasyan
Hi Balbi, On 4/10/2018 2:21 PM, Grigor Tovmasyan wrote: > Here are two little fixes for LPM feature. > > First one is coverity warning fix. > > The Second one was asserted by Stefan Wahren. > > Changes from version 0: > > 1/2: > - Instead of converting para

Re: [PATCH v1 0/2] usb: dwc2: gadget: Fixes for LPM

2018-04-20 Thread Grigor Tovmasyan
Hi Simon, On 4/19/2018 8:31 PM, Simon Shields wrote: > Hi all, > > On 10/04/2018 10:21 PM, Grigor Tovmasyan wrote: >> Here are two little fixes for LPM feature. >> >> First one is coverity warning fix. >> >> The Second one was asserted by Stefan Wahren.

[PATCH] usb: dwc2: gadget: Fix memory leak in dwc2_gadget_init()

2018-04-16 Thread Grigor Tovmasyan
dwc2_hsotg_ep_alloc_request(). Tested using kmemleak. Cc: Stefan Wahren Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/gadget.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 6c32bf26e48e..24000bda5c20 100644

[PATCH v1 2/2] usb: dwc2: gadget: Change LPM default values

2018-04-10 Thread Grigor Tovmasyan
Changed default values of LPM parameters to avoid "dwc2_check_params: Invalid parameter" warnings when hardware did not support LPM feature. Cc: Stefan Wahren Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/params.c | 8 1 file changed, 4 insertions(+), 4 deletions(-)

[PATCH v1 1/2] usb: dwc2: gadget: Fix coverity issue

2018-04-10 Thread Grigor Tovmasyan
When _param is unsigned and the minimum value of range is 0, CHECK_RANGE macro gives the following warning: COVERITY NO_EFFECT: This less-than-zero comparison of an unsigned value is never true. So I changed the type of hird_threshold from u8 to int to avoid that warning. Signed-off-by: Grigor

[PATCH v1 0/2] usb: dwc2: gadget: Fixes for LPM

2018-04-10 Thread Grigor Tovmasyan
Here are two little fixes for LPM feature. First one is coverity warning fix. The Second one was asserted by Stefan Wahren. Changes from version 0: 1/2: - Instead of converting parameter in the CHECK_RANGE macro to int, changed hird_threshold type from u8 to int. Grigor Tovmasyan

Re: dwc2: Memory leak in dwc2_gadget_init

2018-04-09 Thread Grigor Tovmasyan
Hi Stefan, On 4/2/2018 12:59 PM, Stefan Wahren wrote: > Hi Minas, > > i noticed that in opposite to all allocations in dwc2_gadget_init() the > function dwc2_hsotg_ep_alloc_request() uses kzalloc. So in case > usb_add_gadget_udc() would fail, the memory of the USB request would be > leaked: >

Re: [PATCH v4] usb: dwc2: dwc2_vbus_supply_init: fix error check

2018-04-05 Thread Grigor Tovmasyan
On 4/5/2018 12:11 PM, Tomeu Vizoso wrote: > Hi Minas, > > On 04/05/2018 09:54 AM, Minas Harutyunyan wrote: >> Hi Tomeu, >> >> On 3/26/2018 1:01 PM, Tomeu Vizoso wrote: >>> devm_regulator_get_optional returns -ENODEV if the regulator isn't >>> there, so if that's the case we have to make sure not t

Re: [PATCH v4] usb: dwc2: dwc2_vbus_supply_init: fix error check

2018-04-05 Thread Grigor Tovmasyan
+4347,7 @@ static int _dwc2_hcd_start(struct usb_hcd *hcd) > > spin_unlock_irqrestore(&hsotg->lock, flags); > > - dwc2_vbus_supply_init(hsotg); > - > - return 0; > + return dwc2_vbus_supply_init(hsotg); > } > > /* > Reviewed-by: Grigor Tovmasyan -- 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 0/2] usb: dwc2: gadget: Fixes for LPM

2018-04-03 Thread Grigor Tovmasyan
He Stefan On 4/3/2018 8:09 PM, Stefan Wahren wrote: > Hi Grigor, > > Am 03.04.2018 um 13:21 schrieb Grigor Tovmasyan: >> Here are two little fixes for LPM feature. >> >> First one is coverity warning fix. >> >> The Second one was asserted by Stefan Wahren.

Re: [PATCH v1] usb: dwc2: Fix kernel doc's warnings.

2018-04-03 Thread Grigor Tovmasyan
On 4/3/2018 5:10 PM, Grigor Tovmasyan wrote: > On 4/3/2018 4:41 PM, Greg Kroah-Hartman wrote: >> On Tue, Apr 03, 2018 at 03:28:22PM +0400, Grigor Tovmasyan wrote: >>> Added descriptions for all not described parameters. >>> Fix all kernel doc's warnings. >>

[PATCH v2] usb: dwc2: Fix kernel doc's warnings.

2018-04-03 Thread Grigor Tovmasyan
Added descriptions for all not described parameters. Fix all kernel doc's warnings. Signed-off-by: Grigor Tovmasyan --- Changes from version 1: Fix minor kernel-doc style issue. Changes from version 0: Rebased to balbi/next. Fixed new kernel-doc warnings which cames from new pa

Re: [PATCH v1] usb: dwc2: Fix kernel doc's warnings.

2018-04-03 Thread Grigor Tovmasyan
On 4/3/2018 4:41 PM, Greg Kroah-Hartman wrote: > On Tue, Apr 03, 2018 at 03:28:22PM +0400, Grigor Tovmasyan wrote: >> Added descriptions for all not described parameters. >> Fix all kernel doc's warnings. >> >> Signed-off-by: Grigor Tovmasyan >> --- >>

[PATCH v1] usb: dwc2: Fix kernel doc's warnings.

2018-04-03 Thread Grigor Tovmasyan
Added descriptions for all not described parameters. Fix all kernel doc's warnings. Signed-off-by: Grigor Tovmasyan --- Changes from version 0: Rebased to balbi/next. Fixed new kernel-doc warnings which cames from new patches. --- drivers/usb/dwc2/core.c | 7 ++ drivers/usb

[PATCH 2/2] usb: dwc2: gadget: Change default values

2018-04-03 Thread Grigor Tovmasyan
Change default values of LPM parameters to avoid "dwc2_check_params: Invalid parameter" warnings when harwere did not support LPM feature. Cc: Stefan Wahren Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/params.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) di

[PATCH 1/2] usb: dwc2: gadget: Fix coverity issue

2018-04-03 Thread Grigor Tovmasyan
When _param is unsigned and the minimum value of range is 0, it gives the following warning: COVERITY NO_EFFECT: This less-than-zero comparison of an unsigned value is never true. Converting ._param to int to avoid this warning. Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/params.c | 2

[PATCH 0/2] usb: dwc2: gadget: Fixes for LPM

2018-04-03 Thread Grigor Tovmasyan
Here are two little fixes for LPM feature. First one is coverity warning fix. The Second one was asserted by Stefan Wahren. Grigor Tovmasyan (2): usb: dwc2: gadget: Fix coverity issue usb: dwc2: gadget: Change default values drivers/usb/dwc2/params.c | 10 +- 1 file changed, 5

Re: dwc2: Confusing warnings in next-20180327 on Raspberry Pi

2018-04-02 Thread Grigor Tovmasyan
Hi Stefan, On 4/2/2018 7:47 PM, Stefan Wahren wrote: > Hi Minas, > > in linux-next-20180327 i will get the following confusing warnings on the > Raspberry Pi: > > Linux raspberrypi 4.16.0-rc7-next-20180327+ #2 SMP PREEMPT Sat Mar 31 > 13:24:47 CEST 2018 armv6l GNU/Linux > > [6.809185] dwc

Re: [PATCH -next] usb: dwc2: pci: Fix error return code in dwc2_pci_probe()

2018-03-30 Thread Grigor Tovmasyan
On 3/28/2018 5:36 PM, Wei Yongjun wrote: > Fix to return error code -ENOMEM from the alloc fail error handling > case instead of 0, as done elsewhere in this function. > > Fixes: ecd29dabb2ba ("usb: dwc2: pci: Handle error cleanup in probe") > Signed-off-by: Wei Yong

Re: [PATCH v1 10/14] usb: dwc2: Add dwc2_enter_hibernation(), dwc2_exit_hibernation()

2018-03-12 Thread Grigor Tovmasyan
On 3/12/2018 5:34 PM, Felipe Balbi wrote: > > Hi, > > Grigor Tovmasyan writes: >> One more thing. >> >> In "969d58abe57d usb: dwc2: Enable LPM" patch the author's (John Youn) >> Signed-off is missing. >> >> Could you please manua

Re: [PATCH v1 10/14] usb: dwc2: Add dwc2_enter_hibernation(), dwc2_exit_hibernation()

2018-03-12 Thread Grigor Tovmasyan
One more thing. In "969d58abe57d usb: dwc2: Enable LPM" patch the author's (John Youn) Signed-off is missing. Could you please manually add his Signed-off ("Signed-off-by: John Youn ") or it's against rules? On 3/12/2018 5:07 PM, Felipe Balbi wrote: >

Re: [PATCH v1 10/14] usb: dwc2: Add dwc2_enter_hibernation(), dwc2_exit_hibernation()

2018-03-12 Thread Grigor Tovmasyan
Hi, Yes. I'm verifying, it's okay. Sorry for inconvenience. Thanks, Grigor. On 3/12/2018 4:47 PM, Felipe Balbi wrote: > > (please avoid top-posting) > > Hi, > > Grigor Tovmasyan writes: >> Hi Balbi, >> >> Please also cherry-pick following com

Re: [PATCH v1 10/14] usb: dwc2: Add dwc2_enter_hibernation(), dwc2_exit_hibernation()

2018-03-12 Thread Grigor Tovmasyan
Hi Balbi, Please also cherry-pick following commit from your 'testing/next' to 'tmp' right before 01/14. It will solve the problem. 969d58abe57d usb: dwc2: Enable LPM On 3/12/2018 4:03 PM, Felipe Balbi wrote: > > Hi, > > Grigor Tovmasyan writes: >>

Re: [PATCH v1 10/14] usb: dwc2: Add dwc2_enter_hibernation(), dwc2_exit_hibernation()

2018-03-12 Thread Grigor Tovmasyan
ch> pick 3d6c862d9361 usb: dwc2: gadget: Moved dtxfsiz backup array place On 3/12/2018 2:22 PM, Felipe Balbi wrote: > Grigor Tovmasyan writes: > >> Hi Balbi, >> >> This patch didn't apply, because you missing 01/14 and 02/14 commits >> from this patch se

Re: [PATCH v1 10/14] usb: dwc2: Add dwc2_enter_hibernation(), dwc2_exit_hibernation()

2018-03-09 Thread Grigor Tovmasyan
n 3/9/2018 5:10 PM, Grigor Tovmasyan wrote: > Hi Balbi, > > Seems like your testing/next was changed. > I will rebese and send them again. > > On 3/9/2018 1:07 PM, Felipe Balbi wrote: >> Grigor Tovmasyan writes: >> >>> From: Vardan Mikayelyan >>> >

Re: [PATCH v1 10/14] usb: dwc2: Add dwc2_enter_hibernation(), dwc2_exit_hibernation()

2018-03-09 Thread Grigor Tovmasyan
Hi Balbi, Seems like your testing/next was changed. I will rebese and send them again. On 3/9/2018 1:07 PM, Felipe Balbi wrote: > Grigor Tovmasyan writes: > >> From: Vardan Mikayelyan >> >> These are wrapper functions which are calling device or host >> en

Re: [PATCH 11/11] usb: dwc2: Enable LPM

2018-03-09 Thread Grigor Tovmasyan
Hi John, Could you please add your Signed-off to this patch? On 3/9/2018 12:06 PM, Felipe Balbi wrote: > Hi, > > Grigor Tovmasyan writes: >> From: John Youn >> >> Set 'lpm_capable' flag in the gadget structure so >> indicating that LPM is supp

Re: [balbi-usb:testing/next 45/57] drivers/usb/dwc2/core.c:438:13: error: static declaration of 'dwc2_clear_force_mode' follows non-static declaration

2018-03-09 Thread Grigor Tovmasyan
Hi Balbi, I saw you applied "e9c07984979d usb: dwc2: Force mode optimizations" patch to your testing/next. Please re-apply this commit. On 2/15/2018 6:37 PM, Grigor Tovmasyan wrote: > Hi Balbi > > On 2/15/2018 17:34, Felipe Balbi wrote: >> Hi, >> >>

[PATCH v1 14/14] usb: dwc2: Enable power down

2018-02-16 Thread Grigor Tovmasyan
From: John Youn Enable the power down option based on the core capability. Signed-off-by: John Youn Signed-off-by: Vardan Mikayelyan Signed-off-by: Artur Petrosyan Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/params.c | 16 +++- 1 file changed, 15 insertions(+), 1

[PATCH v1 13/14] usb: dwc2: Change hub-control to allow hibernation

2018-02-16 Thread Grigor Tovmasyan
From: Vardan Mikayelyan Affected cases: ClearPortFeature's USB_PORT_FEAT_SUSPEND SetPortFeature's USB_PORT_FEAT_SUSPEND USB_PORT_FEAT_RESET Signed-off-by: Vardan Mikayelyan Signed-off-by: John Youn Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/hcd.c | 16 +-

[PATCH v1 12/14] usb: dwc2: Add dwc2_handle_gpwrdn_intr() handler

2018-02-16 Thread Grigor Tovmasyan
as it was(used corresponing functions for host and gadget), maybe in the future we'll resolve this problem and will use dwc2_core_init for both sides. Signed-off-by: Vardan Mikayelyan Signed-off-by: John Youn Signed-off-by: Artur Petrosyan Signed-off-by: Minas Harutyunyan Signed-off-by: G

[PATCH v1 10/14] usb: dwc2: Add dwc2_enter_hibernation(), dwc2_exit_hibernation()

2018-02-16 Thread Grigor Tovmasyan
From: Vardan Mikayelyan These are wrapper functions which are calling device or host enter/exit hibernation functions. Signed-off-by: Vardan Mikayelyan Signed-off-by: John Youn Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.c | 38 ++ drivers

[PATCH v1 11/14] usb: dwc2: Allow entering hibernation from USB_SUSPEND interrupt

2018-02-16 Thread Grigor Tovmasyan
From: Vardan Mikayelyan Do changes to allow entering hibernated state from USB_SUSPEND interrupt. All code is added under if conditions and mustn't impact existing functionality. Signed-off-by: Vardan Mikayelyan Signed-off-by: John Youn Signed-off-by: Grigor Tovmasyan --- drivers/usb

[PATCH v1 08/14] usb: dwc2: Add helper functions for restore routine

2018-02-16 Thread Grigor Tovmasyan
-off-by: Minas Harutyunyan Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.c | 136 drivers/usb/dwc2/core.h | 3 ++ 2 files changed, 139 insertions(+) diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c index 69c19706334d

[PATCH v1 09/14] usb: dwc2: Add host/device hibernation functions

2018-02-16 Thread Grigor Tovmasyan
names: dwc2_gadget_enter_hibernation() dwc2_gadget_exit_hibernation() dwc2_host_enter_hibernation() dwc2_host_exit_hibernation() Signed-off-by: Vardan Mikayelyan Signed-off-by: John Youn Signed-off-by: Artur Petrosyan Signed-off-by: Minas Harutyunyan Signed-off-by: Grigor Tovmasyan --- drivers/usb

[PATCH v1 06/14] usb: dwc2: gadget: Add remote_wakeup_allowed flag

2018-02-16 Thread Grigor Tovmasyan
bringing remote wake-up signalling. Signed-off-by: Vardan Mikayelyan Signed-off-by: John Youn Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.h | 3 +++ drivers/usb/dwc2/gadget.c | 5 + 2 files changed, 8 insertions(+) diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h

[PATCH v1 07/14] usb: dwc2: Changes in registers backup/restore functions

2018-02-16 Thread Grigor Tovmasyan
_registers() dwc2_restore_host_registers() dwc2_backup_global_registers() dwc2_restore_global_registers() Signed-off-by: Vardan Mikayelyan Signed-off-by: John Youn Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.c | 8 ++-- drivers/usb/dwc2/core.h | 6 -- drivers/usb/dwc2/

[PATCH v1 05/14] usb: dwc2: core: Add hibernated flag

2018-02-16 Thread Grigor Tovmasyan
From: Vardan Mikayelyan Added a flag to indicate that core is in hibernation, it is used to determine the hibernation state of the core. Signed-off-by: Vardan Mikayelyan Signed-off-by: John Youn Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.h | 2 ++ drivers/usb/dwc2

[PATCH v1 03/14] usb: dwc2: gadget: Moved dtxfsiz backup array place

2018-02-16 Thread Grigor Tovmasyan
From: Vardan Mikayelyan Moved dtxfsiz from dwc2_gregs_backup to dwc2_dregs_backup, because it is device register. Signed-off-by: Vardan Mikayelyan Signed-off-by: John Youn Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.c | 8 ++-- drivers/usb/dwc2/core.h | 4 ++-- drivers

[PATCH v1 04/14] usb: dwc2: gadget: Fix dwc2_restore_device_registers

2018-02-16 Thread Grigor Tovmasyan
ardan Mikayelyan Signed-off-by: John Youn Signed-off-by: Artur Petrosyan Signed-off-by: Minas Harutyunyan Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.c | 2 +- drivers/usb/dwc2/core.h | 5 +++-- drivers/usb/dwc2/gadget.c | 38 ++ 3 files ch

[PATCH v1 02/14] usb: dwc2: Add hibernation field into dwc2_hw_params

2018-02-16 Thread Grigor Tovmasyan
-off-by: Vardan Mikayelyan Signed-off-by: John Youn Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.c | 2 +- drivers/usb/dwc2/core.h | 12 ++-- drivers/usb/dwc2/hcd.c| 4 ++-- drivers/usb/dwc2/params.c | 34 ++ 4 files changed, 47 insertions(

[PATCH v1 01/14] usb: dwc2: Rename hibernation to partial_power_down

2018-02-16 Thread Grigor Tovmasyan
off-by: Vardan Mikayelyan Signed-off-by: John Youn Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.c | 14 +++--- drivers/usb/dwc2/core.h | 12 ++-- drivers/usb/dwc2/core_intr.c | 14 +++--- drivers/usb/dwc2/debugfs.c | 2 +- drivers/usb/dwc2/ga

[PATCH v1 00/14] usb: dwc2: Add hibernation support

2018-02-16 Thread Grigor Tovmasyan
This series contains patches which are already have been sent in "usb: dwc2: fixes, enhancements and new features" series. That patch series was too large, and based on community feedbacks decided to split that series into small pieces. This is a fourth and last part. In this series we included

[PATCH 6/6] usb: dwc2: Force mode optimizations

2018-02-16 Thread Grigor Tovmasyan
dwc2_force_mode_if_needed() function since the "if needed" part is already taken care of by the polling in dwc2_force_mode(). Finally, remove all other calls to dwc2_clear_force_mode(). Tested-by: Stefan Wahren Signed-off-by: John Youn Signed-off-by: Vardan Mikayelyan Signed-off-

Re: [PATCH 6/6] usb: dwc2: Force mode optimizations

2018-02-16 Thread Grigor Tovmasyan
Hi Balbi, On 2/16/2018 11:09, Felipe Balbi wrote: > > Hi, > > Grigor Tovmasyan writes: > >> Hi Balbi, >> >> I rebased this commit to your testing/next (see below). > > Are you sure you did? Yes. I checked my ve

Re: [PATCH 5/6] usb: dwc2: eliminate irq parameter from dwc2_gadget_init

2018-02-15 Thread Grigor Tovmasyan
On 2/15/2018 17:08, Felipe Balbi wrote: > Grigor Tovmasyan writes: > >> From: Vardan Mikayelyan >> >> The irq is available in hsotg already, so there's no need to pass it as >> separate function parameter. >> >> Signed-off-by: Vardan Mikayelyan &

Re: [PATCH 6/6] usb: dwc2: Force mode optimizations

2018-02-15 Thread Grigor Tovmasyan
cements and new features " patch series. Please apply this rebased patch. Also, please, reapply "[PATCH 09/17] usb: dwc2: Make dwc2_force_mode() static" which was dropped because of having dependancy from this pacth. Thanks a lot. On 1/16/2018 16:05, Grigor Tovmasyan wrote: > Fro

Re: [PATCH 01/14] usb: dwc2: Rename hibernation to partial_power_down

2018-02-15 Thread Grigor Tovmasyan
Hi Balbi On 2/15/2018 17:23, Felipe Balbi wrote: > Grigor Tovmasyan writes: > >> From: Vardan Mikayelyan >> >> No-op change, only rename. >> >> This code was misnamed originally. It was only responsible for partial >> power down and not for hibernation

Re: [balbi-usb:testing/next 45/57] drivers/usb/dwc2/core.c:438:13: error: static declaration of 'dwc2_clear_force_mode' follows non-static declaration

2018-02-15 Thread Grigor Tovmasyan
Hi Balbi On 2/15/2018 17:34, Felipe Balbi wrote: > > Hi, > > kbuild test robot writes: >> tree: >> https://urldefense.proofpoint.com/v2/url?u=https-3A__git.kernel.org_pub_scm_linux_kernel_git_balbi_usb.git&d=DwIFAg&c=DPL6_X_6JkXFx7AXWqB0tg&r=K1ULVL1slpLXpMJJlAXSOxws4tRq0IkTBqxDkyW2hUQ&m=2Hq2

[PATCH] usb: dwc2: Fix interval type issue

2018-02-06 Thread Grigor Tovmasyan
The maximum value that unsigned char can hold is 255, meanwhile the maximum value of interval is 2^(bIntervalMax-1)=2^15. Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2

[PATCH] usb: dwc2: Fix kernel doc's warnings.

2018-02-06 Thread Grigor Tovmasyan
Added descriptions for all not described parameters. Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.c | 7 +++ drivers/usb/dwc2/core.h | 131 ++- drivers/usb/dwc2/debug.h | 2 +- drivers/usb/dwc2/debugfs.c | 19

[PATCH 14/14] usb: dwc2: Enable power down

2018-01-26 Thread Grigor Tovmasyan
From: John Youn Enable the power down option based on the core capability. Signed-off-by: John Youn Signed-off-by: Vardan Mikayelyan Signed-off-by: Artur Petrosyan Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/params.c | 16 +++- 1 file changed, 15 insertions(+), 1

[PATCH 13/14] usb: dwc2: Change hub-control to allow hibernation

2018-01-26 Thread Grigor Tovmasyan
From: Vardan Mikayelyan Affected cases: ClearPortFeature's USB_PORT_FEAT_SUSPEND SetPortFeature's USB_PORT_FEAT_SUSPEND USB_PORT_FEAT_RESET Signed-off-by: Vardan Mikayelyan Signed-off-by: John Youn Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/hcd.c | 16 +-

[PATCH 12/14] usb: dwc2: Add dwc2_handle_gpwrdn_intr() handler

2018-01-26 Thread Grigor Tovmasyan
as it was(used corresponing functions for host and gadget), maybe in the future we'll resolve this problem and will use dwc2_core_init for both sides. Signed-off-by: Vardan Mikayelyan Signed-off-by: John Youn Signed-off-by: Artur Petrosyan Signed-off-by: Minas Harutyunyan Signed-off-by: G

[PATCH 10/14] usb: dwc2: Add dwc2_enter_hibernation(), dwc2_exit_hibernation()

2018-01-26 Thread Grigor Tovmasyan
From: Vardan Mikayelyan These are wrapper functions which are calling device or host enter/exit hibernation functions. Signed-off-by: Vardan Mikayelyan Signed-off-by: John Youn Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.c | 38 ++ drivers

[PATCH 11/14] usb: dwc2: Allow entering hibernation from USB_SUSPEND interrupt

2018-01-26 Thread Grigor Tovmasyan
From: Vardan Mikayelyan Do changes to allow entering hibernated state from USB_SUSPEND interrupt. All code is added under if conditions and mustn't impact existing functionality. Signed-off-by: Vardan Mikayelyan Signed-off-by: John Youn Signed-off-by: Grigor Tovmasyan --- drivers/usb

[PATCH 09/14] usb: dwc2: Add host/device hibernation functions

2018-01-26 Thread Grigor Tovmasyan
names: dwc2_gadget_enter_hibernation() dwc2_gadget_exit_hibernation() dwc2_host_enter_hibernation() dwc2_host_exit_hibernation() Signed-off-by: Vardan Mikayelyan Signed-off-by: John Youn Signed-off-by: Artur Petrosyan Signed-off-by: Minas Harutyunyan Signed-off-by: Grigor Tovmasyan --- drivers/usb

[PATCH 08/14] usb: dwc2: Add helper functions for restore routine

2018-01-26 Thread Grigor Tovmasyan
-off-by: Minas Harutyunyan Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.c | 136 drivers/usb/dwc2/core.h | 3 ++ 2 files changed, 139 insertions(+) diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c index 8647e2a26eee

[PATCH 07/14] usb: dwc2: Changes in registers backup/restore functions

2018-01-26 Thread Grigor Tovmasyan
_registers() dwc2_restore_host_registers() dwc2_backup_global_registers() dwc2_restore_global_registers() Signed-off-by: Vardan Mikayelyan Signed-off-by: John Youn Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.c | 8 ++-- drivers/usb/dwc2/core.h | 6 -- drivers/usb/dwc2/

[PATCH 05/14] usb: dwc2: core: Add hibernated flag

2018-01-26 Thread Grigor Tovmasyan
From: Vardan Mikayelyan Added a flag to indicate that core is in hibernation, it is used to determine the hibernation state of the core. Signed-off-by: Vardan Mikayelyan Signed-off-by: John Youn Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.h | 2 ++ drivers/usb/dwc2

[PATCH 06/14] usb: dwc2: gadget: Add remote_wakeup_allowed flag

2018-01-26 Thread Grigor Tovmasyan
bringing remote wake-up signalling. Signed-off-by: Vardan Mikayelyan Signed-off-by: John Youn Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.h | 3 +++ drivers/usb/dwc2/gadget.c | 5 + 2 files changed, 8 insertions(+) diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h

[PATCH 03/14] usb: dwc2: gadget: Moved dtxfsiz backup array place

2018-01-26 Thread Grigor Tovmasyan
From: Vardan Mikayelyan Moved dtxfsiz from dwc2_gregs_backup to dwc2_dregs_backup, because it is device register. Signed-off-by: Vardan Mikayelyan Signed-off-by: John Youn Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.c | 8 ++-- drivers/usb/dwc2/core.h | 4 ++-- drivers

[PATCH 04/14] usb: dwc2: gadget: Fix dwc2_restore_device_registers

2018-01-26 Thread Grigor Tovmasyan
ardan Mikayelyan Signed-off-by: John Youn Signed-off-by: Artur Petrosyan Signed-off-by: Minas Harutyunyan Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.c | 2 +- drivers/usb/dwc2/core.h | 5 +++-- drivers/usb/dwc2/gadget.c | 38 ++ 3 files ch

[PATCH 01/14] usb: dwc2: Rename hibernation to partial_power_down

2018-01-26 Thread Grigor Tovmasyan
off-by: Vardan Mikayelyan Signed-off-by: John Youn Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.c | 14 +++--- drivers/usb/dwc2/core.h | 12 ++-- drivers/usb/dwc2/core_intr.c | 14 +++--- drivers/usb/dwc2/debugfs.c | 2 +- drivers/usb/dwc2/ga

[PATCH 02/14] usb: dwc2: Add hibernation field into dwc2_hw_params

2018-01-26 Thread Grigor Tovmasyan
-off-by: Vardan Mikayelyan Signed-off-by: John Youn Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.c | 2 +- drivers/usb/dwc2/core.h | 12 ++-- drivers/usb/dwc2/hcd.c| 4 ++-- drivers/usb/dwc2/params.c | 34 ++ 4 files changed, 47 insertions(

[PATCH 00/14] usb: dwc2: Add hibernation support

2018-01-26 Thread Grigor Tovmasyan
This series contains patches which are already have been sent in "usb: dwc2: fixes, enhancements and new features" series. That patch series was too large, and based on community feedbacks decided to split that series into small pieces. This is a fourth and last part. In this series we included

[PATCH 11/11] usb: dwc2: Enable LPM

2018-01-24 Thread Grigor Tovmasyan
From: John Youn Set 'lpm_capable' flag in the gadget structure so indicating that LPM is supported. Signed-off-by: Sevak Arakelyan Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/gadget.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/usb/dwc2/gadget.c b/d

[PATCH 10/11] usb: dwc2: Add core state checking

2018-01-24 Thread Grigor Tovmasyan
Added core state checking in dwc2_hsotg_ep_queue() function to make sure that application will submit requests only in L0 state. Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/gadget.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc2/gadget.c b

[PATCH 09/11] usb: dwc2: Add call_gadget() function call

2018-01-24 Thread Grigor Tovmasyan
Added call_gadget() function call when entering to L1 state to inform gadget that core is in L1 state. Did the same thing when exiting from L1 state to inform gadget that core is in L0 state. Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core_intr.c | 6 ++ 1 file changed, 6

[PATCH 08/11] usb: dwc2: gadget: Configure the core to enable LPM

2018-01-24 Thread Grigor Tovmasyan
From: Sevak Arakelyan Configure core in device mode to support LPM according to programming guide. Device will start giving valid responses for LPM tokens. After this patch device side LPM will start working. Signed-off-by: Sevak Arakelyan Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2

[PATCH 07/11] usb: dwc2: Enable LPM Transaction Received interrupt

2018-01-24 Thread Grigor Tovmasyan
From: Sevak Arakelyan Enable "LPM Transaction Received" interrupt for receive an interrupt when host will send LPM token. Signed-off-by: Sevak Arakelyan Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core_intr.c | 5 +++-- drivers/usb/dwc2/gadget.c| 3 ++- drivers/usb/

[PATCH 06/11] usb: dwc2: gadget: LPM interrupt handler

2018-01-24 Thread Grigor Tovmasyan
From: Sevak Arakelyan This interrupt indicates that an LPM transaction was received on the USB bus. After getting this interrupt we are going from L0 state to L1 state. Signed-off-by: Sevak Arakelyan Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core_intr.c | 63

[PATCH 05/11] usb: dwc2: gadget: Add functionality to exit from LPM L1 state

2018-01-24 Thread Grigor Tovmasyan
From: Sevak Arakelyan Add a function which will be called if device is in L1 sleep state and Resume/Remote Wakeup Detected interrupt is asserted. Signed-off-by: Sevak Arakelyan Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core_intr.c | 52

[PATCH 04/11] usb: dwc2: Add core parameters for LPM support

2018-01-24 Thread Grigor Tovmasyan
From: Sevak Arakelyan Add lpm, lpm_clock_gating, besl, hird_threshold_en and hird_threshold core parameters. These will indicate LPM and LPM Errata support as well as chosen L1 sleeping mode for the core and PHY. Signed-off-by: Sevak Arakelyan Signed-off-by: Grigor Tovmasyan --- drivers/usb

[PATCH 03/11] usb: dwc2: Rename GLPMCFG... definitions

2018-01-24 Thread Grigor Tovmasyan
From: Sevak Arakelyan Make field names of GLPMCFG register in definitions to be the same with the databook. Signed-off-by: Sevak Arakelyan Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/hw.h | 38 -- 1 file changed, 20 insertions(+), 18 deletions

[PATCH 02/11] usb: dwc2: Backup and restore PCGCCTL1 register

2018-01-24 Thread Grigor Tovmasyan
From: Razmik Karapetyan Backup PCGCCTL1 register when entering hibernation mode and restore it after exiting from hibernation, to keep active ACG feature. Signed-off-by: Razmik Karapetyan Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.c | 2 ++ drivers/usb/dwc2/core.h | 1 + 2

  1   2   3   >