aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host (follow)
AgeCommit message (Collapse)AuthorFilesLines
2014-05-28xhci: delete endpoints from bandwidth list before freeing whole deviceMathias Nyman1-10/+10
Lists of endpoints are stored for bandwidth calculation for roothub ports. Make sure we remove all endpoints from the list before the whole device, containing its endpoints list_head stuctures, is freed. This used to be done in the wrong order in xhci_mem_cleanup(), and triggered an oops in resume from S4 (hibernate). Cc: stable <stable@vger.kernel.org> Tested-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-28usb: pci-quirks: Prevent Sony VAIO t-series from switching usb portsMathias Nyman1-0/+7
Sony VAIO t-series machines are not capable of switching usb2 ports over from Intel EHCI to xHCI controller. If tried the USB2 port will be left unconnected and unusable. This patch should be backported to stable kernels as old as 3.12, that contain the commit 26b76798e0507429506b93cd49f8c4cfdab06896 "Intel xhci: refactor EHCI/xHCI port switching" Cc: stable <stable@vger.kernel.org> # 3.12 Reported-by: Jorge <xxopxe@gmail.com> Tested-by: Jorge <xxopxe@gmail.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03fsl-usb: do not test for PHY_CLK_VALID bit on controller version 1.6Nikita Yushchenko1-1/+2
Per reference manuals of Freescale P1020 and P2020 SoCs, USB controller present in these SoCs has bit 17 of USBx_CONTROL register marked as Reserved - there is no PHY_CLK_VALID bit there. Testing for this bit in ehci_fsl_setup_phy() behaves differently on two P1020RDB boards available here - on one board test passes and fsl-usb init succeeds, but on other board test fails, causing fsl-usb init to fail. This patch changes ehci_fsl_setup_phy() not to test PHY_CLK_VALID on controller version 1.6 that (per manual) does not have this bit. Signed-off-by: Nikita Yushchenko <nyushchenko@dev.rtsoft.ru> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03USB: OHCI: fix problem with global suspend on ATI controllersAlan Stern3-0/+21
Some OHCI controllers from ATI/AMD seem to have difficulty with "global" USB suspend, that is, suspending an entire USB bus without setting the suspend feature for each port connected to a device. When we try to resume the child devices, the controller gives timeout errors on the unsuspended ports, requiring resets, and can even cause ohci-hcd to hang; see http://marc.info/?l=linux-usb&m=139514332820398&w=2 and the following messages. This patch fixes the problem by adding a new quirk flag to ohci-hcd. The flag causes the ohci_rh_suspend() routine to suspend each unsuspended, enabled port before suspending the root hub. This effectively converts the "global" suspend to an ordinary root-hub suspend. There is no need to unsuspend these ports when the root hub is resumed, because the child devices will be resumed anyway in the course of a normal system resume ("global" suspend is never used for runtime PM). This patch should be applied to all stable kernels which include commit 0aa2832dd0d9 (USB: use "global suspend" for system sleep on USB-2 buses) or a backported version thereof. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Reported-by: Peter Münster <pmlists@free.fr> Tested-by: Peter Münster <pmlists@free.fr> CC: <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-25usb/xhci: fix compilation warning when !CONFIG_PCI && !CONFIG_PMDavid Cohen1-3/+3
When CONFIG_PCI and CONFIG_PM are not selected, xhci.c gets this warning: drivers/usb/host/xhci.c:409:13: warning: ‘xhci_msix_sync_irqs’ defined but not used [-Wunused-function] Instead of creating nested #ifdefs, this patch fixes it by defining the xHCI PCI stubs as inline. This warning has been in since 3.2 kernel and was caused by commit 421aa841a134f6a743111cf44d0c6d3b45e3cf8c "usb/xhci: hide MSI code behind PCI bars", but wasn't noticed until 3.13 when a configuration with these options was tried Signed-off-by: David Cohen <david.a.cohen@linux.intel.com> Cc: stable@vger.kernel.org # 3.2 Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-25xhci: extend quirk for Renesas cardsIgor Gnatenko1-3/+1
After suspend another Renesas PCI-X USB 3.0 card doesn't work. [root@fedora-20 ~]# lspci -vmnnd 1912: Device: 03:00.0 Class: USB controller [0c03] Vendor: Renesas Technology Corp. [1912] Device: uPD720202 USB 3.0 Host Controller [0015] SVendor: Renesas Technology Corp. [1912] SDevice: uPD720202 USB 3.0 Host Controller [0015] Rev: 02 ProgIf: 30 This patch should be applied to stable kernel 3.14 that contain the commit 1aa9578c1a9450fb21501c4f549f5b1edb557e6d "xhci: Fix resume issues on Renesas chips in Samsung laptops" Reported-and-tested-by: Anatoly Kharchenko <rfr-bugs@yandex.ru> Reference: http://redmine.russianfedora.pro/issues/1315 Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com> Cc: stable@vger.kernel.org # 3.14 Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-25xhci: Switch Intel Lynx Point ports to EHCI on shutdown.Denis Turischev1-0/+2
The same issue like with Panther Point chipsets. If the USB ports are switched to xHCI on shutdown, the xHCI host will send a spurious interrupt, which will wake the system. Some BIOS have work around for this, but not all. One example is Compulab's mini-desktop, the Intense-PC2. The bug can be avoided if the USB ports are switched back to EHCI on shutdown. This patch should be backported to stable kernels as old as 3.12, that contain the commit 638298dc66ea36623dbc2757a24fc2c4ab41b016 "xhci: Fix spurious wakeups after S5 on Haswell" Signed-off-by: Denis Turischev <denis@compulab.co.il> Cc: stable@vger.kernel.org Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-25usb: xhci: Prefer endpoint context dequeue pointer over stopped_trbJulius Werner3-39/+31
We have observed a rare cycle state desync bug after Set TR Dequeue Pointer commands on Intel LynxPoint xHCs (resulting in an endpoint that doesn't fetch new TRBs and thus an unresponsive USB device). It always triggers when a previous Set TR Dequeue Pointer command has set the pointer to the final Link TRB of a segment, and then another URB gets enqueued and cancelled again before it can be completed. Further investigation showed that the xHC had returned the Link TRB in the TRB Pointer field of the Transfer Event (CC == Stopped -- Length Invalid), but when xhci_find_new_dequeue_state() later accesses the Endpoint Context's TR Dequeue Pointer field it is set to the first TRB of the next segment. The driver expects those two values to be the same in this situation, and uses the cycle state of the latter together with the address of the former. This should be fine according to the XHCI specification, since the endpoint ring should be stopped when returning the Transfer Event and thus should not advance over the Link TRB before it gets restarted. However, real-world XHCI implementations apparently don't really care that much about these details, so the driver should follow a more defensive approach to try to work around HC spec violations. This patch removes the stopped_trb variable that had been used to store the TRB Pointer from the last Transfer Event of a stopped TRB. Instead, xhci_find_new_dequeue_state() now relies only on the Endpoint Context, requiring a small amount of additional processing to find the virtual address corresponding to the TR Dequeue Pointer. Some other parts of the function were slightly rearranged to better fit into this model. This patch should be backported to kernels as old as 2.6.31 that contain the commit ae636747146ea97efa18e04576acd3416e2514f5 "USB: xhci: URB cancellation support." Signed-off-by: Julius Werner <jwerner@chromium.org> Cc: stable@vger.kernel.org Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-16USB: ohci-jz4740: FEAT_POWER is a port feature, not a hub featureLaurent Pinchart1-2/+2
Power control of hub ports target the CLEAR_FEATURE and SET_FEATURE requests to ports, not to the hub. Fix the hub control function to detect the request correctly. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-16USB: ohci-jz4740: Fix uninitialized variable warningLaurent Pinchart1-1/+1
The ret variable is not initialized in all code paths of the ohci_jz4740_hub_control function. Fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-16USB: EHCI: tegra: set txfill_tuningStephen Warren1-0/+23
To avoid memory fetch underflows with larger USB transfers, Tegra SoCs need txfill_tuning's txfifothresh register field set to a non-default value. Add a custom reset override in order to set this up. These values are recommended practice for all Tegra chips. However, I've only noticed practical problems when not setting them this way on systems using Tegra124. Hence, CC: stable only for recent kernels which actually support Tegra124. Cc: <stable@vger.kernel.org> # 3.14+ Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Tested-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-16usb: ehci-platform: Return immediately from suspend if ehci_suspend failsVivek Gautam1-0/+2
Patch 'b8efdaf USB: EHCI: add check for wakeup/suspend race' adds a check for possible race between suspend and wakeup interrupt, and thereby it returns -EBUSY as error code if there's a wakeup interrupt. So the platform host controller should not proceed further with its suspend callback, rather should return immediately to avoid powering down the essential things, like phy. Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Cc: Hauke Mehrtens <hauke@hauke-m.de> Cc: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-16usb: ehci-exynos: Return immediately from suspend if ehci_suspend failsVivek Gautam1-0/+2
Patch 'b8efdaf USB: EHCI: add check for wakeup/suspend race' adds a check for possible race between suspend and wakeup interrupt, and thereby it returns -EBUSY as error code if there's a wakeup interrupt. So the platform host controller should not proceed further with its suspend callback, rather should return immediately to avoid powering down the essential things, like phy. Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com> Acked-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-02Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivialLinus Torvalds1-3/+0
Pull trivial tree updates from Jiri Kosina: "Usual rocket science -- mostly documentation and comment updates" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: sparse: fix comment doc: fix double words isdn: capi: fix "CAPI_VERSION" comment doc: DocBook: Fix typos in xml and template file Bluetooth: add module name for btwilink driver core: unexport static function create_syslog_header mmc: core: typo fix in printk specifier ARM: spear: clean up editing mistake net-sysfs: fix comment typo 'CONFIG_SYFS' doc: Insert MODULE_ in module-signing macros Documentation: update URL to hfsplus Technote 1150 gpio: update path to documentation ixgbe: Fix format string in ixgbe_fcoe. Kconfig: Remove useless "default N" lines user_namespace.c: Remove duplicated word in comment CREDITS: fix formatting treewide: Fix typo in Documentation/DocBook mm: Fix warning on make htmldocs caused by slab.c ata: ata-samsung_cf: cleanup in header file idr: remove unused prototype of idr_free()
2014-03-12Merge 3.14-rc6 into usb-nextGreg Kroah-Hartman1-11/+3
We want the USB fixes in here as well.
2014-03-07Merge tag 'for-usb-next-2014-03-06' of git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci into usb-nextGreg Kroah-Hartman7-122/+303
Sarah writes: xhci: Streams and UAS cleanups, misc cleanups for 3.15 Hi Greg, Here's 76 patches to queue to usb-next for 3.15. The bulk of this rather large pull request is the UAS driver cleanup, the xHCI streams fixes, and the new userspace API for usbfs to be able to use and alloc/free bulk streams. I've hammered on these changes, and the UAS driver seems solid. The performance numbers are pretty spiffy too: root@xanatos:~# echo 3 > /proc/sys/vm/drop_caches; dd if=/dev/sdb of=/dev/null bs=4k count=1000M iflag=count_bytes 256000+0 records in 256000+0 records out 1048576000 bytes (1.0 GB) copied, 3.28557 s, 319 MB/s That's about 100 MB/s faster than my fastest Bulk-only-Transport mass storage drive. There's a couple of miscellaneous cleanup patches and non-urgent bug fixes in here as well: 7969943789df xhci: add the meaningful IRQ description if it is empty bcffae7708eb xhci: Prevent runtime pm from autosuspending during initialization e587b8b270d3 xhci: make warnings greppable 25cd2882e2fc usb/xhci: Change how we indicate a host supports Link PM. Sarah Sharp
2014-03-07usb: wusbcore: disable transfer notifications for Alereon HWAsThomas Pugliese1-2/+40
The HWA driver does not do anything with transfer notifications after receiving the first one and the Alereon HWA allows them to be disabled as a performance optimization. This patch sends a vendor specific command to the Alereon HWA on startup to disable transfer notifications. If the command is successful, the DTI system is started immediately since that would normally be started upon the first reception of a transfer notification which will no longer be sent. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-07Revert "xhci 1.0: Limit arbitrarily-aligned scatter gather."Mathias Nyman1-11/+3
This reverts commit 247bf557273dd775505fb9240d2d152f4f20d304. This commit, together with commit 3804fad45411b48233b48003e33a78f290d227c8 "USBNET: ax88179_178a: enable tso if usb host supports sg dma" were origially added to get xHCI 1.0 hosts and usb ethernet ax88179_178a devices working together with scatter gather. xHCI 1.0 hosts pose some requirement on how transfer buffers are aligned, setting this requirement for 1.0 hosts caused USB 3.0 mass storage devices to fail more frequently. USB 3.0 mass storage devices used to work before 3.14-rc1. Theoretically, the TD fragment rules could have caused an occasional disk glitch. Now the devices *will* fail, instead of theoretically failing. >From a user perspective, this looks like a regression; the USB device obviously fails on 3.14-rc1, and may sometimes silently fail on prior kernels. The proper soluition is to implement the TD fragment rules required, but for now this patch needs to be reverted to get USB 3.0 mass storage devices working at the level they used to. Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-06xhci: add the meaningful IRQ description if it is emptyAdrian Huang1-0/+4
When some xHCI host controllers fall back to use the legacy IRQ, the member irq_descr of the usb_hcd structure will be empty. This leads to the empty string of the xHCI host controller in /proc/interrupts. Here is the example (The irq 19 is the xHCI host controller): CPU0 0: 91 IO-APIC-edge timer 8: 1 IO-APIC-edge rtc0 9: 7191 IO-APIC-fasteoi acpi 18: 104 IR-IO-APIC-fasteoi ehci_hcd:usb1, ehci_hcd:usb2 19: 473 IR-IO-APIC-fasteoi After applying the patch, the name of the registered xHCI host controller can be displayed correctly. Here is the example: CPU0 0: 91 IO-APIC-edge timer 8: 1 IO-APIC-edge rtc0 9: 7191 IO-APIC-fasteoi acpi 18: 104 IR-IO-APIC-fasteoi ehci_hcd:usb1, ehci_hcd:usb2 19: 473 IR-IO-APIC-fasteoi xhci_hcd:usb3 Tested on v3.14-rc4. Signed-off-by: Adrian Huang <ahuang12@lenovo.com> Reviewed-by: Nagananda Chumbalkar <nchumbalkar@lenovo.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2014-03-06xhci: Prevent runtime pm from autosuspending during initializationMathias Nyman1-1/+10
xHCI driver has its own pci probe function that will call usb_hcd_pci_probe to register its usb-2 bus, and then continue to manually register the usb-3 bus. usb_hcd_pci_probe does a pm_runtime_put_noidle at the end and might thus trigger a runtime suspend before the usb-3 bus is ready. Prevent the runtime suspend by increasing the usage count in the beginning of xhci_pci_probe, and decrease it once the usb-3 bus is ready. xhci-platform driver is not using usb_hcd_pci_probe to set up busses and should not need to have it's usage count increased during probe. Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Acked-by: Dan Williams <dan.j.williams@intel.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: stable@vger.kernel.org
2014-03-04storage: accept some UAS devices if streams are unavailableOliver Neukum2-0/+6
On some older XHCIs streams are not supported and the UAS driver will fail at probe time. For those devices storage should try to bind to UAS devices. This patch adds a flag for stream support to HCDs and evaluates it. [Note: Sarah fixed a bug where the USB 2.0 root hub, not USB 3.0 root hub would get marked as being able to support streams.] Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Acked-by: Hans de Goede <hdegoede@redhat.com>
2014-03-04xhci: Kill streams URBs when the host dies.Sarah Sharp1-7/+21
If the host controller stops responding to commands, we need to kill all the URBs that were queued to all endpoints. The current code would only kill URBs that had been queued to the endpoint rings. ep->ring is set to NULL if streams has been enabled for the endpoint, which means URBs submitted with a non-zero stream_id would never get killed. Fix this. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2014-03-04xhci: Refactor command watchdog and fix split string.Sarah Sharp1-31/+39
In preparation for fixing this function for streams endpoints, refactor code in the command watchdog timeout function into two new functions. One kills all URBs on a ring (either stream or endpoint), the other kills all URBs associated with an endpoint. Fix a split string while we're at it. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2014-03-04xhci: Handle MaxPSASize == 0Hans de Goede1-0/+6
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2014-03-04xhci: The trb_address_map radix tree expects 1KB segment memory aligmentHans de Goede1-4/+5
If we align segment dma pool memory to 64 bytes, then a segment can be located at 0x10000040 - 0x1000043f, and a segment from another ring at 0x10000440 - 0x1000083f. The last trb in the first segment at 0x10000430 will then translate to the same radix tree key as the first trb of the second segment, while they are in different rings! This patches fixes this by changing the alignment of the dma pool to be 1KB rather then 64 bytes. An alternative fix would be to reduce the shift used to calculate the radix tree keys, but that would (slighlty) grow the radix trees so I believe this is the better fix. Note this patch is mostly theoretical since in practice I've not seen the dma_pool actually return not 1KB aligned memory. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2014-03-04xhci: xhci_mem_cleanup: make sure cmd_ring_reserved_trbs really is 0Hans de Goede1-1/+1
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 controller resume fails. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2014-03-04xhci: Remove segments from radix tree on failed insert.Sarah Sharp1-26/+81
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 newly allocated segment), but before the new ring segments are linked into the old ring. If insert fails on any one segment, remove each segment from the radix tree, deallocate the new segments, and return. Otherwise, link the new segments into the tree. HdG: Add a check to only update stream mappings in xhci_ring_expansion when the ring is a stream ring. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2014-03-04xhci: use usb_ss_max_streams in xhci_check_streams_endpointHans de Goede1-1/+1
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 <hdegoede@redhat.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2014-03-04xhci: For streams the dequeue ptr must be read from the stream ctxHans de Goede2-7/+16
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 the Nec writes the ptr to both the ep and stream contexts when streams are used. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2014-03-04xhci: Set SCT field for Set TR dequeue on streamsHans de Goede2-2/+6
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. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2014-03-04xhci: For streams the css flag most be read from the stream-ctx on ep stopHans de Goede1-3/+11
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2014-03-04xhci: Check size rather then number of streams when allocating stream ctxsHans de Goede1-8/+8
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 <hdegoede@redhat.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2014-03-04xhci: Free streams when they are still allocated on a set_interface callHans de Goede1-1/+20
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 0000:01:00.0: WARN Can't disable streams for endpoint 0x81 , streams are already disabled! [ 96.982400] xhci_hcd 0000:01:00.0: WARN xhci_free_streams() called with non-streams endpoint But it is better to also warn about the actual cause of this later warnings. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2014-03-04xhci: fix usb3 streamsGerd Hoffmann2-43/+90
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 is that things work initially, but as soon as the first segment is full xhci can't map the trb address from the completion event to the stream ring any more -> BOOM. You'll find this message in the logs: ERROR Transfer event for disabled endpoint or incorrect stream ring This patch adds a helper function to update the radix tree, and a function to remove ring segments from the tree. Both functions loop over the segment list and handles all segments instead of just the first. [Note: Sarah changed this patch to add radix_tree_maybe_preload() and radix_tree_preload_end() calls around the radix tree insert, since we can now insert entries in interrupt context. There are now two helper functions to make the code cleaner, and those functions are moved to make them static.] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2014-03-04xhci: make warnings greppableOliver Neukum1-13/+8
This changes debug messages and warnings in xhci-ring.c to be on a single line so grep can find them. grep must have precedence over the 80 column limit. [Sarah fixed two checkpatch.pl issues with split lines introduced by this commit.] Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2014-03-04usb/xhci: Change how we indicate a host supports Link PM.Sarah Sharp2-9/+5
The xHCI driver currently uses a USB core internal field, udev->lpm_capable, to indicate the xHCI driver knows how to calculate the LPM timeout values. If this value is set for the host controller udev, it means Link PM can be enabled for child devices under that host. Change the code so the xHCI driver isn't mucking with USB core internal fields. Instead, indicate the xHCI driver doesn't support Link PM on this host by clearing the U1 and U2 exit latencies in the roothub SuperSpeed Extended Capabilities BOS descriptor. The code to check for the roothub setting U1 and U2 exit latencies to zero will also disable LPM for external devices that do that same. This was already effectively done with commit ae8963adb4ad8c5f2a89ca1d99fb7bb721e7599f "usb: Don't enable LPM if the exit latency is zero." Leave that code in place, so that if a device sets one exit latency value to zero, but the other is set to a valid value, LPM is only enabled for the U1 or U2 state that had the valid value. This is the same behavior the code had before. Also, change messages about missing Link PM information from warning level to info level. Only print a warning about the first device that doesn't support LPM, to avoid log spam. Further, cleanup some unnecessary line breaks to help people to grep for the error messages. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: Alan Stern <stern@rowland.harvard.edu>
2014-03-03USB: EHCI: tegra: Drop unused definesThierry Reding1-4/+0
Since commit 2d22b42db02f "usb: phy: registering Tegra USB PHY as platform driver" the driver no longer relies on the hard-coded physical addresses to determine the association between PHY and EHCI port, so these defines can be dropped. Signed-off-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-02Merge 3.14-rc5 into usb-nextGreg Kroah-Hartman1-3/+10
We want the fixes here too.
2014-02-26usb: ehci: fix deadlock when threadirqs option is usedStanislaw Gruszka1-3/+10
ehci_irq() and ehci_hrtimer_func() can deadlock on ehci->lock when threadirqs option is used. To prevent the deadlock use spin_lock_irqsave() in ehci_irq(). This change can be reverted when hrtimer callbacks become threaded. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Cc: stable <stable@vger.kernel.org> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-24Merge 3.14-rc4 into usb-nextGreg Kroah-Hartman1-4/+22
We want the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-20Merge branch 'master' into for-nextJiri Kosina85-1050/+654
2014-02-20Kconfig: Remove useless "default N" linesPaul Bolle1-3/+0
A number of Kconfig entries default to (uppercase) "N". It was clearly intended to use "default n". But since (lowercase) "n" is the default anyway, these lines might as well be removed. Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-02-18USB: EHCI: add delay during suspend to prevent erroneous wakeupsAlan Stern1-4/+22
High-speed USB connections revert back to full-speed signalling when the device goes into suspend. This takes several milliseconds, and during that time it's not possible to tell reliably whether the device has been disconnected. On some platforms, the Wake-On-Disconnect circuitry gets confused during this intermediate state. It generates a false wakeup signal, which can prevent the controller from going to sleep. To avoid this problem, this patch adds a 5-ms delay to the ehci_bus_suspend() routine if any ports have to switch over to full-speed signalling. (Actually, the delay was already present for devices using a particular kind of PHY power management; the patch merely causes the delay to be used more widely.) Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Reviewed-by: Peter Chen <Peter.Chen@freescale.com> CC: <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-18Merge 3.14-rc3 into usb-nextGreg Kroah-Hartman3-58/+16
We want the fixes in this branch as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-15xhci-platform: Change compatible string from xhci-platform to generic-xhciHans de Goede1-0/+1
This brings the xhci-platform bindings in sync with what we've done for the ohci- and ehci-platform drivers. As discussed there using platform as a postfix is a bit weird as the platform bus is a Linux specific thing and the bindings are supposed to be OS agnostic. Note that the old xhci-platform compatible string is kept around for, well, compatibility reasons. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-15uhci-platform: Change compatible string from platform-uhci to generic-uhciHans de Goede1-0/+1
This brings the uhci-platform bindings in sync with what we've done for the ohci- and ehci-platform drivers. As discussed there using platform as a prefix is a bit weird as the platform bus is a Linux specific thing and the bindings are supposed to be OS agnostic. Note that the old platform-uhci compatible string is kept around for, well, compatibility reasons. While at it rename the bindings txt file to match the name of all the other ?hci-platform bindings docs. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-11USB: ELAN: Remove useless "default M" linesPaul Bolle1-1/+0
The Kconfig entries for USB_U132_HCD and USB_FTDI_ELAN default to (uppercase) "M". But in Kconfig (lowercase) "m" is a magic symbol. "M" is an ordinary symbol. As "M" is never set these Kconfig symbols will also not be set by default. Since I'm not aware of a reason why these driver should be set by default, let's just drop these lines (that basically do nothing). Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-11USB: ohci-platform: check for platform data misconfigurationAlan Stern1-20/+22
The ohci-platform driver checks for misconfigurations in cases where the Device Tree data specifies big-endian registers or descriptors but the corresponding driver config settings have not been enabled. As Jonas Gorski suggested, we may as well apply the same check to general platform data too. This requires moving the code that sets the big-endian quirk flags from the ohci_platform_reset() routine into ohci_platform_probe(), and moving the checks out of the DT-specific "if" statement clause. The patch also changes the text of the error messages in an attempt to make the nature of the error more clear. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Reported-by: Jonas Gorski <jogo@openwrt.org> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-11USB: ehci-platform: check for platform data misconfigurationAlan Stern1-20/+22
The ehci-platform driver checks for misconfigurations in cases where the Device Tree data specifies big-endian registers or descriptors but the corresponding driver config settings have not been enabled. As Jonas Gorski suggested, we may as well apply the same check to general platform data too. This requires moving the code that sets the big-endian quirk flags from the ehci_platform_reset() routine into ehci_platform_probe(), and moving the checks out of the DT-specific "if" statement clause. The patch also changes the text of the error messages in an attempt to make the nature of the error more clear. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Reported-by: Jonas Gorski <jogo@openwrt.org> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-11ehci-platform: Change compatible string from usb-ehci to generic-ehciHans de Goede2-2/+1
The initial versions of the devicetree enablement patches for ehci-platform used "ehci-platform" as compatible string. However this was disliked by various reviewers because the platform bus is a Linux invention and devicetree is supposed to be OS agnostic. After much discussion I gave up, added a: "depends on !PPC_OF" to Kconfig to avoid a known conflict with PPC-OF platforms and went with the generic usb-ehci as requested. In retro-spect I should have chosen something different, the dts files for many existing boards already claim to be compatible with "usb-ehci", ie they have: compatible = "ti,ehci-omap", "usb-ehci"; In theory this should not be a problem since the "ti,ehci-omap" entry takes presedence, but in practice using a conflicting compatible string is an issue, because it makes which driver gets used depend on driver registration order. This patch changes the compatible string claimed by ehci-platform to "generic-ehci", avoiding the driver registration / module loading ordering problems, and removes the "depends on !PPC_OF" workaround. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Tested-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>