[PATCH v2 15/15] usb: dwc2: Get rid of useless error checks in suspend interrupt

2021-04-16 Thread Artur Petrosyan
power_down' is not correct. Get rid of the pile of error checking. - As part of this cleanup some of the error messages not to have __func__ in them. That's not needed for dev_err() calls since they already have the device name as part of the message. Signed-off-by: Artur Petrosyan Signed-off-by: Dougla

[PATCH v2 11/15] usb: dwc2: Add hibernation entering flow by system suspend

2021-04-16 Thread Artur Petrosyan
Adds a new flow of entering hibernation when PC is hibernated or suspended. Signed-off-by: Artur Petrosyan --- Changes in v2: - None drivers/usb/dwc2/hcd.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 093b1717df01

[PATCH v2 12/15] usb: dwc2: Add hibernation exiting flow by system resume

2021-04-16 Thread Artur Petrosyan
Adds a new flow of exiting hibernation when PC is resumed from suspend state. Signed-off-by: Artur Petrosyan --- Changes in v2: - None drivers/usb/dwc2/hcd.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 92848629cc61

[PATCH v2 14/15] usb: dwc2: Update dwc2_handle_usb_suspend_intr function.

2021-04-16 Thread Artur Petrosyan
or Partial Power Down) based on OTG_EN_PWROPT. Signed-off-by: Artur Petrosyan Signed-off-by: Minas Harutyunyan Acked-by: Minas Harutyunyan --- drivers/usb/dwc2/core_intr.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/usb/dwc2/core_intr.c b/drivers/usb/dwc2

[PATCH v2 13/15] usb: dwc2: Add exit hibernation mode before removing drive

2021-04-16 Thread Artur Petrosyan
rmed for host if not then exit is performed for device mode. The introduced checking is because in hibernation state all registers are not accessible. Signed-off-by: Artur Petrosyan Reported-by: kernel test robot Reported-by: Dan Carpenter --- drivers/usb/dwc2/platform.c | 15 +++ 1 file c

[PATCH v2 10/15] usb: dwc2: Allow exit hibernation in urb enqueue

2021-04-16 Thread Artur Petrosyan
When core is in hibernation state and an external hub is connected, upper layer sends URB enqueue request, which results in port reset issue. - Added exit from hibernation state to avoid port reset issue and process upper layer request properly. Signed-off-by: Artur Petrosyan --- Changes in v2

[PATCH v2 09/15] usb: dwc2: Move exit hibernation to dwc2_port_resume() function

2021-04-16 Thread Artur Petrosyan
This move is done to call hibernation exit handler in "dwc2_port_resume()" function when core receives port resume. Otherwise it could be confusing to exit hibernation in "dwc2_hcd_hub_control()" function but other power saving modes in "dwc2_port_resume()" f

[PATCH v2 08/15] usb: dwc2: Move enter hibernation to dwc2_port_suspend() function

2021-04-16 Thread Artur Petrosyan
This move is done to call enter hibernation handler in "dwc2_port_suspend()" function when core receives port suspend. Otherwise it could be confusing to enter to hibernation in "dwc2_hcd_hub_control()" function but other power saving modes in "dwc2_port_suspend()" f

[PATCH v2 07/15] usb: dwc2: Clear GINTSTS_RESTOREDONE bit after restore is generated.

2021-04-16 Thread Artur Petrosyan
is asserted. To avoid restore done interrupt storm after restore is generated clear GINTSTS_RESTOREDONE bit in GINTSTS register. Signed-off-by: Artur Petrosyan Acked-by: Minas Harutyunyan --- drivers/usb/dwc2/core.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/dwc2

[PATCH v2 06/15] usb: dwc2: Clear fifo_map when resetting core.

2021-04-16 Thread Artur Petrosyan
DUAL_ROLE" mode. - Added "static inline void dwc2_clear_fifo_map()" helper function to clear fifo_map with peripheral or dual role mode. - Added a dummy version of "dwc2_clear_fifo_map()" helper for host-only mode. Signed-off-by: Artur Petrosyan Acked-by: Minas Haruty

[PATCH v2 05/15] usb: dwc2: Allow exiting hibernation from gpwrdn rst detect

2021-04-16 Thread Artur Petrosyan
of "dwc2_handle_gpwrdn_intr()" function from void to int because exit from hibernation functions have a return value. Signed-off-by: Artur Petrosyan Acked-by: Minas Harutyunyan --- drivers/usb/dwc2/core_intr.c | 23 ++- 1 file changed, 18 insertions(+), 5 deletion

[PATCH v2 04/15] usb: dwc2: Fix hibernation between host and device modes.

2021-04-16 Thread Artur Petrosyan
is restored which is the solution described above. Fixes: 65c9c4c6b01f ("usb: dwc2: Add dwc2_handle_gpwrdn_intr() handler") Signed-off-by: Artur Petrosyan Signed-off-by: Minas Harutyunyan Acked-by: Minas Harutyunyan --- drivers/usb/dwc2/core_intr.c | 154 +++-

[PATCH v2 03/15] usb: dwc2: Fix host mode hibernation exit with remote wakeup flow.

2021-04-16 Thread Artur Petrosyan
Added setting "port_connect_status_change" flag to "1" in order to re-enumerate, because after exit from hibernation port connection status is not detected. Fixes: c5c403dc4336 ("usb: dwc2: Add host/device hibernation functions") Signed-off-by: Artur Petrosya

[PATCH v2 02/15] usb: dwc2: Reset DEVADDR after exiting gadget hibernation.

2021-04-16 Thread Artur Petrosyan
exits from gadget hibernation. Signed-off-by: Artur Petrosyan Signed-off-by: Minas Harutyunyan Acked-by: Minas Harutyunyan --- 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 2f50f3e62caa..e6bb1bdb2760

[PATCH v2 01/15] usb: dwc2: Update exit hibernation when port reset is asserted

2021-04-16 Thread Artur Petrosyan
ter debug message print. - Added "dwc2_exit_hibernation()" function error checking. Signed-off-by: Artur Petrosyan --- Changes in v2: - None drivers/usb/dwc2/hcd.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/usb/dwc2/hcd.c

[PATCH v2 00/15] usb: dwc2: Fix Hibernation issues.

2021-04-16 Thread Artur Petrosyan
ter. Also removed some text from cover letter because I think that is why vger.kernel.org was rejecting it. Artur Petrosyan (15): usb: dwc2: Update exit hibernation when port reset is asserted usb: dwc2: Reset DEVADDR after exiting gadget hibernation. usb: dwc2: Fix host mode hibernation exit w

Re: [PATCH 10/15] usb: dwc2: Allow exit hibernation in urb enqueue

2021-04-16 Thread Artur Petrosyan
Hi Sergei, On 4/16/2021 09:43, Artur Petrosyan wrote: > Hi Sergei, > > On 4/15/2021 13:12, Sergei Shtylyov wrote: >> On 15.04.2021 8:40, Artur Petrosyan wrote: >> >>> When core is in hibernation state and an external >>> hub is connected, upper layer sends

Re: [PATCH 13/15] usb: dwc2: Add exit hibernation mode before removing drive

2021-04-15 Thread Artur Petrosyan
Hi Sergei, On 4/15/2021 13:24, Sergei Shtylyov wrote: > On 15.04.2021 8:41, Artur Petrosyan wrote: > >> When dwc2 core is in hibernation mode loading >> driver again causes driver fail. Because in >> that mode registers are not accessible. >> >> In order to ex

Re: [PATCH 10/15] usb: dwc2: Allow exit hibernation in urb enqueue

2021-04-15 Thread Artur Petrosyan
Hi Sergei, On 4/15/2021 13:12, Sergei Shtylyov wrote: > On 15.04.2021 8:40, Artur Petrosyan wrote: > >> When core is in hibernation state and an external >> hub is connected, upper layer sends URB enqueue request, >> which results in port reset issue. >> >>

[PATCH 15/15] usb: dwc2: Get rid of useless error checks in suspend interrupt

2021-04-14 Thread Artur Petrosyan
power_down' is not correct. Get rid of the pile of error checking. - As part of this cleanup some of the error messages not to have __func__ in them. That's not needed for dev_err() calls since they already have the device name as part of the message. Signed-off-by: Artur Petrosyan Signed-off-by: Dougla

[PATCH 14/15] usb: dwc2: Update dwc2_handle_usb_suspend_intr function.

2021-04-14 Thread Artur Petrosyan
or Partial Power Down) based on OTG_EN_PWROPT. Signed-off-by: Artur Petrosyan Signed-off-by: Minas Harutyunyan Acked-by: Minas Harutyunyan --- drivers/usb/dwc2/core_intr.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/usb/dwc2/core_intr.c b/drivers/usb/dwc2

[PATCH 13/15] usb: dwc2: Add exit hibernation mode before removing drive

2021-04-14 Thread Artur Petrosyan
rmed for host if not then exit is performed for device mode. The introduced checking is because in hibernation state all registers are not accessible. Signed-off-by: Artur Petrosyan --- drivers/usb/dwc2/platform.c | 16 1 file changed, 16 insertions(+) diff --git a/drivers/usb/dwc2

[PATCH 12/15] usb: dwc2: Add hibernation exiting flow by system resume

2021-04-14 Thread Artur Petrosyan
Adds a new flow of exiting hibernation when PC is resumed from suspend state. Signed-off-by: Artur Petrosyan --- drivers/usb/dwc2/hcd.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index db8eb1940d17..c92307775863 100644

[PATCH 11/15] usb: dwc2: Add hibernation entering flow by system suspend

2021-04-14 Thread Artur Petrosyan
Adds a new flow of entering hibernation when PC is hibernated or suspended. Signed-off-by: Artur Petrosyan --- drivers/usb/dwc2/hcd.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 3b03b2d73aaa..db8eb1940d17 100644

[PATCH 10/15] usb: dwc2: Allow exit hibernation in urb enqueue

2021-04-14 Thread Artur Petrosyan
When core is in hibernation state and an external hub is connected, upper layer sends URB enqueue request, which results in port reset issue. - Added exit from hibernation state to avoid port reset issue and process upper layer request properly. Signed-off-by: Artur Petrosyan --- drivers/usb

[PATCH 09/15] usb: dwc2: Move exit hibernation to dwc2_port_resume() function

2021-04-14 Thread Artur Petrosyan
This move is done to call hibernation exit handler in "dwc2_port_resume()" function when core receives port resume. Otherwise it could be confusing to exit hibernation in "dwc2_hcd_hub_control()" function but other power saving modes in "dwc2_port_resume()" f

[PATCH 08/15] usb: dwc2: Move enter hibernation to dwc2_port_suspend() function

2021-04-14 Thread Artur Petrosyan
This move is done to call enter hibernation handler in "dwc2_port_suspend()" function when core receives port suspend. Otherwise it could be confusing to enter to hibernation in "dwc2_hcd_hub_control()" function but other power saving modes in "dwc2_port_suspend()" f

[PATCH 07/15] usb: dwc2: Clear GINTSTS_RESTOREDONE bit after restore is generated.

2021-04-14 Thread Artur Petrosyan
is asserted. To avoid restore done interrupt storm after restore is generated clear GINTSTS_RESTOREDONE bit in GINTSTS register. Signed-off-by: Artur Petrosyan Acked-by: Minas Harutyunyan --- drivers/usb/dwc2/core.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/dwc2

[PATCH 06/15] usb: dwc2: Clear fifo_map when resetting core.

2021-04-14 Thread Artur Petrosyan
DUAL_ROLE" mode. - Added "static inline void dwc2_clear_fifo_map()" helper function to clear fifo_map with peripheral or dual role mode. - Added a dummy version of "dwc2_clear_fifo_map()" helper for host-only mode. Signed-off-by: Artur Petrosyan Acked-by: Minas Haruty

[PATCH 05/15] usb: dwc2: Allow exiting hibernation from gpwrdn rst detect

2021-04-14 Thread Artur Petrosyan
of "dwc2_handle_gpwrdn_intr()" function from void to int because exit from hibernation functions have a return value. Signed-off-by: Artur Petrosyan Acked-by: Minas Harutyunyan --- drivers/usb/dwc2/core_intr.c | 23 ++- 1 file changed, 18 insertions(+), 5 deletion

[PATCH 04/15] usb: dwc2: Fix hibernation between host and device modes.

2021-04-14 Thread Artur Petrosyan
is restored which is the solution described above. Fixes: 65c9c4c6b01f ("usb: dwc2: Add dwc2_handle_gpwrdn_intr() handler") Signed-off-by: Artur Petrosyan Signed-off-by: Minas Harutyunyan Acked-by: Minas Harutyunyan --- drivers/usb/dwc2/core_intr.c | 154 +++-

[PATCH 03/15] usb: dwc2: Fix host mode hibernation exit with remote wakeup flow.

2021-04-14 Thread Artur Petrosyan
Added setting "port_connect_status_change" flag to "1" in order to re-enumerate, because after exit from hibernation port connection status is not detected. Fixes: c5c403dc4336 ("usb: dwc2: Add host/device hibernation functions") Signed-off-by: Artur Petrosyan --

[PATCH 01/15] usb: dwc2: Update exit hibernation when port reset is asserted

2021-04-14 Thread Artur Petrosyan
ter debug message print. - Added "dwc2_exit_hibernation()" function error checking. Signed-off-by: Artur Petrosyan --- drivers/usb/dwc2/hcd.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 04a1

[PATCH 02/15] usb: dwc2: Reset DEVADDR after exiting gadget hibernation.

2021-04-14 Thread Artur Petrosyan
exits from gadget hibernation. Signed-off-by: Artur Petrosyan Signed-off-by: Minas Harutyunyan Acked-by: Minas Harutyunyan --- 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 2f50f3e62caa..e6bb1bdb2760

Re: [PATCH v2 00/12] usb: dwc2: Add clock gating support.

2021-04-13 Thread Artur Petrosyan
Hi Greg, On 4/13/2021 11:35, Artur Petrosyan wrote: > This patch set adds clock gating power saving support for > dwc2 core. > It adds support for the following cases described by programming guide. >1. Enter to clock gating from USB_SUSPEND interrupt. >2. Clock gatin

[PATCH v2 12/12] usb: dwc2: Add exit clock gating before removing driver

2021-04-13 Thread Artur Petrosyan
When dwc2 core is in clock gating mode loading driver again causes driver fail. Because in that mode registers are not accessible. Added a flow of exiting clock gating mode to avoid the driver reload failure. Signed-off-by: Artur Petrosyan --- Changes in v2: - None drivers/usb/dwc2

[PATCH v2 11/12] usb: dwc2: Add clock gating exiting flow by system resume

2021-04-13 Thread Artur Petrosyan
If not hibernation nor partial power down are supported, port resume is done using the clock gating programming flow. Adds a new flow of exiting clock gating when PC is resumed. Signed-off-by: Artur Petrosyan --- Changes in v2: - None drivers/usb/dwc2/hcd.c | 22 ++ 1

[PATCH v2 09/12] usb: dwc2: Allow exit clock gating in urb enqueue

2021-04-13 Thread Artur Petrosyan
When core is in clock gating state and an external hub is connected, upper layer sends URB enqueue request, which results in port reset issue. Added exit from clock gating state to avoid port reset issue and process upper layer request properly. Signed-off-by: Artur Petrosyan --- Changes in v2

[PATCH v2 10/12] usb: dwc2: Add clock gating entering flow by system suspend

2021-04-13 Thread Artur Petrosyan
If not hibernation nor partial power down are supported, clock gating is used to save power. Adds a new flow of entering clock gating when PC is suspended. Signed-off-by: Artur Petrosyan --- Changes in v2: - None drivers/usb/dwc2/hcd.c | 9 + 1 file changed, 9 insertions(+) diff

[PATCH v2 05/12] usb: dwc2: Add exit clock gating from session request interrupt

2021-04-13 Thread Artur Petrosyan
Added clock gating exit flow from session request interrupt handler according programming guide. Signed-off-by: Artur Petrosyan --- Changes in v2: - None drivers/usb/dwc2/core_intr.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/usb/dwc2

[PATCH v2 08/12] usb: dwc2: Update exit clock gating when port is resumed

2021-04-13 Thread Artur Petrosyan
Updates the implementation of exiting clock gating mode when core receives port resume. Instead of setting the required bit fields of the registers inline, called the "dwc2_host_exit_clock_gating()" function. Signed-off-by: Artur Petrosyan --- Changes in v2: - None drivers/usb/

[PATCH v2 06/12] usb: dwc2: Add exit clock gating when port reset is asserted

2021-04-13 Thread Artur Petrosyan
Adds clock gating exit flow when set port feature reset is received in suspended state. Signed-off-by: Artur Petrosyan --- Changes in v2: - None drivers/usb/dwc2/hcd.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index f1c24c15d185

[PATCH v2 07/12] usb: dwc2: Update enter clock gating when port is suspended

2021-04-13 Thread Artur Petrosyan
Updates the implementation of entering clock gating mode when core receives port suspend. Instead of setting the required bit fields of the registers inline, called the "dwc2_host_enter_clock_gating()" function. Signed-off-by: Artur Petrosyan --- Changes in v2: - None drivers/usb/

[PATCH v2 04/12] usb: dwc2: Add exit clock gating from wakeup interrupt

2021-04-13 Thread Artur Petrosyan
parameter 1. Signed-off-by: Artur Petrosyan Acked-by: Minas Harutyunyan --- drivers/usb/dwc2/core_intr.c | 33 ++--- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/drivers/usb/dwc2/core_intr.c b/drivers/usb/dwc2/core_intr.c index ab7fe303c0f9.

[PATCH v2 03/12] usb: dwc2: Allow entering clock gating from USB_SUSPEND interrupt

2021-04-13 Thread Artur Petrosyan
If core doesn't support hibernation or partial power down power saving options, power can still be saved using clock gating on all the clocks. - Added entering clock gating state from USB_SUSPEND interrupt. Signed-off-by: Artur Petrosyan Acked-by: Minas Harutyunyan --- drivers/usb/dwc2

[PATCH v2 02/12] usb: dwc2: Add host clock gating support functions

2021-04-13 Thread Artur Petrosyan
Added host clock gating support functions according programming guide. Added function names: dwc2_host_enter_clock_gating() dwc2_host_exit_clock_gating() Signed-off-by: Artur Petrosyan Acked-by: Minas Harutyunyan --- drivers/usb/dwc2/core.h | 5 +++ drivers/usb/dwc2/hcd.c | 86

[PATCH v2 01/12] usb: dwc2: Add device clock gating support functions

2021-04-13 Thread Artur Petrosyan
t_enter_clock_gating() dwc2_gadget_exit_clock_gating() Signed-off-by: Artur Petrosyan Acked-by: Minas Harutyunyan --- drivers/usb/dwc2/core.h | 10 -- drivers/usb/dwc2/gadget.c | 71 +++ 2 files changed, 79 insertions(+), 2 deletions(-) diff --git a/drive

[PATCH 12/12] usb: dwc2: Add exit clock gating before removing driver

2021-04-13 Thread Artur Petrosyan
When dwc2 core is in clock gating mode loading driver again causes driver fail. Because in that mode registers are not accessible. Added a flow of exiting clock gating mode to avoid the driver reload failure. Signed-off-by: Artur Petrosyan --- drivers/usb/dwc2/platform.c | 9 + 1 file

[PATCH 11/12] usb: dwc2: Add clock gating exiting flow by system resume

2021-04-13 Thread Artur Petrosyan
If not hibernation nor partial power down are supported, port resume is done using the clock gating programming flow. Adds a new flow of exiting clock gating when PC is resumed. Signed-off-by: Artur Petrosyan --- drivers/usb/dwc2/hcd.c | 22 ++ 1 file changed, 22 insertions

[PATCH 09/12] usb: dwc2: Allow exit clock gating in urb enqueue

2021-04-13 Thread Artur Petrosyan
When core is in clock gating state and an external hub is connected, upper layer sends URB enqueue request, which results in port reset issue. Added exit from clock gating state to avoid port reset issue and process upper layer request properly. Signed-off-by: Artur Petrosyan --- drivers/usb

[PATCH 10/12] usb: dwc2: Add clock gating entering flow by system suspend

2021-04-13 Thread Artur Petrosyan
If not hibernation nor partial power down are supported, clock gating is used to save power. Adds a new flow of entering clock gating when PC is suspended. Signed-off-by: Artur Petrosyan --- drivers/usb/dwc2/hcd.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/usb/dwc2

[PATCH 08/12] usb: dwc2: Update exit clock gating when port is resumed

2021-04-13 Thread Artur Petrosyan
Updates the implementation of exiting clock gating mode when core receives port resume. Instead of setting the required bit fields of the registers inline, called the "dwc2_host_exit_clock_gating()" function. Signed-off-by: Artur Petrosyan --- drivers/usb/dwc2/

[PATCH 07/12] usb: dwc2: Update enter clock gating when port is suspended

2021-04-13 Thread Artur Petrosyan
Updates the implementation of entering clock gating mode when core receives port suspend. Instead of setting the required bit fields of the registers inline, called the "dwc2_host_enter_clock_gating()" function. Signed-off-by: Artur Petrosyan --- drivers/usb/dwc2/

[PATCH 06/12] usb: dwc2: Add exit clock gating when port reset is asserted

2021-04-13 Thread Artur Petrosyan
Adds clock gating exit flow when set port feature reset is received in suspended state. Signed-off-by: Artur Petrosyan --- drivers/usb/dwc2/hcd.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index f1c24c15d185..27f030d5de54 100644

[PATCH 04/12] usb: dwc2: Add exit clock gating from wakeup interrupt

2021-04-13 Thread Artur Petrosyan
parameter 1. Signed-off-by: Artur Petrosyan Acked-by: Minas Harutyunyan --- drivers/usb/dwc2/core_intr.c | 33 ++--- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/drivers/usb/dwc2/core_intr.c b/drivers/usb/dwc2/core_intr.c index ab7fe303c0f9.

[PATCH 02/12] usb: dwc2: Add host clock gating support functions

2021-04-13 Thread Artur Petrosyan
Added host clock gating support functions according programming guide. Added function names: dwc2_host_enter_clock_gating() dwc2_host_exit_clock_gating() Signed-off-by: Artur Petrosyan Acked-by: Minas Harutyunyan --- drivers/usb/dwc2/core.h | 5 +++ drivers/usb/dwc2/hcd.c | 86

[PATCH 03/12] usb: dwc2: Allow entering clock gating from USB_SUSPEND interrupt

2021-04-13 Thread Artur Petrosyan
If core doesn't support hibernation or partial power down power saving options, power can still be saved using clock gating on all the clocks. - Added entering clock gating state from USB_SUSPEND interrupt. Signed-off-by: Artur Petrosyan Acked-by: Minas Harutyunyan --- drivers/usb/dwc2

[PATCH 01/12] usb: dwc2: Add device clock gating support functions

2021-04-13 Thread Artur Petrosyan
t_enter_clock_gating() dwc2_gadget_exit_clock_gating() Signed-off-by: Artur Petrosyan Acked-by: Minas Harutyunyan --- drivers/usb/dwc2/core.h | 10 -- drivers/usb/dwc2/gadget.c | 71 +++ 2 files changed, 79 insertions(+), 2 deletions(-) diff --git a/drive

[PATCH 05/12] usb: dwc2: Add exit clock gating from session request interrupt

2021-04-13 Thread Artur Petrosyan
Added clock gating exit flow from session request interrupt handler according programming guide. Signed-off-by: Artur Petrosyan --- drivers/usb/dwc2/core_intr.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/usb/dwc2/core_intr.c b/drivers/usb

Re: [PATCH v2 00/14] usb: dwc2: Fix Partial Power down issues.

2021-04-08 Thread Artur Petrosyan
Hi Greg, On 4/8/2021 13:17, Artur Petrosyan wrote: > Hi Greg, > > On 4/8/2021 11:28, Artur Petrosyan wrote: >> This patch set fixes and improves the Partial Power Down mode for >> dwc2 core. >> It adds support for the following cases >> 1. Entering an

[PATCH v3 14/14] usb: dwc2: Add exit partial power down before removing driver

2021-04-08 Thread Artur Petrosyan
When dwc2 core is in partial power down mode loading driver again causes driver fail. Because in that mode registers are not accessible. Added a flow of exiting the partial power down mode to avoid the driver reload failure. Signed-off-by: Artur Petrosyan --- Changes in v3: - None Changes

[PATCH v3 13/14] usb: dwc2: Fix partial power down exiting by system resume

2021-04-08 Thread Artur Petrosyan
;usb: dwc2: bus suspend/resume for hosts with DWC2_POWER_DOWN_PARAM_NONE") Signed-off-by: Artur Petrosyan --- Changes in v3: - None Changes in v2: - None drivers/usb/dwc2/hcd.c | 90 +- 1 file changed, 46 insertions(+), 44 deletions(-) diff --git a/dr

[PATCH v3 12/14] usb: dwc2: Update partial power down entering by system suspend

2021-04-08 Thread Artur Petrosyan
. In this patch only Partial Power Down is implemented the Hibernation and clock gating implementations are planned to be added. Signed-off-by: Artur Petrosyan --- Changes in v3: - None Changes in v2: - None drivers/usb/dwc2/hcd.c | 53 ++ 1 file ch

[PATCH v3 11/14] usb: dwc2: Fix session request interrupt handler

2021-04-08 Thread Artur Petrosyan
According to programming guide in host mode, port power must be turned on in session request interrupt handlers. Cc: Fixes: 21795c826a45 ("usb: dwc2: exit hibernation on session request") Signed-off-by: Artur Petrosyan Acked-by: Minas Harutyunyan --- drivers/usb/dwc2/core_

[PATCH v3 10/14] usb: dwc2: Allow exit partial power down in urb enqueue

2021-04-08 Thread Artur Petrosyan
When core is in partial power down state and an external hub is connected, upper layer sends URB enqueue request, which results in port reset issue. Added exit from partial power down state to avoid port reset issue and process upper layer request correctly. Signed-off-by: Artur Petrosyan

[PATCH v3 09/14] usb: dwc2: Add part. power down exit from dwc2_conn_id_status_change().

2021-04-08 Thread Artur Petrosyan
ccrue from a soft reset. Signed-off-by: Artur Petrosyan Acked-by: Minas Harutyunyan --- drivers/usb/dwc2/hcd.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 7c7496719152..9529e9839961 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/d

[PATCH v3 08/14] usb: dwc2: Add exit partial power down when port reset is asserted

2021-04-08 Thread Artur Petrosyan
Adds Partial Power Down exiting flow when set port feature reset is received in suspended state. Signed-off-by: Artur Petrosyan --- Changes in v3: - None Changes in v2: - None drivers/usb/dwc2/hcd.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/usb/dwc2/hcd.c b

[PATCH v3 07/14] usb: dwc2: Add exit partial power down when port is resumed

2021-04-08 Thread Artur Petrosyan
ock gating implementations are planned to be added. Signed-off-by: Artur Petrosyan --- Changes in v3: - None Changes in v2: - None drivers/usb/dwc2/core.h | 5 ++-- drivers/usb/dwc2/hcd.c | 61 ++--- 2 files changed, 42 insertions(+), 24 deletions(-)

[PATCH v3 06/14] usb: dwc2: Add enter partial power down when port is suspended

2021-04-08 Thread Artur Petrosyan
ock gating implementations are planned to be added. Signed-off-by: Artur Petrosyan --- Changes in v3: - None Changes in v2: - None drivers/usb/dwc2/core.h | 5 +++-- drivers/usb/dwc2/hcd.c | 48 ++--- 2 files changed, 34 insertions(+), 19 deletions(-)

[PATCH v3 05/14] usb: dwc2: Update port suspend/resume function definitions.

2021-04-08 Thread Artur Petrosyan
function description in documentation. Signed-off-by: Artur Petrosyan --- Changes in v3: - None Changes in v2: - None drivers/usb/dwc2/core.h | 4 drivers/usb/dwc2/hcd.c | 25 +++-- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/drivers/usb/dwc2/c

[PATCH v3 04/14] usb: dwc2: Add partial power down exit flow in wakeup intr.

2021-04-08 Thread Artur Petrosyan
According to programming guide added host partial power down exit flow in wakeup detected interrupt handler. Signed-off-by: Artur Petrosyan Acked-by: Minas Harutyunyan --- drivers/usb/dwc2/core_intr.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers

[PATCH v3 03/14] usb: dwc2: Update enter and exit partial power down functions

2021-04-08 Thread Artur Petrosyan
partial power down exit driver relies on backup value of "GOTGCTL_CURMODE_HOST" to determine the mode of core before entering to PPD. Signed-off-by: Artur Petrosyan Acked-by: Minas Harutyunyan --- drivers/usb/dwc2/core.c | 113 ++- drivers/usb/d

[PATCH v3 02/14] usb: dwc2: Add host partial power down functions

2021-04-08 Thread Artur Petrosyan
s needed to properly exit gadget Partial Power Down A delay less than 100 doesn't work. Signed-off-by: Artur Petrosyan Acked-by: Minas Harutyunyan --- drivers/usb/dwc2/core.h | 8 ++ drivers/usb/dwc2/hcd.c | 160 2 files changed, 168 insertions(+) diff

[PATCH v3 01/14] usb: dwc2: Add device partial power down functions

2021-04-08 Thread Artur Petrosyan
r_partial_power_down() dwc2_gadget_exit_partial_power_down() NOTE: There is a checkpatch "CHECK" warning on "udelay(100)". The delay is needed to properly exit gadget Partial Power Down A delay less than 100 doesn't work. Signed-off-by: Artur Petrosyan Acked-by: Minas Harutyuny

[PATCH v3 00/14] usb: dwc2: Fix Partial Power down issues.

2021-04-08 Thread Artur Petrosyan
h sets. Changes since V2: No changes in the patches or the source code. Assuming that the issue due to which the patches are not reaching to vger.kernel.org is a comma in the end of To: or Cc: lists removed commas in the end of those lists in each email of patches. Artur Petrosyan (14): usb: dwc2:

Re: [PATCH v2 00/14] usb: dwc2: Fix Partial Power down issues.

2021-04-08 Thread Artur Petrosyan
Hi Greg, On 4/8/2021 11:28, Artur Petrosyan wrote: > This patch set fixes and improves the Partial Power Down mode for > dwc2 core. > It adds support for the following cases > 1. Entering and exiting partial power down when a port is > suspended, resumed, port re

[PATCH v2 13/14] usb: dwc2: Fix partial power down exiting by system resume

2021-04-08 Thread Artur Petrosyan
;usb: dwc2: bus suspend/resume for hosts with DWC2_POWER_DOWN_PARAM_NONE") Signed-off-by: Artur Petrosyan --- Changes in v2: - None drivers/usb/dwc2/hcd.c | 90 +- 1 file changed, 46 insertions(+), 44 deletions(-) diff --git a/drivers/usb/dwc2/hcd.

[PATCH v2 00/14] usb: dwc2: Fix Partial Power down issues.

2021-04-08 Thread Artur Petrosyan
h sets. Changes since V1: No changes in the patches or the source code. Sending the second version of the patch set because the first version was not received by vger.kernel.org. Artur Petrosyan (14): usb: dwc2: Add device partial power down functions usb: dwc2: Add host partial power down func

Re: [PATCH 00/14] usb: dwc2: Fix Partial Power down issues.

2021-04-07 Thread Artur Petrosyan
Hi Greg, On 4/7/2021 14:00, Artur Petrosyan wrote: > This patch set fixes and improves the Partial Power Down mode for > dwc2 core. > It adds support for the following cases > 1. Entering and exiting partial power down when a port is > suspended, resumed, port re

[PATCH 13/14] usb: dwc2: Fix partial power down exiting by system resume

2021-04-07 Thread Artur Petrosyan
;usb: dwc2: bus suspend/resume for hosts with DWC2_POWER_DOWN_PARAM_NONE") Signed-off-by: Artur Petrosyan --- drivers/usb/dwc2/hcd.c | 90 +- 1 file changed, 46 insertions(+), 44 deletions(-) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.

[PATCH 00/14] usb: dwc2: Fix Partial Power down issues.

2021-04-07 Thread Artur Petrosyan
nd improve power saving modes" patch set. (Patch set link: https://marc.info/?l=linux-usb=160379622403975=2). The patches that were included in the "usb: dwc2: Fix and improve power saving modes" which was submitted earlier was too large and needed to be split up into smaller patch set

Re: [RFC PATCH] usb: dwc2: Try usb_get_phy_by_phandle instead of usb_get_phy

2020-12-29 Thread Artur Petrosyan
Hi Jules, On 12/26/2020 17:45, Jules Maselbas wrote: > Hi Artur, > > On Fri, Dec 25, 2020 at 11:41:04AM +0000, Artur Petrosyan wrote: >>> @@ -251,7 +251,12 @@ static int dwc2_lowlevel_hw_init(struct dwc2_hsotg >>> *hsotg) >>> } >>> >>&

Re: [RFC PATCH] usb: dwc2: Try usb_get_phy_by_phandle instead of usb_get_phy

2020-12-25 Thread Artur Petrosyan
Hi Jules, On 12/16/2020 20:59, Jules Maselbas wrote: > On probe the dwc2 driver tries two path to get an usb phy, first calling > devm_phy_get() and secondly with devm_usb_get_phy(). > > However the current implementation of devm_phy_get() never return a valid > phy for usb-nop-xceiv. And the

Re: [PATCH] usb: dwc2: Remove redundant null check before clk_prepare_enable/clk_disable_unprepare

2020-12-07 Thread Artur Petrosyan
On 12/4/2020 12:36, Xu Wang wrote: > Because clk_prepare_enable() and clk_disable_unprepare() already checked > NULL clock parameter, so the additional checks are unnecessary, just > remove them. > > Signed-off-by: Xu Wang Reviewed-by: Artur Petrosyan > --- > driver

Re: [PATCH v2 0/5] USB: dwc2: Allow wakeup from suspend; enable for rk3288-veyron

2019-04-19 Thread Artur Petrosyan
Hi Doug, On 4/19/2019 15:43, Artur Petrosyan wrote: > Hi, > > On 4/18/2019 19:55, Doug Anderson wrote: >> Hi, >> >> On Thu, Apr 18, 2019 at 5:41 AM Minas Harutyunyan >> wrote: >>> Did you consider/reviewed patch series from Artur Petrosyan "[PA

Re: [PATCH] usb: dwc2: Disable power down feature on Samsung SoCs

2018-12-14 Thread Artur Petrosyan
Hi Marek, On 12/6/2018 18:20, Marek Szyprowski wrote: > Hi Artur, > > On 2018-12-04 15:28, Artur Petrosyan wrote: >> On 11/20/2018 19:38, Marek Szyprowski wrote: >>> Power down feature of DWC2 module integrated in Samsung SoCs doesn't work >>> properly or need

Re: [PATCH] usb: dwc2: Disable power down feature on Samsung SoCs

2018-12-04 Thread Artur Petrosyan
Hi Marek, On 11/20/2018 19:38, Marek Szyprowski wrote: > Power down feature of DWC2 module integrated in Samsung SoCs doesn't work > properly or needs some additional handling in PHY or SoC glue layer, so > disable it for now. Without disabling power down, DWC2 causes random memory > trashes and

Re: [PATCH] usb: dwc2: Disable power down feature on Samsung SoCs

2018-12-04 Thread Artur Petrosyan
Hi Marek, On 11/20/2018 19:38, Marek Szyprowski wrote: > Power down feature of DWC2 module integrated in Samsung SoCs doesn't work > properly or needs some additional handling in PHY or SoC glue layer, so > disable it for now. Without disabling power down, DWC2 causes random memory > trashes and

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

2018-09-27 Thread Artur Petrosyan
Hi John, On 9/25/2018 21:59, John Stultz wrote: > 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://urldefense.proofpoint.com

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

2018-09-27 Thread Artur Petrosyan
Hi John, On 9/25/2018 21:59, John Stultz wrote: > 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://urldefense.proofpoint.com