Re: [PATCH] USB: chaoskey: Use kasprintf() over strcpy()/strcat()

2018-02-16 Thread Keith Packard
Kees Cook writes: > Instead of kmalloc() with manually calculated values followed by > multiple strcpy()/strcat() calls, just fold it all into a single > kasprintf() call. > > Signed-off-by: Kees Cook Reviewed-by: Keith Packard

[PATCH] USB: chaoskey: Use kasprintf() over strcpy()/strcat()

2018-02-16 Thread Kees Cook
Instead of kmalloc() with manually calculated values followed by multiple strcpy()/strcat() calls, just fold it all into a single kasprintf() call. Signed-off-by: Kees Cook --- drivers/usb/misc/chaoskey.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff

[PATCH 7/7] usb: dwc3: pci: Add debugfs for device properties

2018-02-16 Thread Thinh Nguyen
Add the ability for PCI platforms to customize device properties via debugfs attributes. For IP and FPGA validation purposes, this feature is useful to test against various HW configurations that are normally statically configured in a real HW. It allows changing of the device properties while

[PATCH 6/7] usb: dwc3: pci: Create header file

2018-02-16 Thread Thinh Nguyen
Move dwc3_pci structure definition and some common function declarations to their own header file so multiple source files can reference them. Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/dwc3-pci.h | 46 +

[PATCH 5/7] usb: dwc3: Rename dwc3-pci.c to pci.c

2018-02-16 Thread Thinh Nguyen
Rename dwc3-pci.c to pci.c. There will be multiple source files to create dwc3-pci module, so dwc3-pci.c needs to use a different name than the module name. Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/Makefile | 2 ++ drivers/usb/dwc3/{dwc3-pci.c => pci.c}

[PATCH 4/7] usb: dwc3: pci: Move platform creation from probe function

2018-02-16 Thread Thinh Nguyen
Refactor and move dwc3 platform creation from dwc3_pci_probe() to a new function called dwc3_pci_add_platform_device(). This way, it can be called later. Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/dwc3-pci.c | 89 - 1 file

[PATCH 1/7] usb: dwc3: pci: Properly cleanup resource

2018-02-16 Thread Thinh Nguyen
Platform device is allocated before adding resources. Make sure to properly cleanup on error case. Fixes: f1c7e7108109 ("usb: dwc3: convert to pcim_enable_device()") Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/dwc3-pci.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 2/7] usb: dwc3: pci: Set an easily recognizable device name

2018-02-16 Thread Thinh Nguyen
Set the device name for PCI glue layer to "dwc3-pci.BB:SS.FF" where BB is PCI bus number, SS is PCI slot, and FF is PCI function number. Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/dwc3-pci.c | 3 +++ 1 file changed, 3 insertions(+) diff --git

[PATCH 0/7] usb: dwc3: pci: Make device properties customizable

2018-02-16 Thread Thinh Nguyen
Add the ability for PCI platforms to customize device properties via debugfs attributes. For IP and FPGA validation purposes, this feature is useful to test against various HW configurations that are normally statically configured in a real HW. It allows changing of the device properties while

[PATCH 3/7] usb: dwc3: pci: Store device properties dynamically

2018-02-16 Thread Thinh Nguyen
Add the ability to add device properties dynamically. Currently, device properties are added to platform device using platform_device_add_properties(). However, this function does not allow adding properties incrementally. It is useful to have this ability when the driver needs to set common

Re: [RFC PATCH] usb: hcd: complete URBs in threaded-IRQ context instead of tasklet

2018-02-16 Thread Alan Stern
On Fri, 16 Feb 2018, Sebastian Andrzej Siewior wrote: > On 2018-02-16 13:29:01 [-0500], Alan Stern wrote: > > We originally used tasklets because we didn't want to incur the delays > > associated with running in a process context. It seems odd to be > > reversing that decision now. > > The

Re: [RFC PATCH] usb: hcd: complete URBs in threaded-IRQ context instead of tasklet

2018-02-16 Thread Sebastian Andrzej Siewior
On 2018-02-16 13:29:01 [-0500], Alan Stern wrote: > We originally used tasklets because we didn't want to incur the delays > associated with running in a process context. It seems odd to be > reversing that decision now. The theaded interrupt runs SCHED_FIFO priority 50 by default. The only

Re: High CPU load produced by USB (DW2)

2018-02-16 Thread Marek Vasut
On 02/16/2018 06:59 AM, Minas Harutyunyan wrote: > On 2/15/2018 5:20 PM, Mirza Krak wrote: >> On 14 February 2018 at 13:07, Minas Harutyunyan >> wrote: >>> On 2/14/2018 12:57 PM, Mirza Krak wrote: On 8 February 2018 at 14:53, Minas Harutyunyan

Re: [PATCH RFC] ehci-omap: simple suspend implementation

2018-02-16 Thread Alan Stern
On Fri, 16 Feb 2018, Andreas Kemnade wrote: > On Fri, 16 Feb 2018 13:13:11 -0500 (EST) > Alan Stern wrote: > > > On Fri, 16 Feb 2018, Andreas Kemnade wrote: > > > > > This powers down the phy and on a gta04 it reduces > > > suspend current by 13 mA. > > > For unknown

Re: [PATCH RFC] ehci-omap: simple suspend implementation

2018-02-16 Thread Andreas Kemnade
On Fri, 16 Feb 2018 13:13:11 -0500 (EST) Alan Stern wrote: > On Fri, 16 Feb 2018, Andreas Kemnade wrote: > > > This powers down the phy and on a gta04 it reduces > > suspend current by 13 mA. > > For unknown reasons usb does not power on properly. > > Also calling

Re: [PATCH 04/12] usb: common: Small class for USB role switches

2018-02-16 Thread Randy Dunlap
On 02/16/2018 02:47 AM, Hans de Goede wrote: > From: Heikki Krogerus > > diff --git a/drivers/usb/common/roles.c b/drivers/usb/common/roles.c > new file mode 100644 > index ..923e3721d183 > --- /dev/null > +++ b/drivers/usb/common/roles.c > @@ -0,0

Re: [RFC PATCH] usb: hcd: complete URBs in threaded-IRQ context instead of tasklet

2018-02-16 Thread Alan Stern
On Fri, 16 Feb 2018, Sebastian Andrzej Siewior wrote: > I've been going over Frederic's softirq patches and it seems that there > were two problems. One was network related, the other was Mauro's USB > dvb-[stc] device which was not able to stream properly over time. > > Here is an attempt to

Re: [PATCH RFC] ehci-omap: simple suspend implementation

2018-02-16 Thread Alan Stern
On Fri, 16 Feb 2018, Andreas Kemnade wrote: > This powers down the phy and on a gta04 it reduces > suspend current by 13 mA. > For unknown reasons usb does not power on properly. > Also calling usb_phy_shutdown() here feels wrong > apparently the reset line has to be activated. >

[PATCH RFC] ehci-omap: simple suspend implementation

2018-02-16 Thread Andreas Kemnade
This powers down the phy and on a gta04 it reduces suspend current by 13 mA. For unknown reasons usb does not power on properly. Also calling usb_phy_shutdown() here feels wrong apparently the reset line has to be activated. usb_phy_set_suspend is not enough here. The power consumption still stays

[RFC PATCH] usb: hcd: complete URBs in threaded-IRQ context instead of tasklet

2018-02-16 Thread Sebastian Andrzej Siewior
I've been going over Frederic's softirq patches and it seems that there were two problems. One was network related, the other was Mauro's USB dvb-[stc] device which was not able to stream properly over time. Here is an attempt to let the URB complete in the threaded handler instead of going to

Re: [BUG] musb: broken isochronous transfer at TI AM335x platform

2018-02-16 Thread Tony Lindgren
* Matwey V. Kornilov [180215 17:55]: > [] 7.219456 d= 0.000997 [181.0 + 3.667] [ 3] IN : 4.5 > [T ] 7.219459 d= 0.03 [181.0 + 7.083] [800] DATA0: 53 da ... > [] 7.220456 d= 0.000997 [182 + 3.667] [ 3] IN : 4.5 > [

Re: [PATCH 04/12] usb: common: Small class for USB role switches

2018-02-16 Thread Heikki Krogerus
On Fri, Feb 16, 2018 at 04:07:59PM +0200, Andy Shevchenko wrote: > On Fri, Feb 16, 2018 at 12:47 PM, Hans de Goede wrote: > > > USB role switch is a device that can be used to choose the > > data role for USB connector. With dual-role capable USB > > controllers, the

Re: [PATCH 04/12] usb: common: Small class for USB role switches

2018-02-16 Thread Andy Shevchenko
On Fri, Feb 16, 2018 at 12:47 PM, Hans de Goede wrote: > USB role switch is a device that can be used to choose the > data role for USB connector. With dual-role capable USB > controllers, the controller itself will be the switch, but > on some platforms the USB host and

Re: [PATCH 03/12] usb: typec: API for controlling USB Type-C Multiplexers

2018-02-16 Thread Andy Shevchenko
On Fri, Feb 16, 2018 at 12:47 PM, Hans de Goede wrote: > USB Type-C connectors consist of various muxes and switches > that route the pins on the connector to the right locations. > The USB Type-C drivers need to be able to control the muxes, > as they are the ones that know

Re: [PATCH 08/12] xhci: Add Intel extended cap / otg phy mux handling

2018-02-16 Thread Andy Shevchenko
On Fri, Feb 16, 2018 at 12:47 PM, Hans de Goede wrote: > The xHCI controller on various Intel SoCs has an extended cap mmio-range > which contains registers to control the muxing to the xHCI (host mode) > or the dwc3 (device mode) and vbus-detection for the otg usb-phy. > >

Re: [PATCH 09/12] usb: roles: Add Intel XHCI USB role switch driver

2018-02-16 Thread Andy Shevchenko
On Fri, Feb 16, 2018 at 12:47 PM, Hans de Goede wrote: > Various Intel SoCs (Cherry Trail, Broxton and others) have an internal USB > role switch for swiching the OTG USB data lines between the xHCI host > controller and the dwc3 gadget controller. > > Note on some Cherry

Re: [PATCH 12/12] extcon: axp288: Set USB role where necessary

2018-02-16 Thread Heikki Krogerus
On Fri, Feb 16, 2018 at 11:47:51AM +0100, Hans de Goede wrote: > The AXP288 BC1.2 charger detection / extcon code may seem like a strange > place to add code to control the USB role-switch on devices with an AXP288, > but there are 2 reasons to do this inside the axp288 extcon code: > > 1) On

Re: [PATCH 11/12] platform/x86: intel_cht_int33fe: Add device connections for the Type-C port

2018-02-16 Thread Heikki Krogerus
On Fri, Feb 16, 2018 at 11:47:50AM +0100, Hans de Goede wrote: > We need to add device-connections for the TYPE-C mux/switch and usb-role > code to be able to find the PI3USB30532 Type-C cross-switch and the > device/host switch integrated in the CHT SoC. > > Signed-off-by: Hans de Goede

Re: [PATCH 10/12] usb: typec: driver for Pericom PI3USB30532 Type-C cross switch

2018-02-16 Thread Heikki Krogerus
On Fri, Feb 16, 2018 at 11:47:49AM +0100, Hans de Goede wrote: > Add a driver for the Pericom PI3USB30532 Type-C cross switch / > mux chip found on some devices with a Type-C port. > > Signed-off-by: Hans de Goede Reviewed-by: Heikki Krogerus

Re: [PATCH 09/12] usb: roles: Add Intel XHCI USB role switch driver

2018-02-16 Thread Heikki Krogerus
On Fri, Feb 16, 2018 at 11:47:48AM +0100, Hans de Goede wrote: > diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile > index 060643a1b5c8..7d1b8c82b208 100644 > --- a/drivers/usb/Makefile > +++ b/drivers/usb/Makefile > @@ -65,3 +65,5 @@ obj-$(CONFIG_USB_COMMON)+= common/ >

Re: [PATCH 00/12] USB Type-C device-connection, mux and switch support

2018-02-16 Thread Andy Shevchenko
On Fri, Feb 16, 2018 at 12:47 PM, Hans de Goede wrote: While I'm going through patches, one notice to all of them: be consistent with xHCI abbreviation. Also check others, like vBus (or whatever is standard de facto to show it in comments and to the user in messages). --

Re: [PATCH 10/12] usb: typec: driver for Pericom PI3USB30532 Type-C cross switch

2018-02-16 Thread Andy Shevchenko
On Fri, Feb 16, 2018 at 12:47 PM, Hans de Goede wrote: > Add a driver for the Pericom PI3USB30532 Type-C cross switch / > mux chip found on some devices with a Type-C port. > +static int pi3usb30532_set_conf(struct pi3usb30532 *pi, u8 new_conf) > +{ > + int ret = 0; >

Re: [PATCH 08/12] xhci: Add Intel extended cap / otg phy mux handling

2018-02-16 Thread Heikki Krogerus
On Fri, Feb 16, 2018 at 11:47:47AM +0100, Hans de Goede wrote: > The xHCI controller on various Intel SoCs has an extended cap mmio-range > which contains registers to control the muxing to the xHCI (host mode) > or the dwc3 (device mode) and vbus-detection for the otg usb-phy. > > Having a

Re: Not enough bandwidth with Magewell XI100DUSB-HDMI

2018-02-16 Thread Michael Tretter
Hi Mathias, On Mon, 29 Jan 2018 14:02:57 +0200, Mathias Nyman wrote: > On 19.01.2018 22:12, Philipp Zabel wrote: > > Hi, > > > > On Fri, Jan 19, 2018 at 2:10 PM, Michael Tretter > > wrote: > >> I found the old thread and it sounds exactly like my issue. Different >

Re: [PATCH 07/12] xhci: Add option to get next extended capability in list by passing id = 0

2018-02-16 Thread Heikki Krogerus
On Fri, Feb 16, 2018 at 11:47:46AM +0100, Hans de Goede wrote: > From: Mathias Nyman > > Modify xhci_find_next_ext_cap(base, offset, id) to return the next > capability offset if 0 is passed for id. Otherwise it will behave as > previously and return the offset of

Re: [PATCH 05/12] usb: typec: tcpm: Set USB role switch to device mode when configured as such

2018-02-16 Thread Heikki Krogerus
On Fri, Feb 16, 2018 at 11:47:44AM +0100, Hans de Goede wrote: > Setting the mux to MUX_NONE and the switch to USB_SWITCH_DISCONNECT when > the data-role is device is not correct. Plenty of devices support > operating as USB device through a (separate) USB device controller. > > We really need 2

Re: [PATCH 06/12] usb: typec: tcpm: Use new Type-C switch/mux and usb-role-switch functions

2018-02-16 Thread Heikki Krogerus
On Fri, Feb 16, 2018 at 11:47:45AM +0100, Hans de Goede wrote: > Remove the unused (not implemented anywhere) tcpc_mux_dev abstraction > and replace it with calling the new typec_set_orientation, > usb_role_switch_set and typec_set_mode functions. > > Signed-off-by: Hans de Goede

Re: [PATCH 12/12] extcon: axp288: Set USB role where necessary

2018-02-16 Thread Andy Shevchenko
On Fri, Feb 16, 2018 at 12:47 PM, Hans de Goede wrote: > The AXP288 BC1.2 charger detection / extcon code may seem like a strange > place to add code to control the USB role-switch on devices with an AXP288, > but there are 2 reasons to do this inside the axp288 extcon code:

Re: [PATCH 11/12] platform/x86: intel_cht_int33fe: Add device connections for the Type-C port

2018-02-16 Thread Andy Shevchenko
On Fri, Feb 16, 2018 at 12:47 PM, Hans de Goede wrote: > We need to add device-connections for the TYPE-C mux/switch and usb-role > code to be able to find the PI3USB30532 Type-C cross-switch and the > device/host switch integrated in the CHT SoC. > Acked-by: Andy Shevchenko

Re: [PATCH v5 00/17] Support for Qualcomm QUSBv2 and QMPv3 USB PHYs

2018-02-16 Thread Kishon Vijay Abraham I
On Thursday 01 February 2018 06:08 PM, Kishon Vijay Abraham I wrote: > Hi, > > On Wednesday 31 January 2018 10:51 AM, Manu Gautam wrote: >> Hi Kishon, >> >> >> On 1/16/2018 4:26 PM, Manu Gautam wrote: >>> QUSB-v2 and QMP-v3 USB PHYs are present on Qualcomm's 14nm >>> and 10nm SOCs. >>> This

Re: [PATCH 01/12] drivers: base: Unified device connection lookup

2018-02-16 Thread Heikki Krogerus
On Fri, Feb 16, 2018 at 12:21:15PM +0100, Hans de Goede wrote: > Hi, > > On 16-02-18 12:00, Andy Shevchenko wrote: > > On Fri, Feb 16, 2018 at 12:47 PM, Hans de Goede wrote: > > > From: Heikki Krogerus > > > > > > Several frameworks - clk,

Re: [PATCH 02/12] usb: typec: Start using ERR_PTR

2018-02-16 Thread Hans de Goede
Hi, On 16-02-18 12:07, Andy Shevchenko wrote: On Fri, Feb 16, 2018 at 12:47 PM, Hans de Goede wrote: From: Heikki Krogerus In order to allow the USB Type-C Class driver take care of things like muxes and other possible dependencies for

Re: [PATCH 01/12] drivers: base: Unified device connection lookup

2018-02-16 Thread Hans de Goede
Hi, On 16-02-18 12:00, Andy Shevchenko wrote: On Fri, Feb 16, 2018 at 12:47 PM, Hans de Goede wrote: From: Heikki Krogerus Several frameworks - clk, gpio, phy, pmw, etc. - maintain lookup tables for describing connections and provide

Re: [PATCH 02/12] usb: typec: Start using ERR_PTR

2018-02-16 Thread Andy Shevchenko
On Fri, Feb 16, 2018 at 12:47 PM, Hans de Goede wrote: > From: Heikki Krogerus > > In order to allow the USB Type-C Class driver take care of > things like muxes and other possible dependencies for the > port drivers, returning ERR_PTR

Re: [PATCH 01/12] drivers: base: Unified device connection lookup

2018-02-16 Thread Andy Shevchenko
On Fri, Feb 16, 2018 at 12:47 PM, Hans de Goede wrote: > From: Heikki Krogerus > > Several frameworks - clk, gpio, phy, pmw, etc. - maintain > lookup tables for describing connections and provide custom > API for handling them. This

[PATCH 00/12] USB Type-C device-connection, mux and switch support

2018-02-16 Thread Hans de Goede
Hi All, Some devices with an USB Type-C connector have a bunch of muxes behind that connector which need to be controlled by the kernel (rather then having them controlled by firmware as on most devices). Quite a while back I submitted a patch-series to tie together these muxes and the Type-C

[PATCH 04/12] usb: common: Small class for USB role switches

2018-02-16 Thread Hans de Goede
From: Heikki Krogerus USB role switch is a device that can be used to choose the data role for USB connector. With dual-role capable USB controllers, the controller itself will be the switch, but on some platforms the USB host and device controllers are separate

[PATCH 01/12] drivers: base: Unified device connection lookup

2018-02-16 Thread Hans de Goede
From: Heikki Krogerus Several frameworks - clk, gpio, phy, pmw, etc. - maintain lookup tables for describing connections and provide custom API for handling them. This introduces a single generic lookup table and API for the connections. The motivation for this

[PATCH 02/12] usb: typec: Start using ERR_PTR

2018-02-16 Thread Hans de Goede
From: Heikki Krogerus In order to allow the USB Type-C Class driver take care of things like muxes and other possible dependencies for the port drivers, returning ERR_PTR instead of NULL from the registration functions in case of failure. The reason for taking

[PATCH 03/12] usb: typec: API for controlling USB Type-C Multiplexers

2018-02-16 Thread Hans de Goede
From: Heikki Krogerus USB Type-C connectors consist of various muxes and switches that route the pins on the connector to the right locations. The USB Type-C drivers need to be able to control the muxes, as they are the ones that know things like the cable plug

[PATCH 05/12] usb: typec: tcpm: Set USB role switch to device mode when configured as such

2018-02-16 Thread Hans de Goede
Setting the mux to MUX_NONE and the switch to USB_SWITCH_DISCONNECT when the data-role is device is not correct. Plenty of devices support operating as USB device through a (separate) USB device controller. We really need 2 different versions of USB_SWITCH_CONNECT, USB_SWITCH_CONNECT_HOST and

[PATCH 06/12] usb: typec: tcpm: Use new Type-C switch/mux and usb-role-switch functions

2018-02-16 Thread Hans de Goede
Remove the unused (not implemented anywhere) tcpc_mux_dev abstraction and replace it with calling the new typec_set_orientation, usb_role_switch_set and typec_set_mode functions. Signed-off-by: Hans de Goede --- drivers/usb/typec/Kconfig | 1 +

[PATCH 08/12] xhci: Add Intel extended cap / otg phy mux handling

2018-02-16 Thread Hans de Goede
The xHCI controller on various Intel SoCs has an extended cap mmio-range which contains registers to control the muxing to the xHCI (host mode) or the dwc3 (device mode) and vbus-detection for the otg usb-phy. Having a role-sw driver included in the xhci code (under drivers/usb/host) is not

[PATCH 07/12] xhci: Add option to get next extended capability in list by passing id = 0

2018-02-16 Thread Hans de Goede
From: Mathias Nyman Modify xhci_find_next_ext_cap(base, offset, id) to return the next capability offset if 0 is passed for id. Otherwise it will behave as previously and return the offset of the next capability with matching id capability id 0 is not used by xhci

[PATCH 09/12] usb: roles: Add Intel XHCI USB role switch driver

2018-02-16 Thread Hans de Goede
Various Intel SoCs (Cherry Trail, Broxton and others) have an internal USB role switch for swiching the OTG USB data lines between the xHCI host controller and the dwc3 gadget controller. Note on some Cherry Trail systems there is ACPI/AML code listening to edge interrupts on the id-pin (through

[PATCH 10/12] usb: typec: driver for Pericom PI3USB30532 Type-C cross switch

2018-02-16 Thread Hans de Goede
Add a driver for the Pericom PI3USB30532 Type-C cross switch / mux chip found on some devices with a Type-C port. Signed-off-by: Hans de Goede --- Note this is a rewrite of my previous driver which was using the drivers/mux framework to use the new drivers/usb/typec/mux

[PATCH 11/12] platform/x86: intel_cht_int33fe: Add device connections for the Type-C port

2018-02-16 Thread Hans de Goede
We need to add device-connections for the TYPE-C mux/switch and usb-role code to be able to find the PI3USB30532 Type-C cross-switch and the device/host switch integrated in the CHT SoC. Signed-off-by: Hans de Goede --- drivers/platform/x86/intel_cht_int33fe.c | 25

[PATCH 12/12] extcon: axp288: Set USB role where necessary

2018-02-16 Thread Hans de Goede
The AXP288 BC1.2 charger detection / extcon code may seem like a strange place to add code to control the USB role-switch on devices with an AXP288, but there are 2 reasons to do this inside the axp288 extcon code: 1) On many devices the USB role is controlled by ACPI AML code, but the AML

[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

[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

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

2018-02-16 Thread Grigor Tovmasyan
From: Vardan Mikayelyan The GPWRDN interrupts are those that occur in both Host and Device mode while core is in hibernated state. Export dwc2_core_init to be able to use it in GPWRDN_IDSTS interrupt handler. Here we have duplicated init functions in host and gadget sides

[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

[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

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

2018-02-16 Thread Grigor Tovmasyan
From: Vardan Mikayelyan Add common (host/device) helper functions, which will be called while exiting from hibernation, from both sides. dwc2_restore_essential_regs() dwc2_hib_restore_common() Signed-off-by: Vardan Mikayelyan Signed-off-by: John

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

2018-02-16 Thread Grigor Tovmasyan
From: Vardan Mikayelyan Add host/device hibernation functions which must be wrapped by core's dwc2_enter_hibernation()/dwc2_exit_hibernation() functions. Make dwc2_backup_global_registers dwc2_restore_global_register non-static to use them in both host/gadget sides.

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

2018-02-16 Thread Grigor Tovmasyan
From: Vardan Mikayelyan It will be set once corresponding set_feature command comes. True if device is allowed to wake-up host by remote-wakeup signalling. This is preparation for remote wake-up support implementation, it will not be implemented until gadget stack provide

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

2018-02-16 Thread Grigor Tovmasyan
From: Vardan Mikayelyan Move hptxfsiz to host register's backup/restore functions, not needed to have it in global register's backup/restore functions. Add backup for glpmcfg, and read/write for gi2cctl and pcgcctl. As requires programming guide. Affected functions:

[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

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

2018-02-16 Thread Grigor Tovmasyan
From: Vardan Mikayelyan Add parameter remote_wakeup to dwc2_restore_device_registers() to be able to restore device registers according to programming guide for dwc-otg. It says that in case of rem_wakeup DCTL must not be restored here. Remove setting of DCTL_PWRONPRGDONE

[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

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

2018-02-16 Thread Grigor Tovmasyan
From: Vardan Mikayelyan Add parameter and it's initialization, needed for hibernation. Reimplement dwc2_set_param_power_down() to support hibernation too. Now 'power_down' parameter can be initialized with 0, 1 or 2. 0 - No 1 - Partial power down 2 - Hibernation

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

2018-02-16 Thread Grigor Tovmasyan
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. Rename core_params->hibernation to core_params->power_down, dwc2_set_param_hibernation() to

[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
From: Vardan Mikayelyan If the dr_mode is USB_DR_MODE_OTG, forcing the mode is needed during driver probe to get the host and device specific HW parameters. Then we clear the force mode bits so that the core operates in OTG mode. The force mode bits should not be touched

Re: [GIT PULL] USB fixes for v4.16-rc2

2018-02-16 Thread Greg Kroah-Hartman
On Fri, Feb 16, 2018 at 10:20:51AM +0200, Felipe Balbi wrote: > > Hi Greg, > > here's my first set of fixes for current -rc cycle. Let me know if you > want any changes to the pull request. > > cheers > > The following changes since commit 7928b2cbe55b2a410a0f5c1f154610059c57b1b2: > > Linux

[GIT PULL] USB fixes for v4.16-rc2

2018-02-16 Thread Felipe Balbi
Hi Greg, here's my first set of fixes for current -rc cycle. Let me know if you want any changes to the pull request. cheers The following changes since commit 7928b2cbe55b2a410a0f5c1f154610059c57b1b2: Linux 4.16-rc1 (2018-02-11 15:04:29 -0800) are available in the Git repository at:

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 version of your testing/next, it also was