[PATCH] USB: fix coding style issue

2017-08-15 Thread pierre Kuo
try to fix some codeing style issue, such as "space prohibited" and "not initialise statics". Signed-off-by: pierre Kuo --- drivers/usb/host/ehci-hcd.c | 6 ++--- drivers/usb/host/ehci-hub.c | 22 - drivers/usb/host/ehci-mem.c | 55

[PATCH] usb: quirks: add delay init quirk for Corsair Strafe RGB keyboard

2017-08-15 Thread Kai-Heng Feng
Corsair Strafe RGB keyboard has trouble to initialize: [ 1.679455] usb 3-6: new full-speed USB device number 4 using xhci_hcd [ 6.871136] usb 3-6: unable to read config index 0 descriptor/all [ 6.871138] usb 3-6: can't read configurations, error -110 [ 6.991019] usb 3-6: new full-speed USB device

Re: [PATCH v3 5/5] usb: xhci: Handle USB transaction error on address command

2017-08-15 Thread Lu Baolu
Hi, On 08/15/2017 07:30 PM, Mathias Nyman wrote: > On 11.08.2017 05:41, Lu Baolu wrote: >> Xhci driver handles USB transaction errors on transfer events, >> but transaction errors are possible on address device command >> completion events as well. >> >> The xHCI specification (section 4.6.5)

Re: [PATCH v2 0/5] usb: Replace the deprecated extcon API

2017-08-15 Thread Chanwoo Choi
Dear Kishon and Felipe, I applied these patches on extcon-next branch for v4.14-rc1. And I created the immutable branch ('ib-extcon-usb-phy-4.14') and send the pull-request for these patches in order to prevent the merge conflict. Best Regards, Chanwoo Choi The following changes since commit

Re: [PATCH v2 4/5] usb: gadget: udc: Replace the deprecated extcon API

2017-08-15 Thread Chanwoo Choi
Hi, On 2017년 08월 15일 18:48, Felipe Balbi wrote: > > Hi, > > Chanwoo Choi writes: >> This patch replaces the deprecated extcon API as following: >> - extcon_get_cable_state_() -> extcon_get_state() >> >> Cc: Felipe Balbi >> Cc: Greg Kroah-Hartman

Re: Sometimes supports_usb_power_delivery reports incorrect value.

2017-08-15 Thread Badhri Jagan Sridharan
Submitted couple of patches for the missing pieces in TCPM. Those patches along with "usb: typec: update partner power delivery support with opmode" seems to address the issue of reporting the right value for supports_usb_power_delivery. Thanks, Badhri On Tue, Aug 15, 2017 at 7:13 AM, Badhri

Inconsistency in usb_add_gadget_udc_release() interface

2017-08-15 Thread Alexey Khoroshilov
Hello, usb_add_gadget_udc_release() gets release() argument that allows to release user resources. As far as I can see, the release() is called on error paths of usb_add_gadget_udc_release() as a result of put_device(>dev); except for the only path going via err1. As a result a caller of the

Re: uvc-gadget for UVC testing doesn't seem to work with vivid

2017-08-15 Thread Rail Shafigulin
On Tue, Aug 15, 2017 at 2:43 AM, Felipe Balbi wrote: > > Hi, > > Rail Shafigulin writes: >> Let me apologize for emailing directly to the list as I'm not one of >> the developers and just starting out with USB and UVC. After searching > > the

Re: Possible null pointer dereference in adutux.ko

2017-08-15 Thread Oliver Neukum
Am Dienstag, den 15.08.2017, 16:38 +0300 schrieb Anton Volkov: > On 15.08.2017 16:20, Oliver Neukum wrote: > > > > Am Dienstag, den 15.08.2017, 15:59 +0300 schrieb Anton Volkov: > > > > > > Hello. > > > > > > While searching for races in the Linux kernel I've come across > > >

Re: [PATCH v5 1/8] usb: gadget: f_ecm/f_eem/f_rndis: Setup quirk_avoids_skb_reserve

2017-08-15 Thread Dmitry Osipenko
Hi, On 15.08.2017 12:49, Felipe Balbi wrote: > Dmitry Osipenko writes: >> This quirk is required to make USB Ethernet gadget working with HW that >> can't cope with unaligned DMA. For some reason only f_ncm handles that >> quirk, let's handle it in the rest of the network

Re: Sometimes supports_usb_power_delivery reports incorrect value.

2017-08-15 Thread Badhri Jagan Sridharan
On Tue, Aug 15, 2017 at 6:36 AM, Heikki Krogerus wrote: > Hi, > > On Mon, Aug 14, 2017 at 11:57:15AM -0700, Badhri Jagan Sridharan wrote: >> Hi Heikki, >> >> While testing with different type-c phones available in the market, >> With some phones, I noticed that

Re: This is probably crazy

2017-08-15 Thread Alan Stern
On Tue, 15 Aug 2017, Steven Timms wrote: > Hi Alan, thank you for looking in to this. I am not a programmer but I am > technically capable. Although I have not done debugging before I am happy > to provide the data. Is it as simple as sending audio data to the DAC and > then running a program

Re: [PATCH] usb: gadget: dummy: fix infinite loop because of missing loop decrement

2017-08-15 Thread Alan Stern
On Tue, 15 Aug 2017, Colin King wrote: > From: Colin Ian King > > The while loop never terminates because the loop counter i is never > decremented. Fix this by decrementing i. > > Detected by CoverityScan, CID#751073 ("Infinite Loop") > > Signed-off-by: Colin Ian

Re: Sometimes supports_usb_power_delivery reports incorrect value.

2017-08-15 Thread Heikki Krogerus
Hi, On Mon, Aug 14, 2017 at 11:57:15AM -0700, Badhri Jagan Sridharan wrote: > Hi Heikki, > > While testing with different type-c phones available in the market, > With some phones, I noticed that supports_usb_power_delivery > reports "no" eventhough an explicit pd contract has been >

Re: Possible null pointer dereference in adutux.ko

2017-08-15 Thread Anton Volkov
On 15.08.2017 16:20, Oliver Neukum wrote: Am Dienstag, den 15.08.2017, 15:59 +0300 schrieb Anton Volkov: Hello. While searching for races in the Linux kernel I've come across "drivers/usb/misc/adutux.ko" module. Here is a question that I came up with while analyzing results. Lines are given

Re: [PATCH] arm64: dts: hi6220: improve g-tx-fifo-size setting for usb device

2017-08-15 Thread Wei Xu
Hi Shawn, John, On 2017/8/7 22:18, John Stultz wrote: > On Sun, Aug 6, 2017 at 10:01 PM, Shawn Guo wrote: >> From: Shawn Guo >> >> The current usb device g-tx-fifo-size setting in DT causes two problems >> for kernel driver. >> >> 1. On hi6220, there

Re: Possible null pointer dereference in adutux.ko

2017-08-15 Thread Oliver Neukum
Am Dienstag, den 15.08.2017, 15:59 +0300 schrieb Anton Volkov: > Hello. > > While searching for races in the Linux kernel I've come across > "drivers/usb/misc/adutux.ko" module. Here is a question that I came up > with while analyzing results. Lines are given using the info from Linux > v4.12.

Possible null pointer dereference in adutux.ko

2017-08-15 Thread Anton Volkov
Hello. While searching for races in the Linux kernel I've come across "drivers/usb/misc/adutux.ko" module. Here is a question that I came up with while analyzing results. Lines are given using the info from Linux v4.12. Consider the following case: Thread 1: Thread 2:

Re: [PATCH] usb: gadget: udc: udc_stop before gadget unbind

2017-08-15 Thread Danilo Krummrich
On 2017-08-15 14:02, Felipe Balbi wrote: Hi, Danilo Krummrich writes: thanks for reviewing. np :-) On 2017-08-15 12:03, Felipe Balbi wrote: Hi, Danilo Krummrich writes: udc_stop needs to be called before gadget driver

Re: [PATCH] usb: gadget: udc: udc_stop before gadget unbind

2017-08-15 Thread Felipe Balbi
Hi, Danilo Krummrich writes: > thanks for reviewing. np :-) > On 2017-08-15 12:03, Felipe Balbi wrote: >> Hi, >> >> Danilo Krummrich writes: >>> udc_stop needs to be called before gadget driver unbind. Otherwise it >>> might

Re: [PATCH] usb: gadget: udc: udc_stop before gadget unbind

2017-08-15 Thread Danilo Krummrich
Hi, thanks for reviewing. On 2017-08-15 12:03, Felipe Balbi wrote: Hi, Danilo Krummrich writes: udc_stop needs to be called before gadget driver unbind. Otherwise it might happen that udc drivers still call into the gadget driver (e.g. to reset gadget after

Re: [PATCH v2 2/3] usb: chipidea: Hook into mux framework to toggle usb switch

2017-08-15 Thread Peter Rosin
On 2017-08-12 00:26, Stephen Boyd wrote: > Quoting Peter Rosin (2017-08-08 05:46:30) >> On 2017-08-08 03:51, Stephen Boyd wrote: >> >>> It looked like we paired the start/stop ops with >>> each other so that the mux is properly managed across these ops. >> >> Yes, it *looks*

Re: [PATCH v3 5/5] usb: xhci: Handle USB transaction error on address command

2017-08-15 Thread Mathias Nyman
On 11.08.2017 05:41, Lu Baolu wrote: Xhci driver handles USB transaction errors on transfer events, but transaction errors are possible on address device command completion events as well. The xHCI specification (section 4.6.5) says: A USB Transaction Error Completion Code for an Address Device

Re: [PATCH v4 0/3] Introduce USB charger support in USB phy

2017-08-15 Thread Baolin Wang
Hi Felipe, On 15 August 2017 at 17:53, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >>> Currently the Linux kernel does not provide any standard integration of this >>> feature that integrates the USB subsystem with the system power regulation

[PATCH v5 2/3] usb: phy: Add USB charger support

2017-08-15 Thread Baolin Wang
This patch introduces the usb charger support based on usb phy that makes an enhancement to a power driver. The basic conception of the usb charger is that, when one usb charger is added or removed by reporting from the extcon device state change, the usb charger will report to power user to set

[PATCH v5 0/3] Introduce USB charger support in USB phy

2017-08-15 Thread Baolin Wang
Currently the Linux kernel does not provide any standard integration of this feature that integrates the USB subsystem with the system power regulation provided by PMICs meaning that either vendors must add this in their kernels or USB gadget devices based on Linux (such as mobile phones) may not

[PATCH v5 1/3] include: uapi: usb: Introduce USB charger type and state definition

2017-08-15 Thread Baolin Wang
Introducing USB charger type and state definition can help to support USB charging which will be added in USB phy core. Signed-off-by: Baolin Wang --- include/uapi/linux/usb/charger.h | 31 +++ 1 file changed, 31 insertions(+) create mode

[PATCH v5 3/3] power: wm831x_power: Support USB charger current limit management

2017-08-15 Thread Baolin Wang
Integrate with the newly added USB charger interface to limit the current we draw from the USB input based on the input device configuration identified by the USB stack, allowing us to charge more quickly from high current inputs without drawing more current than specified from others.

Re: [balbi-usb:next 21/42] drivers/usb/gadget/function/f_midi.c:836:24: error: 'f_midi_rmidi_free' undeclared

2017-08-15 Thread Felipe Balbi
Hi, kbuild test robot writes: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git next > head: af982758d0a9e5189e657de2bbab2f65f16c48cc > commit: b8bd28e32e5fc3ad2d8c80ad3978fabb523a1763 [21/42] usb: gadget: f_midi: > Use snd_card_free_when_closed

[balbi-usb:next 21/42] drivers/usb/gadget/function/f_midi.c:836:24: error: 'f_midi_rmidi_free' undeclared

2017-08-15 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git next head: af982758d0a9e5189e657de2bbab2f65f16c48cc commit: b8bd28e32e5fc3ad2d8c80ad3978fabb523a1763 [21/42] usb: gadget: f_midi: Use snd_card_free_when_closed with refcount config: i386-randconfig-x075-201733 (attached as

Re: [PATCH 2/2] usb: musb: musb_cppi41: Fix cppi41_set_dma_mode() for DA8xx

2017-08-15 Thread Sergei Shtylyov
On 8/13/2017 3:04 PM, Alexandre Bailon wrote: The way to configure the DMA mode on DA8xx is different from DSPS. Add a new function to configure DMA mode on DA8xx and use a callback to call the right function based on the platform. Signed-off-by: Alexandre Bailon ---

Re: [PATCH 1/2] usb: musb: musb_cppi41: Fix the address of teardown and autoreq registers

2017-08-15 Thread Sergei Shtylyov
Hello! On 8/13/2017 3:04 PM, Alexandre Bailon wrote: The DA8xx and DSPS platforms don't use the same address for few registers. On Da8xx, this is causing some issues (e.g. teardown that doesn't work). Configure the address of the register during the init and use them instead of constants.

Re: [PATCH] usb: gadget: udc: udc_stop before gadget unbind

2017-08-15 Thread Felipe Balbi
Hi, Danilo Krummrich writes: > udc_stop needs to be called before gadget driver unbind. Otherwise it > might happen that udc drivers still call into the gadget driver (e.g. > to reset gadget after OTG event). If this happens it is likely to get > panics from

Re: [PATCH v4 0/3] Introduce USB charger support in USB phy

2017-08-15 Thread Felipe Balbi
Hi, Baolin Wang writes: >> Currently the Linux kernel does not provide any standard integration of this >> feature that integrates the USB subsystem with the system power regulation >> provided by PMICs meaning that either vendors must add this in their kernels >> or USB

Re: [PATCH v5 1/8] usb: gadget: f_ecm/f_eem/f_rndis: Setup quirk_avoids_skb_reserve

2017-08-15 Thread Felipe Balbi
Hi, Dmitry Osipenko writes: > This quirk is required to make USB Ethernet gadget working with HW that > can't cope with unaligned DMA. For some reason only f_ncm handles that > quirk, let's handle it in the rest of the network models. All models have > been tested with a

Re: [PATCH v2 4/5] usb: gadget: udc: Replace the deprecated extcon API

2017-08-15 Thread Felipe Balbi
Hi, Chanwoo Choi writes: > This patch replaces the deprecated extcon API as following: > - extcon_get_cable_state_() -> extcon_get_state() > > Cc: Felipe Balbi > Cc: Greg Kroah-Hartman > Cc: Raviteja Garimella

Re: [PATCH v2 3/3] usb: gadget: udc: renesas_usb3: add support for R-Car M3-W

2017-08-15 Thread Felipe Balbi
Hi, Rob Herring writes: > On Fri, Aug 04, 2017 at 11:16:58AM +0900, Yoshihiro Shimoda wrote: >> This patch adds support for R-Car M3-W. This patch also adds R-Car >> Gen3 generic version's compatible and changes ".compatible" in >> the usb3_of_match from

Re: uvc-gadget for UVC testing doesn't seem to work with vivid

2017-08-15 Thread Felipe Balbi
Hi, Rail Shafigulin writes: > Let me apologize for emailing directly to the list as I'm not one of > the developers and just starting out with USB and UVC. After searching the list is open to anybody and we welcome newcomers :-) > online for about a week I just couldn't

[PATCH 0/3] constify snd_rawmidi_ops structures

2017-08-15 Thread Julia Lawall
These snd_rawmidi_ops structures are only passed as the third argument of snd_rawmidi_set_ops. This argument is const, so the snd_rawmidi_ops structures can be const too. Done with the help of Coccinelle. --- drivers/hid/hid-prodikeys.c |2 +- drivers/usb/gadget/function/f_midi.c

[PATCH 1/3] usb: gadget: f_midi: constify snd_rawmidi_ops structures

2017-08-15 Thread Julia Lawall
These snd_rawmidi_ops structures are only passed as the third argument of snd_rawmidi_set_ops. This argument is const, so the snd_rawmidi_ops structures can be const too. Done with the help of Coccinelle. Signed-off-by: Julia Lawall ---

[PATCH] usb: gadget: dummy: fix infinite loop because of missing loop decrement

2017-08-15 Thread Colin King
From: Colin Ian King The while loop never terminates because the loop counter i is never decremented. Fix this by decrementing i. Detected by CoverityScan, CID#751073 ("Infinite Loop") Signed-off-by: Colin Ian King ---