[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 --- drivers/usb/gadget/udc/dummy_hcd.c | 2 +- 1 file changed, 1 insertion(+),

[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 --- drivers/usb/gadget/function/f_midi.c |4 ++-- 1 file

[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

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 find answers and I hope

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 "renesas,r8a7796-usb3-peri" to >> "renesa

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 > Signed-off-by: Chanwoo Choi Do you want to take these through your tree or mine

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 ChipIdea UDC driver on N

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 gadget devices based on

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 gadget driver dereferencing NULL ptr,

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. Repo

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 --- drivers/usb/musb/musb_cp

[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 .co

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 with refcount > config: i

[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. Signed-off-

[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 100644 include/uapi/linux/

[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 b

[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 th

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 >>> provided by PMICs meaning that either ven

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 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* ok

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 OTG event). If this happens it is

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 happen that udc drivers still call into the gadget driver (e.g. >>>

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 unbind. Otherwise it might happen that udc drivers still call into t

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: adu_

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.

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 are 15 tx_fifo dedicated for all EPs except E

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 usi

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 > established.

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 King > --- > drivers/usb/ga

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 from

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 supports_usb_power_delivery >> repor

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 models. All models have

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 > > > "drivers/usb/misc/

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 list is open to anybody and we welcome newcomers :-) >

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(&gadget->dev); except for the only path going via err1. As a result a caller o

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 Jaga

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 >> Cc: Raviteja Garimella >> Signed-off-by: Ch

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 5

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) says

[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

[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 v2 2/4] usb: xhci-mtk: add generic compatible string

2017-08-15 Thread Chunfeng Yun
The xhci-mtk driver is a generic driver for MediaTek xHCI IP, add a generic compatible to avoid confusion when support new SoCs but use a compatible with specific SoC's name "mt8173". Signed-off-by: Chunfeng Yun --- drivers/usb/host/xhci-mtk.c |1 + 1 file changed, 1 insertion(+) diff --git

[PATCH v2 4/4] dt-bindings: mt8173-xhci: add generic compatible and rename file

2017-08-15 Thread Chunfeng Yun
The mt8173-xhci.txt actually holds the bindings for all mediatek SoCs with xHCI controller, so add a generic compatible and change the name to mediatek,mtk-xhci.txt to reflect that. Signed-off-by: Chunfeng Yun --- .../usb/{mt8173-xhci.txt => mediatek,mtk-xhci.txt} | 14 +++--- .../devi

[PATCH v2 3/4] dt-bindings: mt8173-mtu3: add generic compatible and rename file

2017-08-15 Thread Chunfeng Yun
The mt8173-mtu3.txt actually holds the bindings for all mediatek SoCs with usb3 DRD IP, so add a generic compatible and change the name to mediatek,mtu3.txt. Signed-off-by: Chunfeng Yun --- .../usb/{mt8173-mtu3.txt => mediatek,mtu3.txt} |6 +- 1 file changed, 5 insertions(+), 1 delet

[PATCH v2 1/4] usb: mtu3: add generic compatible string

2017-08-15 Thread Chunfeng Yun
The mtu3 driver is a generic driver for MediaTek usb3 DRD IP, add a generic compatible to avoid confusion when support new SoCs but use a compatible with specific SoC's name "mt8173". Signed-off-by: Chunfeng Yun --- drivers/usb/mtu3/mtu3_plat.c |1 + 1 file changed, 1 insertion(+) diff --gi