[PATCH 0/7] USB changes for rare warnings

2016-01-28 Thread Arnd Bergmann
Hi Felipe, This set of patches addresses warnings I got in randconfig builds, in the USB drivers. The first three patches are for the pxa25x UDC driver and are a larger scale cleanup triggered by finding the initial bug. The other four are relatively simple but still need to be reviewed properly,

[PATCH 1/7] usb: gadget: pxa25x_udc: move register definitions from arch

2016-01-28 Thread Arnd Bergmann
ixp4xx and pxa25x both use this driver and provide a slightly different set of register definitions for it. Aside from that, the definition in the ixp4xx-regs.h header conflicts with the on in the pxa27x device driver when compile-testing that: In file included from

我的个人主页是

2016-01-28 Thread 我的个人主页是
你的老朋友邀你来Q群:343257759

[PATCH 7/7] usb: musb/ux500: remove duplicate check for dma_is_compatible

2016-01-28 Thread Arnd Bergmann
When dma_addr_t is 64-bit, we get a warning about an invalid cast in the call to ux500_dma_is_compatible() from ux500_dma_channel_program(): drivers/usb/musb/ux500_dma.c: In function 'ux500_dma_channel_program': drivers/usb/musb/ux500_dma.c:210:51: error: cast to pointer from integer of

[PATCH 6/7] usb: musb: use %pad format string from dma_addr_t

2016-01-28 Thread Arnd Bergmann
The musb driver prints DMA addresses in a few places, using the 0x%x format string. This is wrong on 64-bit architectures (which need %lx) and 32-bit ARM with CONFIG_LPAE set (which needs %llx), otherwise we print the wrong data, as gcc warns: musb/musbhsdma.c: In function 'configure_channel':

[PATCH 5/7] usb: isp1301-omap: mark power_up as __maybe_unused

2016-01-28 Thread Arnd Bergmann
The power_up function is used for otg or udc mode, but nost when the driver is only configured for host mode: drivers/usb/phy/phy-isp1301-omap.c:261:13: error: 'power_up' defined but not used [-Werror=unused-function] This marks the function __maybe_unused to avoid the warning and silently drop

[PATCH 4/7] usb: fsl: drop USB_FSL_MPH_DR_OF Kconfig symbol

2016-01-28 Thread Arnd Bergmann
The USB_FSL_MPH_DR_OF symbol is used to ensure the code that interprets the DR device node is built whenever one of the two drivers (EHCI or UDC) for the platform is enabled. However, if CONFIG_USB is disabled and we only support gadget mode, this causes a Kconfig warning: warning: (USB_FSL_USB2)

[PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-01-28 Thread Arnd Bergmann
This converts the pxa25x udc driver to use readl/writel as normal driver should do, rather than dereferencing __iomem pointers themselves. Based on the earlier preparation work, we can now also pass the register start in the device pointer so we no longer need the global variable. The unclear

[PATCH 2/7] usb: gadget: pxa25x_udc cleanup

2016-01-28 Thread Arnd Bergmann
This removes the dependency on the mach/hardware.h header file from the pxa25x_udc driver after the register definitions were already unified in the previous patch. Following the model of pxa27x_udc (and basically all other drivers in the kernel), we define the register numbers as offsets from

Re: [GIT PULL] USB-serial fixes for v4.5-rc2

2016-01-28 Thread Greg Kroah-Hartman
On Thu, Jan 28, 2016 at 04:12:03PM +0100, Johan Hovold wrote: > Hi Greg, > > Here's a first set of fixes for 4.5-rc. > > Thanks, > Johan > > > The following changes since commit 92e963f50fc74041b5e9e744c330dca48e04f08d: > > Linux 4.5-rc1 (2016-01-24 13:06:47 -0800) > > are available in the

Re: [PATCH v5 04/21] usb: dwc2: host: Set host_perio_tx_fifo_size to 304 for rk3066

2016-01-28 Thread Doug Anderson
Kever, On Wed, Jan 27, 2016 at 10:41 PM, Kever Yang wrote: > Hi Doug, > > We are in HOST mode, we only need to receive data from USB camera > with RX FIFO, and no need to use TX FIFO for USB webcam, right? :) > > Any way, I think we need to NAK this patch after look

Re: [PATCH v5 04/21] usb: dwc2: host: Set host_perio_tx_fifo_size to 304 for rk3066

2016-01-28 Thread Doug Anderson
Hi, On Thu, Jan 28, 2016 at 10:16 AM, Doug Anderson wrote: > Kever, > > > On Wed, Jan 27, 2016 at 10:41 PM, Kever Yang > wrote: >> Hi Doug, >> >> We are in HOST mode, we only need to receive data from USB camera >> with RX FIFO, and no need to

Re: [PATCH v5 05/21] usb: dwc2: host: Avoid use of chan->qh after qh freed

2016-01-28 Thread Doug Anderson
Hi, On Wed, Jan 27, 2016 at 7:25 PM, Kever Yang wrote: > Hi Doug, > > The NULL pointer bug is one of the most frequent issue we met > during hot plug stress test, thanks for this bug fix. > > Reviewed-by: Kever Yang > > Thanks, > - Kever

[PATCH v2] USB: option: add support for SIM7100E

2016-01-28 Thread Andrey Skvortsov
$ lsusb: Bus 001 Device 101: ID 1e0e:9001 Qualcomm / Option $ usb-devices: T: Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=101 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 2 P: Vendor=1e0e ProdID=9001 Rev= 2.32 S: Manufacturer=SimTech, Incorporated S:

Re: [PATCH] HID: quirks: Add no_init_reports for AKAI midi controller

2016-01-28 Thread Oliver Neukum
On Wed, 2016-01-27 at 22:31 +0100, Jiri Kosina wrote: > On Wed, 27 Jan 2016, Stafford Horne wrote: > > > The midi controller times-out while initializing reports, this > > causes boot to take an extra 10 seconds. The device descriptor > > advertises that it has an internal HID device but seems to

Re: [PATCH v5 03/21] usb: dwc2: host: Set host_rx_fifo_size to 528 for rk3066

2016-01-28 Thread Kever Yang
Hi Doug, On 01/28/2016 03:44 AM, Doug Anderson wrote: If it's all the same to you, I'll probably change it back to 525 and then increase the periodic FIFO size by 3 DWORDS in the next patch. 12 bytes may not be much, but might as well make use of them to improve performance / compatibility?

Re: [PATCH v7 0/5] usb: usbtmc: Add support for missing functions in USBTMC-USB488 spec

2016-01-28 Thread Clemens Ladisch
Dave Penkler wrote: > Implement support for the USB488 defined READ_STATUS_BYTE ioctl (1/5) > and SRQ notifications with fasync (2/5) and poll/select (3/5) in order > to be able to synchronize with variable duration instrument > operations. > > Add convenience ioctl to return all device

Re: [PATCH] HID: quirks: Add no_init_reports for AKAI midi controller

2016-01-28 Thread Stafford Horne
On Thu, 28 Jan 2016, Oliver Neukum wrote: On Wed, 2016-01-27 at 22:31 +0100, Jiri Kosina wrote: On Wed, 27 Jan 2016, Stafford Horne wrote: The midi controller times-out while initializing reports, this causes boot to take an extra 10 seconds. The device descriptor advertises that it has an

Re: [PATCH] usb: musb: ux500: Fix NULL pointer dereference at system PM

2016-01-28 Thread Linus Walleij
On Mon, Jan 25, 2016 at 1:01 PM, Ulf Hansson wrote: > The commit 7d32cdef5356 ("usb: musb: fail with error when no DMA > controller set"), caused the core platform driver to correctly return an > error code when fail probing. > > Unfurtante it also caused bug for a NULL

Re: [PATCH V8 1/1] usb:serial: Add Fintek F81532/534 driver

2016-01-28 Thread kbuild test robot
Hi Peter, [auto build test ERROR on usb/usb-testing] [also build test ERROR on v4.5-rc1 next-20160128] [if your patch is applied to the wrong git tree, please drop us a note to help improving the system] url: https://github.com/0day-ci/linux/commits/Peter-Hung/usb-serial-Add-Fintek-F81532

Re: [PATCH 6/7] usb: musb: use %pad format string from dma_addr_t

2016-01-28 Thread Tony Lindgren
* Arnd Bergmann [160128 08:26]: > The musb driver prints DMA addresses in a few places, using the > 0x%x format string. This is wrong on 64-bit architectures (which > need %lx) and 32-bit ARM with CONFIG_LPAE set (which needs > %llx), otherwise we print the wrong data, as gcc

[PATCH v6 20/22] usb: dwc2: host: Properly set even/odd frame

2016-01-28 Thread Douglas Anderson
When setting up ISO and INT transfers dwc2 needs to specify whether the transfer is for an even or an odd frame (or microframe if the controller is running in high speed mode). The controller appears to use this as a simple way to figure out if a transfer should happen right away (in the current

[PATCH v6 21/22] usb: dwc2: host: Totally redo the microframe scheduler

2016-01-28 Thread Douglas Anderson
This totally reimplements the microframe scheduler in dwc2 to attempt to handle periodic splits properly. The old code didn't even try, so this was a significant effort since periodic splits are one of the most complicated things in USB. I've attempted to keep the old "don't use the microframe"

[PATCH v6 19/22] usb: dwc2: host: Add dwc2_hcd_get_future_frame_number() call

2016-01-28 Thread Douglas Anderson
As we start getting more exact about our scheduling it's becoming more and more important to know exactly how far through the current frame we are. This lets us make decisions about whether there's still time left to start a new transaction in the current frame. We'll add

[PATCH v6 01/22] usb: dwc2: rockchip: Make the max_transfer_size automatic

2016-01-28 Thread Douglas Anderson
Previously we needed to set the max_transfer_size to explicitly be 65535 because the old driver would detect that our hardware could support much bigger transfers and then would try to do them. This wouldn't work since the DMA alignment code couldn't support it. Later in commit e8f8c14d9da7

[PATCH v6 06/22] usb: dwc2: host: fix split transfer schedule sequence

2016-01-28 Thread Douglas Anderson
We're supposed to keep outstanding splits in order. Keep track of a list of the order of splits and process channel interrupts in that order. Without this change and the following setup: * Rockchip rk3288 Chromebook, using port ff54 -> Pluggable 7-port Hub with Charging (powered) ->

[PATCH v6 05/22] usb: dwc2: host: Always add to the tail of queues

2016-01-28 Thread Douglas Anderson
The queues the the dwc2 host controller used are truly queues. That means FIFO or first in first out. Unfortunately though the code was iterating through these queues starting from the head, some places in the code was adding things to the queue by adding at the head instead of the tail. That

[PATCH v6 03/22] usb: dwc2: host: Set host_rx_fifo_size to 525 for rk3066

2016-01-28 Thread Douglas Anderson
As documented in dwc2_calculate_dynamic_fifo(), host_rx_fifo_size should really be: 2 * ((Largest Packet size / 4) + 1 + 1) + n with n = number of host channel. We have 9 host channels, so 2 * ((1024/4) + 2) + 9 = 516 + 9 = 525 We've got 960 / 972 total_fifo_size on rk3288 (and presumably on

[PATCH v6 0/22] usb: dwc2: host: Fix and speed up all the stuff, especially with splits

2016-01-28 Thread Douglas Anderson
This is a bit of catchall series for all the bug fix and performance patches I've been working on over the last few months. Note that for dwc2 we need to do LOTS in software and need super low interrupt latency, so most performance improvements actually fix real bugs. Patches are structured to

[PATCH v6 02/22] usb: dwc2: host: Get aligned DMA in a more supported way

2016-01-28 Thread Douglas Anderson
All other host controllers who want aligned buffers for DMA do it a certain way. Let's do that too instead of working behind the USB core's back. This makes our interrupt handler not take forever and also rips out a lot of code, simplifying things a bunch. This also has the side effect of

[PATCH v6 04/22] usb: dwc2: host: Avoid use of chan->qh after qh freed

2016-01-28 Thread Douglas Anderson
When poking around with USB devices with slub_debug enabled, I found another obvious use after free. Turns out that in dwc2_hc_n_intr() I was in a state when the contents of chan->qh was filled with 0x6b, indicating that chan->qh was freed but chan still had a reference to it. Let's make sure

[PATCH v6 22/22] usb: dwc2: host: If using uframe scheduler, end splits better

2016-01-28 Thread Douglas Anderson
The microframe scheduler figured out exactly how many transfers we need for a split transaction. Let's use this knowledge to know when to end things. Without this I found that certain devices would just keep responding with tons of NYET resonses on their INT_IN endpoint. These would just keep

[PATCH v6 11/22] usb: dwc2: host: There's not really a TT for the root hub

2016-01-28 Thread Douglas Anderson
I find that when I plug a full speed (NOT high speed) hub into a dwc2 port and then I plug a bunch of devices into that full speed hub that dwc2 goes bat guano crazy. Specifically, it just spews errors like this in the console: usb usb1: clear tt 1 (9043) error -22 The specific test case I

[PATCH v6 07/22] usb: dwc2: host: Add scheduler tracing

2016-01-28 Thread Douglas Anderson
In preparation for future changes to the scheduler let's add some tracing that makes it easy for us to see what's happening. By default this tracing will be off. By changing "core.h" you can easily trace to ftrace, the console, or nowhere. Signed-off-by: Douglas Anderson

[PATCH v6 08/22] usb: dwc2: host: Add a delay before releasing periodic bandwidth

2016-01-28 Thread Douglas Anderson
We'd like to be able to use HCD_BH in order to speed up the dwc2 host interrupt handler quite a bit. However, according to the kernel doc for usb_submit_urb() (specifically the part about "Reserved Bandwidth Transfers"), we need to keep a reservation active as long as a device driver keeps

[PATCH v6 13/22] usb: dwc2: host: Rename some fields in struct dwc2_qh

2016-01-28 Thread Douglas Anderson
This no-op change just does some renames to simplify a future patch. 1. The "interval" field is renamed to "host_interval" to make it more obvious that this interval may be 8 times the interval that the device sees (if we're doing split transactions). A future patch will also add the

[PATCH v6 12/22] usb: dwc2: host: Use periodic interrupt even with DMA

2016-01-28 Thread Douglas Anderson
The old code in dwc2_process_periodic_channels() would only enable the "periodic empty" interrupt if we weren't using DMA. That wasn't right since we can still get into cases where we have small FIFOs even on systems that have DMA (the rk3288 is a prime example). Let's always enable/disable the

[PATCH v6 16/22] usb: dwc2: host: Add scheduler logging for missed SOFs

2016-01-28 Thread Douglas Anderson
We'll use the new "scheduler verbose debugging" macro to log missed SOFs. This is fast enough (assuming you configure it to use the ftrace buffer) that we can do it without worrying about the speed hit. The overhead hit if the scheduler tracing is set to "no_printk" should be near zero.

[PATCH v6 14/22] usb: dwc2: host: Reorder things in hcd_queue.c

2016-01-28 Thread Douglas Anderson
This no-op change just reorders a few functions in hcd_queue.c in order to prepare for future changes. Motivations here: The functions dwc2_hcd_qh_free() and dwc2_hcd_qh_create() are exported functions. They are not called within the file. That means that they should be near the bottom so that

[PATCH v6 18/22] usb: dwc2: host: Schedule periodic right away if it's time

2016-01-28 Thread Douglas Anderson
In dwc2_hcd_qh_deactivate() we will put some things on the periodic_sched_ready list. These things won't be taken off the ready list until the next SOF, which might be a little late. Let's put them on right away. Signed-off-by: Douglas Anderson Tested-by: Heiko Stuebner

[PATCH v6 17/22] usb: dwc2: host: Manage frame nums better in scheduler

2016-01-28 Thread Douglas Anderson
The dwc2 scheduler (contained in hcd_queue.c) was a bit confusing in the way it initted / kept track of which frames a QH was going to be active in. Let's clean things up a little bit in preparation for a rewrite of the microframe scheduler. Specifically: * Old code would pick a frame number in

[PATCH v6 09/22] usb: dwc2: host: Giveback URB in tasklet context

2016-01-28 Thread Douglas Anderson
In commit 94dfd7edfd5c ("USB: HCD: support giveback of URB in tasklet context") support was added to give back the URB in tasklet context. Let's take advantage of this in dwc2. This speeds up the dwc2 interrupt handler considerably. Note that this requires the change ("usb: dwc2: host: Add a

[PATCH v6 10/22] usb: dwc2: host: Properly set the HFIR

2016-01-28 Thread Douglas Anderson
According to the most up to date version of the dwc2 databook, the FRINT field of the HFIR register should be programmed to: * 125 us * (PHY clock freq for HS) - 1 * 1000 us * (PHY clock freq for FS/LS) - 1 This is opposed to older versions of the doc that claimed it should be: * 125 us * (PHY

[PATCH v6 15/22] usb: dwc2: host: Split code out to make dwc2_do_reserve()

2016-01-28 Thread Douglas Anderson
This no-op change splits code out of dwc2_schedule_periodic() into a dwc2_do_reserve() function. This makes it a little easier to follow the logic. Signed-off-by: Douglas Anderson Tested-by: Heiko Stuebner Tested-by: Stefan Wahren

regression with S3 and XHCI

2016-01-28 Thread Oliver Neukum
Hi, with the latest kernels I tested devices connected to XHCI are gone after resume. The ports are not resumed. An error is in dmesg: [ 614.639506] sd 5:0:0:0: [sdc] Starting disk [ 614.672568] xhci_hcd :00:14.0: port 7 resume PLC timeout [ 614.695152] xhci_hcd :00:14.0: port 6

[GIT PULL] USB-serial fixes for v4.5-rc2

2016-01-28 Thread Johan Hovold
Hi Greg, Here's a first set of fixes for 4.5-rc. Thanks, Johan The following changes since commit 92e963f50fc74041b5e9e744c330dca48e04f08d: Linux 4.5-rc1 (2016-01-24 13:06:47 -0800) are available in the git repository at: