Re: [PATCH v3 1/9] usb: typec: Copy everything from struct typec_capability during registration

2019-10-09 Thread Heikki Krogerus
On Tue, Oct 08, 2019 at 01:44:28PM -0700, Guenter Roeck wrote: > > @@ -1579,9 +1581,10 @@ struct typec_port *typec_register_port(struct device > > *parent, > > mutex_init(&port->port_type_lock); > > > > port->id = id; > > - port->cap = cap; > > + port->orig_cap = cap; > > port->p

Re: [PATCH] usb: chipidea: imx: check data->usbmisc_data against NULL before access

2019-10-09 Thread Peter Chen
On 19-10-09 10:52:28, jun...@nxp.com wrote: > From: Li Jun > > As usbmisc_data is optional, so add the check before access its member, > this fix below static checker warning: > drivers/usb/chipidea/ci_hdrc_imx.c:438 ci_hdrc_imx_probe() > warn: 'data->usbmisc_data' can also be NULL > which is int

Re: [PATCH] usb: chipidea: tegra: clean up tegra_udc flag code

2019-10-09 Thread Peter Chen
On 19-10-02 09:19:33, Peter Geis wrote: > All Tegra devices handled by tegra-udc use the same flags. > Consolidate all the entries under one roof. > > Signed-off-by: Peter Geis > > Acked-by: Thierry Reding > --- > drivers/usb/chipidea/ci_hdrc_tegra.c | 22 +- > 1 file chang

[PATCH 1/2] usb: gadget: Remove set but not used variable 'opts' in acm_ms_do_config

2019-10-09 Thread zhengbin
Fixes gcc '-Wunused-but-set-variable' warning: drivers/usb/gadget/legacy/acm_ms.c: In function acm_ms_do_config: drivers/usb/gadget/legacy/acm_ms.c:108:19: warning: variable opts set but not used [-Wunused-but-set-variable] It is not used since commit f78bbcae86e6 ("usb: f_mass_storage: test whe

[PATCH 0/2] usb: gadget: Remove set but not used variable 'opts'

2019-10-09 Thread zhengbin
zhengbin (2): usb: gadget: Remove set but not used variable 'opts' in acm_ms_do_config usb: gadget: Remove set but not used variable 'opts' in msg_do_config drivers/usb/gadget/legacy/acm_ms.c | 3 --- drivers/usb/gadget/legacy/mass_storage.c | 3 --- 2 files changed, 6 deletions(-)

[PATCH 2/2] usb: gadget: Remove set but not used variable 'opts' in msg_do_config

2019-10-09 Thread zhengbin
Fixes gcc '-Wunused-but-set-variable' warning: drivers/usb/gadget/legacy/mass_storage.c: In function msg_do_config: drivers/usb/gadget/legacy/mass_storage.c:108:19: warning: variable opts set but not used [-Wunused-but-set-variable] It is not used since commit f78bbcae86e6 ("usb: f_mass_storage:

Re: Possible bug with cdc_ether, triggers NETDEV WATCHDOG

2019-10-09 Thread Bjørn Mork
Adam Bennett writes: > I've been messing around with a Raspberry Pi Zero, in its ethernet > gadget mode.  This possible bug report is not against the Pi Zero > linux kernel, but rather the host computer's linux kernel.  I've been > able to reproduce the same host computer issue with my normal lap

[PATCH 1/1] net: usb: qmi_wwan: add Telit 0x1050 composition

2019-10-09 Thread Daniele Palmas
This patch adds support for Telit FN980 0x1050 composition 0x1050: tty, adb, rmnet, tty, tty, tty, tty Signed-off-by: Daniele Palmas --- Hi Bjørn, please find below usb-devices output T: Bus=03 Lev=01 Prnt=01 Port=06 Cnt=02 Dev#= 10 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 M

[PATCH] USB: usbfs: Suppress emission of uevents for interfaces handled via usbfs.

2019-10-09 Thread Ingo Rohloff
commit 1455cf8dbfd0 ("driver core: emit uevents when device is bound to a driver") added bind/unbind uevents when a driver is bound/unbound to a physical device. For USB devices which are handled via the generic usbfs layer (via libusb for example), this is problematic: Each time a user space pr

Re: [PATCH 1/1] net: usb: qmi_wwan: add Telit 0x1050 composition

2019-10-09 Thread Bjørn Mork
Daniele Palmas writes: > This patch adds support for Telit FN980 0x1050 composition > > 0x1050: tty, adb, rmnet, tty, tty, tty, tty Great! I must admit I have been a bit curious about this since you submitted the option patch. And I'm still curious about what to expect from X55 modems in gener

[PATCH] USB: usbfs: Suppress emission of uevents for interfaces handled via usbfs

2019-10-09 Thread Ingo Rohloff
>From 17d1e75543e26cfe702e7f5b0d4e07e0e45e5250 Mon Sep 17 00:00:00 2001 From: Ingo Rohloff Date: Tue, 8 Oct 2019 20:27:57 +0200 Subject: [PATCH] USB: usbfs: Suppress emission of uevents for interfaces handled via usbfs. commit 1455cf8dbfd0 ("driver core: emit uevents when device is bound to a dr

[PATCH -next] usb: typec: remove duplicated include from hd3ss3220.c

2019-10-09 Thread YueHaibing
Remove duplicated include. Signed-off-by: YueHaibing --- drivers/usb/typec/hd3ss3220.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/typec/hd3ss3220.c b/drivers/usb/typec/hd3ss3220.c index 1900910c637e..0ea5bf3c19c7 100644 --- a/drivers/usb/typec/hd3ss3220.c +++ b/drivers/usb/ty

Re: Possible bug with cdc_ether, triggers NETDEV WATCHDOG

2019-10-09 Thread Adam Bennett
On 10/9/19 4:53 AM, Bjørn Mork wrote: Adam Bennett writes: I've been messing around with a Raspberry Pi Zero, in its ethernet gadget mode.  This possible bug report is not against the Pi Zero linux kernel, but rather the host computer's linux kernel.  I've been able to reproduce the same host

[PATCH 0/5] Add Apple MFi fastcharge USB device driver

2019-10-09 Thread Bastien Nocera
As discussed in the thread "Driver for something that's neither a device nor an interface driver?", here's a patchset that makes it possible for device drivers to extend the generic device driver. An example usage is provided in the shape of a driver that allows changing the charge type of an Appl

[PATCH 2/5] USB: Make it possible to "subclass" usb_device_driver

2019-10-09 Thread Bastien Nocera
The kernel currenly has only 2 usb_device_drivers, one generic one, one that completely replaces the generic one to make USB devices usable over a network. Use the newly exported generic driver functions when a driver declares to want them run, in addition to its own code. This makes it possible t

[PATCH 1/5] USB: Export generic USB device driver functions

2019-10-09 Thread Bastien Nocera
This will make it possible to implement device drivers which extend the generic driver without needing to reimplement it. Signed-off-by: Bastien Nocera --- drivers/usb/core/generic.c | 20 drivers/usb/core/usb.h | 4 2 files changed, 16 insertions(+), 8 deletions(-

[PATCH 4/5] USB: Select better matching USB drivers when available

2019-10-09 Thread Bastien Nocera
Now that USB device drivers can reuse code from the generic USB device driver, we need to make sure that they get selected rather than the generic driver. Add an id_table and match vfunc to the usb_device_driver struct, which will get used to select a better matching driver at ->probe time. This i

[PATCH 3/5] USB: Implement usb_device_match_id()

2019-10-09 Thread Bastien Nocera
Match a usb_device with a table of IDs. Signed-off-by: Bastien Nocera --- drivers/usb/core/driver.c | 15 +++ include/linux/usb.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index 863e380a272b..50f92da8afcf 1006

[PATCH 5/5] USB: Add driver to control USB fast charge for iOS devices

2019-10-09 Thread Bastien Nocera
iOS devices will not draw more than 500mA unless instructed to do so. Setting the charge type power supply property to "fast" tells the device to start drawing more power, using the same procedure that official "MFi" chargers would. Signed-off-by: Bastien Nocera --- drivers/usb/misc/Kconfig

Re: [PATCH 2/5] USB: Make it possible to "subclass" usb_device_driver

2019-10-09 Thread Alan Stern
On Wed, 9 Oct 2019, Bastien Nocera wrote: > The kernel currenly has only 2 usb_device_drivers, one generic one, one > that completely replaces the generic one to make USB devices usable over > a network. Presumably your first driver is in generic.c. Where is the second one? > Use the newly expo

Re: [PATCH 3/5] USB: Implement usb_device_match_id()

2019-10-09 Thread Alan Stern
On Wed, 9 Oct 2019, Bastien Nocera wrote: > Match a usb_device with a table of IDs. > > Signed-off-by: Bastien Nocera > --- > drivers/usb/core/driver.c | 15 +++ > include/linux/usb.h | 2 ++ > 2 files changed, 17 insertions(+) > > diff --git a/drivers/usb/core/driver.c b/dr

Re: [PATCH 2/5] USB: Make it possible to "subclass" usb_device_driver

2019-10-09 Thread Alan Stern
On Wed, 9 Oct 2019, Alan Stern wrote: > On Wed, 9 Oct 2019, Bastien Nocera wrote: > > > The kernel currenly has only 2 usb_device_drivers, one generic one, one > > that completely replaces the generic one to make USB devices usable over > > a network. > > Presumably your first driver is in gener

Re: [PATCH 4/5] USB: Select better matching USB drivers when available

2019-10-09 Thread Alan Stern
On Wed, 9 Oct 2019, Bastien Nocera wrote: > Now that USB device drivers can reuse code from the generic USB device > driver, we need to make sure that they get selected rather than the > generic driver. Add an id_table and match vfunc to the usb_device_driver > struct, which will get used to selec

Re: [PATCH 1/1] net: usb: qmi_wwan: add Telit 0x1050 composition

2019-10-09 Thread Daniele Palmas
Il giorno mer 9 ott 2019 alle ore 12:17 Bjørn Mork ha scritto: > > Daniele Palmas writes: > > > This patch adds support for Telit FN980 0x1050 composition > > > > 0x1050: tty, adb, rmnet, tty, tty, tty, tty > > Great! I must admit I have been a bit curious about this since you > submitted the op

Re: [PATCH 4/5] USB: Select better matching USB drivers when available

2019-10-09 Thread Bastien Nocera
On Wed, 2019-10-09 at 10:43 -0400, Alan Stern wrote: > On Wed, 9 Oct 2019, Bastien Nocera wrote: > > > Now that USB device drivers can reuse code from the generic USB > device > > driver, we need to make sure that they get selected rather than the > > generic driver. Add an id_table and match vfun

[PATCH 5/5] USB: yurex: fix NULL-derefs on disconnect

2019-10-09 Thread Johan Hovold
The driver was using its struct usb_interface pointer as an inverted disconnected flag, but was setting it to NULL without making sure all code paths that used it were done with it. Before commit ef61eb43ada6 ("USB: yurex: Fix protection fault after device removal") this included the interrupt-in

[PATCH 1/5] USB: adutux: fix use-after-free on release

2019-10-09 Thread Johan Hovold
The driver was accessing its struct usb_device in its release() callback without holding a reference. This would lead to a use-after-free whenever the device was disconnected while the character device was still open. Fixes: 66d4bc30d128 ("USB: adutux: remove custom debug macro") Cc: stable #

[PATCH 3/5] USB: ldusb: fix NULL-derefs on driver unbind

2019-10-09 Thread Johan Hovold
The driver was using its struct usb_interface pointer as an inverted disconnected flag, but was setting it to NULL before making sure all completion handlers had run. This could lead to a NULL-pointer dereference in a number of dev_dbg, dev_warn and dev_err statements in the completion handlers whi

[PATCH 2/5] USB: chaoskey: fix use-after-free on release

2019-10-09 Thread Johan Hovold
The driver was accessing its struct usb_interface in its release() callback without holding a reference. This would lead to a use-after-free whenever the device was disconnected while the character device was still open. Fixes: 66e3e591891d ("usb: Add driver for Altus Metrum ChaosKey device (v2)")

[PATCH 4/5] USB: legousbtower: fix use-after-free on release

2019-10-09 Thread Johan Hovold
The driver was accessing its struct usb_device in its release() callback without holding a reference. This would lead to a use-after-free whenever the device was disconnected while the character device was still open. Fixes: fef526cae700 ("USB: legousbtower: remove custom debug macro") Cc: stable

[PATCH 0/5] USB: misc: fix disconnect bugs

2019-10-09 Thread Johan Hovold
This series fixes a number of issues introduced primarily with the conversion to dev_err() and dev_dbg(), which failed to notice that the drivers where using their USB interface and device pointers as disconnected flags (leading to NULL derefs) and that they did not hold references to the structure

Re: [PATCH 3/5] USB: Implement usb_device_match_id()

2019-10-09 Thread Bastien Nocera
On Wed, 2019-10-09 at 10:36 -0400, Alan Stern wrote: > On Wed, 9 Oct 2019, Bastien Nocera wrote: > > > Match a usb_device with a table of IDs. > > > > Signed-off-by: Bastien Nocera > > --- > > drivers/usb/core/driver.c | 15 +++ > > include/linux/usb.h | 2 ++ > > 2 files cha

[PATCH 0/3] USB: usb-skeleton: regression fix

2019-10-09 Thread Johan Hovold
I messed up when submitting the runtime PM fixes last week and failed to notice that the change to usb-skeleton depended on another fix I already had in my tree (I did notice the conflict, but rebased and sent a v2 also without the prerequisite patch). So here's a regression fix to a commit in usb

[PATCH 3/3] USB: usb-skeleton: drop redundant in-urb check

2019-10-09 Thread Johan Hovold
The driver bails out at probe if we can't find a bulk-in endpoint or if we fail to allocate the URB, so drop the check in read(). Signed-off-by: Johan Hovold --- drivers/usb/usb-skeleton.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/usb-skeleton.c b/drivers/

[PATCH 2/3] USB: usb-skeleton: fix use-after-free after driver unbind

2019-10-09 Thread Johan Hovold
The driver failed to stop its read URB on disconnect, something which could lead to a use-after-free in the completion handler after driver unbind in case the character device has been closed. Fixes: e7389cc9a7ff ("USB: skel_read really sucks royally") Signed-off-by: Johan Hovold --- drivers/usb

[PATCH 1/3] USB: usb-skeleton: fix NULL-deref on disconnect

2019-10-09 Thread Johan Hovold
The driver was using its struct usb_interface pointer as an inverted disconnected flag and was setting it to NULL before making sure all completion handlers had run. This could lead to NULL-pointer dereferences in the dev_err() statements in the completion handlers which relies on said pointer. Fi

Re: [PATCH 4/5] USB: Select better matching USB drivers when available

2019-10-09 Thread Alan Stern
On Wed, 9 Oct 2019, Bastien Nocera wrote: > On Wed, 2019-10-09 at 10:43 -0400, Alan Stern wrote: > > On Wed, 9 Oct 2019, Bastien Nocera wrote: > > > > > Now that USB device drivers can reuse code from the generic USB > > device > > > driver, we need to make sure that they get selected rather than

Re: [PATCH 3/5] USB: Implement usb_device_match_id()

2019-10-09 Thread Alan Stern
On Wed, 9 Oct 2019, Bastien Nocera wrote: > > This would be better if you allowed matching against just the > > idVendor > > field rather than matching against both. That would make it a lot > > simpler to match all Apple devices, for instance. > > That should already be possible. The matching

Re: [PATCH 4/5] USB: Select better matching USB drivers when available

2019-10-09 Thread Bastien Nocera
On Wed, 2019-10-09 at 13:28 -0400, Alan Stern wrote: > No, that's not quite it. > > Here's what should happen when the subclass driver is being probed: > First, call the generic_probe routine, and return immediately if that > fails. Then call the subclass driver's probe routine. If that gets >

Re: [PATCH 4/5] USB: Select better matching USB drivers when available

2019-10-09 Thread Alan Stern
On Wed, 9 Oct 2019, Bastien Nocera wrote: > On Wed, 2019-10-09 at 13:28 -0400, Alan Stern wrote: > > > No, that's not quite it. > > > > Here's what should happen when the subclass driver is being probed: > > First, call the generic_probe routine, and return immediately if that > > fails. Then c

Re: Etron EJ168A controller

2019-10-09 Thread Kenneth
Hi, I was informed that there were bug fixes for the Etron EJ168A controller in kernel 5.2 and 5.3 While I can read most USB sticks, if I connect an android phone to this port, applications hang trying to access the phone. MX Linux Form Topic = Android phone hangs with USB 3.0 Kenneth

[PATCH 5/7] usb: musb: omap2430: Clean up enable and remove devctl tinkering

2019-10-09 Thread Tony Lindgren
There should be no need to tinker with devctl in enable in the SoC glue code. We have musb_start() to take care of handling it already. Signed-off-by: Tony Lindgren --- drivers/usb/musb/omap2430.c | 20 1 file changed, 20 deletions(-) diff --git a/drivers/usb/musb/omap2430.

[PATCH 4/7] usb: musb: Add musb_set_host and peripheral and use them for omap2430

2019-10-09 Thread Tony Lindgren
At least some revisions of musb core need to set devctl session bit in peripheral mode to force musb to host mode. And we have places clearing the devctl session bit. Let's add a generic function to do this, and use it for omap2430. This should get us a bit closer to completely removing devctl reg

[PATCH 6/7] usb: musb: omap2430: Idle musb on init

2019-10-09 Thread Tony Lindgren
We want to configure musb state in omap2430_musb_enable() instead of omap2430_musb_init(). Otherwise musb may not idle properly until USB cable has been connected at least once. And we already have omap_musb_set_mailbox() configure mode with omap_control_usb_set_mode() so we can remove those calls

[PATCH 2/7] usb: musb: omap2430: Wait on enable to avoid babble

2019-10-09 Thread Tony Lindgren
We can babble interrupt if we attempt to switch to USB host mode too soon after enabling musb. Let's fix the issue by waiting a bit in runtime_resume. Cc: Jacopo Mondi Cc: Marcel Partap Cc: Merlijn Wajer Cc: Michael Scott Cc: NeKit Cc: Pavel Machek Cc: Sebastian Reichel Signed-off-by: Tony

[PATCH 1/7] usb: musb: omap2430: Get rid of musb .set_vbus for omap2430 glue

2019-10-09 Thread Tony Lindgren
We currently have musb_set_vbus() called from two different paths. Mostly it gets called from the USB PHY via omap_musb_set_mailbox(), but in some cases it can get also called from musb_stage0_irq() rather via .set_vbus: (musb_set_host [musb_hdrc]) (omap2430_musb_set_vbus [omap2430]) (musb_stage0_

[PATCH 3/7] usb: musb: omap2430: Handle multiple ID ground interrupts

2019-10-09 Thread Tony Lindgren
We currently get "unhandled DISCONNECT transition" warnings from musb core on device disconnect as things are wrongly set to OTG_STATE_A_IDLE in host mode when enumerating devices. We can also get "Failed to write reg index" errors after enumerating. This is happening at least with cpcap phy where

[PATCHv2 0/7] musb host improvments mostly for omap2430 glue

2019-10-09 Thread Tony Lindgren
Hi, Here's v2 set of musb clean-up mostly for the 2430 glue layer. Regards, Tony Changes since v1: - Get rid of set_vbus stuff Tony Lindgren (7): usb: musb: omap2430: Get rid of musb .set_vbus for omap2430 glue usb: musb: omap2430: Wait on enable to avoid babble usb: musb: omap2430: H

[PATCH 7/7] usb: musb: Get rid of omap2430_musb_set_vbus()

2019-10-09 Thread Tony Lindgren
Now that we've removed direct calls from interrupt handler to omap2430_musb_set_vbus(), let's make things less confusing and configure VBUS directly in omap_musb_set_mailbox(). We have omap_musb_set_mailbox() called from the PHYs, and that's all we need. Note that we can now also drop the check f

Hello

2019-10-09 Thread Triverton
Good Morning! I strongly apologize for delving into your privacy. I am Elizabeth Leon, Loan Expert at Triverton Financial Service, Montreal, Canada. We are offering all kind of loans at low interest rate. Respond for more details, and our website will be unveil to you for application. Best R

Re: [PATCH 1/1] net: usb: qmi_wwan: add Telit 0x1050 composition

2019-10-09 Thread Jakub Kicinski
On Wed, 9 Oct 2019 11:07:18 +0200, Daniele Palmas wrote: > This patch adds support for Telit FN980 0x1050 composition > > 0x1050: tty, adb, rmnet, tty, tty, tty, tty > > Signed-off-by: Daniele Palmas Applied, thanks!

Need clarification regarding UASP gadget status in Linux kernel

2019-10-09 Thread Rahul Kumar
Hi, I am trying to test the UASP gadget based on f_tcm.c against Command Verifier in super-speed mode. I would like to know whether anyone has had any luck in this regard. However I see a lot of failures, due to lack of features in the function/f_tcm .c code. My understanding is that it doesn't