Commit Graph

4295 Commits

Author SHA1 Message Date
Matt Sealey
d2849443a0 usb: restrict mass storage ATA passthrough for several disk chassis/controllers (Launchpad #431963 etc.) 2011-10-24 09:42:54 -05:00
Matt Sealey
9ad9fdb991 CONFIG_USB_STATIC_IRAM fixes: actually make it build
* usb abi changes broke it
* FSL never added use_iram to urb struct ever so it never compiled in the first place
* cleanup memcpy usage so it's more readable (breaks 80 column limit but..)

Not enabled in any config. PROBABLY DOESN'T WORK. But at least it can be built and tested now.
2010-11-18 18:30:18 -06:00
Oliver Neukum
de45487165 USB: fix cdc-acm regression in open
cdc-acm needs to set a flag during open to tell the
tty layer that the device is initialized

Signed-off-by: Oliver Neukum <oliver@neukum.org>
Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Paul Martin <pm@debian.org>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-13 10:10:03 -06:00
Dinh Nguyen
193db12141 usb: Increase timeout value for device reset
It seems that for USB IP on Freescale MX5x processors, it needs >750
usec for the reset to complete. This change should not hurt any other
EHCI hardware.

Signed-off-by: Dinh Nguyen <Dinh.Nguyen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-03 13:26:25 -05:00
Hu hui
bf62e34178 ENGR00125521 USB: register/unregister gadget module cause system hang
In function of gadget unregister the phy will been put to lowpower
mode,however in function of gadget regisger the phy lowpower mode will
not been cleard when OTG pin detect enabled.

Signed-off-by: Huhui <b29976@freescale.com>
(cherry picked from commit 11dc51645fe5a196f53fb30369698b4cb4d1e296)
2010-08-10 11:52:08 -05:00
Peter Chen
2baee11d55 ENGR00125251 usb_gadget: should not read PORT Reset at reset_irq
1. At reset_irq, the status of port reset is unsure, maybe the reset
process(hardware does it) is finished, and the status of port reset
is also cleared by usb controller. So it only needs to compare to USBSTS
at usb irq process.

2. Due to mx35/mx25 phy's bug, it needs to reset phy when re-open
usb clock next time(Begin to use usb next time)

3. mdelay 100 seconds is too long for resume process, as this code
is only added for mx37, add arch macro for this mdelay. This can
minimize the effect for other platforms.

4. Compile is ok for all imx platform, functional tests are finished
for mx35 and mx23.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
2010-08-10 11:51:53 -05:00
Hu hui
8917d92d1a ENGR00124963 USB: add vbus enable/disable
support imx53 evk board OTG and Host1 vbus active
and inactive to low the power consume, fix fsl_otg.c
build failt, add vbus power control function pointer
in struct fsl_usb2_platform_data.

Signed-off-by: Hu hui <b29976@freescale.com>
2010-08-10 11:51:32 -05:00
Peter Chen
260daf5aa4 ENGR00124831 USB-UDC: Delete the useless code
The probe is called only pdev->name is the same with driver_name,
So the statement for name judgement is useless.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
2010-08-10 11:51:23 -05:00
Peter Chen
c83903e8db ENGR00124167 [mfg-tool]: Enhancement the UTP protocol
Enhancement the UTP protocol and give more comments
for source code

Signed-off-by: Peter Chen <b29397@freescale.com>
2010-08-10 11:50:47 -05:00
Dinh Nguyen
1be09a9131 ENGR00122838 gadget: Fix bitfield for calculating maximum packet size
The max packet length bit mask used for isochronous endpoints should
be 0x7FF instead of 0x8FF. 0x8FF will actually clear higher-order bits
in the max packet length field.

Signed-off-by: Dinh Nguyen <Dinh.Nguyen@freescale.com>
2010-08-10 11:49:50 -05:00
Jun Li
905ec17dbf ENGR00121945 Fix USB OTG pin-detect.
In OTG mode, entering low power mode after udc probe causes
otg controller can not exit from it when switch to host mode.
this patch let gadget class driver handle it.

Signed-off-by: Jun Li <r65092@freescale.com>
2010-08-10 11:49:16 -05:00
Frank Li
3d590d7e60 ENGR00122437-1 Rename stmp_updater to fsl_updater
Rename stmp_updater to fsl_updater, as the updater will be shared
across all i.MX platforms that needs MFGTool support.

Signed-off-by: Frank Li <Frank.Li@freescale.com>
2010-08-10 11:49:08 -05:00
Frank Li
3827461e7c ENGR00122309 iMX23 fix usb function break by 100mA patch
Miss "break" at set configuration

Signed-off-by: Frank Li <Frank.Li@freescale.com>
2010-08-10 11:48:59 -05:00
Frank Li
0c13648cb8 ENGR00122124 iMX23 enable USB otg pin detect
iMX23 evk RevC using gpio as usb id.
usb_id pin is conflict with mmcsd detection pin

Signed-off-by: Frank Li <Frank.Li@freescale.com>
2010-08-10 11:48:53 -05:00
Frank Li
1f1c8202e8 ENGR00121497-2 MX28 USB 100mA current draw
Add USB 100mA limitation feature for mx28 to mach usb 2.0 current requirment

Signed-off-by: Frank Li <Frank.li@freescale.com>
2010-08-10 11:48:51 -05:00
Frank Li
b3d784c5db ENGR00121497-1 MX28 USB 100mA current draw
Add USB 100mA limitation feature for mx28 to mach usb 2.0 current requirment

Signed-off-by: Frank Li <Frank.li@freescale.com>
2010-08-10 11:48:51 -05:00
Frank Li
37dccd44a7 ENGR00120698 iMX28 add usb write register work around
mx28 require read arc register before write.

Signed-off-by: Frank Li <Frank.Li@freescale.com>
2010-08-10 11:47:46 -05:00
Albert Chen
719b9dc7c5 ENGR00117742-2 add usb support for mx28
kernel part

Signed-off-by: Albert Chen <r65187@freescale.com>
2010-08-10 11:47:35 -05:00
Albert Chen
28827b46d3 ENGR00117742-1 add usb support for mx28
add usb support for mx28
	include usb host and usb device

Signed-off-by: Albert Chen <r65187@freescale.com>
2010-08-10 11:47:35 -05:00
Rob Herring
183afb82e4 ENGR00121296: imx51: rename mx51 to mx5
Rename mx51 to mx5 for common source for MX5x family

Signed-off-by: Rob Herring <r.herring@freescale.com>
2010-08-10 11:47:12 -05:00
Frank Li
e206cba8a9 ENGR00121029-1 MX51 Add Mfg firmware support
Add Mfg Firmware configuration

Signed-off-by: Frank Li <Frank.Li@freescale.com>
2010-08-10 11:47:06 -05:00
Dinh Nguyen
e0c9e67d36 ENGR00121003 Fix IRAM enabling for USB Gadget driver
In order to add IRAM to the USB Gadget driver, there are 2 kconfig
options to enable. One kconfig option was for USB host and the other
was for Gadget. The current SW required both kconfig to be
enable which is confusing. Also need to add iram_alloc function in
the Gadget driver.

Signed-off-by: Dinh Nguyen <Dinh.Nguyen@freescale.com>
2010-08-10 11:47:05 -05:00
Rob Herring
f361e1bdb9 ENGR00120957-2 restructure usb device registration
Clean-up USB related Kconfigs. Remove the transceiver selections as this
is defined by the chip/board and is selected in platform data.
Use usb device resources defined in devices.c and fix resource sharing.
Use common otg transceiver functions.
Remove unnecessary OTG ifdefs.

Signed-off-by: Rob Herring <r.herring@freescale.com>
2010-08-10 11:47:04 -05:00
Rob Herring
71762896f4 ENGR00120393-4 arc usb: use iram allocator for iram work-around
Convert USB iram work-around to iram allocator functions.

Signed-off-by: Rob Herring <r.herring@freescale.com>
2010-08-10 11:46:53 -05:00
Frank Li
3574ba3ed4 ENGR00120612 MX23 Mfg firmware crash when transfer big size file
There are out of memory when transfer big size file.
There reason is kernel alloc a memory to get data from usb and put to a list,
and wake up uuc to read it. The problem is that read slower than usb transfer
So list become more and more till out of memory

Signed-off-by: Frank Li <Frank.Li@freescale.com>
2010-08-10 11:46:48 -05:00
Jun Li
e7152a6092 ENGR00120361 arc usb gadget:open usb controller clocks before open phy clock.
When register gadget driver,open usb controller clocks before open phy clock.

Signed-off-by: Li Jun <r65092@freescale.com>
2010-08-10 11:46:39 -05:00
Dinh Nguyen
9ed0a6c3b7 ENGR00118363 Fix SATA drive failure on Ubuntu 9.10
Fix SATA drive failure on Ubuntu 9.10
BugLink: https://bugs.launchpad.net/bugs/431963

Signed-off-by: Dinh Nguyen <r00091@freescale.com>
2010-08-10 11:46:11 -05:00
Jun Li
247de7bcf9 ENGR00119024 USB OTG nobody cared IRQ when add gadget driver.
When add usb gadget driver in OTG mode, cause nobody cared irq,
this pach disable usbintr in udc driver probe.

Signed-off-by: Li Jun <r65092@freescale.com>
2010-08-10 11:46:03 -05:00
Jun Li
ff7bf0e322 ENGR00117147-2 USB clock gating and PHY low power mode.
1. If there is no usb devices connectted or all connectted usb
devices are in suspend state, usb host can suspend its whole bus,
then put the PHY into low power mode and close all usb clocks.
2. close all usb clocks for usb device low power mode.
(The patch is splitted 2 patches, this is FSL specific driver
part.)

Signed-off-by: Li Jun <r65092@freescale.com>
2010-08-10 11:46:00 -05:00
Jun Li
69d4c12178 ENGR00117147-1 USB clock gating and PHY low power mode.
If there is no usb devices connectted or all connectted usb
devices are in suspend state, usb host can suspend its whole bus,
then put the PHY into low power mode and close all usb clocks.
(The patch is splitted 2 patches, this is common code part.)

Signed-off-by: Li Jun <r65092@freescale.com>
2010-08-10 11:45:59 -05:00
Frank Li
34d71b41a9 ENGR00118888-1 Fix iMX23 mfg firmware usb segment fault
Miss some configuration and wrong use put_unaligned_be32

Signed-off-by: Frank Li <Frank.Li@freescale.com>
2010-08-10 11:45:54 -05:00
Albert Chen
1be00f9323 ENGR00109408 mx25 usb remote wakeup
Add remote wakeup feature for host mode.

Signed-off-by: Albert Chen <r65187@freescale.com>
2010-08-10 11:45:49 -05:00
Jun Li
9968237bed ENGR00117937 USB pin detct is broken on 2.6.31 branch
When register platform driver in 2.6.31 kernal, suspend
and resume are not set for device driver.
The patch fix this issue by using platform driver's
suspend/resume rountine directly in otg driver.

Signed-off-by: Li Jun <r65092@freescale.com>
2010-08-10 11:45:30 -05:00
Rob Herring
df6a3db108 ENGR00116558: MX233: USB pin detect
MX233: Restructure the STMP378xxx USB Host and Gadget device structures
to be similar to MXC structures. Enable fsl_otg_arc driver to work on
MX233 platform. Remove FSL_USB2_DONT_REMAP requirement.

Signed-off-by: Dinh Nguyen <Dinh.Nguyen@freescale.com>

Conflicts:

	arch/arm/mach-stmp3xxx/Kconfig
	arch/arm/mach-stmp3xxx/Makefile
	arch/arm/mach-stmp3xxx/devices.c
	arch/arm/mach-stmp3xxx/include/mach/stmp3xxx.h
	arch/arm/mach-stmp3xxx/stmp378x_devb.c
2010-08-10 11:44:52 -05:00
Albert Chen
94af0e7844 ENGR00115875 add USB gadget low power mode feature.
USB will enter low power mode if no vbus power supply.
	Only finished this feature in Mx37.
	1. When enter low power mode, driver will close usb related clocks
		as possible as could.
		set usb IP to stop.
		Set PHY to low power suspend by setting PHCD bit of portsc.
	2. This patch doesn't support low power mode in OTG mode yet.

Signed-off-by: Albert Chen <r65187@freescale.com>
2010-08-10 11:44:49 -05:00
Rob Herring
be0524d38f ENGR00117389 Port 5.0.0 release to 2.6.31
This is i.MX BSP 5.0.0 release ported to 2.6.31

Signed-off-by: Rob Herring <r.herring@freescale.com>
Signed-off-by: Alan Tull <r80115@freescale.com>
Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2010-08-10 11:44:41 -05:00
Frank Li
40f418ad28 gadget: add stmp uut support to file storage
This is gadget file storage changes needed for STMP universal updater
tool (manufacturing flashing tool).

Signed-off-by: Frank Li <Frank.Li@freescale.com>
2010-08-10 11:44:35 -05:00
Rob Herring
8bf39db6fd usb: Add arc ehci driver to ehci core driver
Signed-off-by: Rob Herring <r.herring@freescale.com>
2010-08-10 11:44:34 -05:00
Dinh Nguyen
88beb29fd0 usb: imx usb buffers in iram work-around
Some i.MX parts (MX31, MX37) need to have usb host queue descriptors
and/or buffers in on-chip IRAM in cases of heavily loaded memory
system (i.e. large LCDs).

Signed-off-by: Dinh Nguyen <r00091@freescale.com>
2010-08-10 11:44:31 -05:00
Rob Herring
c428ef3836 usb: stmp3xxx host hack
the USBPHY of STMP3xxx SoC has bug. The usb port power
is never enabled during standard ehci reset procedure if the
external device once passed plug/unplug procedure. This work-
around resets and reinitiates USBPHY before the ehci port reset
sequence started.

Signed-off-by: Rob Herring <r.herring@freescale.com>
2010-08-10 11:44:30 -05:00
Dinh Nguyen
d824c1c7dd usb: add ehci otg support
Add OTG support to ehci host controllers

Signed-off-by: Dinh Nguyen <r00091@freescale.com>
2010-08-10 11:44:29 -05:00
Jun Li
9d76d8d713 ENGR00114795 fix usb OTG co-work with remote wakeup issue.
This patch fix OTG pin-detect failure issue.
via sysfs set power/wakeup, i.MX51 can:
Put usb phy into low power mode when system enters stop or
standby mode; Enable usb device remote wakeup system by Vbus
and usb host remote wakeup system by device connection or
disconnection.

Signed-off-by: Li Jun <r65092@freescale.com>
2010-08-10 11:44:29 -05:00
Rob Herring
9cb5ad7579 gadget: gadgetfs changes for MTP support
MTP protocol support using gadgetfs requires the ability to cancel
I/O transactions.

Signed-off-by: Jun Li <r65092@freescale.com>
2010-08-10 11:44:25 -05:00
Alan Stern
194d238608 USB: fix usbfs regression
commit 7152b592593b9d48b33f8997b1dfd6df9143f7ec upstream.

This patch (as1352) fixes a bug in the way isochronous input data is
returned to userspace for usbfs transfers.  The entire buffer must be
copied, not just the first actual_length bytes, because the individual
packets will be discontiguous if any of them are short.

Reported-by: Markus Rechberger <mrechberger@gmail.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-04-01 15:56:00 -07:00
Greg KH
acbf8a1411 USB: usbfs: only copy the actual data received
commit d4a4683ca054ed9917dfc9e3ff0f7ecf74ad90d6 upstream

We need to only copy the data received by the device to userspace, not
the whole kernel buffer, which can contain "stale" data.

Thanks to Marcus Meissner for pointing this out and testing the fix.

Reported-by: Marcus Meissner <meissner@suse.de>
Tested-by: Marcus Meissner <meissner@suse.de>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Jeff Mahoney <jeffm@suse.com>
2010-04-01 15:55:43 -07:00
Linus Torvalds
97fde87ccf USB: usbfs: properly clean up the as structure on error paths
commit ddeee0b2eec2a51b0712b04de4b39e7bec892a53 upstream

USB: usbfs: properly clean up the as structure on error paths

I notice that the processcompl_compat() function seems to be leaking the
'struct async *as' in the error paths.

I think that the calling convention is fundamentally buggered. The
caller is the one that did the "reap_as()" to get the as thing, the
caller should be the one to free it too.

Freeing it in the caller also means that it very clearly always gets
freed, and avoids the need for any "free in the error case too".

From: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Marcus Meissner <meissner@suse.de>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Jeff Mahoney <jeffm@suse.com>
2010-04-01 15:55:43 -07:00
Ryan May
1eb2d343a6 USB: fix usbstorage for 2770:915d delivers no FAT
commit 10d2cdb6102669279bee2d9a00a22431b74583d5 upstream.

Resolves kernel.org bug 14914.

Remove entry for 2770:915d (usb digital camera with mass storage
support) from unusual_devs.h. The fix triggered by the entry causes
the file system on the camera to be completely inaccessible (no
partition table, the device is not mountable).

The patch works, but let me clarify a few things about it.  All the
patch does is remove the entry for this device from the
drivers/usb/storage/unusual_devs.h, which is supposed to help with a
problem with the device's reported size (I think).  I'm pretty sure it
was originally added for a reason, so I'm not sure removing it won't
cause other problems to reappear.  Also, I should note that this
unusual_devs.h entry was present (and activating workarounds) in
2.6.29, but in that version everything works fine.  Starting with
2.6.30, things no longer work.

Signed-off-by: Ryan May <rmay31@gmail.com>
Cc: Rohan Hart <rohan.hart17@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-04-01 15:55:39 -07:00
Johan Hovold
14a2fe817f usb: serial: fix memory leak in generic driver
commit 2591530204a76fecc843529ade56afe865dd2657 upstream.

Fix a regression introduced by commit
715b1dc01f ("USB: usb_debug,
usb_generic_serial: implement multi urb write").

URB transfer buffer was never freed when using multi-urb writes.
Currently the only driver enabling multi-urb writes is usb_debug.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Cc: Greg KH <greg@kroah.com>
Acked-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-04-01 15:55:38 -07:00
Alan Stern
70f176dfdc USB: fix bitmask merge error
commit a91b593edd4b3e8aa91f671b763b27b8119eb49d upstream.

This patch adds a mask bit which was mistakenly omitted from the
as1311 patch (usb-storage: add BAD_SENSE flag).

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-04-01 15:55:38 -07:00
Alan Stern
4f0e35f03d USB: EHCI & UHCI: fix race between root-hub suspend and port resume
commit cec3a53c7fe794237b582e8e77fc0e48465e65ee upstream.

This patch (as1321) fixes a problem with EHCI and UHCI root-hub
suspends: If the suspend occurs while a port is trying to resume, the
resume doesn't finish and simply gets lost.  When remote wakeup is
enabled, this is undesirable behavior.

The patch checks first to see if any port resumes are in progress, and
if they are then it fails the root-hub suspend with -EBUSY.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-04-01 15:55:37 -07:00