Commit Graph

456232 Commits

Author SHA1 Message Date
Himangi Saraogi
96ae571338 uhci-platform: use devm_ioremap resource
This patch replaces the memory allocation using request_mem_region and
the ioremap by a single call to managed interface devm_ioremap_reource.
The corresponding calls to release_mem_region and iounmap in the probe
and release functions are now unnecessary and are removed. Also a label
is done away with and linux/device.h is added to make sure the devm_*()
outine declarations are unambiguously available.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 16:31:48 -07:00
Bert Vermeulen
5a7fbe7e9e USB: ftdi_sio: Add extra PID.
This patch adds PID 0x0003 to the VID 0x128d (Testo). At least the
Testo 435-4 uses this, likely other gear as well.

Signed-off-by: Bert Vermeulen <bert@biot.com>
Cc: Johan Hovold <johan@kernel.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 16:27:40 -07:00
Tuomas Tynkkynen
3e346d41bf USB: PHY: tegra: Call tegra_usb_phy_close only on device removal
tegra_usb_phy_close() is supposed to undo the effects of
tegra_usb_phy_init(). It is also currently added as the USB PHY shutdown
callback, which is wrong, since tegra_usb_phy_init() is only called
during probing wheras the shutdown callback can get called multiple
times. This then leads to warnings about unbalanced regulator_disable if
the EHCI driver is unbound and bound again at runtime.

Signed-off-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 16:25:46 -07:00
Tuomas Tynkkynen
a47cc24cd1 USB: EHCI: tegra: Fix probe order issue leading to broken USB
The Tegra USB complex has a particularly annoying misdesign: some of the
UTMI pad configuration registers are global for all the 3 USB controllers
on the chip, but those registers are located in the first controller's
register space and will be cleared when the reset to the first
controller is asserted. Currently, this means that if the 1st controller
were to finish probing after the 2nd or 3rd controller, USB would not
work at all.

Fix this situation by always resetting the 1st controller before doing
any other setup to any of the controllers, and then never ever reset the
first controller again. As the UTMI registers are related to the PHY,
the PHY driver should probably reset the Tegra controllers instead,
but since old device trees only have reset phandles in the EHCI nodes,
do it here, which means a bit of device tree groveling. Those old DTs
also won't get the reset fix from this commit, so we'll dev_warn() them,
but the driver will still keep probing successfully.

Signed-off-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 16:25:46 -07:00
Tuomas Tynkkynen
308efde202 ARM: tegra: Add resets & has-utmi-pad-registers flag to all USB PHYs
Add new properties to all of the Tegra PHYs that are now required
according to the binding.

In order to stay compatible with old device trees, the USB drivers
will still function without these reset properties but with the old,
potentially buggy behaviour.

Signed-off-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 16:25:46 -07:00
Tuomas Tynkkynen
883df42abf USB: tegra: Add resets & has-utmi-pad-registers flag to the PHY binding
When Tegra was converted to use the standard reset bindings, the PHY was
forgotten, probably because all the resetting of the USB blocks were
done in the EHCI driver. What also went unnoticed is that resetting the
1st on-chip USB module also wipes some of the UTMI pad configuration
registers that are also used by the other USB blocks. So this fact needs
to be described in the device tree, and the driver modified not to reset
the 1st module at inappropriate times.

In order to stay compatible with old device trees, the USB drivers will
still function without these properties but with the old,
potentially buggy behaviour.

Signed-off-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 16:25:46 -07:00
Fabian Frederick
91c72df1fc drivers/usb/serial/mos7840.c: remove unnecessary null test before kfree
Cc: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 16:25:22 -07:00
Himangi Saraogi
ddd9425741 usb: host: uhci-grlib.c : use devm_ functions
The various devm_ functions allocate memory that is released when a
driver detaches. This patch uses devm_ioremap_resource for data
that is allocated in the probe function of a platform device and
is only freed in the remove function. The corresponding free functions
are removed and two labels are done away with. Also, linux/device.h
is added to make sure the devm_*() routine declarations are
unambiguously available.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Andreas Larsson <andreas@gaisler.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 16:25:22 -07:00
Tuomas Tynkkynen
6a70b62122 USB: EHCI: tegra: Fix use-after-free in .remove()
The tegra_ehci_hcd structure is located in the private space allocated
by the core USB code so it must not be accessed after the HCD is
freed.

Signed-off-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 16:25:22 -07:00
Linus Torvalds
4f440cd534 PCI updates for v3.16:
Virtualization
     - Fix "wait for pending transactions" for PCI AF reset (Alex Williamson)
 
   Miscellaneous
     - Update mx6 PCI driver maintainer email (Fabio Estevam)
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJTvcfrAAoJEFmIoMA60/r8xeUP/ixESUPHSD44EgXLUQYF5DL1
 SG8lvDkAzG/nRUckfu2kWXCTNVtu0U25ZEBZskPstcr69fMEur0qM841ggI37DFI
 SIIGZEnxky8/GBkhvucdiK70iMN39lfHuZtZ1Yx5IrILjyOTtvO4EoWt+r03KxhH
 Y03e8MSp4z5oVq8WZ7wqsKr95cSGOeLANs4XPhTneLFKYGtFgZzTgetFePV9KIeP
 PeQrG2RTCQkonxYx4HEtVYdPM6Pc/MgBDVGkvtA69GcuKnnnDxjiJfXnGYoODHHT
 iYUO9JJ8XcgJpdrnVDN+n8LNMlbzcfHc9lVXSXJAk9W70Ge6WUtYUTYb5us9ZmWl
 QGGKmh+QbdmZ76tZCIv+mQg2aEUdaE25ieS4nt6R+BnwdtoBIKHc92oOfn+7pmFv
 +VCb5Hd0p9xSOSQ9w0Xes4adjVHfwtIj1wy+67TXBGILtOKbFgWhG/DD2cwt3thh
 b8B25BX0tAriWzn2xzhOKaDMW77/c5IvxLYn7r7QFYJzVl2iSk/5Q3W94pfH5SNC
 5QNh9uteRR9zuruouKoTqSiqZTYAymNWNq7ycoMGNgBO2UlBhM5rleF2n0RGsvsy
 ETjPIeODdsV1bj+UoiK9MafFG/ozDO3tlIKD9q3jRP+e07+rQ5IkluHppjum7CTG
 cVVb6xacUaZo+uTIPfk4
 =VndR
 -----END PGP SIGNATURE-----

Merge tag 'pci-v3.16-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci

Pull PCI fixes from Bjorn Helgaas:
 "Just a fix for the device reset path and an email address update.

  Virtualization
    - Fix "wait for pending transactions" for PCI AF reset (Alex
      Williamson)

  Miscellaneous
    - Update mx6 PCI driver maintainer email (Fabio Estevam)"

* tag 'pci-v3.16-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
  MAINTAINERS: Update mx6 PCI driver maintainer's email
  PCI: Fix unaligned access in AF transaction pending test
2014-07-09 16:18:18 -07:00
Bryan O'Donoghue
6e693739e9 USB: ehci-pci: USB host controller support for Intel Quark X1000
The EHCI packet buffer in/out threshold is programmable for Intel Quark X1000
USB host controller, and the default value is 0x20 dwords. The in/out threshold
can be programmed to 0x80 dwords (512 Bytes) to maximize the perfomrance,
but only when isochronous/interrupt transactions are not initiated by the USB
host controller. This patch is to reconfigure the packet buffer in/out
threshold as maximal as possible to maximize the performance, and 0x7F dwords
(508 Bytes) should be used because the USB host controller initiates
isochronous/interrupt transactions.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@intel.com>
Signed-off-by: Alvin (Weike) Chen <alvin.chen@intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Reviewed-by: Jingoo Han <jg1.han@samsung.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 16:16:07 -07:00
Vladimir Zapolskiy
4428524d8d USB: OHCI: don't allocate HCCA atomically
OHCI HCCA memory region is allocated from atomic DMA pool one time
during usb_add_hcd() and deallocated by usb_remove_hcd().

Do non-atomic allocation of OHCI HCCA and free some space in
coherent atomic DMA pool.

Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 16:16:07 -07:00
Vladimir Zapolskiy
f589b3e040 USB: UHCI: don't allocate frame list atomically
uhci_start() is executed one time during usb_add_hcd() call and by
default UHCI frame list is allocated from atomic DMA pool.

Do non-atomic allocation of uhci->frame and free some space in
coherent atomic DMA pool.

Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 16:16:07 -07:00
Vladimir Zapolskiy
47c6ae7cdc USB: EHCI: don't allocate hardware periodic table atomically by default
ehci_mem_init() is executed one time during ehci_init() and by default
all memory allocations but ehci->periodic are done not atomically,
GFP_KERNEL is passed as flags parameter.

Do similar allocation for ehci->periodic and free some space in
coherent atomic DMA pool by default.

Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 16:16:07 -07:00
Fabian Frederick
64024d9f2a drivers/usb/host/fhci-dbg.c: remove unnecessary null test before debugfs_remove
This fixes checkpatch warning:
"WARNING: debugfs_remove(NULL) is safe this check is probably not required"

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 16:13:03 -07:00
Jingoo Han
3632eba532 USB: ehci-spear: Make of_device_id array const
Make of_device_id array const, because all OF functions handle
it as const.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 16:13:03 -07:00
Jingoo Han
1b45049a37 USB: ehci-tegra: Make of_device_id array const
Make of_device_id array const, because all OF functions handle
it as const.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 16:13:03 -07:00
Jingoo Han
10e15d6d90 USB: ohci-spear: Make of_device_id array const
Make of_device_id array const, because all OF functions handle
it as const.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 16:13:03 -07:00
Jingoo Han
3587fb3ba0 USB: ehci-msm: Make of_device_id array const
Make of_device_id array const, because all OF functions handle
it as const.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 16:13:03 -07:00
Himangi Saraogi
8968614a8c USB: oxu210hp-hcd.c: use devm_ functions
This patch introduces the use of devm_ioremap_resource instead of
request_mem_region and ioremap. The error handling on
platform_get_resource and the error message for ioremap are removed. The
function devm_kzalloc replaces memory allocation by unmanaged kzalloc. The
function calls to free the allocated memory in the probe and remove
functions are done away with. Some labels are removed and a label error
is added to make is less specific to the context. The debug message is
removed as devm_ioremap generates debug messages of its own.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 16:11:11 -07:00
Thierry Reding
2097937467 usb: phy: tegra: Do not include asm/mach-types.h
It is no longer needed and keeping it will break 64-bit ARM builds.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 16:11:11 -07:00
Paul Bolle
cc583db3d7 Documentation: sysfs-bus-usb: update power/persist description
There's no power/persist file for hubs. And CONFIG_USB_PERSIST was
removed in v2.6.26. Update the description of power/persist accordingly.
Also remove the line on its default value. It is not entirely correct, as
CONFIG_USB_DEFAULT_PERSIST and the USB_QUIRK_RESET flag influence the
default. It is not needed to understand this file anyhow.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 16:11:11 -07:00
Alexey Khoroshilov
6c0f36954b usb: host: max3421-hcd: unconditionally use GFP_ATOMIC in max3421_urb_enqueue()
As far as kzalloc() is called with spinlock held,
we have to pass GFP_ATOMIC regardless of mem_flags argument.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: David Mosberger <davidm@egauge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 16:06:50 -07:00
David Mosberger-Tang
a2b63cb52f usb: host: max3421-hcd: Fix max3421_reset_port() to set USB_PORT_STAT_RESET
Signed-off-by: David Mosberger <davidm@egauge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 16:06:35 -07:00
David Mosberger-Tang
2eb5dbdd12 usb: host: max3421-hcd: Use atomic bitops in lieu of bit fields
Bit fields are not MP-safe.

Signed-off-by: David Mosberger <davidm@egauge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 16:06:35 -07:00
Mickael Maison
f6d9d89f86 USB: gadget: Fixed a few typos in comments
Signed-off-by: Mickael Maison <mickael.maison@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 16:05:52 -07:00
Jeremiah Mahler
31e01f0aca usb: doc: hotplug.txt code typos
Fixed several typos in the code examples given in
Documentation/usb/hotplug.txt.

  - missing [] with array of struct usb_device_id

  - checkpatch.pl warning: space between function name and parenthesis

  - missing terminating ';'

Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 16:05:42 -07:00
Sachin Kamat
14ad5a94cb usb: ehci-exynos: Use NULL instead of 0
The third argument of devm_of_phy_get expects a pointer.
Hence use NULL instead of 0. Fixes the following warning:
drivers/usb/host/ehci-exynos.c:91:51: warning: Using plain integer as NULL pointer

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Vivek Gautam <gautam.vivek@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 16:05:42 -07:00
Sachin Kamat
473e92e69e usb: ohci-exynos: Use NULL instead of 0
The third argument of devm_of_phy_get expects a pointer.
Hence use NULL instead of 0.

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Vivek Gautam <gautam.vivek@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 16:05:42 -07:00
Rickard Strandqvist
ab53eb9736 usb: class: usbtmc.c: Cleaning up uninitialized variables
There is a risk that the variable will be used without being initialized.

This was largely found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 15:59:10 -07:00
Jingoo Han
53dbcb399b usb: dwc2: gadget: remove incorrect file reference
The file and folder movements resulted in the incorrect reference.
So for better code maintainability, let's remove it.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 15:56:13 -07:00
Jingoo Han
d04477d84b usb: dwc2: gadget: remove unnecessary OOM messages
The site-specific OOM messages are unnecessary, because they
duplicate the MM subsystem generic OOM message.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 15:56:13 -07:00
Jingoo Han
e9ebe7c3b7 usb: dwc2: gadget: fix checkpatch errors
Fix checkpatch errors as belows.

  ERROR: open brace '{' following function declarations go on the next line
  ERROR: space required before the open parenthesis '('

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 15:56:13 -07:00
Yoshihiro Shimoda
4ac8918f3a usb: host: xhci-plat: add support for the R-Car H2 and M2 xHCI controllers
The R-Car H2 and M2 SoCs come with an xHCI controller that requires
some specific initializations related to the firmware downloading and
some specific registers. This patch adds the support for this special
configuration as an xHCI quirk executed during probe and start.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: "mathias.nyman@intel.com" <mathias.nyman@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 15:49:10 -07:00
Himangi Saraogi
fd666348c5 usb: host: xhci-plat: use devm_functions
This patch introduces the use of managed interface devm_ioremap_resource
for ioremap_nocache and request_mem_region and removes the corresponding
free functions in the probe and remove functions.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Cc: Mathias Nyman <mathias.nyman@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 15:47:51 -07:00
Oliver Neukum
288c0f44eb xhci: make error messages grepable
grep must work, not matter the line length.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 15:45:42 -07:00
Peter Senna Tschudin
f4f8ae0568 USB: kl5kusb105: Remove klsi_105_tiocmset function
This patch remove the function klsi_105_tiocmset which was only
returning -EINVAL. It also removes the function prototype and
the .tiocmset entry in the struct usb_serial_driver.

Verified by compilation only.

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 15:44:06 -07:00
Lan Tianyu
f64c51975d usb: documentation for usb port power off mechanisms
describe the mechanisms for controlling port power policy and
discovering the port power state.

[oliver]: fixes, clarification of wakeup vs port-power-control
[sarah]: wordsmithing
[djbw]: updates for peer port changes
[alan]: review and fixes
Cc: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 15:43:12 -07:00
Dan Williams
3cd12f9151 usb: force warm reset to break link re-connect livelock
Resuming a powered down port sometimes results in the port state being
stuck in the training sequence.

 hub 3-0:1.0: debounce: port 1: total 2000ms stable 0ms status 0x2e0
 port1: can't get reconnection after setting port  power on, status -110
 hub 3-0:1.0: port 1 status 0000.02e0 after resume, -19
 usb 3-1: can't resume, status -19
 hub 3-0:1.0: logical disconnect on port 1

In the case above we wait for the port re-connect timeout of 2 seconds
and observe that the port status is USB_SS_PORT_LS_POLLING (although it
is likely toggling between this state and USB_SS_PORT_LS_RX_DETECT).
This is indicative of a case where the device is failing to progress the
link training state machine.

It is resolved by issuing a warm reset to get the hub and device link
state machines back in sync.

 hub 3-0:1.0: debounce: port 1: total 2000ms stable 0ms status 0x2e0
 usb usb3: port1 usb_port_runtime_resume requires warm reset
 hub 3-0:1.0: port 1 not warm reset yet, waiting 50ms
 usb 3-1: reset SuperSpeed USB device number 2 using xhci_hcd

After a reconnect timeout when we expect the device to be present, force
a warm reset of the device.  Note that we can not simply look at the
link status to determine if a warm reset is required as any of the
training states USB_SS_PORT_LS_POLLING, USB_SS_PORT_LS_RX_DETECT, or
USB_SS_PORT_LS_COMP_MOD are valid states that do not indicate the need
for warm reset by themselves.

Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Vincent Palatin <vpalatin@chromium.org>
Cc: Lan Tianyu <tianyu.lan@intel.com>
Cc: Ksenia Ragiadakou <burzalodowa@gmail.com>
Cc: Vivek Gautam <gautam.vivek@samsung.com>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Sunil Joshi <joshi@samsung.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Acked-by: Julius Werner <jwerner@chromium.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 15:43:12 -07:00
Pratyush Anand
51df62ff74 usb: allow lpm (en/dis)able only if device is atleast in default state
When a USB device is disconnected, usb_unbind_interface is called, which
tries to enable and disable LPM. usb_enable_lpm also try to send a
control command SET SEL to the device.
Since device is already disconnected, therefore it does not make sense
to execute usb_(en/dis)able_lpm.
This patch returns from usb_(en/dis)able_lpm, if device was not in
default state atleast.

Signed-off-by: Pratyush Anand <pratyush.anand@st.com>
Tested-by: Aymen Bouattay <aymen.bouattay@st.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 15:41:34 -07:00
Pratyush Anand
b2f463e130 dwc3: host: Enable USB3 LPM capability
All dwc3 based xhci host controller supports USB3.0 LPM functionality.
Therefore enable it in platform data for all dwc3 based xhci device if
DWC3_HOST_USB3_LPM_ENABLE is selected in Kconfig.

Signed-off-by: Pratyush Anand <pratyush.anand@st.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-of-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 15:41:34 -07:00
Pratyush Anand
20f6fdd01c xhci: Platform: Set xhci lpm support quirk based on platform data
If an xhci platform supports USB3 LPM capability then enable
XHCI_LPM_SUPPORT quirk flag.

Signed-off-by: Pratyush Anand <pratyush.anand@st.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 15:41:34 -07:00
Pratyush Anand
94ef3d5042 xhci: Platform: Add (en/dis)able_usb3_lpm_timeout
To use auto U0-U1/U2 transition by xhci platform device add
(en/dis)able_usb3_lpm_timeout function to the xhci_plat_xhci_driver struct.

Signed-off-by: Pratyush Anand <pratyush.anand@st.com>
Tested-by: Aymen Bouattay <aymen.bouattay@st.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 15:41:34 -07:00
Pratyush Anand
9502c46cc9 xhci: A default implementation for Ux timeout calculation and tier policy check
As best case, a host controller should support U0 to U1 switching for
the devices connected below any tier of hub level supported by usb
specification. Therefore xhci_check_tier_policy should always return
success as default implementation.

A host should be able to issue LGO_Ux after the timeout calculated as
per definition of system exit latency defined in C.1.5.2. Therefore
xhci_calculate_ux_timeout returns ux_params.sel as the default
implementation.

Use default calculation in absence of any vendor specific limitations.

Signed-off-by: Pratyush Anand <pratyush.anand@st.com>
Tested-by: Aymen Bouattay <aymen.bouattay@st.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 15:41:34 -07:00
Tushar Behera
ec5734c41b usb: misc: usb3503: Update error code in print message
'err' is uninitialized, rather print the error code directly.

This also fixes following warning.
drivers/usb/misc/usb3503.c: In function ‘usb3503_probe’:
drivers/usb/misc/usb3503.c:195:11: warning: ‘err’ may be used uninitialized
in this function [-Wmaybe-uninitialized]
    dev_err(dev, "unable to request refclk (%d)\n", err);

Signed-off-by: Tushar Behera <tushar.b@samsung.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 15:41:02 -07:00
K. Y. Srinivasan
9bd2d0dfe4 Drivers: hv: util: Fix a bug in the KVP code
Add code to poll the channel since we process only one message
at a time and the host may not interrupt us. Also increase the
receive buffer size since some KVP messages are close to 8K bytes in size.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 14:34:35 -07:00
K. Y. Srinivasan
affb1aff30 Drivers: hv: vmbus: Fix a bug in the channel callback dispatch code
Starting with Win8, we have implemented several optimizations to improve the
scalability and performance of the VMBUS transport between the Host and the
Guest. Some of the non-performance critical services cannot leverage these
optimization since they only read and process one message at a time.
Make adjustments to the callback dispatch code to account for the way
non-performance critical drivers handle reading of the channel.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 14:34:35 -07:00
Greg Kroah-Hartman
2a7db858d6 USB-serial fixes for v3.16-rc5
Here are some USB-serial updates for v3.16-rc5 that add two new device IDs.
 
 Signed-off-by: Johan Hovold <johan@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJTundCAAoJEEEN5E/e4bSV+l4P/RObfn2odYEAMqB7CTkYyHOQ
 27Y1zsvbC2nm//+mC9kVksORnrwqnrltY70IqHLfKuUvvzeKcKCVlqJMwX4PsyGW
 Is4yFLk1d0zbXPsUa/BWAjX8mK7Tny/JH1m3SrLA4etkNHor6Kj0fbPEqfAmAjA8
 Bj4XDFiGkdz2lDxocUJe081WSrLWVqyRave9u6ewzSKsXYi5V+QKln0nb0SGDkO2
 WGeqj0Xz7eRMwBUkMkVZFr4r24C73JzPNPmPsnN2y33pbwa+jl9oXOLEH92VgioY
 JQoy1EpjO0TPotr3sHaDrXsCokolIXaaACC1MQrtXAja21pl5WIQTYEmXV+fA8Y4
 iIjZbRdzyJZ2p8wvyzkLHpu+XL+yWzCKfdkrjrDiYiMQ7WJg+xhw9JhaVEKTWlQq
 UrcoUfaOnMenp4+Bu2f1HQAHmDz6tLJ2raRQRjAp1wGgnosVaQwxd6MuEZpGrA73
 osAAryUjZ5q6j0eqjXdF2hmdA9p5lvMV32QBR+bEa0OIwb7Q0dgrH4iYGVRKOTei
 pyFjSzfBwWkOHRAQHbDK4zvWi8sLqHJItfwXmD7/B55Gjvgrx7r8ZBtoRXD7BHAV
 U3xX3jAw4xkvtkmiC7DEMEFpYMwaEd+sa0eIp6rVnziH7Wv41fYFSsp8yvGeY6ey
 bhuaPevctNFhjxPGzKAX
 =1al6
 -----END PGP SIGNATURE-----

Merge tag 'usb-serial-3.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus

Johan writes:

USB-serial fixes for v3.16-rc5

Here are some USB-serial updates for v3.16-rc5 that add two new device IDs.

Signed-off-by: Johan Hovold <johan@kernel.org>
2014-07-09 10:20:37 -07:00
Linus Torvalds
191d385f25 f2fs bugfixes for 3.16
o fix normal and recovery path for fallocated regions
 o fix error case mishandling
 o recover renamed fsync inodes correctly
 o fix to get out of infinite loops in balance_dirty_pages
 o fix kernel NULL pointer error
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJTvUA5AAoJEEAUqH6CSFDSSKgP/RQ6ryncwwSUilDswq95/VI1
 qXwAlHLBgJkPquld6Klqw//4ot49sThCjBtusxdNqoyB5aSb/xqupJxRvCrJe1RQ
 dRDYP1Mq63phd0cWsjAokfwXuiJQ2Ys/1bq2HguzAhL+7qNVNJEoy27ISUgvh71J
 3v9pTfOqFY/qMxAa1Y91kIat3/27QTCtVQdS1sQM7s8UXlZHIIGyxrSmYWPUGNar
 yVtMNtgMQcEtmekRAjstM0glj3IukosTP1jameXYumEw9bchfIeeLznvtDiEqxKA
 maXtEPA+yrEk5y+RhOiBgaHuV/9uNmrHHvTwoqhMl9Wl+I4RzxpOhD2agRAUFbdn
 rvPKU514tsjhkdelSYf0v2rXf0PxZcZ5XE27TZ+xyhCADKykBdN5ZzTH1OUWjEOA
 TNdPVKv2btpvEdGdmdGzjKIQpPfjLgJLAKqDNNTSQ3u4XlVioMn6IyzEGddz41By
 kSU0Hzj3iBHk+XlqBWSELOd34aCuvqXG/gcE7rWOj0qbJ5T6GKVRTQN5CbqMNutJ
 Udw0JDhImgYxNI5fsy7Stg/5IqOwhp/pDIpLOHXRnYpLb2rJ1kzvgz4B/eJAZCcc
 zmjxZBn1C2GLBJYFDbY1KeR5Tp6WZ9yok+wbXFiO1mpx5RsU7jIL64X/7+Zg0X84
 p3LlN/vBn1nr2DiB3+n/
 =pwxz
 -----END PGP SIGNATURE-----

Merge tag 'f2fs-fixes-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs

Pull f2fs bugfixes from Jaegeuk Kim:
 "This includes a couple of bug fixes found by xfstests.  In addition,
  one critical bug was reported by Brian Chadwick, which is falling into
  the infinite loop in balance_dirty_pages.  And it turned out due to
  the IO merging policy in f2fs, which was newly merged in 3.16.

   - fix normal and recovery path for fallocated regions
   - fix error case mishandling
   - recover renamed fsync inodes correctly
   - fix to get out of infinite loops in balance_dirty_pages
   - fix kernel NULL pointer error"

* tag 'f2fs-fixes-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs:
  f2fs: avoid to access NULL pointer in issue_flush_thread
  f2fs: check bdi->dirty_exceeded when trying to skip data writes
  f2fs: do checkpoint for the renamed inode
  f2fs: release new entry page correctly in error path of f2fs_rename
  f2fs: fix error path in init_inode_metadata
  f2fs: check lower bound nid value in check_nid_range
  f2fs: remove unused variables in f2fs_sm_info
  f2fs: fix not to allocate unnecessary blocks during fallocate
  f2fs: recover fallocated data and its i_size together
  f2fs: fix to report newly allocate region as extent
2014-07-09 09:46:58 -07:00
Michal Marek
dd5a6752ae firmware: Create directories for external firmware
Commit 5180d5f4 ("firmware: Simplify directory creation") broke
including firmware specified in CONFIG_EXTRA_FIRMWARE:

  MK_FW   firmware/amd-ucode/microcode_amd.bin.gen.S
/bin/sh: firmware/amd-ucode/microcode_amd.bin.gen.S: No such file or directory
...
firmware/Makefile:185: recipe for target
'firmware/amd-ucode/microcode_amd.bin.gen.S' failed

It works with O= builds, because the directory is created by
Makefile.build. Create the directory in firmware/Makefile in non-O
builds.

Reported-and-tested-by: Ronald Uitermark <ronald645@gmail.com>
Reported-and-tested-by: Torsten Kaiser <just.for.lkml@googlemail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2014-07-09 15:16:35 +02:00