[PATCH 00/14] usb: dwc2: Fix and improve power saving modes.

2019-04-12 Thread Artur Petrosyan
This patch set, fixes and improves partial power down and hibernation power saving modes. Also, adds support for entering/exiting hibernation from system issued suspend/resume. Artur Petrosyan (14): usb: dwc2: Fix dwc2_restore_device_registers() function. usb: dwc2: Add descriptive debug mess

[PATCH 03/14] usb: dwc2: Fix wakeup detected and session request interrupt handlers.

2019-04-12 Thread Artur Petrosyan
In host mode port power must be turned on when wakeup detected or session request interrupt is detected. Because, otherwise core wouldn't exit form partial power down. - Turned on the port power by setting HPRT0_PWR bit. - Called dwc2_hcd_connect() function after enabling the power of the port.

[PATCH 01/14] usb: dwc2: Fix dwc2_restore_device_registers() function.

2019-04-12 Thread Artur Petrosyan
- Added backup of DCFG register. - Added Set the Power-On Programming done bit. Signed-off-by: Artur Petrosyan --- drivers/usb/dwc2/gadget.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 6812a8a3a98b..dcb0fbb8bc42 1006

[PATCH 02/14] usb: dwc2: Add descriptive debug messages for Partial Power Down mode.

2019-04-12 Thread Artur Petrosyan
Added dev_dbg() messages when entering and exiting from partial power down. It is now more visible when core enters partial power down and when exits form it. Debug messages are added in the following functions. - dwc2_exit_partial_power_down() - dwc2_enter_partial_power_down() Signed-off-by: Art

[PATCH 04/14] usb: dwc2: Fix suspend state in host mode for partial power down.

2019-04-12 Thread Artur Petrosyan
- In dwc2_port_suspend() function added waiting for the HPRT0.PrtSusp register field to be set. - In _dwc2_hcd_suspend() function added checking of "hsotg->flags.b.port_connect_status" port connection status if port connection status is 0 then skipping power saving (entering partial power

[PATCH 05/14] usb: dwc2: Add port conn. sts. checking in _dwc2_hcd_resume() function.

2019-04-12 Thread Artur Petrosyan
Added port connection status checking which prevents exiting from Partial Power Down mode from _dwc2_hcd_resume() when no entering to Partial Power Down mode happened. Signed-off-by: Artur Petrosyan --- drivers/usb/dwc2/hcd.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git

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

2019-04-12 Thread Artur Petrosyan
Before changing to connector B exiting from Partial Power Down is required. - Added exiting from Partial Power Down mode when connector ID status changes to "connId B". Because if connector ID status changed to B connector while core was in partial power down mode, HANG would accrue from a

Re: [PATCH 03/14] usb: dwc2: Fix wakeup detected and session request interrupt handlers.

2019-04-12 Thread Jules Maselbas
Hi Artur, On Fri, Apr 12, 2019 at 01:38:56PM +, Artur Petrosyan wrote: > In host mode port power must be turned on when wakeup > detected or session request interrupt is detected. > Because, otherwise core wouldn't exit form partial > power down. > > - Turned on the port power by setting HPRT

Re: [PATCH v6 2/2] usb: typec: ucsi: ccg: add firmware flashing support

2019-04-12 Thread Heikki Krogerus
Hi Ajay, On Thu, Apr 11, 2019 at 01:03:10PM -0700, Ajay Gupta wrote: > +#define CCG_FW_VERSION_NVIDIA(b) (le16_to_cpu(b) != (('n' << 8) | 'v')) Does that remove the sparce warning? Now that I see that this version is specific to NVIDIA, I think we are going to want to get this detail from a

[RFC PATCH 1/2] i2c: nvidia-gpu: Supply CCGx driver the firmware build information

2019-04-12 Thread Heikki Krogerus
Adding device property "ccgx,firmware-build" for the CCGx device, so the CCGx driver knows the which firmware build it needs to be dealing with. Signed-off-by: Heikki Krogerus --- drivers/i2c/busses/i2c-nvidia-gpu.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/i2c/busses/i2c

[RFC PATCH 0/2] usb: typec: ucsi: ccgx: FW build device property

2019-04-12 Thread Heikki Krogerus
Hi Ajay, This the example I promised. I prepared these on top of your patches. The second patch ("usb: typec: ucsi: ccgx: Read the fw build property") I want to squash into your patch adding the firmware handing to the CCGx driver. If you want to add modifications to these, resend the series. Oth

[RFC PATCH 2/2] usb: typec: ucsi: ccgx: Read the fw build property

2019-04-12 Thread Heikki Krogerus
Ajay, please squash this into your patch if it's OK. I took the liberty of removing one label that was not used. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/ucsi/ucsi_ccg.c | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/usb/typec/uc

RE: [PATCH v6 2/2] usb: typec: ucsi: ccg: add firmware flashing support

2019-04-12 Thread Ajay Gupta
Hi Heikki, > -Original Message- > From: linux-usb-ow...@vger.kernel.org On > Behalf Of Heikki Krogerus > Sent: Friday, April 12, 2019 8:02 AM > To: Ajay Gupta > Cc: linux-usb@vger.kernel.org; Ajay Gupta > Subject: Re: [PATCH v6 2/2] usb: typec: ucsi: ccg: add firmware flashing > suppor

Re: Bug: VHCI + USB 3.0

2019-04-12 Thread Alan Stern
On Wed, 10 Apr 2019, Alan Stern wrote: > On Wed, 10 Apr 2019, Bollinger, Seth wrote: > > > > On Apr 9, 2019, at 2:13 PM, Bollinger, Seth > > > mailto:seth.bollin...@digi.com>> wrote: > > > > > > > Seth, you can try adding: > > > > > > > > blk_queue_virt_boundary(sdev->request_queue, 1024 - 1) >

[PATCH v7 0/3] Add support for firmware update on Cypres CCGx

2019-04-12 Thread Ajay Gupta
Hi Heikki These changes add support for updating firmware on Cypress CCGx controller. New version (v7) fixes comments from you by reading fw build information from device property. First patch in same as posted with v6. There is no change in it. Second patch is from you and adds fw_build device

Re: [v2 PATCH 6/6] usb: mtu3: get optional clock by devm_clk_get_optional()

2019-04-12 Thread Matthias Brugger
On 10/04/2019 08:47, Chunfeng Yun wrote: > Use devm_clk_get_optional() to get optional clock > > Signed-off-by: Chunfeng Yun Reviewed-by: Matthias Brugger > --- > v2: new patch, merged into this series from > https://patchwork.kernel.org/patch/10878235/ > --- > drivers/usb/mtu3/mtu3_pl

[PATCH v7 1/3] usb: typec: ucsi: ccg: add get_fw_info function

2019-04-12 Thread Ajay Gupta
Function is to get the details of ccg firmware and device version. It will be useful in debugging and also during firmware update. Signed-off-by: Ajay Gupta Signed-off-by: Heikki Krogerus --- Changes from v6 to v7 - None drivers/usb/typec/ucsi/ucsi_ccg.c | 66 ++

[PATCH v7 2/3] i2c: nvidia-gpu: Supply CCGx driver the fw build info

2019-04-12 Thread Ajay Gupta
From: Heikki Krogerus Adding device property "ccgx,firmware-build" for the CCGx device, so the CCGx driver knows which firmware binary to use for a specific vendor. Signed-off-by: Heikki Krogerus Signed-off-by: Ajay Gupta --- drivers/i2c/busses/i2c-nvidia-gpu.c | 7 +++ 1 file changed, 7

[PATCH v7 3/3] usb: typec: ucsi: ccg: add firmware flashing support

2019-04-12 Thread Ajay Gupta
CCGx has two copies of the firmware in addition to the bootloader. If the device is running FW1, FW2 can be updated with the new version. Dual firmware mode allows the CCG device to stay in a PD contract and support USB PD and Type-C functionality while a firmware update is in progress. First we r

Re: Problem with USB2 devices connected to a hub

2019-04-12 Thread Georg Chini
On 08.04.19 08:46, Georg Chini wrote: On 02.04.19 16:52, Mathias Nyman wrote: On 28.3.2019 15.41, Mathias Nyman wrote: The issue happens when only a single hub and a single device is connected to the USB subsystem. On my previous board, I had two USB dongles and two sound devices connected t