aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb
AgeCommit message (Collapse)AuthorFilesLines
2013-10-16xhci: remove unused argument from xhci_giveback_urb_in_irq()Xenia Ragiadakou1-4/+4
This patch removes the "adjective" argument from xhci_giveback_urb_in_irq(), since it is not used in the function anymore. Signed-off-by: Xenia Ragiadakou <[email protected]> Acked-by: Sarah Sharp <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2013-10-16xhci: correct the usage of USB_CTRL_SET_TIMEOUTxiao jin2-2/+2
The usage of USB_CTRL_SET_TIMEOUT in xhci is incorrect. The definition of USB_CTRL_SET_TIMEOUT is 5000ms. The input timeout to wait_for_completion_interruptible_timeout is jiffies. That makes the timeout be longer than what we want, such as 50s in some platform. The patch is to use XHCI_CMD_DEFAULT_TIMEOUT instead of USB_CTRL_SET_TIMEOUT as command completion event timeout. Signed-off-by: xiao jin <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2013-10-16usb: xhci: Staticize xhci_del_comp_mod_timerSachin Kamat1-1/+2
'xhci_del_comp_mod_timer' is local to this file. Signed-off-by: Sachin Kamat <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2013-10-16usb: Push USB2 LPM disable on disconnect into USB core.Sarah Sharp2-5/+4
The USB core currently handles enabling and disabling optional USB power management features during device transitions (device suspend/resume, driver bind/unbind, device reset, and device disconnect). Those optional power features include Latency Tolerance Messaging (LTM), USB 3.0 Link PM, and USB 2.0 Link PM. The USB core currently enables LPM on device enumeration and disables USB 2.0 Link PM when the device is reset. However, the xHCI driver disables LPM when the device is disconnected and the device context is freed. Push the call up into the USB core, in order to be consistent with the core handling all power management enabling and disabling. Signed-off-by: Sarah Sharp <[email protected]>
2013-10-16xhci: Enable LPM support only for hardwired or BESL devicesMathias Nyman1-0/+27
Some usb3 devices falsely claim they support usb2 hardware Link PM when connected to a usb2 port. We only trust hardwired devices or devices with the later BESL LPM support to be LPM enabled as default. [Note: Sarah re-worked the original patch to move the code into the USB core, and updated it to check whether the USB device supports BESL, instead of checking if the xHCI port it's connected to supports BESL encoding.] This patch should be backported to kernels as old as 3.11, that contain the commit a558ccdcc71c7770c5e80c926a31cfe8a3892a09 "usb: xhci: add USB2 Link power management BESL support". Without this fix, some USB 3.0 devices will not enumerate or work properly under USB 2.0 ports on Haswell-ULT systems. Signed-off-by: Mathias Nyman <[email protected]> Signed-off-by: Sarah Sharp <[email protected]> Cc: [email protected]
2013-10-16usb: Don't enable USB 2.0 Link PM by default.Sarah Sharp5-155/+26
How it's supposed to work: -------------------------- USB 2.0 Link PM is a lower power state that some newer USB 2.0 devices support. USB 3.0 devices certified by the USB-IF are required to support it if they are plugged into a USB 2.0 only port, or a USB 2.0 cable is used. USB 2.0 Link PM requires both a USB device and a host controller that supports USB 2.0 hardware-enabled LPM. USB 2.0 Link PM is designed to be enabled once by software, and the host hardware handles transitions to the L1 state automatically. The premise of USB 2.0 Link PM is to be able to put the device into a lower power link state when the bus is idle or the device NAKs USB IN transfers for a specified amount of time. ...but hardware is broken: -------------------------- It turns out many USB 3.0 devices claim to support USB 2.0 Link PM (by setting the LPM bit in their USB 2.0 BOS descriptor), but they don't actually implement it correctly. This manifests as the USB device refusing to respond to transfers when it is plugged into a USB 2.0 only port under the Haswell-ULT/Lynx Point LP xHCI host. These devices pass the xHCI driver's simple test to enable USB 2.0 Link PM, wait for the port to enter L1, and then bring it back into L0. They only start to break when L1 entry is interleaved with transfers. Some devices then fail to respond to the next control transfer (usually a Set Configuration). This results in devices never enumerating. Other mass storage devices (such as a later model Western Digital My Passport USB 3.0 hard drive) respond fine to going into L1 between control transfers. They ACK the entry, come out of L1 when the host needs to send a control transfer, and respond properly to those control transfers. However, when the first READ10 SCSI command is sent, the device NAKs the data phase while it's reading from the spinning disk. Eventually, the host requests to put the link into L1, and the device ACKs that request. Then it never responds to the data phase of the READ10 command. This results in not being able to read from the drive. Some mass storage devices (like the Corsair Survivor USB 3.0 flash drive) are well behaved. They ACK the entry into L1 during control transfers, and when SCSI commands start coming in, they NAK the requests to go into L1, because they need to be at full power. Not all USB 3.0 devices advertise USB 2.0 link PM support. My Point Grey USB 3.0 webcam advertises itself as a USB 2.1 device, but doesn't have a USB 2.0 BOS descriptor, so we don't enable USB 2.0 Link PM. I suspect that means the device isn't certified. What do we do about it? ----------------------- There's really no good way for the kernel to test these devices. Therefore, the kernel needs to disable USB 2.0 Link PM by default, and distros will have to enable it by writing 1 to the sysfs file /sys/bus/usb/devices/../power/usb2_hardware_lpm. Rip out the xHCI Link PM test, since it's not sufficient to detect these buggy devices, and don't automatically enable LPM after the device is addressed. This patch should be backported to kernels as old as 3.11, that contain the commit a558ccdcc71c7770c5e80c926a31cfe8a3892a09 "usb: xhci: add USB2 Link power management BESL support". Without this fix, some USB 3.0 devices will not enumerate or work properly under USB 2.0 ports on Haswell-ULT systems. Signed-off-by: Sarah Sharp <[email protected]> Cc: [email protected]
2013-10-16xhci: Set L1 device slot on USB2 LPM enable/disable.Sarah Sharp2-2/+3
To enable USB 2.0 Link Power Management (LPM), the xHCI host controller needs the device slot ID to generate the device address used in L1 entry tokens. That information is set in the L1 device slot ID field of the USB 2.0 LPM registers. Currently, the L1 device slot ID is overwritten when the xHCI driver initiates the software test of USB 2.0 Link PM in xhci_usb2_software_lpm_test. It is never cleared when USB 2.0 Link PM is disabled for the device. That should be harmless, because the Hardware LPM Enable (HLE) bit is cleared when USB 2.0 Link PM is disabled, so the host should not pay attention to the slot ID. This patch should have no effect on host behavior, but since xhci_usb2_software_lpm_test is going away in an upcoming bug fix patch, we need to move that code to the function that enables and disables USB 2.0 Link PM. This patch should be backported to kernels as old as 3.11, that contain the commit a558ccdcc71c7770c5e80c926a31cfe8a3892a09 "usb: xhci: add USB2 Link power management BESL support". The upcoming bug fix patch is also marked for that stable kernel. Signed-off-by: Sarah Sharp <[email protected]> Cc: [email protected]
2013-10-16usb: Disable USB 2.0 Link PM before device reset.Sarah Sharp1-0/+6
Before the USB core resets a device, we need to disable the L1 timeout for the roothub, if USB 2.0 Link PM is enabled. Otherwise the port may transition into L1 in between descriptor fetches, before we know if the USB device descriptors changed. LPM will be re-enabled after the full device descriptors are fetched, and we can confirm the device still supports USB 2.0 LPM after the reset. We don't need to wait for the USB device to exit L1 before resetting the device, since the xHCI roothub port diagrams show a transition to the Reset state from any of the Ux states (see Figure 34 in the 2012-08-14 xHCI specification update). This patch should be backported to kernels as old as 3.2, that contain the commit 65580b4321eb36f16ae8b5987bfa1bb948fc5112 "xHCI: set USB2 hardware LPM". That was the first commit to enable USB 2.0 hardware-driven Link Power Management. Signed-off-by: Sarah Sharp <[email protected]> Cc: [email protected]
2013-10-16USB: quirks: add touchscreen that is dazzeled by remote wakeupOliver Neukum1-0/+3
The device descriptors are messed up after remote wakeup Signed-off-by: Oliver Neukum <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-15usb: gadget: s3c-hsotg: fix can_write limit for non-periodic endpointsRobert Baldyga1-1/+1
Value of can_write variable in s3c_hsotg_write_fifo function should be limited to 512 only for non-periodic endpoints. There was some discrepancy between comment and code, becouse comment suggests correct behavior, but in the code limit was applied to periodic endpoints too. So there is additional check causing the limitation concerns only non-periodic endpoints. Signed-off-by: Robert Baldyga <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-15usb: gadget: s3c-hsotg: fix interrupt configuration in dedicated-fifo modeRobert Baldyga1-5/+9
In dedicated-fifo mode TxFIFOEmpty interrupt should be asserted when TxFIFO for this endpoint is completly empty, so NPTxFEmpLvl and PTxFEmpLvl bits are set in GAHBCFG register. In DIEPMSK register INTknTXFEmpMsk is set, becouse it's needed to indicate FIFO Empty state. Signed-off-by: Robert Baldyga <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-15usb: gadget: s3c-hsotg: fix clear feature ENDPOINT_HALTRobert Baldyga1-1/+9
All requests for endpoint are completed when it was halted and the halt was cleared by CLEAR_FEATURE, but not when new state is same as previous. Signed-off-by: Robert Baldyga <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-15usb: gadget: s3c-hsotg: fix "halted" property updatingRobert Baldyga1-0/+3
Property "halted" of s3c_hsotg_ep structure is actually initialised when ep enabled, and changed when halt is set/cleared. Signed-off-by: Robert Baldyga <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-15usb: gadget: s3c-hsotg: add DAINT maskingRobert Baldyga1-2/+6
In OEPInt/IEPInt interrupts handling added bitwise and of DAINT and DAINTMSK, because we should handle masked interrupts only. Signed-off-by: Robert Baldyga <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-15usb: gadget: s3c-hsotg: fix endpoint interrupts handlingRobert Baldyga1-1/+12
When s3c_hsotg_trytx is called for ep without enqueued request, interrupts for this ep are disabled, to prevent interrupt flooding. Interrupts are enabled when new request for this ep is starting. Signed-off-by: Robert Baldyga <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-15usb: gadget: s3c-hsotg: fix s3c_hsotg_write_fifo function for dedicated fifo ↵Robert Baldyga1-6/+10
mode In s3c_hsotg_write_fifo function PTxFEmp/NPTxFEmp interrupts are enabled only in shared-fifo mode. In dedicated-fifo mode they should not be used (when enabled then cause interrupt storm). Signed-off-by: Robert Baldyga <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-15usb: gadget: s3c-hsotg: fix "protocol stall" handlingRobert Baldyga1-2/+8
After normal handling of SetupDone interrupt, XferCompl interrupt occurs, and then we enqueue new setup request. But when ep0 is stalled, there is no XferCompl, so we have to enqueue setup request immediately after stalling ep. Otherwise incoming control requests won't be processed correctly. Signed-off-by: Robert Baldyga <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-15usb: gadget: storage_common: pass filesem to fsg_store_cdromAndrzej Pietrasiewicz3-13/+39
If cdrom flag is set ro flag is implied. Try setting the ro first, and only if it succeeds set the cdrom flag. Signed-off-by: Andrzej Pietrasiewicz <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Acked-by: Michal Nazarewicz <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-15usb: gadget: storage_common: use strtobool instead of kstrtouintAndrzej Pietrasiewicz1-8/+8
strtobool is more flexible for the user and is more appropriate in the context. Signed-off-by: Andrzej Pietrasiewicz <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Acked-by: Michal Nazarewicz <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-14Merge tag 'omap-for-v3.13/quirk-signed' of ↵Kevin Hilman28-120/+230
git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/dt From Tony Lindgren: Changes needed to prepare for making omap3 device tree only: - Always build in board-generic, and add pdata quirks and auxdata support for it so we have all the pdata related quirks in the same place. - Merge of the drivers/pinctrl changes that are needed for PM to continue working on omap3 and also needed for other omaps eventually. The three pinctrl related patches have been acked by Linus Walleij and are pulled into both the pinctrl tree and this branch. - Few defconfig related changes for drivers needed. * tag 'omap-for-v3.13/quirk-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: (523 commits) ARM: configs: omap2plus_defconfig: enable dwc3 and dependencies ARM: OMAP2+: Add WLAN modules and of_serial to omap2plus_defconfig ARM: OMAP2+: Run make savedefconfig on omap2plus_defconfig to shrink it ARM: OMAP2+: Add minimal 8250 support for GPMC ARM: OMAP2+: Use pdata quirks for wl12xx for omap3 evm and zoom3 ARM: OMAP: Move DT wake-up event handling over to use pinctrl-single-omap ARM: OMAP2+: Add support for auxdata pinctrl: single: Add support for auxdata pinctrl: single: Add support for wake-up interrupts pinctrl: single: Prepare for supporting SoC specific features ARM: OMAP2+: igep0020: use display init from dss-common ARM: OMAP2+: pdata-quirks: add legacy display init for IGEPv2 board +Linux 3.12-rc4 Signed-off-by: Kevin Hilman <[email protected]>
2013-10-14Revert "usb: musb: gadget: fix otg active status flag"Greg Kroah-Hartman1-0/+1
This reverts commit 9b0a1de3c85d99d881c86a29b3d52da7b9c7bd61. Aaro writes: With v3.12-rc4 I can no longer connect to N800 (OMAP2) with USB (peripheral, g_ether). According to git bisect this is caused by: 9b0a1de3c85d99d881c86a29b3d52da7b9c7bd61 is the first bad commit So revert this patch, as Felipe says: It's unfortunate that tusb6010 is so messed up Reported-by: Aaro Koskinen <[email protected]> Acked-by: Felipe Balbi <[email protected]> Cc: Bin Liu <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-14USB: quirks.c: add one device that cannot deal with suspensionOliver Neukum1-0/+3
The device is not responsive when resumed, unless it is reset. Signed-off-by: Oliver Neukum <[email protected]> CC: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-14USB: ohci-exynos: Remove non-DT supportJingoo Han1-15/+3
The non-DT for EXYNOS SoCs is not supported from v3.11. Thus, there is no need to support non-DT for Exynos OHCI driver. The 'include/linux/platform_data/usb-ohci-exynos.h' file has been used for non-DT support. Thus, the 'usb-ohci-exynos.h' file can be removed. Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-14usb/hcd: remove unnecessary local_irq_saveMichael Opdenacker1-15/+0
Remove the use of local_irq_save() and IRQF_DISABLED, no longer needed since interrupt handlers are always run with interrupts disabled on the current CPU. Tested successfully with 3.12.0-rc4 on my PC. Didn't find any issue because of this change. Signed-off-by: Michael Opdenacker <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-14USB: EHCI: start new isochronous streams ASAPAlan Stern1-21/+23
This patch changes the initial delay before the startup of a newly scheduled isochronous stream. Currently the stream doesn't start for at least 5 ms (40 microframes). This value is just an estimate; it has no real justification. Instead, we can start the stream as soon as possible after the scheduling computations are complete. Essentially this requires nothing more than reading the frame counter after the stream is scheduled, instead of before. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-14USB: EHCI: create per-TT bandwidth tablesAlan Stern4-85/+312
This patch continues the scheduling changes in ehci-hcd by adding a table to store the bandwidth allocation below each TT. This will speed up the scheduling code, as it will no longer need to read through the entire schedule to compute the bandwidth currently in use. Properly speaking, the FS/LS budget calculations should be done in terms of full-speed bytes per microframe, as described in the USB-2 spec. However the driver currently uses microseconds per microframe, and the scheduling code isn't robust enough at this point to change over. For the time being, we leave the calculations as they are. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-14Revert "USB: OHCI: Properly handle OHCI controller suspend"Greg Kroah-Hartman1-8/+1
This reverts commit 476e4bf939c9b947ea49923700fbac655cc9057c. Manjunath is no longer at Linaro, the email address bounces. Given that, and the fact that others have reported problems with these patches, I'm reverting them until someone from Linaro who can SUPPORT THEM submits them. I will no longer accept patches from linaro.com developers unless a senior Linaro developer has signed off on them, which did not happen with this patch set. Reported-by: Olof Johansson <[email protected]> Cc: Manjunath Goudar <[email protected]> Cc: Manjunath Goudar <[email protected]> Cc: Alan Stern <[email protected]> Cc: Arnd Bergmann <[email protected]>
2013-10-14Revert "USB: OHCI: Properly handle ohci-at91 suspend"Greg Kroah-Hartman1-8/+2
This reverts commit 056ca85dab838bf064485b6cd73ddfcd9bf707e7. Manjunath is no longer at Linaro, the email address bounces. Given that, and the fact that others have reported problems with these patches, I'm reverting them until someone from Linaro who can SUPPORT THEM submits them. I will no longer accept patches from linaro.com developers unless a senior Linaro developer has signed off on them, which did not happen with this patch set. Reported-by: Olof Johansson <[email protected]> Cc: Manjunath Goudar <[email protected]> Cc: Manjunath Goudar <[email protected]> Cc: Alan Stern <[email protected]> Cc: Arnd Bergmann <[email protected]>
2013-10-14Revert "USB: OHCI: Properly handle ohci-s3c2410 suspend"Greg Kroah-Hartman1-4/+17
This reverts commit 19d339430403336f2f3c9d502db5f4e51fa21729. Manjunath is no longer at Linaro, the email address bounces. Given that, and the fact that others have reported problems with these patches, I'm reverting them until someone from Linaro who can SUPPORT THEM submits them. I will no longer accept patches from linaro.com developers unless a senior Linaro developer has signed off on them, which did not happen with this patch set. Reported-by: Olof Johansson <[email protected]> Cc: Manjunath Goudar <[email protected]> Cc: Manjunath Goudar <[email protected]> Cc: Alan Stern <[email protected]> Cc: Arnd Bergmann <[email protected]>
2013-10-14Revert "USB: OHCI: Properly handle ohci-da8xx suspend"Greg Kroah-Hartman1-11/+4
This reverts commit 86a63f10211ba7d249763bbe10b52073273affa8. Manjunath is no longer at Linaro, the email address bounces. Given that, and the fact that others have reported problems with these patches, I'm reverting them until someone from Linaro who can SUPPORT THEM submits them. I will no longer accept patches from linaro.com developers unless a senior Linaro developer has signed off on them, which did not happen with this patch set. Reported-by: Olof Johansson <[email protected]> Cc: Manjunath Goudar <[email protected]> Cc: Manjunath Goudar <[email protected]> Cc: Alan Stern <[email protected]> Cc: Arnd Bergmann <[email protected]>
2013-10-14Revert "USB: OHCI: Properly handle ohci-ep93xx suspend"Greg Kroah-Hartman1-9/+2
This reverts commit 018258b4360b99b41c50ece917111f138e2314e7. Manjunath is no longer at Linaro, the email address bounces. Given that, and the fact that others have reported problems with these patches, I'm reverting them until someone from Linaro who can SUPPORT THEM submits them. I will no longer accept patches from linaro.com developers unless a senior Linaro developer has signed off on them, which did not happen with this patch set. Reported-by: Olof Johansson <[email protected]> Cc: Manjunath Goudar <[email protected]> Cc: Manjunath Goudar <[email protected]> Cc: Alan Stern <[email protected]> Cc: Arnd Bergmann <[email protected]>
2013-10-14Revert "USB: OHCI: Properly handle ohci-exynos suspend"Greg Kroah-Hartman1-5/+15
This reverts commit fea0896fd36cff487685970bfc36ddd96352d95b. Manjunath is no longer at Linaro, the email address bounces. Given that, and the fact that others have reported problems with these patches, I'm reverting them until someone from Linaro who can SUPPORT THEM submits them. I will no longer accept patches from linaro.com developers unless a senior Linaro developer has signed off on them, which did not happen with this patch set. Reported-by: Olof Johansson <[email protected]> Cc: Manjunath Goudar <[email protected]> Cc: Manjunath Goudar <[email protected]> Cc: Alan Stern <[email protected]> Cc: Arnd Bergmann <[email protected]>
2013-10-14Revert "USB: OHCI: Properly handle ohci-spear suspend"Greg Kroah-Hartman1-9/+3
This reverts commit 36a8758736238c9354f46b39ca506e9acabe82d0. Manjunath is no longer at Linaro, the email address bounces. Given that, and the fact that others have reported problems with these patches, I'm reverting them until someone from Linaro who can SUPPORT THEM submits them. I will no longer accept patches from linaro.com developers unless a senior Linaro developer has signed off on them, which did not happen with this patch set. Reported-by: Olof Johansson <[email protected]> Cc: Manjunath Goudar <[email protected]> Cc: Manjunath Goudar <[email protected]> Cc: Alan Stern <[email protected]> Cc: Arnd Bergmann <[email protected]>
2013-10-14treewide: Fix typo in KconfigMasanari Iida1-1/+1
Correct spelling typo in Kconfig. Signed-off-by: Masanari Iida <[email protected]> Acked-by: Randy Dunlap <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2013-10-11drivers: usb: core: hub.c: Comments shouldnt be C99 // comment styleMatthias Beyer1-2/+2
Signed-off-by: Matthias Beyer <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-11drivers: usb: core: file.c: moved asterisk to variable nameMatthias Beyer1-1/+1
Signed-off-by: Matthias Beyer <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-11drivers: usb: core: {file,hub,sysfs,usb}.c: Whitespace fixesMatthias Beyer4-62/+62
including: - removing of trailing whitespace - removing spaces before array indexing (foo [] to foo[]) - reindention of a switch-case block - spaces to tabs Signed-off-by: Matthias Beyer <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-11USB: mos7840: fix tiocmget error handlingJohan Hovold1-0/+4
Make sure to return errors from tiocmget rather than rely on uninitialised stack data. Cc: [email protected] Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-11USB: serial: export usb_serial_generic_write_startJohan Hovold1-1/+2
Export usb_serial_generic_write_start which is needed when implementing a custom resume function while still relying on the generic write implementation. Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-11USB: serial: add memory flags to usb_serial_generic_write_startJohan Hovold1-8/+10
Add memory-flags parameter to usb_serial_generic_write_start which is called from write, resume and completion handler, all with different allocation requirements. Note that by using the memory flag to determine when called from the completion handler, everything will work as before even if the completion handler is run with interrupts enabled (as suggested). Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-11USB: serial: clean up comments in generic driverJohan Hovold1-32/+25
Clean up some comments, drop excessive comments and fix-up style. Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-11drivers: usb: core: hcd.c: converted busmap from struct to bitmapMatthias Beyer1-7/+5
The DECLARE_BITMAP macro should be used for declaring this bitmap. This commit converts the busmap from a struct to a simple (static) bitmap, using the DECLARE_BITMAP macro from linux/types.h. Please review, as I'm new to kernel development, I don't know if this has any hidden side effects! Suggested by [email protected] Signed-off-by: Matthias Beyer <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-11USB: host: Rename ehci-s5p to ehci-exynosJingoo Han3-70/+69
Currently, Samsung is using 'EXYNOS' as the name of Samsung SoCs. Thus, ehci-exynos is preferred than ehci-s5p. Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-11USB: ehci-s5p: Remove non-DT supportJingoo Han1-28/+4
The non-DT for EXYNOS SoCs is not supported from v3.11. Thus, there is no need to support non-DT for Exynos EHCI driver. The 'include/linux/platform_data/usb-ehci-s5p.h' file has been used for non-DT support. Thus, the 'usb-ehci-s5p.h' file can be removed. Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-11USB: EHCI: use a bandwidth-allocation tableAlan Stern6-244/+344
This patch significantly changes the scheduling code in ehci-hcd. Instead of calculating the current bandwidth utilization by trudging through the schedule and adding up the times used by the existing transfers, we will now maintain a table holding the time used for each of 64 microframes. This will drastically speed up the bandwidth computations. In addition, it eliminates a theoretical bug. An isochronous endpoint may have bandwidth reserved even at times when it has no transfers listed in the schedule. The table will keep track of the reserved bandwidth, whereas adding up entries in the schedule would miss it. As a corollary, we can keep bandwidth reserved for endpoints even when they aren't in active use. Eventually the bandwidth will be reserved when a new alternate setting is installed; for now the endpoint's reservation takes place when its first URB is submitted. A drawback of this approach is that transfers with an interval larger than 64 microframes will have to be charged for bandwidth as though the interval was 64. In practice this shouldn't matter much; transfers with longer intervals tend to be rather short anyway (things like hubs or HID devices). Another minor drawback is that we will keep track of two different period and phase values: the actual ones and the ones used for bandwidth allocation (which are limited to 64). This adds only a small amount of overhead: 3 bytes for each endpoint. The patch also adds a new debugfs file named "bandwidth" to display the information stored in the new table. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-11USB: EHCI: create a "periodic schedule info" structAlan Stern5-121/+124
This patch begins the process of unifying the scheduling parameters that ehci-hcd uses for interrupt and isochronous transfers. It creates an ehci_per_sched structure, which will be stored in both ehci_qh and ehci_iso_stream structures, and will contain the common scheduling information needed for both. Initially we merely create the new structure and move some existing fields into it. Later patches will add more fields and utilize these structures in improved scheduling algorithms. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-11USB: EHCI: use consistent NO_FRAME valueAlan Stern2-6/+7
ehci-hcd is inconsistent in the sentinel values it uses to indicate that no frame number has been assigned for a periodic transfer. Some places it uses NO_FRAME (defined as 65535), other places it uses -1, and elsewhere it uses 9999. This patch defines a value for NO_FRAME which can fit in a 16-bit signed integer, and changes the code to use it everywhere. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-11USB: EHCI: change toggle only upon successful resetAlan Stern1-1/+1
ehci-hcd uses a value of 0 in an endpoint's toggle flag to indicate that the endpoint has been reset (and therefore the Data Toggle bit needs to be cleared in the endpoint's QH overlay region). The toggle flag should be set to 0 only when ehci_endpoint_reset() succeeds. This patch moves the usb_settoggle() call into the appropriate branch of the "if" statement. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-11USB: EHCI: No SSPLIT allowed in uframe 7Alan Stern1-0/+4
The scheduling code in ehci-hcd contains an error. For full-speed isochronous-OUT transfers, the EHCI spec forbids scheduling Start-Split transactions in H-microframe 7, but the driver allows it anyway. This patch adds a check to prevent it. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-11USB: EHCI: compute full-speed bandwidth usage correctlyAlan Stern1-1/+1
Although the bandwidth statistics maintained by ehci-hcd show up only in the /sys/kernel/debug/usb/devices file, they ought to be calculated correctly. The calculation for full-speed isochronous endpoints is wrong; it mistakenly yields bytes per microframe instead of bytes per frame. The "interval" value, which is in frames, should not be converted to microframes. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>