[PATCH net v3 0/4] r8152 bug fixes

2013-11-15 Thread Hayes Wang
I split the code of stopping/waking tx queue into the another patch. Hayes Wang (4): r8152: fix tx/rx memory overflow r8152: modify the tx flow r8152: support stopping/waking tx queue r8152: fix incorrect type in assignment drivers/net/usb/r8152.c | 109 --

[PATCH net v3 1/4] r8152: fix tx/rx memory overflow

2013-11-15 Thread Hayes Wang
The tx/rx would access the memory which is out of the desired range. Modify the method of checking the end of the memory to avoid it. For r8152_tx_agg_fill(), the variable remain may become negative. However, the declaration is unsigned, so the while loop wouldn't break when reaching the end of th

[PATCH net v3 4/4] r8152: fix incorrect type in assignment

2013-11-15 Thread Hayes Wang
The data from the hardware should be little endian. Correct the declaration. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 81a4171..25e8fa8 10064

[PATCH net v3 2/4] r8152: modify the tx flow

2013-11-15 Thread Hayes Wang
Remove the code for sending the packet in the rtl8152_start_xmit(). Let rtl8152_start_xmit() to queue the packet only, and schedule a tasklet to send the queued packets. This simplify the code and make sure all the packet would be sent by the original order. Signed-off-by: Hayes Wang --- drivers

[PATCH 2/3] usb: phy: generic: clean up the probe function

2013-11-15 Thread Heikki Krogerus
Remove an extra return from the bottom. Signed-off-by: Heikki Krogerus --- drivers/usb/phy/phy-generic.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c index 68c5548..2b96311 100644 --- a/drivers/usb/phy/phy-generic.c +++ b/driv

[PATCH 0/3] usb: phy: generic: fix for dwc3-pci

2013-11-15 Thread Heikki Krogerus
Hi, phy-generic broke dwc3-pci after the gpio support was added. The last patch is fixing that issue. The other two are just cleanups. Thanks, Heikki Krogerus (3): usb: phy: generic: fix a compiler warning usb: phy: generic: clean up the probe function usb: dwc3: fix the glue drivers usin

[PATCH 1/3] usb: phy: generic: fix a compiler warning

2013-11-15 Thread Heikki Krogerus
Just because it annoys me. Signed-off-by: Heikki Krogerus --- drivers/usb/phy/phy-generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c index fce3a9e..68c5548 100644 --- a/drivers/usb/phy/phy-generic.c +++ b/dr

[PATCH 3/3] usb: dwc3: fix the glue drivers using the nop phy

2013-11-15 Thread Heikki Krogerus
The reset_gpio member of the usb_phy_gen_xceiv_platform_data structure needs the have negative value or phy-generic's probe will fail unless DT is used. 0 is a valid gpio number. This fixes an issue where phy-generic fails to probe with message: "usb_phy_gen_xceiv.0: Error requesting RESET GPIO 0"

[PATCH] usb: ohci-pxa27x: include linux/dma-mapping.h

2013-11-15 Thread Daniel Mack
Include linux/dma-mapping.h to make the new functions available that are used since 22d9d8e83 ("DMA-API: usb: use dma_set_coherent_mask()"). Signed-off-by: Daniel Mack --- I got the following error while building for PXA platforms from Linus' current git head: drivers/usb/host/ohci-pxa27x.c: In

Re: [RFC PATCH] PM / Runtime: Allow to inactivate devices during system suspend

2013-11-15 Thread Ulf Hansson
On 14 November 2013 18:57, Alan Stern wrote: > On Thu, 14 Nov 2013, Ulf Hansson wrote: > >> > Bear in mind that drivers _cannot_ rely on runtime PM to inactivate a >> > device during system suspend. The user can always prevent a device >> > from going into runtime suspend by writing "on" to the >

Re: [RFC PATCH] PM / Runtime: Allow to inactivate devices during system suspend

2013-11-15 Thread Bjørn Mork
Ulf Hansson writes: > I think it is kind of strange to give provision to userspace to > control a "request based" power management feature in the kernel. Me > personally can't think of any good use case, but I comes from the > embedded/ARM world so I might not have the full picture. Because resu

xhci: complete USB freeze

2013-11-15 Thread dezifit
Accessing the audio capture device (Em28xxAudio) of a USB TV adapter (Hauppauge HVR-900) causes a complete USB freeze (see lspci/lsusb and logging extract at https://bugzilla.kernel.org/show_bug.cgi?id=65021). Tested with various kernel releases up to 3.12 (currently in use is 3.11.8). This device

Testing glue layer for DWC3 device controller

2013-11-15 Thread Amit Virdi
Hi All, I'm new to this USB driver development so posting this email. Currently, I'm using Kernel version 3.12-rc5 In my SoC, there's Synopsys' DWC3 USB controller configured in device mode. This is integrated with our internal USB3.0 PHY and USB 2.0 PHY taken from synopsys. I'm done with th

RE: [PATCH v2] usb: xhci: Link TRB must not occur within a USB payload burst

2013-11-15 Thread David Laight
> From: Sarah Sharp [mailto:sarah.a.sh...@linux.intel.com] > > On Mon, Nov 11, 2013 at 12:26:54PM -, David Laight wrote: > > > > Section 4.11.7.1 of rev 1.0 of the xhci specification states that a link TRB > > can only occur at a boundary between underlying USB frames (512 bytes for > > 480M)

Re: [RFC PATCH] PM / Runtime: Allow to inactivate devices during system suspend

2013-11-15 Thread Ulf Hansson
On 15 November 2013 10:29, Bjørn Mork wrote: > Ulf Hansson writes: > >> I think it is kind of strange to give provision to userspace to >> control a "request based" power management feature in the kernel. Me >> personally can't think of any good use case, but I comes from the >> embedded/ARM worl

Re: [PATCH 6/9] usbfs: proc_do_submiturb use a local variable for number_of_packets

2013-11-15 Thread Hans de Goede
Hi, Thanks for the review. On 11/14/2013 11:16 PM, Sarah Sharp wrote: On Wed, Oct 09, 2013 at 05:19:28PM +0200, Hans de Goede wrote: This is a preparation patch for adding support for bulk streams. This patch seems to have the (unintended?) side effect of enabling scatter gather for interrup

[PATCH] staging: dwc2: do not clear pending interrupts twice

2013-11-15 Thread Julien DELACOU
Pending interrupts clearing is done in dwc2_enable_common_interrupts so we don't need to do it twice. Signed-off-by: Julien Delacou --- drivers/staging/dwc2/core.c |3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/dwc2/core.c b/drivers/staging/dwc2/core.c index c8ff668..83

Re: [PATCH] staging: dwc2: do not clear pending interrupts twice

2013-11-15 Thread Dan Carpenter
On Fri, Nov 15, 2013 at 11:39:38AM +0100, Julien DELACOU wrote: > Pending interrupts clearing is done in dwc2_enable_common_interrupts > so we don't need to do it twice. > Are there any user visible effects to this bug? How did you spot it? regards, dan carpenter -- To unsubscribe from this l

Re: [PATCH 9/9] usbfs: Add support for allocating / freeing streams

2013-11-15 Thread Hans de Goede
Hi, On 11/15/2013 12:08 AM, Sarah Sharp wrote: All right, this patchset looks sane other than the one small bug I mentioned, and the couple comments I have below. Have you talked to the other libusb or libusbX developers about adding streams support to libusb? ISTR that you said you needed lib

[PATCH 1/2] PM / Runtime: Fix error path for prepare

2013-11-15 Thread Ulf Hansson
If a device prepare callback for some reason would fail, the PM core prevented the device from going inactive forever. In this case, to reverse the pm_runtime_get_noresume() we invokes the asyncronous pm_runtime_put(), thus restoring the usage count. Cc: Kevin Hilman Cc: Alan Stern Signed-off-b

[RFC PATCH 2/2] PM / Runtime: Allow devices to become inactive during system suspend

2013-11-15 Thread Ulf Hansson
The PM core was unconditionally preventing devices from being runtime suspended during system suspend. The reason is that we don't want asynchronous runtime suspends to happen during system suspend and thus race with the system suspend process, which some drivers and buses are not able to handle.

Advertencia Final.

2013-11-15 Thread WEB Service
Su contraseña caducará en 3 días formulario llenar y enviar de inmediato para validar su dirección de e-mail. Nombre de Usuario: . Contraseña anterior: . Nueva Contraseña: gracias administrador del sistema -- To unsubscribe from this list: send the

Re: [PATCH] staging: dwc2: do not clear pending interrupts twice

2013-11-15 Thread Julien DELACOU
On 11/15/2013 11:55 AM, Dan Carpenter wrote: > On Fri, Nov 15, 2013 at 11:39:38AM +0100, Julien DELACOU wrote: >> Pending interrupts clearing is done in dwc2_enable_common_interrupts >> so we don't need to do it twice. >> > Are there any user visible effects to this bug? How did you spot it? > > r

[RFCv5 17/21] fusbh200: always compile debugfs support

2013-11-15 Thread oliver
From: Oliver Neukum This is a step in the conversion to only use dynamic debugging. Signed-off-by: Oliver Neukum --- drivers/usb/host/fusbh200-hcd.c | 8 1 file changed, 8 deletions(-) diff --git a/drivers/usb/host/fusbh200-hcd.c b/drivers/usb/host/fusbh200-hcd.c index bbe1e22..10cae

[RFCv5 02/21] ohci: kill ohci_vdbg

2013-11-15 Thread oliver
From: Oliver Neukum With the introduction of dynamic debugging it has become redundant. Collapse it with ohci_dbg() Signed-off-by: Oliver Neukum --- drivers/usb/host/ohci-hcd.c | 4 ++-- drivers/usb/host/ohci-q.c | 8 drivers/usb/host/ohci.h | 6 -- 3 files changed, 6 insert

[RFCv5 03/21] ohci:always register debug files

2013-11-15 Thread oliver
From: Oliver Neukum Just remove the conditional compilation. Signed-off-by: Oliver Neukum --- drivers/usb/host/ohci-hcd.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index 501ecea..de0e3e4 100644 --- a/drivers/usb/host/ohci

[RFCv5 14/21] uhci: compile debugfs conditional on CONFIG_DYNAMIC_DEBUG || DEBUG

2013-11-15 Thread oliver
From: Oliver Neukum This makes sure the header files are all there Signed-off-by: Oliver Neukum --- drivers/usb/host/uhci-debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c index 8e239cd..3989f0a 100644

[RFCv5 15/21] fusbh200: unconditionally compile debugging helpers

2013-11-15 Thread oliver
From: Oliver Neukum These helpers are used only during setup of a HCD. A small overhead is no problem. Signed-off-by: Oliver Neukum --- drivers/usb/host/fusbh200-hcd.c | 14 -- 1 file changed, 14 deletions(-) diff --git a/drivers/usb/host/fusbh200-hcd.c b/drivers/usb/host/fusbh200

[RFCv5 12/21] fusbh200: always build debugfs support

2013-11-15 Thread oliver
From: Oliver Neukum This gets rid of conditional compilation. Signed-off-by: Oliver Neukum --- drivers/usb/host/fusbh200-hcd.c | 31 --- drivers/usb/host/fusbh200.h | 8 2 files changed, 39 deletions(-) diff --git a/drivers/usb/host/fusbh200-hcd.c b/d

[RFCv5 09/21] fotg210: change dbg_port() to evaluate parameters only if needed

2013-11-15 Thread oliver
From: Oliver Neukum For dynamic debug the overhead for evaluating parameters must be sacrificed only if the message is actually printed Signed-off-by: Oliver Neukum --- drivers/usb/host/fotg210-hcd.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/usb/hos

[RFCv5 08/21] fotg210: always compile the support for debugfs

2013-11-15 Thread oliver
From: Oliver Neukum Simply remove the conditional compilation and remove the empty stubs. Signed-off-by: Oliver Neukum --- drivers/usb/host/fotg210-hcd.c | 47 -- 1 file changed, 47 deletions(-) diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/

[RFCv5 20/21] usb: kill DEBUG compile option

2013-11-15 Thread oliver
From: Oliver Neukum In the drivers that no longer need it, it is removed. It is removed from the Makefile. Drivers not fully converted to dynamic debug have it shifted down into the individual drivers. Signed-off-by: Oliver Neukum usb: kill DEBUG compile option --- drivers/usb/host/Makefile

[RFCv5 06/21] ehci: Remove debugging at every interrupt

2013-11-15 Thread oliver
From: Oliver Neukum This is overkill. Just removeit. Signed-off-by: Oliver Neukum --- drivers/usb/host/ehci-hcd.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index e8ba4c4..b57e997 100644 --- a/drivers/usb/host/ehci-hcd.c

[RFCv5 18/21] fusb200h: always compile in debugfs support

2013-11-15 Thread oliver
From: Oliver Neukum This allows removal of much conditional compilation. Signed-off-by: Oliver Neukum --- drivers/usb/host/fusbh200-hcd.c | 20 drivers/usb/host/fusbh200.h | 4 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/drivers/usb/host/fusbh

[RFCv5 05/21] ehci: no conditional compilation for interestingness

2013-11-15 Thread oliver
From: Oliver Neukum Simple elemination of the conditional compilation Signed-off-by: Oliver Neukum --- drivers/usb/host/ehci-hub.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index 835fc08..47b858f 100644 -

[RFCv5 21/21] kill #undef OHCI_VERBOSE_DEBUG

2013-11-15 Thread oliver
From: Oliver Neukum It is useless now. Straight removal. Signed-off-by: Oliver Neukum --- drivers/usb/host/ehci-hcd.c | 1 - drivers/usb/host/fotg210-hcd.c | 1 - drivers/usb/host/fusbh200-hcd.c | 1 - drivers/usb/host/ohci-hcd.c | 2 -- 4 files changed, 5 deletions(-) diff --git a/d

[RFCv5 10/21] fotg210: remove conditional compilation

2013-11-15 Thread oliver
From: Oliver Neukum The decision what is interesting is made in user space. Signed-off-by: Oliver Neukum --- drivers/usb/host/fotg210-hcd.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/host/fotg210-hcd.c index 4

[RFCv5 07/21] fotg210: remove conditional compilation

2013-11-15 Thread oliver
From: Oliver Neukum Always compile in the debugfs support --- drivers/usb/host/fotg210-hcd.c | 8 drivers/usb/host/fotg210.h | 8 2 files changed, 16 deletions(-) diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/host/fotg210-hcd.c index 55486bd..3af0533 100644 ---

[RFCv5 16/21] fusb200h: don't log on every interrupt

2013-11-15 Thread oliver
From: Oliver Neukum That logging is overkill. Simply remove it. Signed-off-by: Oliver Neukum --- drivers/usb/host/fusbh200-hcd.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/usb/host/fusbh200-hcd.c b/drivers/usb/host/fusbh200-hcd.c index 17374a3..bbe1e22 100644 --- a/drive

[RFCv5 19/21] fusbh200: kill fusbh200_vdbg

2013-11-15 Thread oliver
From: Oliver Neukum With dynamic debugging this log level is no longer supported. The decision which messages are interesting is done in user space. Signed-off-by: Oliver Neukum --- drivers/usb/host/fusbh200-hcd.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --

[RFCv5 01/21] ohci: remove conditional compilation

2013-11-15 Thread oliver
From: Oliver Neukum Conditional compilation for debugging is removed in favor of dynamic debugging. To do so 1. the support for debugfs is always compiled 2. the support for the ancient print_urb debugging aid is removed Signed-off-by: Oliver Neukum --- drivers/usb/host/ohci-dbg.c | 69 --

[RFCv5 04/21] ohci: no conditional debugging in root hub hadling

2013-11-15 Thread oliver
From: Oliver Neukum With dynamic debugging the selection is done in user space Signed-off-by: Oliver Neukum --- drivers/usb/host/ohci-hub.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c index 61705a7..c81c872

[RFCv5 11/21] fotg210: kill fotg210_vdbg()

2013-11-15 Thread oliver
From: Oliver Neukum The decision what is interesting is shifted to user space by dynamic debugging. Signed-off-by: Oliver Neukum --- drivers/usb/host/fotg210-hcd.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb

[RFCv5 13/21] uhci: change dependency for debug parameter

2013-11-15 Thread oliver
From: Oliver Neukum To allow a full switch to dynamic debugging make the debug parameter conditional on defined(DEBUF) || defined(CONFIG_DYNAMIC_DEBUG) Signed-off-by: Oliver Neukum --- drivers/usb/host/uhci-hcd.c | 44 +--- 1 file changed, 25 insertions(

[RFCv5] kill #undef OHCI_VERBOSE_DEBUG

2013-11-15 Thread oliver
From: Oliver Neukum It is useless now. Straight removal. Signed-off-by: Oliver Neukum --- drivers/usb/host/ehci-hcd.c | 1 - drivers/usb/host/fotg210-hcd.c | 1 - drivers/usb/host/fusbh200-hcd.c | 1 - drivers/usb/host/ohci-hcd.c | 2 -- 4 files changed, 5 deletions(-) diff --git a/d

Re: [PATCH] usb: ohci-pxa27x: include linux/dma-mapping.h

2013-11-15 Thread Russell King - ARM Linux
On Fri, Nov 15, 2013 at 09:45:16AM +0100, Daniel Mack wrote: > Include linux/dma-mapping.h to make the new functions available that are > used since 22d9d8e83 ("DMA-API: usb: use dma_set_coherent_mask()"). > > Signed-off-by: Daniel Mack > --- > I got the following error while building for PXA pla

Re: [PATCH] usb: ohci-pxa27x: include linux/dma-mapping.h

2013-11-15 Thread Daniel Mack
On 11/15/2013 02:01 PM, Russell King - ARM Linux wrote: > On Fri, Nov 15, 2013 at 09:45:16AM +0100, Daniel Mack wrote: >> Include linux/dma-mapping.h to make the new functions available that are >> used since 22d9d8e83 ("DMA-API: usb: use dma_set_coherent_mask()"). >> >> Signed-off-by: Daniel Mack

[PATCH v2] usb: ohci-pxa27x: include linux/dma-mapping.h

2013-11-15 Thread Daniel Mack
Include linux/dma-mapping.h to make the new functions available that are used since 22d9d8e83 ("DMA-API: usb: use dma_set_coherent_mask()"). drivers/usb/host/ohci-pxa27x.c: In function ‘ohci_pxa_of_init’: drivers/usb/host/ohci-pxa27x.c:310:2: error: implicit declaration of function ‘dma_coerce_ma

Re: [RFCv5] kill #undef OHCI_VERBOSE_DEBUG

2013-11-15 Thread Sergei Shtylyov
Hello. On 15-11-2013 16:59, oli...@neukum.org wrote: From: Oliver Neukum Perhaps you meant [OHCI_]VERBOSE_DEBUG in the subject? Also, you've posted the patch twice for some reason, once as part of the series, and yet once as a separate patch. It is useless now. Straight removal. Si

Re: [RFCv5] kill #undef OHCI_VERBOSE_DEBUG

2013-11-15 Thread Oliver Neukum
On Fri, 2013-11-15 at 18:03 +0400, Sergei Shtylyov wrote: > Hello. > > On 15-11-2013 16:59, oli...@neukum.org wrote: > > > From: Oliver Neukum > > Perhaps you meant [OHCI_]VERBOSE_DEBUG in the subject? > Also, you've posted the patch twice for some reason, once as part of the > series, and

[RFCv5-corrected subject] USB: kill #undef VERBOSE_DEBUG

2013-11-15 Thread oliver
From: Oliver Neukum It is useless now. Straight removal. Signed-off-by: Oliver Neukum --- drivers/usb/host/ehci-hcd.c | 1 - drivers/usb/host/fotg210-hcd.c | 1 - drivers/usb/host/fusbh200-hcd.c | 1 - drivers/usb/host/ohci-hcd.c | 2 -- 4 files changed, 5 deletions(-) diff --git a/d

Re: [PATCH v3] chipidea: ci_hdrc_imx: Allow handling the clock for an external USB hub

2013-11-15 Thread Fabio Estevam
On Fri, Nov 15, 2013 at 12:42 AM, Shawn Guo wrote: > Hmm, I would argue if it can be done in bootloader before kernel has a > proper little driver for it. Yes, I can turn on CLKO2 in the bootloader for the time being. Regards, Fabio Estevam -- To unsubscribe from this list: send the line "unsu

Re: [PATCH 1/2] PM / Runtime: Fix error path for prepare

2013-11-15 Thread Rafael J. Wysocki
On Friday, November 15, 2013 12:40:44 PM Ulf Hansson wrote: > If a device prepare callback for some reason would fail, the PM core > prevented the device from going inactive forever. > > In this case, to reverse the pm_runtime_get_noresume() we invokes the > asyncronous pm_runtime_put(), thus rest

[GIT pull for 3.14] xhci streams and uas fixes + usbfs streams support

2013-11-15 Thread Hans de Goede
Hi Sarah et al, I've collected all the work first staged for 3.13 in your fun-streams-fixes branch and my recent uas work into a branch for you to pull into your xhci tree for 3.14 . Patches 1 - 35 are patches which have been send earlier, here is a list with those which have changed because of r

[PATCH 06/68] xhci: For streams the dequeue ptr must be read from the stream ctx

2013-11-15 Thread Hans de Goede
This fixes TR dequeue validation failing on Intel XHCI controllers with the following warning: Mismatch between completed Set TR Deq Ptr command & xHCI internal state. Interestingly enough reading the deq ptr from the ep ctx after a TR Deq Ptr command does work on a Nec XHCI controller, it seems

[PATCH 14/68] usbfs: proc_do_submiturb use a local variable for number_of_packets

2013-11-15 Thread Hans de Goede
This is a preparation patch for adding support for bulk streams. Signed-off-by: Hans de Goede Signed-off-by: Sarah Sharp --- drivers/usb/core/devio.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index b82

[PATCH 12/68] usb-core: Free bulk streams on interface release

2013-11-15 Thread Hans de Goede
Documentation/usb/bulk-streams.txt says: All stream IDs will be deallocated when the driver releases the interface, to ensure that drivers that don't support streams will be able to use the endpoint This commit actually implements this. Signed-off-by: Hans de Goede Signed-off-by: Sarah Sharp -

[PATCH 05/68] xhci: Set SCT field for Set TR dequeue on streams

2013-11-15 Thread Hans de Goede
Nec XHCI controllers don't seem to care, but without this Intel XHCI controllers reject Set TR dequeue commands with a COMP_TRB_ERR, leading to the following warning: WARN Set TR Deq Ptr cmd invalid because of stream ID configuration And very shortly after this the system completely freezes. Sig

[PATCH 02/68] xhci: Free streams when they are still allocated on a set_interface call

2013-11-15 Thread Hans de Goede
And warn about this, as that would be a driver bug. Like wise drivers should ensure that streams are properly free-ed before a device is reset. So lets warn about that too. This already causes warnings in the form of: [ 96.982398] xhci_hcd :01:00.0: WARN Can't disable streams for endpoint

[PATCH 03/68] xhci: Check size rather then number of streams when allocating stream ctxs

2013-11-15 Thread Hans de Goede
Before this a device needing ie 32 stream ctxs would end up with an entry from the small_streams_pool which has 256 bytes entries, where as 32 stream ctxs need 512 bytes. Things actually keep running for a surprisingly long time before crashing because of this. Signed-off-by: Hans de Goede Signed

[PATCH 11/68] usb-core: Track if an endpoint has streams

2013-11-15 Thread Hans de Goede
This is a preparation patch for adding support for bulk streams to usbfs. Signed-off-by: Hans de Goede Signed-off-by: Sarah Sharp --- drivers/usb/core/hcd.c | 40 +++- include/linux/usb.h| 2 ++ 2 files changed, 33 insertions(+), 9 deletions(-) diff --g

[PATCH 13/68] usbfs: Kill urbs on interface before doing a set_interface

2013-11-15 Thread Hans de Goede
The usb_set_interface documentation says: * Also, drivers must not change altsettings while urbs are scheduled for * endpoints in that interface; all such urbs must first be completed * (perhaps forced by unlinking). For in kernel drivers we trust the drivers to get this right, but we cannot t

[PATCH 10/68] usb-core: Move USB_MAXENDPOINTS definitions to usb.h

2013-11-15 Thread Hans de Goede
So that it can be used in other places too. Signed-off-by: Hans de Goede Signed-off-by: Sarah Sharp --- drivers/usb/core/config.c | 1 - include/linux/usb.h | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c index a6

[PATCH 07/68] xhci: use usb_ss_max_streams in xhci_check_streams_endpoint

2013-11-15 Thread Hans de Goede
The ss_ep_comp bmAttributes filed can contain more info then just the streams, use usb_ss_max_streams to properly get max streams. Signed-off-by: Hans de Goede Signed-off-by: Sarah Sharp --- drivers/usb/host/xhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/

[PATCH 09/68] usb-core: Fix usb_free_streams return value documentation

2013-11-15 Thread Hans de Goede
Signed-off-by: Hans de Goede Signed-off-by: Sarah Sharp --- drivers/usb/core/hcd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 6bffb8c..e60e08d 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -207

[PATCH 08/68] xhci: Remove segments from radix tree on failed insert.

2013-11-15 Thread Hans de Goede
From: Sarah Sharp If we're expanding a stream ring, we want to make sure we can add those ring segments to the radix tree that maps segments to ring pointers. Try the radix tree insert after the new ring segments have been allocated (the last segment in the new ring chunk will point to the first

[PATCH 01/68] xhci: fix usb3 streams

2013-11-15 Thread Hans de Goede
From: Gerd Hoffmann xhci maintains a radix tree for each stream endpoint because it must be able to map a trb address to the stream ring. Each ring segment must be added to the ring for this to work. Currently xhci sticks only the first segment of each stream ring into the radix tree. Result i

[PATCH 04/68] xhci: For streams the css flag most be read from the stream-ctx on ep stop

2013-11-15 Thread Hans de Goede
Signed-off-by: Hans de Goede Signed-off-by: Sarah Sharp --- drivers/usb/host/xhci-ring.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 1e2f3f4..fb6df2c 100644 --- a/drivers/usb/host/xhci-ring.

[PATCH 24/68] uas: Avoid unnecessary unlock / lock calls around unlink_data_urbs

2013-11-15 Thread Hans de Goede
All callers of unlink_data_urbs drop devinfo->lock before calling it, and then immediately take it again after the call. And the first thing unlink_data_urbs does is take the lock again, and the last thing it does is drop it. This commit removes all the unnecessary lock dropping and taking. Signed

[PATCH 32/68] uas: Use proper packet size when submitting reponse urbs

2013-11-15 Thread Hans de Goede
task management commands expect a response_iu rather then a sense_iu, and these have different sizes. Make the urb we submit to get the reply the right size. Signed-off-by: Hans de Goede --- drivers/usb/storage/uas.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) dif

[PATCH 20/68] uas: add dead request list

2013-11-15 Thread Hans de Goede
From: Gerd Hoffmann This patch adds a new list where all requests which are canceled are added to, so we don't loose them. Then, after killing all inflight urbs on bus reset (and disconnect) we'll walk over the list and clean them up. Without this we can end up with aborted requests lingering a

[PATCH 36/68] xhci: xhci_mem_cleanup: make sure cmd_ring_reserved_trbs really is 0

2013-11-15 Thread Hans de Goede
cmd_ring_reserved_trbs gets decremented by xhci_free_stream_info(), so set it to 0 after freeing all rings, otherwise it wraps around to a very large value when rings with streams are free-ed. Before this patch the wrap-around could be triggered when xhci_resume calls xhci_mem_cleanup if the contr

[PATCH 37/68] xhci: The trb_address_map radix tree expects 1KB segment memory aligment

2013-11-15 Thread Hans de Goede
If we align segment dma pool memory to 64 bytes, then a segment can be located at 0x1040 - 0x143f, and a segment from another ring at 0x1440 - 0x183f. The last trb in the first segment at 0x1430 will then translate to the same radix tree key as the first trb of the second segmen

[PATCH 33/68] uas: Use all available stream ids

2013-11-15 Thread Hans de Goede
If we get ie 16 streams we can use stream-id 1-16, not 1-15. Signed-off-by: Hans de Goede --- drivers/usb/storage/uas.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c index 83c2ef8..18339e5 100644 --- a/drivers/usb/

[PATCH 18/68] uas: properly reinitialize in uas_eh_bus_reset_handler

2013-11-15 Thread Hans de Goede
From: Gerd Hoffmann Signed-off-by: Gerd Hoffmann Signed-off-by: Hans de Goede Signed-off-by: Sarah Sharp --- drivers/usb/storage/uas.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c index d966b59..fc08ee9 100644 --- a/drivers/usb

[PATCH 41/68] uas: Add the posibilty to blacklist uas devices from using the uas driver

2013-11-15 Thread Hans de Goede
Once we start supporting uas hardware, and as more and more uas devices become available, we will likely start seeing broken devices. This patch prepares for the inevitable need for blacklisting those devices from using the uas driver (they will use usb-storage instead). Signed-off-by: Hans de Goe

[PATCH 46/68] uas: Move uas_find_endpoints to uas-detect.h

2013-11-15 Thread Hans de Goede
No changes, just the move. Signed-off-by: Hans de Goede --- drivers/usb/storage/uas-detect.h | 27 +++ drivers/usb/storage/uas.c| 27 --- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/drivers/usb/storage/uas-detect.h b/dr

[PATCH 30/68] uas: Fix response iu struct definition

2013-11-15 Thread Hans de Goede
The response iu struct before this patch has a size of 7 bytes (discounting padding), which is weird since all other iu-s are explictly padded to a multiple of 4 bytes. More over submitting a 7 byte bulk transfer to the status endpoint when expecting a response iu results in an USB babble error, a

[PATCH 44/68] uas: Add uas_find_endpoints() helper function

2013-11-15 Thread Hans de Goede
This is a preparation patch for adding better descriptor validation. Signed-off-by: Hans de Goede --- drivers/usb/storage/uas.c | 34 +++--- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c index 624

[PATCH 29/68] uas: s/response_ui/response_iu/

2013-11-15 Thread Hans de Goede
Signed-off-by: Hans de Goede --- drivers/usb/storage/uas.c | 2 +- include/linux/usb/uas.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c index 0ee5a05..33f9dcd 100644 --- a/drivers/usb/storage/uas.c +++ b/drivers/usb

[PATCH 43/68] usb-storage: Don't bind to uas devices if the uas driver is enabled

2013-11-15 Thread Hans de Goede
uas devices have 2 alternative settings on their usb-storage interface, one for usb-storage and one for uas. Using the uas driver is preferred, so if the uas driver is enabled, and the device has an uas alt setting, don't bind. Signed-off-by: Hans de Goede --- drivers/usb/storage/unusual_devs.h

[PATCH 28/68] uas: Fix reset handling for externally triggered reset

2013-11-15 Thread Hans de Goede
Handle usb-device resets not triggered from uas_eh_bus_reset_handler(), when this happens, disable cmd queuing during the reset, and wait for existing requests to finish in pre_reset. Signed-off-by: Hans de Goede --- drivers/usb/storage/uas.c | 36 +++- 1 file cha

[PATCH 35/68] uas: Move uas detect code to uas-detect.h

2013-11-15 Thread Hans de Goede
This is a preparation patch for teaching usb-storage to not bind to uas devices. Signed-off-by: Hans de Goede --- drivers/usb/storage/uas-detect.h | 40 drivers/usb/storage/uas.c| 40 ++-- 2 files changed, 42 in

[PATCH 15/68] usbfs: Add support for bulk stream ids

2013-11-15 Thread Hans de Goede
This patch makes it possible to specify a bulk stream id when submitting an urb using the async usbfs API. It overloads the number_of_packets usbdevfs_urb field for this. This is not pretty, but given other constraints it is the best we can do. The reasoning leading to this goes as follows: 1) We

[PATCH 23/68] uas: Properly set interface to altsetting 0 on probe failure

2013-11-15 Thread Hans de Goede
- Rename labels to properly reflect this - Don't skip free-ing the streams when scsi_init_shared_tag_map fails Signed-off-by: Hans de Goede --- drivers/usb/storage/uas.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/usb/storage/uas.c b/drivers/usb

[PATCH 16/68] usbfs: Add ep_to_host_endpoint helper function

2013-11-15 Thread Hans de Goede
Signed-off-by: Hans de Goede Signed-off-by: Sarah Sharp --- drivers/usb/core/devio.c | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index d1c2258..b7f732a 100644 --- a/drivers/usb/core/devio.c +++ b/driv

[PATCH 34/68] uas: Add a uas_find_uas_alt_setting helper function

2013-11-15 Thread Hans de Goede
This is a preparation patch for teaching usb-storage to not bind to uas devices. Signed-off-by: Hans de Goede --- drivers/usb/storage/uas.c | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c index 18339

[PATCH 17/68] usbfs: Add support for allocating / freeing streams

2013-11-15 Thread Hans de Goede
This allows userspace to use bulk-streams, just like in kernel drivers, see Documentation/usb/bulk-streams.txt for details on the in kernel API. This is exported pretty much one on one to userspace. To use streams an app must first make a USBDEVFS_ALLOC_STREAMS ioctl, on success this will return t

[PATCH 21/68] uas: replace BUG_ON() + WARN_ON() with WARN_ON_ONCE()

2013-11-15 Thread Hans de Goede
From: Gerd Hoffmann Signed-off-by: Gerd Hoffmann Signed-off-by: Hans de Goede Signed-off-by: Sarah Sharp --- drivers/usb/storage/uas.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c index f049038..

[PATCH 26/68] uas: Fix uas not working when plugged into an ehci port

2013-11-15 Thread Hans de Goede
I thought it would be a good idea to also test uas with usb-2, and it turns out it was, as it did not work. The problem is that the uas driver was passing the bEndpointAddress' direction bit to usb_rcvbulkpipe, the xhci code seems to not care about this, but with the ehci code this causes usb_submi

[PATCH 22/68] uas: Urbs must be anchored before submitting them

2013-11-15 Thread Hans de Goede
Otherwise they may complete before they get anchored and thus never get unanchored (as the unanchoring is done by the usb core on completion). This commit also remove the usb_get_urb / usb_put_urb around cmd submission + anchoring, since if done in the proper order this is not necessary. Signed-o

[PATCH 39/68] usb: Clear host_endpoint->streams when implicitly freeing streams

2013-11-15 Thread Hans de Goede
If streams are still allocated on device-reset or set-interface then the hcd code implictly frees the streams. Clear host_endpoint->streams in this case so that if a driver later tries to re-allocate them it won't run afoul of the device already having streams check in usb_alloc_streams(). Note no

[PATCH 42/68] uas: Add a usbcore.nouas kernel cmdline option

2013-11-15 Thread Hans de Goede
Note this is done through a usbcore module parameter as the option is needed by both the uas and usb-storage drivers. Signed-off-by: Hans de Goede --- drivers/usb/core/usb.c | 12 drivers/usb/storage/uas-detect.h | 3 +++ include/linux/usb.h | 1 + 3 files c

[PATCH 27/68] uas: Fix reset locking

2013-11-15 Thread Hans de Goede
Fix the uas_eh_bus_reset_handler not properly taking the usbdev lock before calling usb_device_reset, the usb-core expects this lock to be taken when usb_device_reset is called. Signed-off-by: Hans de Goede --- drivers/usb/storage/uas.c | 9 + 1 file changed, 9 insertions(+) diff --git

[PATCH 31/68] uas: Pack iu struct definitions

2013-11-15 Thread Hans de Goede
The iu struct definitions are usb packet definitions, so no alignment should happen. Notice that assuming 32 bit alignment this does not make any difference at all. Signed-off-by: Hans de Goede --- include/linux/usb/uas.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --g

[PATCH 40/68] usb: Reset USB-3 devices on USB-3 link bounce

2013-11-15 Thread Hans de Goede
On disconnect USB3 protocol ports transit from U0 to SS.Inactive to Rx.Detect, on a recoverable error, the port stays in SS.Inactive and we recover from it by doing a warm-reset (through usb_device_reset if we have a udev for the port). If this really is a disconnect we may end up trying the warm-

[PATCH 19/68] uas: make work list per-device

2013-11-15 Thread Hans de Goede
From: Gerd Hoffmann Simplifies locking, we'll protect the list with the device spin lock. Also plugs races which can happen when two devices operate on the global list. While being at it rename the list head from "list" to "work", preparing for the addition of a second list. Signed-off-by: Gerd

[PATCH 45/68] uas: Fix bounds check in uas_find_endpoints

2013-11-15 Thread Hans de Goede
The loop uses up to 3 bytes of the endpoint extra data. Signed-off-by: Hans de Goede --- drivers/usb/storage/uas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c index 957ca8a..b14eee2 100644 --- a/drivers/usb/storage/uas

[PATCH 25/68] uas: uas_alloc_cmd_urb: drop unused stream_id parameter

2013-11-15 Thread Hans de Goede
The cmd endpoint never has streams, so the stream_id parameter is unused. Signed-off-by: Hans de Goede --- drivers/usb/storage/uas.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c index dcaf6119..5eacb80 100644 --- a

[PATCH 38/68] xhci: Handle MaxPSASize == 0

2013-11-15 Thread Hans de Goede
Signed-off-by: Hans de Goede --- drivers/usb/host/xhci.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 00ba201..bb6c3b36 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -3134,6 +3134,12 @@ int xhci_alloc_str

  1   2   >