Re: [PATCH v2] usb: dwc2: host: Fix use after free w/ simultaneous irqs

2015-10-16 Thread John Youn
On 10/15/2015 4:38 PM, Doug Anderson wrote: > John, > > On Thu, Oct 15, 2015 at 4:21 PM, John Youn wrote: >> Passing a NULL qtd to some of the subcases will lead to a NULL >> pointer dereference in that function or some function that it >> calls. >> >> I think you could just check the qtd after e

RE: Crash in usb_f_mass_storage

2015-10-16 Thread Kaukab, Yousaf
> -Original Message- > From: Paul Jones [mailto:p.jo...@teclyn.com] > Sent: Friday, October 16, 2015 3:40 AM > To: Kaukab, Yousaf > Cc: Alan Stern; Felipe Balbi; Linux USB Mailing List > Subject: Re: Crash in usb_f_mass_storage > > > On 15 Oct 2015, at 04:12, Kaukab, Yousaf wrote: > > >

Re: [PATCH] USB: serial: cp210x: Adding tx_empty() to avoid cp2108 failure

2015-10-16 Thread Sergei Shtylyov
Hello. On 10/16/2015 1:07 AM, Konstantin Shkolnyy wrote: Occasionally, writing data and immediately closing the port makes cp2108 stop responding. The device had to be unplugged to clear the error. The failure is induced by shutting down the device while its Tx queue still has unsent data. Repo

Re: [PATCH] arm: dts: ls1021a: Add quirk for Erratum A009116

2015-10-16 Thread Shawn Guo
On Wed, Oct 14, 2015 at 11:04:12AM +0530, Rajesh Bhagat wrote: > Add "snps,quirk-frame-length-adjustment" property to > USB3 node for erratum A009116. This property provides > value of GFLADJ_30MHZ for post silicon frame length > adjustment. > > Signed-off-by: Nikhil Badola > Signed-off-by: Rajes

Re: [PATCH] USB: serial: cp210x: Adding tx_empty() to avoid cp2108 failure

2015-10-16 Thread Konstantin Shkolnyy
Hello, On Fri, Oct 16, 2015 at 6:19 AM, Sergei Shtylyov wrote: [...] >> >> @@ -249,6 +251,16 @@ static struct usb_serial_driver * const >> serial_drivers[] = { >> #define CP210X_GET_CHARS 0x0E >> #define CP210X_GET_PROPS 0x0F >> #define CP210X_GET_COMM_STATUS0x10 >> +/* D

Re: [PATCH] USB: serial: cp210x: Adding tx_empty() to avoid cp2108 failure

2015-10-16 Thread Johan Hovold
On Fri, Oct 16, 2015 at 07:35:02AM -0500, Konstantin Shkolnyy wrote: > Hello, > > On Fri, Oct 16, 2015 at 6:19 AM, Sergei Shtylyov > wrote: > [...] > >> > >> @@ -249,6 +251,16 @@ static struct usb_serial_driver * const > >> serial_drivers[] = { > >> #define CP210X_GET_CHARS 0x0E > >> #d

Re: [PATCH] USB: serial: cp210x: Adding tx_empty() to avoid cp2108 failure

2015-10-16 Thread Johan Hovold
On Thu, Oct 15, 2015 at 05:07:08PM -0500, Konstantin Shkolnyy wrote: > Occasionally, writing data and immediately closing the port makes cp2108 > stop responding. The device had to be unplugged to clear the error. > The failure is induced by shutting down the device while its Tx queue still > has

Re: [PATCH v2] USB: serial: cp210x: Workaround for cp2108 failure due to GET_LINE_CTL bug

2015-10-16 Thread Johan Hovold
On Thu, Oct 15, 2015 at 06:23:31PM -0500, Konstantin Shkolnyy wrote: > cp2108 GET_LINE_CTL returns the 16-bit value with the 2 bytes swapped. > However, SET_LINE_CTL functions properly. When the driver tries to modify > the register, it reads it, modifies some bits and writes back. Because the > re

Re: [PATCH] USB: serial: cp210x: Adding tx_empty() to avoid cp2108 failure

2015-10-16 Thread Konstantin Shkolnyy
On Fri, Oct 16, 2015 at 7:55 AM, Johan Hovold wrote: > On Thu, Oct 15, 2015 at 05:07:08PM -0500, Konstantin Shkolnyy wrote: >> Occasionally, writing data and immediately closing the port makes cp2108 >> stop responding. The device had to be unplugged to clear the error. >> The failure is induced b

Re: [PATCH] USB: serial: cp210x: Adding tx_empty() to avoid cp2108 failure

2015-10-16 Thread Johan Hovold
On Fri, Oct 16, 2015 at 08:48:39AM -0500, Konstantin Shkolnyy wrote: > On Fri, Oct 16, 2015 at 7:55 AM, Johan Hovold wrote: > > On Thu, Oct 15, 2015 at 05:07:08PM -0500, Konstantin Shkolnyy wrote: > >> Occasionally, writing data and immediately closing the port makes cp2108 > >> stop responding. T

uPD720200 errors kernel with Superspeed (USB3) devices.

2015-10-16 Thread Stuart Foster
When I try to use a Superspeed device with the USB 3 ports provided by this device I get kernel errors (see attached). The device works fine with HiSpeed (USB2) etc. devices. Please advise. [0.00] Initializing cgroup subsys cpu [0.00] Linux version 4.2.3 (root@Alice) (gcc version

[RFC PATCH] usb: gadget: Introduce Cadence USB2 UDC Driver

2015-10-16 Thread Neil Armstrong
Introduces UDC support for the Device-Mode only version of the Cadence USB2 Controller IP Core. Host mode and OTG mode are not implemented by lack of hardware. Support for Isochronous endpoints is not implemented by lack of time. Internal DMA is supported and can be activated by DT property. Sig

Re: Crash in usb_f_mass_storage

2015-10-16 Thread Paul Jones
On 16 Oct 2015, at 05:55, Kaukab, Yousaf wrote: >> -Original Message- >> From: Paul Jones [mailto:p.jo...@teclyn.com] >> Sent: Friday, October 16, 2015 3:40 AM >> To: Kaukab, Yousaf >> Cc: Alan Stern; Felipe Balbi; Linux USB Mailing List >> Subject: Re: Crash in usb_f_mass_storage >> >>

Re: [PATCH 2/3] pinctrl: sh-pfc: Stop including

2015-10-16 Thread Linus Walleij
On Wed, Oct 7, 2015 at 10:23 AM, Geert Uytterhoeven wrote: > This header file will be removed soon. > > Copy the helper macro RCAR_GP_PIN(), which is used by the pinctrl > drivers only, to sh_pfc.h, and drop the #include. > > Signed-off-by: Geert Uytterhoeven Acked-by: Linus Walleij Include t

Re: [PATCH 0/3] gpio: rcar: Remove obsolete platform data support

2015-10-16 Thread Linus Walleij
On Wed, Oct 7, 2015 at 10:23 AM, Geert Uytterhoeven wrote: > Hi Greg, Linus, Alexandre, > > Since commit 4baadb9e05c68962 ("ARM: shmobile: r8a7778: remove obsolete > setup code"), which is now in arm-soc/for-next, Renesas R-Car SoCs are > only supported in generic DT-only ARM multi-platfo

Re: [PATCH v2] USB: serial: cp210x: Workaround for cp2108 failure due to GET_LINE_CTL bug

2015-10-16 Thread Konstantin Shkolnyy
On Fri, Oct 16, 2015 at 8:27 AM, Johan Hovold wrote: > On Thu, Oct 15, 2015 at 06:23:31PM -0500, Konstantin Shkolnyy wrote: >> cp2108 GET_LINE_CTL returns the 16-bit value with the 2 bytes swapped. >> However, SET_LINE_CTL functions properly. When the driver tries to modify >> the register, it rea

Re: [PATCH v2] USB: serial: cp210x: Workaround for cp2108 failure due to GET_LINE_CTL bug

2015-10-16 Thread Johan Hovold
On Fri, Oct 16, 2015 at 10:11:12AM -0500, Konstantin Shkolnyy wrote: > On Fri, Oct 16, 2015 at 8:27 AM, Johan Hovold wrote: > > On Thu, Oct 15, 2015 at 06:23:31PM -0500, Konstantin Shkolnyy wrote: > >> cp2108 GET_LINE_CTL returns the 16-bit value with the 2 bytes swapped. > >> However, SET_LINE_CT

Re: [PATCH v2] USB: serial: cp210x: Workaround for cp2108 failure due to GET_LINE_CTL bug

2015-10-16 Thread Konstantin Shkolnyy
On Fri, Oct 16, 2015 at 10:27 AM, Johan Hovold wrote: > On Fri, Oct 16, 2015 at 10:11:12AM -0500, Konstantin Shkolnyy wrote: >> On Fri, Oct 16, 2015 at 8:27 AM, Johan Hovold wrote: >> > On Thu, Oct 15, 2015 at 06:23:31PM -0500, Konstantin Shkolnyy wrote: >> >> cp2108 GET_LINE_CTL returns the 16-b

Re: [PATCH v2] USB: serial: cp210x: Workaround for cp2108 failure due to GET_LINE_CTL bug

2015-10-16 Thread Johan Hovold
On Fri, Oct 16, 2015 at 10:39:13AM -0500, Konstantin Shkolnyy wrote: > On Fri, Oct 16, 2015 at 10:27 AM, Johan Hovold wrote: > > On Fri, Oct 16, 2015 at 10:11:12AM -0500, Konstantin Shkolnyy wrote: > >> On Fri, Oct 16, 2015 at 8:27 AM, Johan Hovold wrote: > >> > On Thu, Oct 15, 2015 at 06:23:31PM

[PATCH] usb: gadget: fix platform_no_drv_owner.cocci warnings

2015-10-16 Thread kbuild test robot
drivers/usb/gadget/udc/cadence_hsudc.c:2127:6-11: No need to set .owner here. The core will do it. Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci CC: Neil Armstrong Signed-off-by: Fengguang Wu --- cadence_hs

Re: [RFC PATCH] usb: gadget: Introduce Cadence USB2 UDC Driver

2015-10-16 Thread kbuild test robot
Hi Neil, [auto build test ERROR on balbi-usb/next -- if it's inappropriate base, please suggest rules for selecting the more suitable base] url: https://github.com/0day-ci/linux/commits/Neil-Armstrong/usb-gadget-Introduce-Cadence-USB2-UDC-Driver/20151016-225656 config: i386-allmodc

[PATCH] usb: gadget: fix bugon.cocci warnings

2015-10-16 Thread kbuild test robot
drivers/usb/gadget/udc/cadence_hsudc.c:1303:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG. Please make sure the condition has no side effects (see conditional BUG_ON definition in include/asm-generic/bug.h) Use BUG_ON instead of a if condition followed by BUG. Semantic patch

Re: [RFC PATCH] usb: gadget: Introduce Cadence USB2 UDC Driver

2015-10-16 Thread kbuild test robot
Hi Neil, [auto build test WARNING on balbi-usb/next -- if it's inappropriate base, please suggest rules for selecting the more suitable base] url: https://github.com/0day-ci/linux/commits/Neil-Armstrong/usb-gadget-Introduce-Cadence-USB2-UDC-Driver/20151016-225656 reproduce:

Re: [PATCH] usb: dwc2: host: Protect PCGCTL with lock in dwc2_port_resume()

2015-10-16 Thread John Youn
On 10/14/2015 3:58 PM, Douglas Anderson wrote: > From code inspection, it appears to be unsafe to do a read-modify-write > of PCGCTL in dwc2_port_resume(). Let's make sure the spinlock is held > around this operation. > > Signed-off-by: Douglas Anderson > --- > drivers/usb/dwc2/hcd.c | 5 -

Re: mass storage behaviour

2015-10-16 Thread Paul Jones
On 06 Oct 2015, at 12:34, Paul Jones wrote: > On 06 Oct 2015, at 16:44, Alan Stern wrote: > >> On Tue, 6 Oct 2015, Paul Jones wrote: >> >>> On 05 Oct 2015, at 23:09, Alan Stern wrote: >>> On Mon, 5 Oct 2015, Paul Jones wrote: >> Increasing the max_sectors_kb value, on the oth

Re: mass storage behaviour

2015-10-16 Thread Alan Stern
On Fri, 16 Oct 2015, Paul Jones wrote: > Added some debugging statements in f_mass_storage/net2280 to get an idea of > what is going on on the wire (as I unfortunately don’t have any tools to > figure it out any other way). > Additional debug statement locations: ... > Log for a single large re

Re: [PATCHv4 1/1] SCSI: hosts: update to use ida_simple for host_no management

2015-10-16 Thread Lee Duncan
Adding linux-usb and linux-hotplug to cc list, in case they wish to comment. Summary: I want to change SCSI host number so that it gets re-used, like disk index numbers, instead of always increasing. Please see below. On 10/14/2015 11:53 AM, James Bottomley wrote: > On Wed, 2015-10-14 at 11:34 -

Re: [PATCHv4 1/1] SCSI: hosts: update to use ida_simple for host_no management

2015-10-16 Thread Greg KH
On Fri, Oct 16, 2015 at 01:03:42PM -0700, Lee Duncan wrote: > Adding linux-usb and linux-hotplug to cc list, in case they wish to comment. > > Summary: I want to change SCSI host number so that it gets re-used, like > disk index numbers, instead of always increasing. > > Please see below. > > On

Re: [PATCH v1 14/14] usb: dwc2: host: use kmem cache to allocate descriptors

2015-10-16 Thread Herrero, Gregory
Hi Doug, On Thu, Oct 15, 2015 at 04:50:55PM -0700, Doug Anderson wrote: > Gregory, > > On Mon, Oct 12, 2015 at 2:17 AM, Gregory Herrero > wrote: > > - qh->desc_list = kzalloc(qh->desc_list_sz, flags | GFP_DMA32); > > + qh->desc_list = kmem_cache_zalloc(desc_cache, flags | GFP_DMA32);

Re: [GIT PULL] On-demand device probing

2015-10-16 Thread Olof Johansson
Hi, I've bisected boot failures in next-20151016 down to patches in this branch: On Thu, Oct 15, 2015 at 4:42 AM, Tomeu Vizoso wrote: > Tomeu Vizoso (20): > driver core: handle -EPROBE_DEFER from bus_type.match() The machine it happened on was OMAP5UEVM: http://arm-so

Re: mass storage behaviour

2015-10-16 Thread Paul Jones
On 16 Oct 2015, at 15:59, Alan Stern wrote: > On Fri, 16 Oct 2015, Paul Jones wrote: > >> Added some debugging statements in f_mass_storage/net2280 to get an idea of >> what is going on on the wire (as I unfortunately don’t have any tools to >> figure it out any other way). >> Additional debu

[PATCH v3] usb: dwc2: host: Fix use after free w/ simultaneous irqs

2015-10-16 Thread Douglas Anderson
From: Doug Anderson While plugging / unplugging on a DWC2 host port with "slub_debug=FZPUA" enabled, I found a crash that was quite obviously a use after free. It appears that in some cases when we handle the various sub-cases of HCINT we may end up freeing the QTD. If there is more than one bi

Re: mass storage behaviour

2015-10-16 Thread Felipe Balbi
Hi, Paul Jones writes: > First DMA to first IRQ = 116us. > > Second DMA to second IRQ = 107us. > > These seem fairly stable as the last request in a 500+MB transfer had > exactly the same timings. > > Each IRQ is taking around 14us to handle, during which most of the > time the ep->dev->lock is

[PATCH 1/2] usb: dwc2: host: Fix missing device insertions

2015-10-16 Thread Douglas Anderson
If you've got your interrupt signals bouncing a bit as you insert your USB device, you might end up in a state when the device is connected but the driver doesn't know it. Specifically, the observed order is: 1. hardware sees connect 2. hardware sees disconnect 3. hardware sees connect 4. dwc2

[PATCH 2/2] usb: dwc2: host: Clear interrupts before handling them

2015-10-16 Thread Douglas Anderson
In general it is wise to interrupts before processing them. If you don't do that, you can get: 1. Interrupt happens 2. You look at system state and process interrupt 3. A new interrupt happens 4. You clear interrupt without processing it. This patch was actually a first attempt to fix missing

Re: mass storage behaviour

2015-10-16 Thread Paul Jones
On 16 Oct 2015, at 18:06, Felipe Balbi wrote: > > Hi, > > Paul Jones writes: >> First DMA to first IRQ = 116us. >> >> Second DMA to second IRQ = 107us. >> >> These seem fairly stable as the last request in a 500+MB transfer had >> exactly the same timings. >> >> Each IRQ is taking around 1

Re: [PATCH v3] usb: dwc2: host: Fix use after free w/ simultaneous irqs

2015-10-16 Thread Doug Anderson
Hi, On Fri, Oct 16, 2015 at 2:59 PM, Douglas Anderson wrote: > From: Doug Anderson > > While plugging / unplugging on a DWC2 host port with "slub_debug=FZPUA" > enabled, I found a crash that was quite obviously a use after free. > > It appears that in some cases when we handle the various sub-ca

[PATCH v4] usb: dwc2: host: Fix use after free w/ simultaneous irqs

2015-10-16 Thread Douglas Anderson
From: Doug Anderson While plugging / unplugging on a DWC2 host port with "slub_debug=FZPUA" enabled, I found a crash that was quite obviously a use after free. It appears that in some cases when we handle the various sub-cases of HCINT we may end up freeing the QTD. If there is more than one bi

Re: [PATCH v1 14/14] usb: dwc2: host: use kmem cache to allocate descriptors

2015-10-16 Thread Doug Anderson
Gregory, On Fri, Oct 16, 2015 at 1:44 PM, Herrero, Gregory wrote: > I can't reproduce this issue so far but using GFP_DMA32 is obviously > wrong here, so I will replace with GFP_DMA. With that, I can definitely boot up. :) >> When I reverted this patch and tried to enable DMA descriptor >> tr

net2280 crash during testusb

2015-10-16 Thread Paul Jones
Youssaf, if I run test 13 of testusb I get the following crash: [ 963.504860] WARNING: CPU: 1 PID: 0 at drivers/usb/gadget/udc/net2280.c:893 start_dma+0x218/0x220 [net2280]() [ 963.504861] Modules linked in: g_zero usbtest usb_f_ss_lb libcomposite configfs ccm arc4 iwlmvm i915 mac80211 iwlwifi

Re: [ANNOUNCE] tree closed for v4.4 merge window

2015-10-16 Thread John Youn
On 10/15/2015 8:32 AM, Felipe Balbi wrote: > > Hi guys, > > it's already -rc5 and I need to close my tree for this merge > window. Major fixes will still be queued. I still have 3 patches on DWC2 > pending John's Ack, so those are the last ones which will get into my > tree; after that, only bug

Re: [PATCH v4] usb: dwc2: host: Fix use after free w/ simultaneous irqs

2015-10-16 Thread John Youn
On 10/16/2015 4:02 PM, Douglas Anderson wrote: > From: Doug Anderson > > While plugging / unplugging on a DWC2 host port with "slub_debug=FZPUA" > enabled, I found a crash that was quite obviously a use after free. > > It appears that in some cases when we handle the various sub-cases of > HCINT

Re: [PATCH 1/3] usb: renesas_usbhs: Remove unneeded #include

2015-10-16 Thread Greg Kroah-Hartman
On Wed, Oct 07, 2015 at 10:23:43AM +0200, Geert Uytterhoeven wrote: > This header file will be removed soon. > > Signed-off-by: Geert Uytterhoeven > --- > Please schedule for v4.3, or provide an Ack, so it can go in through the > GPIO tree. Thanks! Acked-by: Greg Kroah-Hartman -- To unsubscribe

Re: [PATCH v2 1/6] usb: host: xhci: add a platform-private pointer field

2015-10-16 Thread Greg KH
On Wed, Oct 07, 2015 at 08:38:53PM +0900, Yoshihiro Shimoda wrote: > This patch adds an xhci->priv field for storing the of_device_id.data > pointer. This will simplify the code to match platform specific > variables (e.g. platform type and firmware name). > > Signed-off-by: Yoshihiro Shimoda > -

Re: [PATCH v9 4/4] USB / PM: Allow USB devices to remain runtime-suspended when sleeping

2015-10-16 Thread Greg Kroah-Hartman
On Mon, Oct 05, 2015 at 04:45:32PM +0200, Tomeu Vizoso wrote: > Have dev_pm_ops.prepare return 1 for USB devices and ports so that USB > devices can remain runtime-suspended when the system goes to a sleep > state, if their wakeup state is correct and they have runtime PM enabled. > > Signed-off-b

Re: [PATCH v2 1/1] usb: misc: usbtest: add bulk queue test

2015-10-16 Thread Greg KH
On Tue, Oct 13, 2015 at 03:18:21PM +0800, Peter Chen wrote: > The bulk queue tests are used to show 'best performance' for bulk > transfer, we are often asked this question by users. The implementation > is the same with iso test, that is queue request at interrupt completion, > so we reuse the iso

Re: [PATCH] ohci-pci: use PCI_DEVICE_SUB()

2015-10-16 Thread Greg KH
On Mon, Oct 12, 2015 at 08:31:55PM +0300, Sergei Shtylyov wrote: > Toshiba Portege 4000 quirk entry can be written shorter using the > PCI_DEVICE_SUB() macro. > > Signed-off-by: Sergei Shtylyov > > --- > The patch is against the 'usb-next' branch of Greg KH's 'usb.git' repo. > > drivers/usb/h

Re: [GIT PULL] On-demand device probing

2015-10-16 Thread Greg Kroah-Hartman
On Wed, Oct 14, 2015 at 10:34:00AM +0200, Tomeu Vizoso wrote: > Hi Rob, > > here is the pull request you asked for, with no changes from the version > that I posted last to the list. > > The following changes since commit 6ff33f3902c3b1c5d0db6b1e2c70b6d76fba357f: > > Linux 4.3-rc1 (2015-09-12 16