RE: [PATCH] usb: gadget: uvc:change the UVC_NUM_REQUESTS value

2017-12-25 Thread Lipengcheng
Hi, > -Original Message- > From: Manu Gautam [mailto:mgau...@codeaurora.org] > Sent: Tuesday, December 26, 2017 1:01 PM > To: Lipengcheng; ba...@kernel.org > Cc: gre...@linuxfoundation.org; linux-ker...@vger.kernel.org; > linux-usb@vger.kernel.org > Subject: Re: [PATCH] usb: gadget:

Re: [PATCH] usb: gadget: uvc:change the UVC_NUM_REQUESTS value

2017-12-25 Thread Manu Gautam
Hi, On 12/26/2017 8:22 AM, Lipengcheng wrote: > The value is 4, it can cache four descriptors. When streaming_interval = 1, > it can tolerate 500us. Some busy scenes, it may be more than 500us because > cpu scheduling is not timely. There will have some problems. It is better > set to eight. > >

[PATCH] usb: gadget: uvc:change the UVC_NUM_REQUESTS value

2017-12-25 Thread Lipengcheng
The value is 4, it can cache four descriptors. When streaming_interval = 1, it can tolerate 500us. Some busy scenes, it may be more than 500us because cpu scheduling is not timely. There will have some problems. It is better set to eight. Signed-off-by: Pengcheng Li ---

Re: [PATCH v2 44/49] usb: dwc2: Bit polling functionality update.

2017-12-25 Thread kbuild test robot
Hi Sevak, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on balbi-usb/next] [cannot apply to v4.15-rc5 next-20171222] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url:

Recall: [PATCH v2 00/49] usb: dwc2: fixes, enhancements and new features

2017-12-25 Thread Grigor Tovmasyan
Grigor Tovmasyan would like to recall the message, "[PATCH v2 00/49] usb: dwc2: fixes, enhancements and new features ".-- 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

[PATCH v2 49/49] usb: dwc2: pci: Handle error cleanup in probe

2017-12-25 Thread Grigor Tovmasyan
From: Vardan Mikayelyan The probe function doesn't properly handle errors. Fix it so that it properly handles cleanup. Signed-off-by: Vardan Mikayelyan Signed-off-by: John Youn Signed-off-by: Grigor Tovmasyan

[PATCH v2 46/49] usb: dwc2: pci: Replace kzalloc() with devm_kzalloc()

2017-12-25 Thread Grigor Tovmasyan
From: Vardan Mikayelyan Use devm_kzalloc() and remove the unnecessary kfree(). Signed-off-by: Vardan Mikayelyan Signed-off-by: John Youn Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/pci.c | 3

[PATCH v2 48/49] usb: dwc2: pci: Move devm_kzalloc() before platform_device_add()

2017-12-25 Thread Grigor Tovmasyan
From: Vardan Mikayelyan After platform_device_add(), if we error out, we must do platform_device_unregister(), which also does the put. So lets move devm_kzalloc() to simplify error handling and avoid calling of platform_device_unregister(). Signed-off-by: Vardan

[PATCH v2 47/49] usb: dwc2: pci: Move usb_phy_generic_register()

2017-12-25 Thread Grigor Tovmasyan
From: Vardan Mikayelyan Move usb_phy_generic_register() function call to the top, to simplify error handling. If this fails we can simply return instead of cleaning up. Signed-off-by: Vardan Mikayelyan Signed-off-by: John Youn

[PATCH v2 44/49] usb: dwc2: Bit polling functionality update.

2017-12-25 Thread Grigor Tovmasyan
From: Sevak Arakelyan Move dwc2_hsotg_wait_bit_set function to core.c so it can be used anywhere in the code. Added dwc2_hsotg_wait_bit_clear function in core.c. Replace all the parts of register bit polling code with dwc2_hsotg_wait_bit_set or dwc2_hsotg_wait_bit_clear

[PATCH v2 45/49] usb: dwc2: Fix dwc2_hsotg_core_init_disconnected()

2017-12-25 Thread Grigor Tovmasyan
From: Vardan Mikayelyan We should call dwc2_hsotg_enqueue_setup() after properly setting lx_state. Because it may cause error-out from dwc2_hsotg_enqueue_setup() due to wrong value in lx_state. Issue can be reproduced by loading driver while connected A-Connector (start in

[PATCH v2 42/49] usb: dwc2: host: Fix transaction errors in host mode

2017-12-25 Thread Grigor Tovmasyan
From: Minas Harutyunyan Added missing GUSBCFG programming in host mode, which fixes transaction errors issue on HiKey and Altera Cyclone V boards. These field even if was programmed in device mode (in function dwc2_hsotg_core_init_disconnected()) will be resetting to POR

[PATCH v2 43/49] usb: dwc2: Add safety check in setting of descriptor chain pointers

2017-12-25 Thread Grigor Tovmasyan
From: Minas Harutyunyan In some cases device sending ZLP IN on non EP0 which reassigning EP0 OUT descriptor pointer to that EP. Dedicated for EP0 OUT descriptor multiple time re-used by other EP while that descriptor already in use by EP0 OUT for SETUP transaction. As result

[PATCH v2 41/49] usb: dwc2: Add safety check for STSPHSERCVD intr

2017-12-25 Thread Grigor Tovmasyan
From: Minas Harutyunyan STSPHSERCVD (status phase received) interrupt should be handled when EP0 is in DWC2_EP0_DATA_OUT state. Sometimes STSPHSERCVD interrupt asserted , when EP0 is not in DATA_OUT state. Spurios interrupt. Signed-off-by: Minas Harutyunyan

[PATCH v2 40/49] usb: dwc2: hcd: Fix host channel halt flow

2017-12-25 Thread Grigor Tovmasyan
From: Minas Harutyunyan According databook in Buffer and External DMA mode non-split periodic channels can't be halted. Signed-off-by: Minas Harutyunyan Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/hcd.c | 18

[PATCH v2 38/49] usb: dwc2: Enable power down

2017-12-25 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 v2 39/49] usb: dwc2: Change TxFIFO and RxFIFO flushing flow

2017-12-25 Thread Grigor Tovmasyan
From: Minas Harutyunyan Before flushing fifos required to check AHB master state and flush when AHB master is in IDLE state. Signed-off-by: Minas Harutyunyan Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.c | 34

[PATCH v2 35/49] usb: dwc2: Allow entering hibernation from USB_SUSPEND interrupt

2017-12-25 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 v2 36/49] usb: dwc2: Add dwc2_handle_gpwrdn_intr() handler

2017-12-25 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 v2 37/49] usb: dwc2: Change hub-control to allow hibernation

2017-12-25 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 v2 34/49] usb: dwc2: Add dwc2_enter_hibernation(), dwc2_exit_hibernation()

2017-12-25 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 v2 33/49] usb: dwc2: Add host/device hibernation functions

2017-12-25 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 v2 32/49] usb: dwc2: Add helper functions for restore routine

2017-12-25 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 v2 31/49] usb: dwc2: Changes in registers backup/restore functions

2017-12-25 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 v2 30/49] usb: dwc2: gadget: Add remote_wakeup_allowed flag

2017-12-25 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 v2 29/49] usb: dwc2: core: Add hibernated flag

2017-12-25 Thread Grigor Tovmasyan
From: Vardan Mikayelyan True if core is hibernated. Signed-off-by: Vardan Mikayelyan Signed-off-by: John Youn Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.h | 2 ++

[PATCH v2 28/49] usb: dwc2: gadget: Fix dwc2_restore_device_registers

2017-12-25 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 v2 27/49] usb: dwc2: gadget: Moved dtxfsiz backup array place

2017-12-25 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 v2 26/49] usb: dwc2: Add hibernation field into dwc2_hw_params

2017-12-25 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 v2 24/49] usb: dwc2: Enable LPM

2017-12-25 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

[PATCH v2 25/49] usb: dwc2: Rename hibernation to partial_power_down

2017-12-25 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 v2 23/49] usb: dwc2: Add core state checking

2017-12-25 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

[PATCH v2 22/49] usb: dwc2: Add call_gadget() function call

2017-12-25 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

[PATCH v2 21/49] usb: dwc2: gadget: Configure the core to enable LPM.

2017-12-25 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

[PATCH v2 17/49] usb: dwc2: Add core parameters for LPM support

2017-12-25 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

[PATCH v2 18/49] usb: dwc2: gadget: Add functionality to exit from LPM L1 state

2017-12-25 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 ---

[PATCH v2 20/49] usb: dwc2: Enable LPM Transaction Received interrupt.

2017-12-25 Thread Grigor Tovmasyan
From: Sevak Arakelyan Enable LPM Transaction Received interrupt. Signed-off-by: Sevak Arakelyan Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core_intr.c | 5 +++-- drivers/usb/dwc2/gadget.c| 3 ++-

[PATCH v2 19/49] usb: dwc2: gadget: LPM interrupt handler

2017-12-25 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

[PATCH v2 15/49] usb: dwc2: Make function static

2017-12-25 Thread Grigor Tovmasyan
Declared dwc2_force_mode() function as static, because it was used only in core.c file, for fixing sparse error. Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc2/core.c

[PATCH v2 14/49] usb: dwc2: Delete unused functionality

2017-12-25 Thread Grigor Tovmasyan
Deleted dwc2_hcd_dump_frrem() function, because it used undefined parameters from dwc2_hsotg structure. The function body was in #ifdef statement and was never compiled. Also removed that parameters from dwc2_hsotg structure, which were used only in dwc2_hcd_dump_frrem() function. And also

[PATCH v2 16/49] usb: dwc2: Fix GLPMCFG... definitions

2017-12-25 Thread Grigor Tovmasyan
From: Sevak Arakelyan Make field names of GLPMCFG register in definitoins to be the same with the databook. Signed-off-by: Sevak Arakelyan Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/hw.h | 38

[PATCH v2 13/49] usb: dwc2: Rename function names

2017-12-25 Thread Grigor Tovmasyan
From: Razmik Karapetyan Renamed __orr32 and __bic32 function names to more descriptive dwc2_set_bit and dwc2_clear_bit respectively. Signed-off-by: Razmik Karapetyan Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/gadget.c

[PATCH v2 10/49] usb: dwc2: Update dwc2_handle_incomplete_isoc_in() function

2017-12-25 Thread Grigor Tovmasyan
From: Razmik Karapetyan Disabled only that ISOC endpoints,for which interrupt bit was set in the DAINTMSK register. This will allow to minimize incomplete ISOC IN interrupt handling. Signed-off-by: Razmik Karapetyan Signed-off-by: Minas Harutyunyan

[PATCH v2 11/49] usb: dwc2: Update dwc2_handle_incomplete_isoc_out() function

2017-12-25 Thread Grigor Tovmasyan
From: Razmik Karapetyan In 'for' loop skipped masked and non-ISOC EPs. Also breaked 'for' loop after setting SGOUTNAK in DCTL,when one enabled EP was detected. This will allow to minimize incomplete ISOC OUT interrupt handling. Signed-off-by: Razmik Karapetyan

[PATCH v2 12/49] usb: dwc2: Update GINTSTS_GOUTNAKEFF interrupt handling

2017-12-25 Thread Grigor Tovmasyan
From: Razmik Karapetyan Disabled only unmasked endpoints based on DAINTMSK register. This will allow to minimize GINTSTS_GOUTNAKEFF interrupt handling. Signed-off-by: Razmik Karapetyan Signed-off-by: Minas Harutyunyan

[PATCH v2 09/49] usb: dwc2: Backup and restore PCGCCTL1 register

2017-12-25 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 ---

[PATCH v2 07/49] usb: dwc2: Define Active Clock Gating support bit in GHWCFG4

2017-12-25 Thread Grigor Tovmasyan
From: Razmik Karapetyan The previously reserved 12th bit in GHWCFG4 now indicates that the controller supports the Dynamic Power Reduction (Active Clock Gating) during no traffic scenarios such as L0, idle, resume and suspend states. Signed-off-by: Razmik Karapetyan

[PATCH v2 08/49] usb: dwc2: Add dwc2_enable_acg function

2017-12-25 Thread Grigor Tovmasyan
From: Razmik Karapetyan Added function for supporting Active Clock Gating functionality. New acg_enable field in dwc2_hw_params checks ACG support from hardware side. Similar acg_enable field in dwc2_core_params used for dynamicly disabling/enabling ACG functionality from

[PATCH v2 06/49] usb: dwc2: Define PCGCCTL1 register in hw.h

2017-12-25 Thread Grigor Tovmasyan
From: Razmik Karapetyan PCGCCTL1 (Power and Clock Control) register will be used for controlling the core`s active clock gating feature. Signed-off-by: Razmik Karapetyan Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/hw.h

[PATCH v2 04/49] usb: dwc2: Set AHB burst size to INCR

2017-12-25 Thread Grigor Tovmasyan
From: Razmik Karapetyan In dwc2_hsotg_core_init_disconnected() function used AHB burst size parameter, instead of calculating already calculated value. Changed AHB burst size from INCR4 to INCR by default. With this value driver show excellent DMA performance.

[PATCH v2 05/49] usb: dwc2: Remove unnecessary debug prints

2017-12-25 Thread Grigor Tovmasyan
From: Razmik Karapetyan Removed unnecessary debug prints about DMA mode for host side from dwc2_gahbcfg_init() function. Signed-off-by: Razmik Karapetyan Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/hcd.c | 16

[PATCH v2 03/49] usb: dwc2: Remove version check in GSNPSID

2017-12-25 Thread Grigor Tovmasyan
From: Gevorg Sahakyan Only check the ID portion of the GSNPSID register and don’t check the version. This will allow the driver to work with version 4.00a and later of the DWC_hsotg IP. Cc: sta...@vger.kernel.org Signed-off-by: Gevorg Sahakyan

[PATCH v2 02/49] usb: dwc2: Force mode optimizations

2017-12-25 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

[PATCH v2 01/49] usb: dwc2: eliminate irq parameter from dwc2_gadget_init

2017-12-25 Thread Grigor Tovmasyan
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 Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/core.h | 4

[PATCH v2 00/49] usb: dwc2: fixes, enhancements and new features

2017-12-25 Thread Grigor Tovmasyan
This patch series includes new features such us Active Clock Gating(ACG), LPM and Hibernation, enhancements and fixes for already existing features. All this patches were already sent to lkml separately. ACG, LPM and Hibernation were sent as patch series. All patches were tested in our lab.

Re: xhci: Reset Renesas uPD72020x USB controller for 32-bit DMA issue

2017-12-25 Thread Marc Zyngier
On Sun, 24 Dec 2017 23:01:33 +, Troy Kisky wrote: > > commit 8466489ef5ba48272ba4fa4ea9f8f403306de4c7 > Author: Marc Zyngier > Date: Tue Aug 1 20:11:08 2017 -0500 > > xhci: Reset Renesas uPD72020x USB controller for 32-bit DMA issue > ... > ... > ... > ---