Re: [PATCH] USB: legousbtower: Fix buffers on stack

2017-04-21 Thread Greg Kroah-Hartman
On Fri, Apr 21, 2017 at 10:48:48PM +0300, Maksim Salau wrote: > Allocate buffers on HEAP instead of STACK for local structures > that are to be received using usb_control_msg(). > > Signed-off-by: Maksim Salau > --- > > I took the liberty to fix the module if Greg don't mind. > It is to be appli

Re: issues with commit c1da59dad0eb ("cdc-wdm: Clear read pipeline in case of error")

2017-04-21 Thread Guenter Roeck
On Thu, Apr 20, 2017 at 2:18 PM, Robert Foss wrote: > Hi Björn, > > Thanks for the thorough and explicit feedback, it was rather helpful. > > > On 2017-04-20 04:32 AM, Bjørn Mork wrote: >> >> Hello Robert, >> >> Sorry for being much too late here, but during recent attemts to debug >> issues cause

Re: [RFC PATCH v5 1/2] usb: typec: USB Type-C Port Manager (tcpm)

2017-04-21 Thread Guenter Roeck
On 04/21/2017 03:15 PM, Guenter Roeck wrote: From: Guenter Roeck This driver implements the USB Type-C Power Delivery state machine for both source and sink ports. Alternate mode support is not fully implemented. The driver attaches to the USB Type-C class code implemented in the following pat

Re: [PATCH 5/5 v3] ARM: dts: Add the FOTG210 USB host to Gemini

2017-04-21 Thread kbuild test robot
Hi Linus, [auto build test ERROR on next-20170421] [cannot apply to robh/for-next usb/usb-testing balbi-usb/next v4.9-rc8 v4.9-rc7 v4.9-rc6 v4.11-rc7] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux

Re: Options for improving f_fs.c performance?

2017-04-21 Thread Jerry Zhang
Hi all, Thanks for the replies. > That wait_for_completion_interruptible() is what's killing > performance. Each and every read/write waits for the USB side to > complete. It would've been much better to have something like: > This would help the write() side of things by a long margin. For read

Re: [PATCH 2/3] usb: add DT bindings for farady fotg2 host controller

2017-04-21 Thread Linus Walleij
On Thu, Mar 30, 2017 at 8:31 PM, Hans Ulli Kroll wrote: >> On Tue, Feb 21, 2017 at 3:43 PM, Rob Herring wrote: >> > On Fri, Feb 17, 2017 at 4:07 AM, Hans Ulli Kroll >> > wrote: >> >> Hi Rob, >> >> >> >> On Wed, 15 Feb 2017, Rob Herring wrote: >> >> >> >>> On Wed, Feb 08, 2017 at 09:00:09PM +0100

[RFC PATCH v5 2/2] usb: typec: Type-C Port Controller Interface driver (tcpci)

2017-04-21 Thread Guenter Roeck
From: Guenter Roeck The port controller interface driver interconnects the Type-C Port Manager with a Type-C Port Controller Interface (TCPCI) compliant port controller. Signed-off-by: Guenter Roeck Signed-off-by: Guenter Roeck --- v5: - API changes [set_pd_header -> set_roles] v4: - Fix RP

[RFC PATCH v5 1/2] usb: typec: USB Type-C Port Manager (tcpm)

2017-04-21 Thread Guenter Roeck
From: Guenter Roeck This driver implements the USB Type-C Power Delivery state machine for both source and sink ports. Alternate mode support is not fully implemented. The driver attaches to the USB Type-C class code implemented in the following patches. usb: typec: add driver for Intel

Re: [PATCH] usb: host: xhci: remove #ifdef around PM functions

2017-04-21 Thread Guenter Roeck
On Fri, Apr 21, 2017 at 11:42:54PM +0200, Arnd Bergmann wrote: > The #ifdef is slightly wrong as it doesn't cover the xhci_priv_resume_quirk() > function, causing a harmless warning: > > drivers/usb/host/xhci-plat.c:58:12: error: 'xhci_priv_resume_quirk' defined > but not used [-Werror=unused-fun

[PATCH] usb: host: xhci: remove #ifdef around PM functions

2017-04-21 Thread Arnd Bergmann
The #ifdef is slightly wrong as it doesn't cover the xhci_priv_resume_quirk() function, causing a harmless warning: drivers/usb/host/xhci-plat.c:58:12: error: 'xhci_priv_resume_quirk' defined but not used [-Werror=unused-function] static int xhci_priv_resume_quirk(struct usb_hcd *hcd) A simpler

Re: Regression - Linux 4.9: ums_eneub6250 broken: transfer buffer not dma capable - Trace

2017-04-21 Thread Andreas Hartmann
Am 21.04.2017 um 20:53 schrieb Alan Stern: On Fri, 21 Apr 2017, Andreas Hartmann wrote: Same here. So the reason usb_stor_set_xfer_buf() wasn't working is because it never got called! Knowing that, it's easy to see where the bug is. It's a completely different issue from the bad DMA problem.

[PATCH 2/5 v3] usb: host: fotg2: add device tree probing

2017-04-21 Thread Linus Walleij
From: Hans Ulli Kroll Add device tree probing to the fotg2 driver. Signed-off-by: Hans Ulli Kroll Signed-off-by: Linus Walleij --- ChangeLog v2->v3: - Change compatible to "faraday,fotg210" simply. --- drivers/usb/host/fotg210-hcd.c | 19 +++ 1 file changed, 19 insertions(+)

[PATCH 5/5 v3] ARM: dts: Add the FOTG210 USB host to Gemini

2017-04-21 Thread Linus Walleij
This adds the FOTG210 USB host controller to the Gemini device trees. In the main SoC DTSI it is flagged as disabled and then it is selectively enabled on the devices that utilize it (these per-platform enablements are done on the out-of-tree OpenWrt patch set). It is not enabled on the Itian Squar

[PATCH 3/5 v3] usb: host: fotg2: add silicon clock handling

2017-04-21 Thread Linus Walleij
When used in a system with software-controller silicon clocks, the FOTG210 needs to grab, prepare and enable the clock. This is needed on for example the Cortina Gemini, where the platform will by default gate off the clock unless the peripheral (in this case the USB driver) grabs and enables the c

[PATCH 1/5 v3] usb: host: add DT bindings for faraday fotg2

2017-04-21 Thread Linus Walleij
From: Hans Ulli Kroll This adds device tree bindings for the Faraday FOTG2 dual-mode host controller. Cc: devicet...@vger.kernel.org Signed-off-by: Hans Ulli Kroll Signed-off-by: Linus Walleij --- ChangeLog v1->v3: - Change compatible to "faraday,fotg210" as the name of the hardware block. -

[PATCH 4/5 v3] usb: host: fotg2: add Gemini-specific handling

2017-04-21 Thread Linus Walleij
The Cortina Systems Gemini has bolted on a PHY inside the silicon that can be handled by six bits in a MISC register in the system controller. If we are running on Gemini, look up a syscon regmap through a phandle and enable VBUS and optionally the Mini-B connector. If the device is flagged as "w

[PATCH] USB: legousbtower: Fix buffers on stack

2017-04-21 Thread Maksim Salau
Allocate buffers on HEAP instead of STACK for local structures that are to be received using usb_control_msg(). Signed-off-by: Maksim Salau --- I took the liberty to fix the module if Greg don't mind. It is to be applied on vanilla v4.10.12 (without Greg's patch). Changes compared to Greg's ver

[PATCH] usb: dwc2: Remove unnecessary uphy and clk checkings

2017-04-21 Thread Sevak Arakelyan
hsotg->uphy and hsotg->clk will be set or NULL, but not ERRPTR. So IS_ERR_OR_NULL() is not required at all. NULL pointer argument is OK for "usb_phy_set_suspend", "otg_set_host", "otg_set_peripheral", "clk_prepare_enable" and "clk_disable_unprepare" functions. So remove unnecessary checkings. Sign

Re: Regression - Linux 4.9: ums_eneub6250 broken: transfer buffer not dma capable - Trace

2017-04-21 Thread Alan Stern
On Fri, 21 Apr 2017, Andreas Hartmann wrote: > > Same here. So the reason usb_stor_set_xfer_buf() wasn't working is > > because it never got called! > > > > Knowing that, it's easy to see where the bug is. It's a completely > > different issue from the bad DMA problem. In fact, I'm surprised th

Re: Regression - Linux 4.9: ums_eneub6250 broken: transfer buffer not dma capable - Trace

2017-04-21 Thread Alan Stern
On Thu, 20 Apr 2017, Andreas Hartmann wrote: > >> Apr 19 19:25:39 notebook2 kernel: scsi host6: scsi scan: INQUIRY result > >> too short (5), using 36 > > > > But that is wrong! Even though it's for a working test. It means the > > usb_stor_set_xfer_buf() subroutine isn't doing what it should.

Re: Regression - Linux 4.9: ums_eneub6250 broken: transfer buffer not dma capable - Trace

2017-04-21 Thread Andreas Hartmann
Am 21.04.2017 um 16:48 schrieb Alan Stern: On Thu, 20 Apr 2017, Andreas Hartmann wrote: Apr 19 19:25:39 notebook2 kernel: scsi host6: scsi scan: INQUIRY result too short (5), using 36 But that is wrong! Even though it's for a working test. It means the usb_stor_set_xfer_buf() subroutine is

Re: [PATCH 1/3] usb: dwc3: gadget: Prevent losing events in event cache

2017-04-21 Thread John Youn
On 04/18/2017 05:47 AM, Felipe Balbi wrote: > > Hi, > > Thinh Nguyen writes: >>> (Thinh, for whatever I didn't receive your email via the list, replying >>> to myself) >> >> Could it be because of the attached file? >> >>> >>> Felipe Balbi writes: > Hmm, can you apply this patch and provide o

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-21 Thread Guenter Roeck
On Fri, Apr 21, 2017 at 07:57:52PM +0530, Rajaram R wrote: > On Fri, Apr 21, 2017 at 1:16 AM, Badhri Jagan Sridharan > wrote: > > Thanks for the responses :) > > > > So seems like we have a plan. > > > > In Type-C connector class the checks for TYPEC_PWR_MODE_PD > > and pd_revision for both the po

Re: [PATCH] USB: Revert "cdc-wdm: fix "out-of-sync" due to missing notifications"

2017-04-21 Thread Daniele Palmas
Hi Bjørn, 2017-04-21 10:01 GMT+02:00 Bjørn Mork : > This reverts commit 833415a3e781 ("cdc-wdm: fix "out-of-sync" due to > missing notifications") > > There have been several reports of wdm_read returning unexpected EIO > errors with QMI devices using the qmi_wwan driver. The reporters > confirm t

Re: Options for improving f_fs.c performance?

2017-04-21 Thread Michal Nazarewicz
On Fri, Apr 21 2017, Felipe Balbi wrote: > why would it have to do that? We would allocate a new struct > usb_request, allocate a new buffer, copy_from_user() and > usb_ep_queue(). Why would we return -EAGAIN? Nvm. Of course you’re right. >> What if user space doesn’t want to read? If kernel sp

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-21 Thread Rajaram R
On Fri, Apr 21, 2017 at 1:16 AM, Badhri Jagan Sridharan wrote: > Thanks for the responses :) > > So seems like we have a plan. > > In Type-C connector class the checks for TYPEC_PWR_MODE_PD > and pd_revision for both the port and the partner will be removed in > power_role_store and the data_role_

Re: Options for improving f_fs.c performance?

2017-04-21 Thread Felipe Balbi
Hi, Michal Nazarewicz writes: Here's how f_fs.c works today: write(ep2, buf, length); ffs_epfile_write_iter() ffs_epfile_io() usb_ep_queue() wait_for_completion_interruptible() That wait_for_completion_interruptible() is what's killing p

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-21 Thread Guenter Roeck
On 04/21/2017 05:12 AM, Heikki Krogerus wrote: Hi, On Thu, Apr 20, 2017 at 12:46:59PM -0700, Badhri Jagan Sridharan wrote: Thanks for the responses :) So seems like we have a plan. In Type-C connector class the checks for TYPEC_PWR_MODE_PD and pd_revision for both the port and the partner wil

[PATCH, 3.18-stable regression] gadgetfs: fix uninitialized variable in error handling

2017-04-21 Thread Arnd Bergmann
gcc warns about a bug in 3.18.y: drivers/usb/gadget/legacy/inode.c:648:10: warning: 'value' may be used This is caused by the backport of f01d35a15fa0416 from 4.0 to 3.18: c81fc59be42c6e0 gadgetfs: use-after-free in ->aio_read() The backported patch was buggy, but the mainline code was rewritten

Re: [PATCH 1/1] drivers: net: usb: qmi_wwan: add QMI_QUIRK_SET_DTR for Telit PID 0x1201

2017-04-21 Thread Bjørn Mork
Daniele Palmas writes: > So, I applied your debug patch and this is what is happening: Thanks > [ 4306.730786] wdm_open: qmi_wwan 2-2:1.2: draining queued data > [ 4306.730955] wdm_write: qmi_wwan 2-2:1.2: Tx URB has been submitted index=2 > > Here qmicli is stuck. Then I disconnect the cable:

[PATCH] usb: dwc3: gadget: Fix ISO transfer performance

2017-04-21 Thread Roger Quadros
Commit 08a36b543803 ("usb: dwc3: gadget: simplify __dwc3_gadget_ep_queue()") caused a small change in the way ISO transfer is handled in the case when XferInProgress event happens on Isoc EP with an active transfer. This caused a performance degradation of 50%. e.g. using g_webcam on DUT and luvcvi

Re: [PATCH 1/1] drivers: net: usb: qmi_wwan: add QMI_QUIRK_SET_DTR for Telit PID 0x1201

2017-04-21 Thread Daniele Palmas
Hi Bjørn, 2017-04-21 12:30 GMT+02:00 Daniele Palmas : > Hi Bjørn, > > 2017-04-19 19:28 GMT+02:00 Bjørn Mork : >> Daniele Palmas writes: >> >> >> Would you mind describing in detail how you trigger the EIOs? What >> software and command sequence are you using? Does it reliably reproduce >> the i

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-21 Thread Heikki Krogerus
Hi, On Thu, Apr 20, 2017 at 12:46:59PM -0700, Badhri Jagan Sridharan wrote: > Thanks for the responses :) > > So seems like we have a plan. > > In Type-C connector class the checks for TYPEC_PWR_MODE_PD > and pd_revision for both the port and the partner will be removed in > power_role_store and

Re: Options for improving f_fs.c performance?

2017-04-21 Thread Michal Nazarewicz
>>> Here's how f_fs.c works today: >>> >>> write(ep2, buf, length); >>> ffs_epfile_write_iter() >>> ffs_epfile_io() >>>usb_ep_queue() >>>wait_for_completion_interruptible() >>> >>> That wait_for_completion_interruptible() is what's killing >>> performance. Each and every read/write wait

Re: Options for improving f_fs.c performance?

2017-04-21 Thread Felipe Balbi
Hi, Michal Nazarewicz writes: >>> Does this sound like something that people want or find acceptable? >> >> yes, it _is_ definitely acceptable. But f_fs.c needs a cleanup >> first. Also, IMHO a better flag to implement would be O_NONBLOCK. Here's >> how f_fs.c works today: >> >> write(ep2, buf,

Re: Options for improving f_fs.c performance?

2017-04-21 Thread Michal Nazarewicz
On Fri, Apr 21 2017, Felipe Balbi wrote: > Hi Jerry, > > Jerry Zhang writes: >> (reposting this question in its own subject, instead of buried in a patchset) >> >> Android has migrated to using f_fs for the mtp function, but in the >> process we ran into some performance hiccups in comparison to f

Re: Options for improving f_fs.c performance?

2017-04-21 Thread Krzysztof Opasiak
On 04/21/2017 09:14 AM, Felipe Balbi wrote: Hi Jerry, Jerry Zhang writes: (reposting this question in its own subject, instead of buried in a patchset) Android has migrated to using f_fs for the mtp function, but in the process we ran into some performance hiccups in comparison to f_mtp du

Re: [PATCH 1/1] drivers: net: usb: qmi_wwan: add QMI_QUIRK_SET_DTR for Telit PID 0x1201

2017-04-21 Thread Daniele Palmas
Hi Bjørn, 2017-04-19 19:28 GMT+02:00 Bjørn Mork : > Daniele Palmas writes: > >> as a side note in latest kernels I had troubles with qmi devices >> (e.g. I/O error when using qmicli). >> >> I found your suggestion in libqmi mailing list to revert commit >> >> 833415a3e781a26fe480a34d45086bdb4fe1e

[PATCH] usb: chipidea: Fix missing resume call after suspend

2017-04-21 Thread Bernhard Walle
We have a i.MX53-based hardware (quite similar to the i.MX53 QSB from Freescale/NXP). I'm reading the /ci_hdrc.0/gadget/suspended sysfs file to find out whether a PC is connected to the USB gadget. With old kernel versions, this worked. However, with kernel 4.9 this didn't work. When the host

[PATCH] USB: Revert "cdc-wdm: fix "out-of-sync" due to missing notifications"

2017-04-21 Thread Bjørn Mork
This reverts commit 833415a3e781 ("cdc-wdm: fix "out-of-sync" due to missing notifications") There have been several reports of wdm_read returning unexpected EIO errors with QMI devices using the qmi_wwan driver. The reporters confirm that reverting prevents these errors. I have been unable to rep

Re: XHCI is slow during boot (bios/efi) and leaves many dmesg messages

2017-04-21 Thread Maël Lavault
On Tue, 2017-04-18 at 16:58 +0200, Maël Lavault wrote: > Hi, > > I can't find how to reply to an old thread with majordomo, sorry for > the inconvenience it might cause.  > > I'm reposting an issue [0] that has been inactive for a few month but > still present in kernel 4.10.10 on a Macbook pro 1

Re: Options for improving f_fs.c performance?

2017-04-21 Thread Felipe Balbi
Hi Jerry, Jerry Zhang writes: > (reposting this question in its own subject, instead of buried in a patchset) > > Android has migrated to using f_fs for the mtp function, but in the > process we ran into some performance hiccups in comparison to f_mtp > during bulk transfer of large files. > > A