Commit graph

9536 commits

Author SHA1 Message Date
Alan Stern 36caff5d79 USB: fix endpoint-disabling for failed config changes
This patch (as1631) fixes a bug that shows up when a config change
fails for a device under an xHCI controller.  The controller needs to
be told to disable the endpoints that have been enabled for the new
config.  The existing code does this, but before storing the
information about which endpoints were enabled!  As a result, any
second attempt to install the new config is doomed to fail because
xhci-hcd will refuse to enable an endpoint that is already enabled.

The patch optimistically initializes the new endpoints' device
structures before asking the device to switch to the new config.  If
the request fails then the endpoint information is already stored, so
we can use usb_hcd_alloc_bandwidth() to disable the endpoints with no
trouble.  The rest of the error path is slightly more complex now; we
have to disable the new interfaces and call put_device() rather than
simply deallocating them.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-and-tested-by: Matthias Schniedermeyer <ms@citd.de>
CC: Sarah Sharp <sarah.a.sharp@linux.intel.com>
CC: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-11 18:06:48 -08:00
Greg Kroah-Hartman 7fd94beeca usb: gadget: patches for v3.8
renesas_usbhs implements ->pullup() method, switches over
 to devm_request_irq(), adds support for DMA Engine and
 got a few miscelaneous cleanups.
 
 The NCM gadget got an endianness fix and the Ethernet
 gadget a frame size fix.
 
 We're finally removing the g_file_storage gadget and
 sticking to g_mass_storage and the new tcm_usb_gadget
 gadgets since that was a huge duplicaton of effort anyway.
 
 While removing g_file_storage, we also had to fix a bunch
 of defconfigs which were still pointing to the old gadget.
 
 There's a big series getting us closer to being able to
 introduce our configfs interface. The series converts
 functions into loadable modules which will, eventually,
 be registered to the configfs interface.
 
 Other than that there's the usual typo fixes and miscelaneous
 cleanups all over the place.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQnXPMAAoJEIaOsuA1yqREkygQALIuhY6veRPZoZJltuADeAOV
 h7lBkuseJxvlJsbMLnjqP5tw4W/haE1deGR+ee1ZItkPrERCX1++jkQ6hmm7e00R
 mvr8rI+n3eBHSKUO89tUfCaz5UBsTl0cowPWdTwxRrV4VRJ1wVBw/oII9sfyss03
 jDo+11DSjTGTB+Bz72p2NTkRiv9my2Kz+ihhqFR5VSl5FyoutG53RNKRmciJKGB+
 i+RptOI+prdW1uOURHbie5FAI0xOBrE1Up2XdNiZ9blT6zcsK754Lc8erFJEZXX5
 7s8Ys/HJZLQCF/fRt4WAw8e1lSPELD2xuDMqV+WKu93aXOiAWL1SbzqK3Y+PaUDg
 Red07jOxgPqgq0F1mAp3+0Rs1RnshSvKREtQhZqsttg7suXhDB0q7h61CX8uQbRA
 hBZh8eFexRjqOZxveeV+h4ATz00c2nlEa8cJscr5zLf4R/LSxJWT7LV5227BDkBV
 9NUMA3dunDYZLqnxBv5lS2gQzmYO6G11wzdpgjnABL2WlM8Pv1lUDhY+erwvTRzd
 BM+9qMd7K40BuI1JyUsbBdmuEpJAD/yWE77pT2aBrr4767x0CYjBPZqQAxXFcWi8
 5NG1BzqWmH9HhwxKyWueWgNgY253cRcAzFlUN80NRA2UuNkMAeOAeJjvK48isAqJ
 T1MUkQgIFNvSecpRPrEl
 =umtl
 -----END PGP SIGNATURE-----

Merge tag 'gadget-for-v3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next

USB gadget patches from Felipe:
"usb: gadget: patches for v3.8

renesas_usbhs implements ->pullup() method, switches over
to devm_request_irq(), adds support for DMA Engine and
got a few miscelaneous cleanups.

The NCM gadget got an endianness fix and the Ethernet
gadget a frame size fix.

We're finally removing the g_file_storage gadget and
sticking to g_mass_storage and the new tcm_usb_gadget
gadgets since that was a huge duplicaton of effort anyway.

While removing g_file_storage, we also had to fix a bunch
of defconfigs which were still pointing to the old gadget.

There's a big series getting us closer to being able to
introduce our configfs interface. The series converts
functions into loadable modules which will, eventually,
be registered to the configfs interface.

Other than that there's the usual typo fixes and miscelaneous
cleanups all over the place."
2012-11-11 17:31:53 -08:00
Greg Kroah-Hartman 0f89fc3fd8 usb: dwc3: patches for v3.8
We can finaly drop HAVE_CLK dependency from exynos glue layer
 now that clk API provides no-op stubs when it's not linked
 into the kernel.
 
 We're also switching over event buffer allocation to devm_kzalloc()
 and moving the allocation out of dwc3_core_init() so that can be
 re-used when implementing PM support for v3.9.
 
 After the introduction of PLATFORM_DEVID_AUTO, we can also drop the
 homebrew platform device ID handling we had on dwc3 core and let
 driver core take care of that for us.
 
 Exynos glue layer learns about DeviceTree and drops platform_data
 support completely.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQnWwFAAoJEIaOsuA1yqREBCwP/0QH34TL292W0BH9wKj7GVgK
 fT9DOKWGJFNr238WcDmnl+NBVVtWuEjqcAplNNWpJndwRm36lD1WCYOe/fPEh01h
 rm0scCijJcvgpBbQDOAR4B9UbMe9YcymWvuZ7Rx9217ryHiy352OlNoKfAkJOt2e
 JXMREHl7yJwWv6x5pN44NaMDgL/LqFnhvf8KAqo5LjR7XUJlkKQcmUmzkqyxGvnq
 9BFiOoIiRSwmTtnieulgvocgWgmlzkMabeAWvY/w5Cq3g2FKWVwBqg1zyRQK9MrE
 YEoEFy6Edc37C2CrmjaK6g/3Mw7p4v5s0AmU4jCRSFcpk2jpqZa+TEHkdCwgyXXY
 g/nlerxhprc5OFw7BnX26A7u1tIEfVMc9K3lcbadc5PpyiHnsveQHlr7kxhfPocF
 12AhfQRx8G/a365Fle88fTZs+aDKiBnIqpzzLNTHBw3riBdgvQsIjx4X+7Y0rE46
 v1SXqW/H0thlY38YpUQ5a4jNVKUNJJM4vamQ7cu7i9m2n0nHshfMPx2xe5NFKUHW
 bI44+pTq1FO73mmkFbWmMRCdE7aRv63aQInQ4nSbVHBi7Nv+xv8nNT8Y3XJu9T27
 bEv9nXxpx0GFwLQYcwzrhyI7Ws7+EZU5W13vemQUf4EEtwBZq4d9NxUYCUg2OpYo
 ivHz3p1AtBkjL6ImFxjc
 =wqLI
 -----END PGP SIGNATURE-----

Merge tag 'dwc3-for-v3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next

USB dwc3 patches from Felipe:

"usb: dwc3: patches for v3.8

We can finaly drop HAVE_CLK dependency from exynos glue layer
now that clk API provides no-op stubs when it's not linked
into the kernel.

We're also switching over event buffer allocation to devm_kzalloc()
and moving the allocation out of dwc3_core_init() so that can be
re-used when implementing PM support for v3.9.

After the introduction of PLATFORM_DEVID_AUTO, we can also drop the
homebrew platform device ID handling we had on dwc3 core and let
driver core take care of that for us.

Exynos glue layer learns about DeviceTree and drops platform_data
support completely."
2012-11-11 17:22:01 -08:00
Greg Kroah-Hartman 3a3f2e5095 usb: musb: patches for v3.8 merge window
We have here the usual set of cleanups for the MUSB driver; a
 big set of patches converting platform_device_del() and
 platform_device_put() into platform_device_unregister().
 
 Another big set was applied converting to module_platform_driver()
 macro in order to reduce some boilerplate code from all glue
 layers.
 
 Other than that, we had a series fixing one known silicon errata
 where we couldn't read a few registers. In order to fix that
 we're now using shadow variables for reads and only writing
 to the registers which are known to break functionality when
 read.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQnWnTAAoJEIaOsuA1yqREsb8P/2fYBTfwJSzlr4Gw7CWIedw1
 6l0VsHRBPr7cnUFmbkxdVAcDbuqfDrtEZoYSxF97DoDmqKqM4JXcGsozLn62J4pL
 E0jscaojx1ZbELEoWWTY4Sr7KBIz5SPYnZhQFj2S3oXWtDvQe+3NyGU6uJxwTjzD
 A57xpSAJmruQE+8hPL2e1/rPR+I9ZmaebhpQ2cyNTFWu/tv+Q7VtpvjtreD1C/fZ
 0IVlyz6r/2OXB4C//xWfJ2BRPa6wRHAu/BpH5HU0P84hPi7hshtjKHjWUZFkuDHy
 JsBArA2LGJN2Jc62H9tiKaD28kHWNm99P7XPkCnPRY7bfAINZ6SwDxYCrQ9QKpNq
 ExLLhdJA4rhVQATRlwczluFNK1rTVSxJQFEcK/hkopK8wK/B+mgWqDu4OZDDhowu
 u8/pPNM9gJe1/NNVfSigJ9f/h0wb25Ua+V7MyrmCOuQq1tdVELYfHCj+VhjqAIud
 YzBLsGTnrto7TYYV2wuc6iiHW0nJ0zrBOiSfsUjLiGoB0dH224MqCvezwUREqyob
 fy25JmyCVjlxZ5wkfjJ9UlFuruWJHJf2zVr04xfdxaUY9eUk1rmEmhNR9mAlfnQG
 3fJC580fVgHVceucOP2knsnXAzGjy/jr+xiFzOU9lE8NopO46qtbmBm5CwcW0STX
 L9IJq7SA2KhuVpGpQkwf
 =tr2i
 -----END PGP SIGNATURE-----

Merge tag 'musb-for-v3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next

USB musb merge from Felipe:

"usb: musb: patches for v3.8 merge window

We have here the usual set of cleanups for the MUSB driver; a
big set of patches converting platform_device_del() and
platform_device_put() into platform_device_unregister().

Another big set was applied converting to module_platform_driver()
macro in order to reduce some boilerplate code from all glue
layers.

Other than that, we had a series fixing one known silicon errata
where we couldn't read a few registers. In order to fix that
we're now using shadow variables for reads and only writing
to the registers which are known to break functionality when
read."
2012-11-11 17:13:16 -08:00
Greg Kroah-Hartman 8e06c6a7f4 usb: phy: patches for v3.8 merge window
Not too many patches this time. First two patches are only
 cleanups where one of them switches over to module_platform_driver
 macro and the second removes inclusion of <mach/iomap.h> and is
 part of a bigger set of include cleanups from the Tegra folks.
 
 The only substantial change here is the addition of a driver
 for Renesas' R-Car USB Phy controller.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQnWcbAAoJEIaOsuA1yqREmSAQALGLSzrFrcmJcUBEckTlSLu3
 H9Dc4GzJk1R8eyyippPgMeJKDwsXBZuZUC+KoEoeyTdm5lqBKLYwkqdHlYrlxlFX
 J8FpIzXNYih4hEaOuhkCsojSsJXZODASDowqRunEcFaOOSv6J1zZQVe3mtw9H5Ap
 59gXz9Fdcyc4D9JnPvkJpNxBiGBTQMNUjJ0yyUZNwHh1N+zdwQ+De3msxEaDHoJF
 it9e92QdfCZrSPIXC+hjVLgPG3JeMsQsJabRq8hlRfJzdMP5rdE6WVadkaDFcaPl
 pbNIKxSmz9QaD8IfVivmyRw6oG0/yiSbmKXgz+npj6bo/nzlYaTYbgWNaIeLA2US
 E9QM8MSGYl1nefNjhfobVTxVUOmi5vYcBXo9OMXBS6NO3TczGGQLMQzOO6Xmnqf6
 MzsvdmbMgWsz0OjT2MopxyUTVTh/ps5nUaySyrnSlXC95yUH65Ky5avBUC1jqWxj
 YbZiqaLgSccKDIo4UOgQFaMR6jKxUQx+fgJy/s9uCdFh0EGAhfrVP+DpX12erHQ/
 F+5uVja4H/nLeCff2ea0kIV9tyouaRe/89stWQ28RIE/yLrHN41KmrwppoJZwhxl
 fzW3kWKASIVTy976Hk/N9d13TnpZIj2eJWR2LIzkt2BDb6dfN+IV0NPwreiTe92L
 l7RScAepGbF5HK3aFAuu
 =6i3J
 -----END PGP SIGNATURE-----

Merge tag 'xceiv-for-v3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into USB-next

Pull USB phy patches from Felipe:

"usb: phy: patches for v3.8 merge window

Not too many patches this time. First two patches are only
cleanups where one of them switches over to module_platform_driver
macro and the second removes inclusion of <mach/iomap.h> and is
part of a bigger set of include cleanups from the Tegra folks.

The only substantial change here is the addition of a driver
for Renesas' R-Car USB Phy controller."
2012-11-11 16:12:14 -08:00
Tony Lindgren edf8dde393 Merge branch 'linus' into omap-for-v3.8/cleanup-headers-prepare-multiplatform-v3 2012-11-09 14:58:01 -08:00
Afzal Mohammed d75542263a Revert "usb: musb: dsps: remove explicit NOP device creation"
This reverts commit d8c3ef256f.

Above mentioned change was made along with multi usb phy change and
adding DT support for nop transceiver. But other two changes did not
make it to mainline. This in effect makes dsps musb wrapper unusable
even for single instance.

Hence revert it so that at least single instance can be supported.

Cc: stable@vger.kernel.org # v3.7
Signed-off-by: Afzal Mohammed <afzal@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-09 08:01:54 +02:00
Dmytro Milinevskyy f72e3b7886 usb: gadget: ncm: correct endianess conversion
Convert USB descriptor's fields to CPU byte order before using locally in USB
NCM gadget driver.

Tested on MIPS32 big-endian device.

Signed-off-by: Dmytro Milinevskyy <milinevskyy@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-08 16:05:39 +02:00
Ian Coolidge 23834e5331 usb: gadget: g_ether: fix frame size check
Checking skb->len against ETH_FRAME_LEN assumes a 1514
ethernet frame size. With an 802.1Q VLAN header, ethernet
frame length can now be 1518. Validate frame length against that.

Signed-off-by: Ian Coolidge <iancoolidge@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-08 16:04:50 +02:00
Michal Nazarewicz be44f1c80b usb: gadget: Remove reference to is_dualspeed from sysfs.
This commit removes the /sys/devices/platform/<UDC>/udc/<UDC>/is_dualspeed
file and is_dualspeeed line from /sys/devices/platform/ci13xxx_*/udc/device
file.

The is_dualspeed file is superseded by maximum_speed in the same directory
and is_dualspeed line in device file is superseded by max_speed line in
the same file.

The maximum_speed/max_speed specifies maximum speed supported by UDC.
To check if dualspeeed is supported, check if the value is >= 3.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-08 16:04:34 +02:00
Michal Nazarewicz fea20dbcfd usb: gadget: storage_common: Make fsg_lun_is_open() a function.
Since function-line macros are to be avoided, this commit replaces
the fsg_lun_is_open() macro with a static inline function.

While at it, this commit also adds “inline” modifier to the
fsg_lun_from_dev() function.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-08 16:04:04 +02:00
Michal Nazarewicz 8575f7a706 usb: gadget: storage_common: Drop #ifdefs used for the sake of FSG.
storage_common.c has been used by both file_storage.c and f_mass_storage.c
which had some different requirements in a few places.  To accomodate for
that, storage_common.c provided configuratian macros which were to be
defined (or not) prior to the file #inclusion.  Because now
file_storage.c is no longer with us, we can remove support for those
macros and thus simplify the code slightly.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-08 16:03:35 +02:00
Michal Nazarewicz c7800a34ac usb: gadget: storage_common: Remove FSG specific definitions.
Since g_file_storage has been removed, this commit removes code from
the storage_common.c file which has been used by file_storage.c only
(and not by f_mass_storage.c).

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-08 16:02:55 +02:00
Michal Nazarewicz fa06920a3e usb: gadget: Remove File-backed Storage Gadget (g_file_storage).
The File-backed Storage Gadget (g_file_storage) gadget has been replaced
with Mass Storage Gadget (g_mass_storage) which uses the composite
framework.  This commit removes g_file_storage (and most references to it).

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-08 16:01:04 +02:00
Kuninori Morimoto 1c90ee0b3e usb: renesas_usbhs: use transfer counter if IN direction bulk pipe
received data will break if it was bulk pipe and large data size,
because pipe kept BUF PID even though it doesn't have enough buffer.
To avoid this issue, renesas_usbhs can use transfer counter.
Pipe PID will be NAK if it didn't have enough buffer by this patch.

renesas_usbhs has strange address mapping.
Thus, it is difficult to calculate transfer counter setting address.
This patch use fixed table for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-08 15:46:06 +02:00
Felipe Balbi e32672f0bc usb: dwc3: core: don't kfree() devm_kzalloc()'ed memory
commit 380f0d2 (usb: dwc3: core: switch event
buffer allocation to devm_kzalloc()) was incomplete
leaving a trailing kfree(evt) in an error exit
path.

Fix this problem by removing the trailing kfree(evt).

Cc: Julia Lawall <julia.lawall@lip6.fr>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-08 15:26:41 +02:00
Ian Coolidge 4fe5f079b4 usb: gadget: g_ether: fix frame size check for 802.1Q
Checking skb->len against ETH_FRAME_LEN assumes a 1514
ethernet frame size. With an 802.1Q VLAN header, ethernet
frame length can now be 1518. Validate frame length against that.

Signed-off-by: Ian Coolidge <iancoolidge@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-11-07 21:12:26 -05:00
Olof Johansson 66267ee587 Merge branch 'arm-next' of git://git.xilinx.com/linux-xlnx into next/cleanup
From Michal Simek:

* 'arm-next' of git://git.xilinx.com/linux-xlnx:
  zynq: move static peripheral mappings
  zynq: remove use of CLKDEV_LOOKUP
  zynq: use pl310 device tree bindings
  zynq: use GIC device tree bindings
  + Linux 3.7-rc3
2012-11-06 07:51:06 -08:00
Philippe De Swert baef653a50 usb: musb: remove generic_interrupt
This patch is based on the discussion of a previous patch to fix an issue
where the omap2430 musb driver is not working for N9/N950.

Moving all the interrupt handling to the devices. Avoids inclusion of generic
interrupt and breakage due to sometimes misleading CONFIG options. This makes
sure usb always works if on of the subdrivers is chosen. Tested on Nokia N9/N950.

Partially clean up CONFIG_SOC_OMAP3430 which is not necessary in the cases
where I removed it. Also helps with the removal work of those options that
Tony Lindgren predicted would happen at some point.

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-06 15:32:13 +02:00
Sergei Shtylyov 8b416b0b25 usb: musb: cppi_dma: export cppi_interrupt()
Now that DaVinci glue layer can be modular, we must export cppi_interrupt()
that it may call...

Cc: stable@vger.kernel.org # 3.0+
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-06 15:12:09 +02:00
Kuninori Morimoto 7b332e5fef usb: renesas_usbhs: host: add endpoint user counter
renesas_usbhs attaches pipe to endpoint when urb was queued, and it will be
detached when transfer was done.  Multi device controlling was enabled by this
behavior.

Now renesas_usbhs driver tried to wait until detaching if urb was queued to
endpoint which already has been attached to pipe, and it created strange driver
behavior.

But it can re-use this attached pipe if multi urb was queued.  This patch
implements it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-06 15:04:28 +02:00
Kuninori Morimoto 24e4c1c30d usb: renesas_usbhs: remove debug information from usbhsh_hub_status_data()
Because usbhsh_hub_status_data() will be called many times,
there are too many obstructive/useless debug informations if driver has #define DEBUG.
Thus, other important dev_dbg() information will hide.
This patch removed obstructive/useless dev_dbg().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-06 15:04:28 +02:00
Masanari Iida 984e833c2b usb: fix typo in drivers/usb
Correct spelling typo in debug messages within drivers/usb.

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-06 15:04:14 +02:00
Santhapuri, Damodar c68bb4c679 usb: musb: dsps: control module handling (quirk)
am335x uses nop transceiver driver and need to enable builtin phy
by writing into usb_ctrl register available in system control
module register space. This is being added at musb glue driver
layer until a separate system control module driver is available.

Proper solution is to make use of control module driver, but it is
not expected to be ready soon.

Other options available are providing control module register space
as memory resource via DT or using omap hwmod.

DT approach has been rejected by Rob Herring, while resources are
being moved from hwmod to DT. And both of the above approaches
require that control module registers be configured in wrapper
itself requring a quirk in driver as well as DT or hwmod.

Here another option is used, providing driver with control module
register physical address. Even though this a hack, there is no other
option left till control module driver is ready. As of now only
am335x is using dsps wrapper, and so driver is made aware of am335x
control module physical address.

Please note that this is a temporary arrangment till omap control
module driver is available.

[afzal@ti.com: limit quirk to dsps wrapper]

Signed-off-by: Santhapuri, Damodar <damodar.santhapuri@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Ravi Babu <ravibabu@ti.com>
Signed-off-by: Afzal Mohammed <afzal@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-06 15:03:02 +02:00
Afzal Mohammed 3e594b18f1 usb: musb: dsps: get resources by index
dsps wrapper is now dt only. This requires that resources be obtained
using index and not name, modify accordingly.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-06 15:01:39 +02:00
Afzal Mohammed 3b46dd76a9 usb: musb: dsps: reduce musb instance to one
Currently multiple phy's of the same type are not supported, hence
reduce musb instances to one. This helps in supporting at least one
instance of musb, rather than having none. Even without this, it was
observed that both instances were working (by luck), but this holds
good iff wrapper is part of Image. And it is not correct for both
controller's to be associated with same phy, here it was working
because phy is a nop one. And having wrapper as a module and
rmmod'ing would crash.

This can be reverted once multi phy support for same type is available
and driver is enhanced to make use of it.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-06 15:01:36 +02:00
Afzal Mohammed 12fc9266de usb: musb: dsps: remove platform callback
dsps wrapper is dt only, it cannot execute platform callbacks.
Presence of this would cause NULL dereference, hence remove it.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-06 14:59:39 +02:00
Jean-Christophe PLAGNIOL-VILLARD bcd2360c1f arm: at91: move platfarm_data to include/linux/platform_data/atmel.h
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
2012-11-06 20:29:33 +08:00
Vivek Gautam 7947699a4e usb: dwc3: exynos: remove platform data support
We are removing plat data which was used till now to init and
exit phy. We no longer need this since dwc3-core takes care of
initializing and shutting-down the phy using usb_phy_init()
and usb_phy_shutdown().

Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-06 13:44:29 +02:00
Vivek Gautam accefdd4b2 usb: dwc3: exynos: add support for device tree
This patch adds support to parse probe data for
dwc3-exynos driver using device tree.

Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-06 13:44:15 +02:00
Stephen Warren dc9fe7f973 usb: phy: tegra remove include of <mach/iomap.h>
Almost nothing from this file is used, and the file will hopefully be
deleted soon. Copy the tiny portions that are used directly into
tegra_usb_phy.c. I believe that Venu Byravarasu is working on cleaning up
our USB driver, and those cleanups will remove the need for these
constants.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-05 11:36:04 -07:00
Stephen Warren f7d147dd87 usb: host: tegra remove include of <mach/iomap.h>
Almost nothing from this file is used, and the file will hopefully be
deleted soon. Copy the tiny portions that are used directly into
ehci-tegra.c. I believe that Venu Byravarasu is working on cleaning up
our USB driver, and those cleanups will remove the need for these
constants.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-05 11:36:04 -07:00
Olof Johansson 365480d67b Merge branch 'depends/omap-cleanup-headers-usb' into next/headers
Conflicts resolved same as Tony did in his later dependent branch:

	arch/arm/mach-omap1/clock.c
	arch/arm/mach-omap2/board-2430sdp.c
	arch/arm/mach-omap2/board-4430sdp.c
	arch/arm/mach-omap2/board-cm-t35.c
	arch/arm/mach-omap2/board-igep0020.c
	arch/arm/mach-omap2/board-ldp.c
	arch/arm/mach-omap2/board-omap3beagle.c
	arch/arm/mach-omap2/board-omap3logic.c
	arch/arm/mach-omap2/board-omap4panda.c
	arch/arm/mach-omap2/board-overo.c
	arch/arm/mach-omap2/board-rm680.c
	arch/arm/mach-omap2/board-rx51.c
	arch/arm/mach-omap2/twl-common.c
	arch/arm/mach-omap2/usb-host.c
	arch/arm/mach-omap2/usb-musb.c

Signed-off-by: Olof Johansson <olof@lixom.net>
2012-11-05 10:27:33 -08:00
Olof Johansson 6d06721570 Merge branch 'depends/tty' into next/headers
Merging in Greg's tty tree including a cleanup patch needed by the OMAP serial
header cleanups.

* depends/tty: (305 commits)
  tty/serial/8250: Make omap hardware workarounds local to 8250.h
  serial/8250/8250_early: Prevent rounding error in uartclk
  serial: samsung: use clk_prepare_enable and clk_disable_unprepare
  TTY: Report warning when low_latency flag is wrongly used
  console: use might_sleep in console_lock
  TTY: move tty buffers to tty_port
  TTY: add port -> tty link
  TTY: tty_buffer, cache pointer to tty->buf
  TTY: move TTY_FLUSH* flags to tty_port
  TTY: n_tty, propagate n_tty_data
  TTY: move ldisc data from tty_struct: locks
  TTY: move ldisc data from tty_struct: read_* and echo_* and canon_* stuff
  TTY: move ldisc data from tty_struct: bitmaps
  TTY: move ldisc data from tty_struct: simple members
  TTY: n_tty, add ldisc data to n_tty
  TTY: audit, stop accessing tty->icount
  TTY: n_tty, remove bogus checks
  TTY: n_tty, simplify read_buf+echo_buf allocation
  TTY: hci_ldisc, remove invalid check in open
  TTY: ldisc, wait for idle ldisc in release
  ...
2012-11-05 10:09:12 -08:00
Alan Stern cdb2fac783 USB: EHCI: fix build error in ChipIdea host driver
This patch (as1629) fixes a build error in the ChipIdea host driver
when compiled for the ARM architecture.  The error was introduced
by commit 99f91934a9 (USB: EHCI: make
ehci-platform a separate driver).

The fix is simple; an additional header-file #include is needed.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-03 10:17:38 -07:00
Jan Beulich bc8d51ea7e fix build of EHCI debug port code when USB_CHIPIDEA but !USB_EHCI_HCD
Relax condition of building the reset interface stubs in
drivers/usb/early/ehci-dbgp.c from USB_EHCI_HCD to just USB, to also
cover the chipidea driver re-using code from ehci-hcd.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 10:13:33 -07:00
Alan Stern 09f6ffde2e USB: EHCI: fix build error by making ChipIdea host a normal EHCI driver
This patch (as1627) splits the ehci-hcd core code, which has become a
separate library module, out from the ChipIdea host driver.  Instead
of #include-ing ehci-hcd.c directly, the ChipIdea module will now use
the ehci-hcd library in a normal fashion.

This fixes a build error caused by commit
3e02320399 (USB: EHCI: prepare to make
ehci-hcd a library module); I had forgotten about the unorthodox way
the ChipIdea driver uses the ehci-hcd code.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 10:03:50 -07:00
Vincent Palatin 57465109ce USB: ohci-exynos: initialize registers pointer earlier
In the former code, we have a race condition between the first interrupt
and the regs field initilization in the usb_hcd structure.
If the OHCI irq fires before hcd->regs is set, we are getting a null
pointer dereference in ohci_irq.

When calling usb_add_hcd(), it first executes the reset() callback,
then enables the ohci interrupt, and finally executes the start()
callback. So moving the ohci_init() call which actually initializes the
reg field from start() to reset() should remove the race.

Tested by enabling the external HSIC hub in the bootloader on an exynos5
machine and booting. With the former code, this triggers an early interrupt
about 50% of the boots and a subsequent kernel panic in ohci_irq when trying
to access the registers.

Cc: Olof Johansson <olofj@chromium.org>
Cc: Doug Anderson <dianders@chromium.org>
Cc: Arjun.K.V <arjun.kv@samsung.com>
Cc: Vikas Sajjan <vikas.sajjan@samsung.com>
Cc: Abhilash Kesavan <a.kesavan@samsung.com>
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 09:25:20 -07:00
Alan Stern d1bb67a7a2 USB: EHCI: fix build error in ehci-platform.c under PowerPC
This patch (as1628) fixes a build error in the ehci-platform driver
when compiled for the PowerPC architecture.  The error was introduced
by commit 99f91934a9 (USB: EHCI: make
ehci-platform a separate driver).

The fix is simple; a few additional header-file #includes are needed.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 09:24:15 -07:00
Alan Stern 99f91934a9 USB: EHCI: make ehci-platform a separate driver
This patch (as1626) splits the ehci-platform code from ehci-hcd out
into its own separate driver module.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-01 08:51:13 -07:00
Alan Stern adfa79d1c0 USB: EHCI: make ehci-pci a separate driver
This patch (as1625) splits the PCI portion of ehci-hcd out into its
own separate driver module, called ehci-pci.  Consistently with the
current practice, the decision whether to build this module is not
user-configurable.  If EHCI and PCI are enabled then the module will
be built, always.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-01 08:51:12 -07:00
Alan Stern 3e02320399 USB: EHCI: prepare to make ehci-hcd a library module
This patch (as1624) prepares ehci-hcd for being split up into a core
library and separate platform driver modules.  A generic
ehci_hc_driver structure is created, containing all the "standard"
values, and a new mechanism is added whereby a driver module can
specify a set of overrides to those values.  In addition the
ehci_setup(), ehci_suspend(), and ehci_resume() routines need to be
EXPORTed for use by the drivers.

As a side effect of this change, a few routines no longer need to be
marked __maybe_unused.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-01 08:51:12 -07:00
Sebastian Andrzej Siewior 2f77116425 usb: musb: remove hand-crafted id handling
This replaced the handcrafted id handling by the PLATFORM_DEVID_AUTO
value which should do the same thing.

This patch probably also fixes ux500 because I did not find the "musbid"
variable to remove. And we close a tiny-unlikely race window becuase the
old code gave the id back before device was destroyed in the remove
case.

[ balbi@ti.com : fixed up two failed hunks when applying patch ]

Cc: B, Ravi <ravibabu@ti.com>
Cc: Santhapuri, Damodar <damodar.santhapuri@ti.com>
Cc: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Cc: Bob Liu <lliubbo@gmail.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-01 12:32:23 +02:00
Kuninori Morimoto 1789e52acc usb: phy: add R-Car USB phy driver
This patch adds Renesas R-Car USB phy driver.
It supports R8A7779 chip at this point.

R-Car has some USB controllers, but has only one phy-initializer.
So, this driver is counting users.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-01 12:17:53 +02:00
Bjørn Mork 7c83b44836 USB: option: idVendor and idProduct are __le16
The exception is needed on big endian systems too.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-31 12:58:12 -07:00
Bjørn Mork dbdf680703 USB: option: replace vendor probe rule with match flags
No need for a vendor specific probe exception just to
match on the interface class.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-31 12:58:12 -07:00
Bjørn Mork 1b95bee563 USB: option: never bind to a usb-storage interface
There are many modems in addition to the D-Link DWM 652
exposing the CD interface in modem mode, and some expose
an integrated card reader as well. Always ignore these
interfaces.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-31 12:58:11 -07:00
Alan Stern c73cee717e USB: EHCI: remove ehci_port_power() routine
This patch (as1623) removes the ehci_port_power() routine and all the
places that call it.  There's no reason for ehci-hcd to change the
port power settings; the hub driver takes care of all that stuff.

There is one exception: When the controller is resumed from
hibernation or following a loss of power, the ports that are supposed
to be handed over to a companion controller must be powered on first.
Otherwise the handover won't work.  This process is not visible to the
hub driver, so it has to be handled in ehci-hcd.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-31 12:48:07 -07:00
Alan Stern 4968f95191 USB: EHCI: remove unused Link Power Management code
This patch (as1622) removes the USB-2.1 Link Power Management code
from the ehci-hcd driver.  This code was never integrated with
usbcore, it is full of bugs, and it was not getting used by anybody.

However, the debugging code for dumping the LPM-related fields in the
EHCI registers is left in place.  In theory it might be useful to see
these values, even though we don't use them.

This essentially amounts to a partial revert of commit
aa4d834298 (USB: EHCI: EHCI 1.1
addendum: preparation) and an almost full revert of commit
48f2497014 (USB: EHCI: EHCI 1.1
addendum: Basic LPM feature support) plus its follow-ons.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-31 12:48:07 -07:00
Alan Stern 571e41214e USB: remove iteration limit in hub_tt_work()
This patch (as1621) removes the limit on the number of loops allowed
in hub_tt_work().  The value is arbitrary, and it's silly to have a
limit in the first place -- anything beyond the limit would not get
handled.

Besides, it's most unlikely that we'll ever need to clear more than a
couple of TT buffers at any time.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-31 12:48:07 -07:00
Johan Hovold bcbec053d2 USB: serial: remove driver version information
Remove all MODULE_VERSION macros and driver-version information (except
for garmin_gps which uses it in a status reply).

It is the kernel version that matters and not some private version
scheme which rarely even gets updated.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-31 12:48:06 -07:00
Sebastian Andrzej Siewior b18d26f6ad usb: musb: Perform only write access on MUSB_INTRTXE
This is part of the workaround for AM35x advisory Advisory 1.1.20.
The advisory says that the IPSS bridge can't handle 8 & 16 bit read
access. An 16bit read access to MUSB_INTRTXE results in an 32bit read
access which also reads INTRRX and therefore may lose interrupts.
This patch uses a shadow register of MUSB_INTRTXE so we only perform
write access to it.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:22:18 +02:00
Sebastian Andrzej Siewior af5ec14d40 usb: musb: Perform only write access on MUSB_INTRRXE
This is part of the workaround for AM35x advisory Advisory 1.1.20.
The advisory says that the IPSS bridge can't handle 8 & 16 bit read
access. An 16bit read access to MUSB_INTRRXE results in an 32bit read
access which also reads INTRUSB and therefore may lose interrupts.
This patch uses a shadow register of MUSB_INTRRXE so we only perform
write access to it.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:22:03 +02:00
Sebastian Andrzej Siewior 515ba29cd7 usb: musb: avoid FADDR read access
This is part of the workaround for AM35x advisory Advisory 1.1.20.
The advisory says that the IPSS bridge can't handle 8 & 16 bit read
access. An 8bit read access to FADDR results in an 32bit read
access which also reads INTRTX and therefore may lose interrupts.
This patch removes any reads to FADDR as they are not really required.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:21:01 +02:00
Sebastian Andrzej Siewior b11e94d037 usb: musb: read MUSB_POWER register only when required.
This is part of the workaround for AM35x advisory Advisory 1.1.20.
The advisory says that the IPSS bridge can't handle 8 & 16 bit read
access. An 8bit read access to MUSB_POWER results in an 32bit read
access which also reads INTRTX and therefore may lose interrupts.
This patch tries to minimize reads to MUSB_POWER and perform them only
when required.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:20:40 +02:00
Sebastian Andrzej Siewior 124dafde8f usb: dwc3: remove custom unique id handling
The lockless implementation of the unique id is quite impressive (:P)
but dirver's core can handle it, we can remove it and make our code a
little smaller.

Cc: Anton Tikhomirov <av.tikhomirov@samsung.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:18:52 +02:00
Sebastian Andrzej Siewior b100a2f34d usb: gadget: dummy_hcd: remove global the_controller variable
The one thing that makes two UDCs+HCDs impossible is the global
the_controller variable. This patch changes this. After device
allocation we allocate the "the_controller" variable and pass it as
platform_data to the UDC and its companion.
We can have now multiple instances dummy hcd and therefore I change the
limit from one to two. I was able to test this with g_ncm adn g_zero:

|# lsusb
|Bus 001 Device 002: ID 0525:a4a0 Netchip Technology, Inc. Linux-USB "Gadget Zero"
|Bus 002 Device 002: ID 0525:a4a1 Netchip Technology, Inc. Linux-USB Ethernet Gadget
|Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
|Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I was able to start testusb -a and ifconfig usb[01] up with no complains.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:18:01 +02:00
Sebastian Andrzej Siewior c7a1db457b usb: gadget: dummy_hcd: add setup / cleanup of multiple HW intances
This patch creates & adds multiple instances of the HCD and UDC. We have
a new module option "num" which says how many emulated UDCs + HCDs we
want. The default value is one and currently the maximum is one as well.
This will change soon.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:17:07 +02:00
Sebastian Andrzej Siewior b2113136a5 usb: gadget: dummy_hdc: prepare for multiple instances
This patch replaces the single pdev variable by an array. One change:
The device id is no longer -1 (i.e. none) but 0.
This is prepation work for multiple instances of the dummy_hcd + udc
which should help to test gadget framework with multiple UDCs.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:16:47 +02:00
Sebastian Andrzej Siewior 1616e99d42 usb: gadget: let f_* use usb_string_ids_tab() where it makes sense
Instead of calling usb_string_id() multiple times I replace it with one
usb_string_ids_tab(). The NULL pointer in struct usb_string with "" and
are not overwritten in fail or unbind case.

The conditional assignment remains because some gadgets recycle the string
ID because the same descriptor (and string ID) is used if we have more
than one config descriptor.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:11:47 +02:00
Sebastian Andrzej Siewior b36c347966 usb: gadget: uac2: use the strings directly
There is no need for this variable in between.

Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:10:37 +02:00
Sebastian Andrzej Siewior 4ce63571d6 usb: gadget: uac2: provide a variable for interface and alt settings
This patch removes the shifting and masking of interface and its alt
setting and provides its own variable.

This looks better and is smaller:
 text    data     bss     dec     hex filename
x86-32
 6940     956      56    7952    1f10 gadget/audio.o.old
 6908     956      56    7920    1ef0 gadget/audio.o.new
arm
 7914     956      56    8926    22de gadget/audio.o.old
 7886     956      56    8898    22c2 gadget/audio.o.new

Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:10:25 +02:00
Sebastian Andrzej Siewior b7c041aada usb: gadget: remove DMA_ADDR_INVALID from f_uac2 and gadgetfs
DMA_ADDR_INVALID is used by the UDC driver and the gadgets should
provide only a buffer address. Everything else should be taken core of
by the UDC and udc-core.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:10:06 +02:00
Sebastian Andrzej Siewior 10287baec7 usb: gadget: always update HS/SS descriptors and create a copy of them
HS and SS descriptors are staticaly created. They are updated during the
bind process with the endpoint address, string id or interface numbers.

After that, the descriptor chain is linked to struct usb_function which
is used by composite in order to serve the GET_DESCRIPTOR requests,
number of available configs and so on.

There is no need to assign the HS descriptor only if the UDC supports
HS speed because composite won't report those to the host if HS support
has not been reached. The same reasoning is valid for SS.

This patch makes sure each function updates HS/SS descriptors
unconditionally and uses the newly introduced helper function to create a
copy the descriptors for the speed which is supported by the UDC.

While at that, also rename f->descriptors to f->fs_descriptors in order
to make it more explicit what that means.

Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:09:44 +02:00
Sebastian Andrzej Siewior 0f9df93938 usb: gadget: uvc: fix error path in uvc_function_bind()
The "video->minor = -1" assigment is done in V4L2 by
video_register_device() so it is removed here.
Now. uvc_function_bind() calls in error case uvc_function_unbind() for
cleanup. The problem is that uvc_function_unbind() frees the uvc struct
and uvc_bind_config() does as well in error case of usb_add_function().
Removing kfree() in usb_add_function() would make the patch smaller but
it would look odd because the new allocated memory is not cleaned up.
However it is not guaranteed that if we call usb_add_function() we also
get to the bind function.
Therefore the patch extracts the conditional cleanup from
uvc_function_unbind() applies to uvc_function_bind().
uvc_function_unbind() now contains only the complete cleanup which is
required once everything has been registrated.

Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Bhupesh Sharma <bhupesh.sharma@st.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:07:00 +02:00
Sebastian Andrzej Siewior d0eca719dd usb: gadget: phonet: free requests in pn_bind()'s error path
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:05:55 +02:00
Sebastian Andrzej Siewior 7f2a9268b4 usb: gadget: midi: make FS and HS available
This function works only on FS or HS. If the gadget is HS capable only
HS descriptors are assigned. If we plug it to an 1.1 host it won't work
because we have only 2.0 descriptors. This patch changes the behavior to
provide both sets.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:05:37 +02:00
Sebastian Andrzej Siewior d185039f79 usb: gadget: midi: free hs descriptors
The HS descriptors are only created if HS is supported by the UDC but we
never free them.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:05:20 +02:00
Sebastian Andrzej Siewior 1377af2f75 usb: gadget: audio: remove c->highpseed = true from f_midi and uac1
Whether highspeed configuration is valid or not is something that
composite decides and not the gadget. That gadget can only provide the
required descriptors for it.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:05:00 +02:00
Sebastian Andrzej Siewior e79cc615a9 usb: gadget: network: fix bind() error path
I think this is wrong since 72c973dd ("usb: gadget: add
usb_endpoint_descriptor to struct usb_ep"). If we fail to allocate an ep
or bail out early we shouldn't check for the descriptor which is
assigned at ep_enable() time.

Cc: Tatyana Brokhman <tlinder@codeaurora.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:04:24 +02:00
Sebastian Andrzej Siewior 391aa852a3 usb: gadget: uac2: add some error recovery in afunc_bind()
In case something goes wrong here, don't leak memory / endpoints.

Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:03:27 +02:00
Sebastian Andrzej Siewior 64dce91445 usb: gadget storage: use a computation macro for INT endpoint interval
The 9 for HS means 32ms. Use the macro to make it easier to read.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:02:58 +02:00
Sebastian Andrzej Siewior bcb2f99c6c usb: gadget: use a computation macro for INT endpoint interval
The 5+4 magic for HS tries to aim 32ms which is also what is intended
with 1 << 5 for FS. This little macro should make this easier to
understand.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:01:15 +02:00
Sebastian Andrzej Siewior fad8deb274 usb: gadget: tcm_usb_gadget: NULL terminate the FS descriptor list
The descriptor list for FS speed was not NULL terminated. This patch
fixes this.

While here one of the twe two bAlternateSetting assignments for the BOT
interface. Both assign 0, one is enough.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 15:00:03 +02:00
Sebastian Andrzej Siewior 585e3931b9 usb: gadget: ecm: Add IAD descriptor in SS mode
Commit d11519 ("usb: gadget: Add Interface Association Descriptor to
ECM") added the IAD descriptor to FS and HS descriptors. The SS
descriptor has been left out probably because it has been added "just
recently".

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 14:59:27 +02:00
Kuninori Morimoto 87c2905fd8 usb: renesas_usbhs: add DMAEngine support on mod_host
This patch enabled dma mapping, and used dma transfer handler
on mod_host

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 14:50:29 +02:00
Kuninori Morimoto 3192fcb234 usb: renesas_usbhs: fixup unreadable macro
mod.h has irq_bempsts/irq_brdysts to keep each irq status,
but it was difficult to find where they were used
on renesas_usbhs driver by using "grep irq_xxxx" command,
since it used irq_##status macro.
This patch fixup them

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 14:50:25 +02:00
Kuninori Morimoto 797b4e145c usb: renesas_usbhs: use devm_request_irq()
This patch uses devm_request_irq() instead of request_irq(),
and removed free_irq() from driver

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31 14:50:16 +02:00
Jingoo Han 806df3ac2a USB: ums_realtek: fix build warning
When rts51x_read_status() returns USB_STOR_TRANSPORT_ERROR,
an error happens. This patch fixes build warning as below:

drivers/usb/storage/realtek_cr.c: In function 'init_realtek_cr':
drivers/usb/storage/realtek_cr.c:476:33: warning: 'buf[15]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[15]' was declared here
drivers/usb/storage/realtek_cr.c:475:33: warning: 'buf[14]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[14]' was declared here
drivers/usb/storage/realtek_cr.c:474:50: warning: 'buf[13]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[13]' was declared here
drivers/usb/storage/realtek_cr.c:472:30: warning: 'buf[12]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[12]' was declared here
drivers/usb/storage/realtek_cr.c:471:31: warning: 'buf[11]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[11]' was declared here
drivers/usb/storage/realtek_cr.c:470:31: warning: 'buf[10]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[10]' was declared here
drivers/usb/storage/realtek_cr.c:469:30: warning: 'buf[9]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[9]' was declared here
drivers/usb/storage/realtek_cr.c:468:27: warning: 'buf[8]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[8]' was declared here
drivers/usb/storage/realtek_cr.c:468:43: warning: 'buf[7]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[7]' was declared here
drivers/usb/storage/realtek_cr.c:467:30: warning: 'buf[6]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[6]' was declared here
drivers/usb/storage/realtek_cr.c:466:30: warning: 'buf[5]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[5]' was declared here
drivers/usb/storage/realtek_cr.c:465:28: warning: 'buf[4]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[4]' was declared here
drivers/usb/storage/realtek_cr.c:464:24: warning: 'buf[3]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[3]' was declared here
drivers/usb/storage/realtek_cr.c:464:40: warning: 'buf[2]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[2]' was declared here
drivers/usb/storage/realtek_cr.c:463:24: warning: 'buf[1]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[1]' was declared here
drivers/usb/storage/realtek_cr.c:463:40: warning: 'buf[0]' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[0]' was declared here

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 13:22:22 -07:00
Johan Hovold 5fb0432e64 USB: ftdi_sio: use ftdi_get_modem_status in chars_in_buffer
Use ftdi_get_modem_status to check hardware buffers in chars_in_buffer.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 13:19:32 -07:00
Johan Hovold 8da636d9b5 USB: ftdi_sio: optimise chars_in_buffer
No need to check hardware buffers when we know that the software
buffers are non-empty.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 13:19:32 -07:00
Johan Hovold 755b6040fa USB: ftdi_sio: use generic chars_in_buffer
Use generic chars_in_buffer rather than copying it's implementation.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 13:19:32 -07:00
Johan Hovold 428d998855 USB: serial: export usb_serial_generic_chars_in_buffer
Export generic chars_in_buffer implementation so it can be used in
subdrivers in combination with checks of any hardware buffers.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 13:19:30 -07:00
Johan Hovold a4afff6b32 USB: ftdi_sio: refactor modem-control status retrieval
Refactor modem-control status retrieval.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 13:19:30 -07:00
Johan Hovold 2c2ee54507 USB: ftdi_sio: fix tiocmget and tiocmset return values
Make sure we do not return USB-internal error codes to userspace.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 13:19:30 -07:00
Johan Hovold fef0b828a3 USB: ftdi_sio: fix tiocmget indentation
Align the modem-control status operands as was originally indented.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 13:19:30 -07:00
Johan Hovold 81e84424f9 USB: ftdi_sio: remove unused private port-data
Remove unused port field from private port data.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 13:19:30 -07:00
Jan Beulich 86effe5980 USB: fix build with XEN and EARLY_PRINTK_DBGP enabled but USB_SUPPORT disabled
Since there's no possible caller of dbgp_external_startup() and
dbgp_reset_prep() when !USB_EHCI_HCD, there's no point in building and
exporting these functions in that case. This eliminates a build error
under the conditions listed in the subject, introduced with the merge
f1c6872e49.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 13:19:30 -07:00
Johan Hovold d067a31553 USB: ftdi_sio: remove unnecessary memset
No need to memset a kzalloced struct.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 13:06:08 -07:00
Johan Hovold 4f2ab88874 USB: cp210x: fix whitespace issues
Fix missing and superfluous whitespace.
Fix misplaced brackets.
Fix indentation.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 13:06:08 -07:00
Jingoo Han 487c151a4a USB: iuu_phoenix: replace strict_strtoul() with kstrtoul()
The usage of strict_strtoul() is not preferred, because
strict_strtoul() is obsolete. Thus, kstrtoul() should be
used.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 13:06:08 -07:00
Jan Beulich d99e65bda8 USB: fix build with XEN and EARLY_PRINTK_DBGP enabled but USB_SUPPORT disabled
Since there's no possible caller of dbgp_external_startup() and
dbgp_reset_prep() when !USB_EHCI_HCD, there's no point in building and
exporting these functions in that case. This eliminates a build error
under the conditions listed in the subject, introduced with the merge
f1c6872e49.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 13:05:14 -07:00
Johan Hovold 8e493ca176 USB: usb_wwan: fix bulk-urb allocation
Make sure we do not allocate urbs if we do not have a bulk endpoint.

Legacy code used incorrect assumption to test for bulk endpoints.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 12:46:51 -07:00
Joe Perches f2ec522e78 usb: Convert dev_printk(KERN_<LEVEL> to dev_<level>(
dev_<level> calls take less code than dev_printk(KERN_<LEVEL>
and reducing object size is good.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 12:32:03 -07:00
Greg Kroah-Hartman 169b245a72 usb: fixes for v3.7-rc4
We're reverting MUSB Mode 1 DMA patch which caused many regressions. Meanwhile
 Roger is cooking a better version of that patch, which will hopefully be ready
 for v3.8 merge window.
 
 We also fix an undeclared error in ux5000_remove() and another build error
 when we try to build USB_MUSB_OMAP2PLUS as a module.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQj8prAAoJEIaOsuA1yqREHq8P/RYhQkCXdn9VqhhZGJwRWNve
 b46rNsWw0qWsGefi4yTRxzLSFpASI9dH+BMs8eC7DA5JrwbRlQsL8SeY41pxclyz
 yH/hFxsUen2oUMkoFQ6Ydm04VP0YDOplQ62HSIjtTYcE2eUqPKtxkXlZpIy80HD/
 9QI/R4bJNOR6LqtZSXOK3ySUkSiTCwxtrJh4bGIgxYaVxwXwuIoc2HTFVf3FkypD
 oT240npC+/xOUAFjs8a0b6AoAs6GEjePUvhX6J+cfdGIRylfro0/sEGfs4yt9dBi
 juKMje0h5VMtLHRUutBcEv2daDXd97htkYL2Qh/MaUIftJ5vCKtb+4/VjfZSainf
 +S5aLWfGgHxXc0+AscJbk45WOEBVEakL6IvuTScO2/wvxhwH+Ag9RHs6DeViGl27
 qU4i8MliF3zAeNt+ErDwLhMxslkbqekYUSVEgoAm7RQkqoW+VkAjSxVA0sBzhtVQ
 6PRF83WPgfLpUqbvuE8fA/qCCnGv8rpo66Ljd67BRZplUme5RVIMvsbvy9e9mBU4
 85Ujz3p8ouVAFRABHaYr/8aSKsdtF+lUQYdrthb5TMHbq2eW76xTWCZCRdjgOpsC
 kA/6I+h1rThA1VGlbyWUwYZSUSLrLWktCx/EZijI7IreVdpiLtWp3gd/YpKQbzq2
 ylZe/DoQMCND0wwT9sCE
 =caV/
 -----END PGP SIGNATURE-----

Merge tag 'fixes-for-v3.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus

usb: fixes for v3.7-rc4

We're reverting MUSB Mode 1 DMA patch which caused many regressions. Meanwhile
Roger is cooking a better version of that patch, which will hopefully be ready
for v3.8 merge window.

We also fix an undeclared error in ux5000_remove() and another build error
when we try to build USB_MUSB_OMAP2PLUS as a module.
2012-10-30 09:38:55 -07:00
Roger Quadros f6bc8c2938 usb: otg: Fix build errors if USB_MUSB_OMAP2PLUS is selected as module
TWL4030_USB & TWL6030_USB must depend on USB_MUSB_OMAP2PLUS in Kconfig else
we get build errors with

CONFIG_USB_MUSB_HDRC=m
CONFIG_USB_MUSB_OMAP2PLUS=m
CONFIG_TWL4030_USB=y
CONFIG_TWL6030_USB=y

LD      init/built-in.o
drivers/built-in.o: In function `twl4030_usb_irq':
drivers/usb/otg/twl4030-usb.c:518: undefined reference to `omap_musb_mailbox'
drivers/built-in.o: In function `twl4030_usb_phy_init':
drivers/usb/otg/twl4030-usb.c:540: undefined reference to `omap_musb_mailbox'

drivers/built-in.o: In function `twl6030_usb_irq':
drivers/usb/otg/twl6030-usb.c:230: undefined reference to `omap_musb_mailbox'
drivers/usb/otg/twl6030-usb.c:225: undefined reference to `omap_musb_mailbox'
drivers/built-in.o: In function `twl6030_usbotg_irq':
drivers/usb/otg/twl6030-usb.c:259: undefined reference to `omap_musb_mailbox'

CC: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-30 14:37:07 +02:00
Greg Kroah-Hartman b472b8e22f Merge 3.7-rc3 into usb-next.
This pulls in all of the USB changes in 3.7-rc3 into usb-next and
resolves the merge issue with:
	drivers/usb/misc/ezusb.c

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-29 09:04:39 -07:00
Wei Yongjun 9a65d162e4 usb: musb: ux500: fix 'musbid' undeclared error in ux500_remove()
commit 65b3d52d02
(usb: musb: add musb_ida for multi instance support)
used musbid in ux500_remove() but nerver declared it.

I found this in x86_64 platform, but not sure whether
this is a error on the correct ARCH.

$ make drivers/usb/musb/ux500.o
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `relocs'.
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  UPD     include/generated/utsrelease.h
  CALL    scripts/checksyscalls.sh
  CC      drivers/usb/musb/ux500.o
drivers/usb/musb/ux500.c: In function 'ux500_probe':
drivers/usb/musb/ux500.c:78:2: error: 'musbid' undeclared (first use in this function)
drivers/usb/musb/ux500.c:78:2: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [drivers/usb/musb/ux500.o] Error 1
make: *** [drivers/usb/musb/ux500.o] Error 2

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-26 11:11:21 +03:00
Wei Yongjun 4b0de6f383 usb: musb: ux500: use platform_device_unregister in ux500_remove()
platform_device_unregister() only calls platform_device_del() and
platform_device_put(), thus use platform_device_unregister() to
simplify the code.

Also the documents in platform.c shows that platform_device_del
and platform_device_put must _only_ be externally called in error
cases.  All other usage is a bug.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-26 11:10:39 +03:00
Wei Yongjun a81a01f9fe usb: musb: tusb6010: use platform_device_unregister in tusb_remove()
platform_device_unregister() only calls platform_device_del() and
platform_device_put(), thus use platform_device_unregister() to
simplify the code.

Also the documents in platform.c shows that platform_device_del
and platform_device_put must _only_ be externally called in error
cases.  All other usage is a bug.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-26 11:10:33 +03:00
Wei Yongjun b415c8fa9e usb: musb: dsps: use platform_device_unregister in dsps_delete_musb_pdev()
platform_device_unregister() only calls platform_device_del() and
platform_device_put(), thus use platform_device_unregister() to
simplify the code.

Also the documents in platform.c shows that platform_device_del
and platform_device_put must _only_ be externally called in error
cases.  All other usage is a bug.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-26 11:10:22 +03:00
Wei Yongjun 12a71f5b1c usb: musb: davinci: use platform_device_unregister in davinci_remove()
platform_device_unregister() only calls platform_device_del() and
platform_device_put(), thus use platform_device_unregister() to
simplify the code.

Also the documents in platform.c shows that platform_device_del
and platform_device_put must _only_ be externally called in error
cases.  All other usage is a bug.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-26 11:09:53 +03:00
Wei Yongjun b59e906c57 usb: musb: da8xx: use platform_device_unregister in da8xx_remove()
platform_device_unregister() only calls platform_device_del() and
platform_device_put(), thus use platform_device_unregister() to
simplify the code.

Also the documents in platform.c shows that platform_device_del
and platform_device_put must _only_ be externally called in error
cases.  All other usage is a bug.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-26 11:09:46 +03:00
Wei Yongjun 01e40da08c usb: musb: blackfin: use platform_device_unregister in bfin_remove()
platform_device_unregister() only calls platform_device_del() and
platform_device_put(), thus use platform_device_unregister() to
simplify the code.

Also the documents in platform.c shows that platform_device_del
and platform_device_put must _only_ be externally called in error
cases.  All other usage is a bug.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-26 11:09:36 +03:00
Wei Yongjun 5629151531 usb: musb: am35x: use platform_device_unregister in am35x_remove()
platform_device_unregister() only calls platform_device_del() and
platform_device_put(), thus use platform_device_unregister() to
simplify the code.

Also the documents in platform.c shows that platform_device_del
and platform_device_put must _only_ be externally called in error
cases.  All other usage is a bug.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-26 11:09:04 +03:00
Felipe Balbi 00a89180e5 Revert "usb: musb: use DMA mode 1 whenever possible"
This reverts commit 4f3e8d263d.

it turns out that current implementation of Mode 1
DMA added a few regressions to some users, so we
need to revert this patch and let author work on
a better version of Mode 1 DMA support.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-26 09:55:31 +03:00
Sarah Sharp df0379065b xhci: trivial: Remove assigned but unused ep_ctx.
Remove the variable ep_ctx from xhci_add_endpoint(), since it is
assigned but unused.  Caught by Coverity.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2012-10-25 13:13:48 -07:00
Sarah Sharp 7e5f77f9bc xhci: trivial: Remove assigned but unused slot_ctx.
Remove the variable slot_ctx from xhci_dbg_ctx(), since it is assigned
but unused.  Caught by Coverity.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2012-10-25 13:13:48 -07:00
Sarah Sharp b80313422a xhci: Fix missing break in xhci_evaluate_context_result.
Coverity complains that xhci_evaluate_context_result() is missing a
break statement after the COMP_EBADSLT switch case.  It's not a big
deal, since we wanted to return the same error code as the case
statement below it does.  The end result would be one that a Slot
Disabled error completion code would also print the warning message
associated with a Context State error code.  No other bad behavior would
result.

It's not worth backporting to stable kernels, since it only fixes an
issue with too much debugging.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2012-10-25 13:13:48 -07:00
Sarah Sharp 43a09f7fb0 xhci: Fix potential NULL ptr deref in command cancellation.
The command cancellation code doesn't check whether find_trb_seg()
couldn't find the segment that contains the TRB to be canceled.  This
could cause a NULL pointer deference later in the function when next_trb
is called.  It's unlikely to happen unless something is wrong with the
command ring pointers, so add some debugging in case it happens.

This patch should be backported to stable kernels as old as 3.0, that
contain the commit b63f4053cc "xHCI:
handle command after aborting the command ring".

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@vger.kernel.org
2012-10-25 13:13:47 -07:00
Nobuhiro Iwamatsu d124a60dbb USB: isp1760-if: Change to use irq_of_parse_and_map
This uses irq_of_parse_and_map instead of of_irq_map_one and
irq_create_of_mapping.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 11:51:52 -07:00
Ming Lei 596d789a21 USB: set hub's default autosuspend delay as 0
This patch sets hub device's default autosuspend delay as 0 to
speedup bus suspend, see comments in code for details.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 11:45:32 -07:00
Ming Lei e6f30deafe USB: check port changes before hub runtime suspend for some bug device
The hub status endpoint has a long 'bInterval', which is 255ms
for FS/LS device and 256ms for HS device according to USB 2.0 spec,
so the device connection change may be reported later more than 255ms
via status pipe.

The connection change in hub may have been happened already on the
downstream ports, but no status URB completes when it is killed
in hub_suspend(auto), so the connection change may be missed by some
buggy hub devices, which won't generate remote wakeup signal after
their remote wakeup is enabled and they are put into suspend state.

The problem can be observed at least on the below Genesys Logic, Inc.
hub devices:

	0x05e3,0x0606
	0x05e3,0x0608

In theory, there is no way to fix the problem completely, but we
can make it less likely to occur by this patch.

This patch introduces one quirk of HUB_QUIRK_CHECK_PORTS_AUTOSUSPEND
to check ports' change during hub_suspend(auto) for the buggy
devices. If ports' change is found, terminate the auto suspend and
return to working state.

So for the buggy hubs, if the connection change happend before
the ports' check, it can be handled correctly. If it happens between
the ports' check and enabling remote wakeup/entering suspend, it
will be missed. Considered the interval is quite short, it is very
less likely to happen during the window.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 11:45:32 -07:00
Anisse Astier 8daf8b6086 ehci: Add yet-another Lucid nohandoff pci quirk
Board name changed on another shipping Lucid tablet.

Signed-off-by: Anisse Astier <anisse@astier.eu>
Cc: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 11:43:44 -07:00
Anisse Astier c323dc023b ehci: fix Lucid nohandoff pci quirk to be more generic with BIOS versions
BIOS vendors keep changing the BIOS versions. Only match the beginning
of the string to match all Lucid tablets with board name M11JB.

Signed-off-by: Anisse Astier <anisse@astier.eu>
Cc: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 11:43:44 -07:00
Johan Hovold ae685effe7 USB: mos7840: fix port_probe flow
Remove temporary do-while(0) loop used to keep changes minimal.

Fixup indentation, remove some line breaks, and replace break with goto
to maintain flow.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 11:11:19 -07:00
Johan Hovold 80c00750f0 USB: mos7840: fix port-data memory leak
Fix port-data memory leak by moving port data allocation and
deallocation to port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Note that the indentation was kept intact using a do-while(0) in order
to facilitate review. A follow-up patch will remove it.

Compile-only tested.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 11:11:19 -07:00
Johan Hovold e681b66f2e USB: mos7840: remove invalid disconnect handling
Remove private zombie flag used to signal disconnect and to prevent
control urb from being submitted from interrupt urb completion handler.

The control urb will not be re-submitted as both the control urb and the
interrupt urb is killed on disconnect.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 11:11:19 -07:00
Johan Hovold 28c3ae9a8c USB: mos7840: remove NULL-urb submission
The private int_urb is never allocated so the submission from the
control completion handler will always fail. Remove this odd piece of
broken code.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 11:11:19 -07:00
Jarkko Huijts 6f602912c9 usb: serial: ftdi_sio: Add missing chars_in_buffer function
The driver does not wait until the hardware buffer (for data from the PC to the
UART line) is drained when tcdrain or close is called in an application.
Solution: Implement a chars_in_buffer function that checks both the software
and hardware buffer. If the TEMT (TX empty) bit of the line status register
indicates the hw buffer is not empty, let the function return at least 1. This
has been verified to work correctly with an FT232RL. The check on the hw buffer
can not be done for the original SIO device.

Signed-off-by: Jarkko Huijts <jarkko.huijts@gmail.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:42:26 -07:00
Johan Hovold 961be09e1e USB: qcserial: fix interface-data memory leak in error path
Move interface data allocation to attach so that it is deallocated
should usb-serial probe fail.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:39:38 -07:00
Johan Hovold c2dd4a8eac USB: option: fix interface-data memory leak in error path
Move interface data allocation to attach so that it is deallocated
should usb-serial probe fail.

Note that the usb device id is stored at probe so that it can be used
in attach to determine send-setup blacklisting.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:39:37 -07:00
Johan Hovold a997448c89 USB: ipw: fix interface-data memory leak in error path
Move interface data allocation to attach so that it is deallocated
should usb-serial probe fail.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:39:37 -07:00
Johan Hovold 3eb55cc4ed USB: mos7840: fix port-device leak in error path
The driver set the usb-serial port pointers to NULL on errors in attach,
effectively preventing usb-serial core from decrementing the port ref
counters and releasing the port devices and associated data.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:38:06 -07:00
Johan Hovold 65a4cdbb17 USB: mos7840: fix urb leak at release
Make sure control urb is freed at release.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:38:06 -07:00
Johan Hovold f525c05bab USB: sierra: fix port-data memory leak
Fix port-data memory leak by moving port data allocation and
deallocation to port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Note also that urb-count for multi-port interfaces has not been changed
even though the usb-serial port number is now determined from the port
and interface minor numbers.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:37:13 -07:00
Johan Hovold 084817d793 USB: sierra: fix memory leak in probe error path
Move interface data allocation to attach so that it is deallocated on
errors in usb-serial probe.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:37:13 -07:00
Johan Hovold 7e41f9bcdd USB: sierra: fix memory leak in attach error path
Make sure port private data is deallocated on errors in attach.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:37:13 -07:00
Johan Hovold b8f0e82044 USB: usb-wwan: fix multiple memory leaks in error paths
Fix port-data memory leak in usb-serial probe error path by moving port
data allocation to port_probe.

Since commit a1028f0abf ("usb: usb_wwan: replace release and disconnect
with a port_remove hook") port data is deallocated in port_remove. This
leaves a possibility for memory leaks if usb-serial probe fails after
attach but before the port in question has been successfully registered.

Note that this patch also fixes two additional memory leaks in the error
path of attach should port initialisation fail for any port as the urbs
were never freed and neither was the data of any of the successfully
initialised ports.

Compile-only tested.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:37:13 -07:00
Johan Hovold f79b2d0fe8 USB: keyspan: fix NULL-pointer dereferences and memory leaks
Fix NULL-pointer dereference at release by moving port data allocation
and deallocation to port_probe and port_remove.

Fix NULL-pointer dereference at disconnect by stopping port urbs at
port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer accessible at
disconnect or release.

Note that this patch also fixes port and interface-data memory leaks in
the error path of attach should port initialisation fail for any port.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:37:13 -07:00
Johan Hovold 5260e458f5 USB: mct_u232: fix broken close
Make sure generic close is called at close.

The driver relies on the generic write implementation but did not call
generic close.

Note that the call to kill the read urb is not redundant, as mct_u232
uses an interrupt urb from the second port as the read urb and that
generic close therefore fails to kill it.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:37:09 -07:00
Johan Hovold a8f2ae7a3a USB: mct_u232: fix port-data memory leak
Fix port-data memory leak by moving port data allocation and
deallocation to port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Note that the write waitqueue was initialised but never used.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:37:04 -07:00
Johan Hovold acbf0e5263 USB: opticon: fix memory leak in error path
Fix memory leak in write error path.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:36:59 -07:00
Johan Hovold ea0dbebffe USB: opticon: fix DMA from stack
Make sure to allocate the control-message buffer dynamically as some
platforms cannot do DMA from stack.

Note that only the first byte of the old buffer was used.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:36:59 -07:00
Johan Hovold 2f0295adf6 USB: quatech2: fix io after disconnect
Make sure no control urb is submitted during close after a disconnect by
checking the disconnected flag.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:36:58 -07:00
Johan Hovold 8e512ab0b6 USB: quatech2: fix close and disconnect urb handling
Kill urbs unconditionally at close and disconnect.

Note that URB status is not valid outside of completion handler.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:36:58 -07:00
Johan Hovold 40d0473849 USB: quatech2: fix port-data memory leaks
Fix port-data memory leak by moving port data allocation and
deallocation to port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Note that this also fixes memory leaks in the error path of attach where
the write urbs were not freed on errors.

Make sure all interface-data deallocation is done in release by moving
the read urb deallocation from disconnect.

Note that the write urb is killed during close so that the call in
disconnect was superfluous.

Compile-only tested.

Cc: Bill Pemberton <wfp5p@virginia.edu>
Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:36:58 -07:00
Johan Hovold b8a0055050 USB: quatech2: fix memory leak in error path
Fix memory leak in attach error path where the read urb was never freed.

Cc: Bill Pemberton <wfp5p@virginia.edu>
Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:36:58 -07:00
Johan Hovold feffa7ca60 USB: omninet: fix port-data memory leak
Fix port-data memory leak by replacing attach and release with
port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:36:58 -07:00
Johan Hovold 4230af572f USB: mos7720: fix port-data memory leak
Fix port-data memory leak by moving port data allocation and
deallocation to port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Note that this patch also fixes a second port-data memory leak in the
error path of attach, should parallel-port initialisation fail.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:36:58 -07:00
Johan Hovold fb44ff854e USB: digi_acceleport: fix port-data memory leak
Fix port-data memory leak by moving port data allocation and
deallocation to port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Note that the oob port is never registered as a port device and should
thus be handled in attach and release.

Compile-only tested.

Cc: Peter Berger <pberger@brimson.com>
Cc: Al Borchers <alborchers@steinerpoint.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:36:57 -07:00
Johan Hovold 456c5be56e USB: ch341: fix port-data memory leak
Fix port-data memory leak by moving port data allocation to port_probe
and actually implementing deallocation.

Note that this driver has never even bothered to try to deallocate it's
port data...

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:36:57 -07:00
Johan Hovold c467206ed6 USB: whiteheat: fix port-data memory leak
Fix port-data memory leak by moving port data allocation and
deallocation to port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Note that the fifth port (command port) is never registered as a
port device and thus should be handled in attach and release.

Compile-only tested.

Cc: <support@connecttech.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:36:57 -07:00
Johan Hovold c129197c99 USB: whiteheat: fix memory leak in error path
Make sure command buffer is deallocated in case of errors during attach.

Cc: <support@connecttech.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:36:57 -07:00
Johan Hovold 2ee44fbeac USB: metro-usb: fix io after disconnect
Make sure no control urb is submitted during close after a disconnect by
checking the disconnected flag.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:36:57 -07:00
Johan Hovold 50dde8686e USB: metro-usb: fix port-data memory leak
Fix port-data memory leak by moving port data allocation and
deallocation to port_probe and port_remove.

Since commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Note that the call to metrousb_clean (close) in shutdown was redundant.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25 09:36:57 -07:00
Tony Lindgren 6d02643d64 Merge branch 'omap-for-v3.8/cleanup-headers-usb' into omap-for-v3.8/cleanup-headers
Conflicts:
	arch/arm/mach-omap1/clock.c
	arch/arm/mach-omap2/board-2430sdp.c
	arch/arm/mach-omap2/board-4430sdp.c
	arch/arm/mach-omap2/board-cm-t35.c
	arch/arm/mach-omap2/board-igep0020.c
	arch/arm/mach-omap2/board-ldp.c
	arch/arm/mach-omap2/board-omap3beagle.c
	arch/arm/mach-omap2/board-omap3logic.c
	arch/arm/mach-omap2/board-omap4panda.c
	arch/arm/mach-omap2/board-overo.c
	arch/arm/mach-omap2/board-rm680.c
	arch/arm/mach-omap2/board-rx51.c
	arch/arm/mach-omap2/twl-common.c
	arch/arm/mach-omap2/usb-host.c
	arch/arm/mach-omap2/usb-musb.c
2012-10-24 15:05:45 -07:00
Michael Shigorin d7870af7e2 usb-storage: add unusual_devs entry for Casio EX-N1 digital camera
This commit sets removable subclass for Casio EX-N1 digital camera.

The patch has been tested within an ALT Linux kernel:
http://git.altlinux.org/people/led/packages/?p=kernel-image-3.0.git;a=commitdiff;h=c0fd891836e89fe0c93a4d536a59216d90e4e3e7

See also https://bugzilla.kernel.org/show_bug.cgi?id=49221

Signed-off-by: Oleksandr Chumachenko <ledest@gmail.com>
Signed-off-by: Michael Shigorin <mike@osdn.org.ua>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24 15:00:11 -07:00
Justin P. Mattock bd066eef1a usb: "ehci-w90x900" Fix a typo and add some whitespace.
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24 14:51:22 -07:00
Alan Stern bfd1e91013 USB: speed up usb_bus_resume()
This patch (as1620) speeds up USB root-hub resumes in the common case
where every enabled port has its suspend feature set (which currently
will be true for every runtime resume of the root hub).  If all the
enabled ports are suspended then resuming the root hub won't resume
any of the downstream devices.  In this case there's no need for a
Resume Recovery delay, because that delay is meant to give devices a
chance to get ready for active use.

To keep track of the port suspend features, the patch adds a
"port_is_suspended" flag to struct usb_device.  This has to be tracked
separately from the device's state; it's entirely possible for a USB-2
device to be suspended while the suspend feature on its parent port is
clear.  The reason is that devices will go into suspend whenever their
parent hub does.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reviewed-by: Peter Chen <peter.chen@freescale.com>
Tested-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24 14:51:22 -07:00