Commit graph

5035 commits

Author SHA1 Message Date
Johan Hovold 2db6c7698b USB: cp210x: use generic submit_read_urb at open
There is no need to initialise the read urb as this is done at port
probe.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:34 -07:00
Johan Hovold 056afc0f01 USB: serial: remove unnecessary re-initialisation of generic urbs
The generic read and write bulk urbs are initialised when allocated in
usb_serial_probe. The only field that needs to be updated after that is
the transfer_buffer_length of the write urb.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:33 -07:00
Johan Hovold 41bd72f904 USB: serial: refactor read urb submission in generic driver
Use the already exported function for submitting the read urb associated
with a usb_serial_port.

Make sure it returns the result of usb_submit_urb and rename to the
more descriptive usb_serial_generic_submit_read_urb.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:33 -07:00
Johan Hovold f26788da3b USB: serial: refactor generic close
Export usb_serial_generic_close so that drivers can easily kill the read
and write urb and make sure that the write fifo is reset.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:33 -07:00
Johan Hovold ec3ee5086c USB: serial: clear fifo on close
Make sure fifo is emptied on close.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:33 -07:00
Johan Hovold 50dbb85287 USB: serial: fix missing locking on fifo in write callback
On errors the fifo was reset without any locking. This could race with
write which do kfifo_put and perhaps also chars_in_buffer and write_room.

Every other access to the fifo is protected using the port lock so
better add it to the error path as well.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:33 -07:00
Johan Hovold 30af7fb5a4 USB: serial: fix generic chars_in_buffer
Make sure chars_in_buffer accounts also for data in host stack queues.

This fixes the problem with tty_wait_until_sent returning too soon at
close which could cause the final write urb to be cancelled.

Reported-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:33 -07:00
Johan Hovold 7919c2fd9e USB: pl2303: increase bulk-in buffer size to 256 byte
The pl2303 requires a bulk-in buffer larger than endpoint size to keep
up at high baudrates without loosing data.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:33 -07:00
Johan Hovold 3efeaff629 USB: pl2303: increase the bulk-out buffer size to 256 byte
Increase the bulk-out buffer size from 64 to 256 byte.

This gives a significant increase in throughput already at 1Mbaud as well
as lowered CPU usage. The buffer is big enough to keep up also at 3Mbaud
(128b would not suffice).

        64b         256b
921k:   640 KB/s    870 KB/s
3M:     640 KB/s    2520 KB/s

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:33 -07:00
Johan Hovold aea006b93a USB: cp210x: increase bulk-in buffer size to 256 byte
The cp210x requires a bulk-in buffer larger than endpoint size to keep
up at high baudrates without loosing data.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:33 -07:00
Johan Hovold d4e598f65d USB: cp210x: increase the bulk-out buffer size to 256 byte
Increase the bulk-out buffer size from 64 to 256 byte.

This gives a significant increase in throughput already at 1Mbaud
(e.g. 710 instead of 640 KB/s) as well as lowered CPU usage.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:33 -07:00
Johan Hovold bbcb2b9074 USB: serial: allow drivers to define bulk buffer sizes
Allow drivers to define custom bulk in/out buffer sizes in struct
usb_serial_driver. If not set, fall back to the default buffer size
which matches the endpoint size.

Three drivers are currently freeing the pre-allocated buffers and
allocating larger ones to achieve this at port probe (ftdi_sio) or even
at port open (ipaq and iuu_phoenix), which needless to say is suboptimal.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:33 -07:00
Hans de Goede 317149c655 USB: Add a new quirk: USB_QUIRK_HONOR_BNUMINTERFACES
Add a new quirk USB_QUIRK_HONOR_BNUMINTERFACES, when this quirk is
set and a device has more interface descriptors in a configuration
then it claims to have in config->bNumInterfaces, ignore all additional
interfaces.

This is needed for devices which try to hide unused interfaces by only
lowering config->bNumInterfaces, and which can't handle if you try to talk
to the "hidden" interfaces.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:32 -07:00
Randy Dunlap 7f0ae3a8ee usb: fix serial build when SYSRQ is disabled
Fix build error when CONFIG_MAGIC_SYSRQ is not enabled:

drivers/usb/serial/generic.c:566: error: implicit declaration of function 'handle_sysrq'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:32 -07:00
Vijay Kumar 2a1e7d5d54 USB Serial Driver: ZIO Motherboard
Add ZIO Motherboard USB serial interface driver.

Signed-off-by: Vijay Kumar B. <vijaykumar@zilogic.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:32 -07:00
Jason Wessel 92d2c5e4ba usb-console: pass baud from console to the initial tty open
The usb console code has had a long standing problem of not being able
to pass the baud rate from the kernel argument console=ttyUSB0,BAUD
down to the initial tty open, unless you were willing to settle for
9600 baud.

The solution is to directly use tty_init_termios() in
usb_console_setup() as this will preserve any changes to the initial
termios setting on future opens.

CC: Alan Cox <alan@linux.intel.com>
CC: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:32 -07:00
Michal Nazarewicz aae86e8adb USB: f_mass_storage: dynamic buffers for better alignment
"Static" buffers in fsg_buffhd structure (ie. fields which are arrays
rather then pointers to dynamically allocated memory) are not aligned
to any "big" power of two which may lead to poor DMA performance
(copying "by hand" of head or tail) or no DMA at all even if otherwise
hardware supports it.

Therefore, this patch makes mass storage function use kmalloc()ed
buffers which are (because of their size) page aligned (which should
be enough for any hardware).

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:32 -07:00
Felipe Balbi ddb495d4d8 usb: musb: hsdma: use musb_read/writel
... and simplify the was we read/write from/to
DMA COUNT register.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:32 -07:00
Felipe Balbi ca4b2532fb usb: musb: gadget: support musb-specific test modes
we can support the musb-specific test modes on the
vendor specific range of test selector as stated
on USB Specification Table 9-7 Test Mode Selectors.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:32 -07:00
Felipe Balbi 7f7f9e2a5a usb: musb: add debugfs support
for now only a simple register dump entry (which can
be rather useful on debugging) and a way to start
test modes.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:32 -07:00
Cliff Cai 6ddc6dae4a USB: musb: allow the Blackfin vrsel gpio to be active low
Rather than hardcoding the gpio levels for vrsel, allow the platform
resources to handle this so boards can be active high or low.

Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:32 -07:00
Maulik Mankad fb9c58edf1 USB: MUSB: Add OMAP4 support in MUSB driver
This patch adds CONFIG_ARCH_OMAP4 macro within
MUSB driver.

Signed-off-by: Maulik Mankad <x0082077@ti.com>
Cc: David Brownell <david-b@pacbell.net>
Cc: Sergei Shtylyov <sshtylyov@mvista.com>
Cc: Olof Johansson <olof@lixom.net>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:32 -07:00
Maulik Mankad c71b1b9c21 USB: MUSB: Build MUSB driver for OMAP4
This patch updates the Makefile to build the
MUSB driver for OMAP4. It also sets the Kconfig
options for OMAP4.

Signed-off-by: Maulik Mankad <x0082077@ti.com>
Cc: David Brownell <david-b@pacbell.net>
Cc: Sergei Shtylyov <sshtylyov@mvista.com>
Cc: Olof Johansson <olof@lixom.net>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:32 -07:00
Maulik Mankad de2e1b0c98 usb: musb: Set transceiver interface type
Program the OTG_INTERFSEL register based on
transcevier type passed from board file.

Adapt signature of musb_platform_init() function
for davinci, blackfin and tusb6010.

Signed-off-by: Maulik Mankad <x0082077@ti.com>
Cc: David Brownell <david-b@pacbell.net>
Cc: Sergei Shtylyov <sshtylyov@mvista.com>
Cc: Olof Johansson <olof@lixom.net>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:32 -07:00
Felipe Balbi e6c213b296 usb: musb: allow board to pass down fifo mode
boards might want to optimize their fifo configuration
to the particular needs of that specific board. Allow
that by moving all related data structures to
<linux/usb/musb.h>

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:31 -07:00
Jason Wessel bd5afa9eac usb-serial: Use tty_port version console instead of usb_serial_port
Replace all instances of using the console variable in struct
usb_serial_port with the struct tty_port version.

CC: Alan Cox <alan@linux.intel.com>
CC: Alan Stern <stern@rowland.harvard.edu>
CC: Oliver Neukum <oliver@neukum.org>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: linux-usb@vger.kernel.org
CC: linux-kernel@vger.kernel.org
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:31 -07:00
Manuel Lauss 9757de3844 USB: ehci-au1xxx does not need EHCI IO watchdog
I've been running variations of this patch for well over a year now;
my usual zoo of test devices didn't trigger any ill effects even
under heavy load.  As a nice sideeffect idle-wakeups are reduced
from 20/s to about 2/s (EHCI hub with mouse and kbd).

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:31 -07:00
Alan Stern 0ede76fcec USB: remove uses of URB_NO_SETUP_DMA_MAP
This patch (as1350) removes all usages of coherent buffers for USB
control-request setup-packet buffers.  There's no good reason to
reserve coherent memory for these things; control requests are hardly
ever used in large quantity (the major exception is firmware
transfers, and they aren't time-critical).  Furthermore, only seven
drivers used it.  We might as well always use streaming DMA mappings
for setup-packet buffers, and remove some extra complexity from
usbcore.

The DMA-mapping portion of hcd.c is currently in flux.  A separate
patch will be submitted to remove support for URB_NO_SETUP_DMA_MAP
after everything else settles down.  The removal should go smoothly,
as by then nobody will be using it.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:31 -07:00
Alan Stern 749da5f82f USB: straighten out port feature vs. port status usage
This patch (as1349b) clears up the confusion in many USB host
controller drivers between port features and port statuses.  In mosty
cases it's true that the status bit is in the position given by the
corresponding feature value, but that's not always true and it's not
guaranteed in the USB spec.

There's no functional change, just replacing expressions of the form
(1 << USB_PORT_FEAT_x) with USB_PORT_STAT_x, which has the same value.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:31 -07:00
Alan Stern 288ead45fa USB: remove bogus USB_PORT_FEAT_*_SPEED symbols
This patch (as1348) removes the bogus
USB_PORT_FEAT_{HIGHSPEED,SUPERSPEED} symbols from ch11.h.  No such
features are defined by the USB spec.  (There is a PORT_LOWSPEED
feature, but the spec doesn't mention it except to say that host
software should never use it.)  The speed indicators are port
statuses, not port features.

As a temporary workaround for the xhci-hcd driver, a fictional
USB_PORT_STAT_SUPER_SPEED symbol is added.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:31 -07:00
Huang Weiyi 45f30e0bda USB: remove duplicated #include
Remove duplicated #include('s) in
  drivers/usb/core/hcd.c

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:31 -07:00
Ian Munsie 0df4d8ef77 USB: Remove large struct from the stack in USB storage isd200 driver
The compiler throws the following warning when compiling for a PowerPC 64
bit machine:

drivers/usb/storage/isd200.c:580: warning: the frame size of 2208 bytes is larger than 2048 bytes

There is a struct scsi_device which is placed on the stack and is
largely responsible for such wastage. The struct is just a dummy struct
filled with NULLs and set as the scsi_cmnd->device to make the
usb_stor_Bulk_transport function happy.

This patch makes the struct static, so that it is never placed onto the
stack and silences the compiler warning.

Signed-off-by: Ian Munsie <imunsie@au.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:31 -07:00
Randy Dunlap fa4dc36482 USB: cdc-acm: make bitfields unsigned
Fix usb/class sparse warnings:

drivers/usb/class/cdc-acm.h:128:34: error: dubious one-bit signed bitfield
drivers/usb/class/cdc-acm.h:129:24: error: dubious one-bit signed bitfield

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:31 -07:00
Alessio Igor Bogani 41f2c6e89c USB: sisusbvga: Remove the BKL from ioctl
Seems to me that BKL is not needed here because necessary locking is already
provided by mutex sisusb->lock.

Also change the returned value to long.

Signed-off-by: Alessio Igor Bogani <abogani@texware.it>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:31 -07:00
Eric Lescouet d65d7e7ef3 USB: make hub.h public (drivers dependency)
The usbcore headers: hcd.h and hub.h are shared between usbcore,
HCDs and a couple of other drivers (e.g. USBIP modules).
So, it makes sense to move them into a more public location and
to cleanup dependency of those modules on kernel internal headers.
This patch moves hub.h from drivers/usb/core into include/linux/usb/

Signed-of-by: Eric Lescouet <eric@lescouet.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:30 -07:00
Eric Lescouet 27729aadd3 USB: make hcd.h public (drivers dependency)
The usbcore headers: hcd.h and hub.h are shared between usbcore,
HCDs and a couple of other drivers (e.g. USBIP modules).
So, it makes sense to move them into a more public location and
to cleanup dependency of those modules on kernel internal headers.
This patch moves hcd.h from drivers/usb/core into include/linux/usb/

Signed-of-by: Eric Lescouet <eric@lescouet.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:30 -07:00
Sarah Sharp 44ebd037c5 USB: xhci: Fix check for room on the ring.
The length of the scatter gather list a driver can enqueue is limited by
the bus' sg_tablesize to 62 entries.  Each entry will be described by at
least one transfer request block (TRB).  If the entry's buffer crosses a
64KB boundary, then that entry will have to be described by two or more
TRBs.  So even if the USB device driver respects sg_tablesize, the whole
scatter list may take more than 62 TRBs to describe, and won't fit on
the ring.

Don't assume that an empty ring means there is enough room on the
transfer ring.  The old code would unconditionally queue this too-large
transfer, and over write the beginning of the transfer.  This would mean
the cycle bit was unchanged in those overwritten transfers, causing the
hardware to think it didn't own the TRBs, and the host would seem to
hang.

Now drivers may see submit_urb() fail with -ENOMEM if the transfers are
too big to fit on the ring.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:30 -07:00
Sarah Sharp bc88d2eba5 USB: xhci: Limit bus sg_tablesize to 62 TRBs.
When a scatter-gather list is enqueued to the xHCI driver, it translates
each entry into a transfer request block (TRB).  Only 63 TRBs can be
used per ring segment, and there must be one additional TRB reserved to
make sure the hardware does not think the ring is empty (so the enqueue
pointer doesn't equal the dequeue pointer).  Limit the bus sg_tablesize
to 62 TRBs.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:30 -07:00
Sarah Sharp 1624ae1c19 USB: xhci: Fix issue with set interface after stall.
When the USB core installs a new interface, it unconditionally clears the
halts on all the endpoints on the new interface.  Usually the xHCI host
needs to know when an endpoint is reset, so it can change its internal
endpoint state.  In this case, it doesn't care, because the endpoints were
never halted in the first place.

To avoid issuing a redundant Reset Endpoint command, the xHCI driver looks
at xhci_virt_ep->stopped_td to determine if the endpoint was actually
halted.  However, the functions that handle the stall never set that
variable to NULL after it dealt with the stall.  So if an endpoint stalled
and a Reset Endpoint command completed, and then the class driver tried to
install a new alternate setting, the xHCI driver would access the old
xhci_virt_ep->stopped_td pointer.  A similar problem occurs if the
endpoint has been stopped to cancel a transfer.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:30 -07:00
Al Viro d83c49f3e3 Fix the regression created by "set S_DEAD on unlink()..." commit
1) i_flags simply doesn't work for mount/unlink race prevention;
we may have many links to file and rm on one of those obviously
shouldn't prevent bind on top of another later on.  To fix it
right way we need to mark _dentry_ as unsuitable for mounting
upon; new flag (DCACHE_CANT_MOUNT) is protected by d_flags and
i_mutex on the inode in question.  Set it (with dont_mount(dentry))
in unlink/rmdir/etc., check (with cant_mount(dentry)) in places
in namespace.c that used to check for S_DEAD.  Setting S_DEAD
is still needed in places where we used to set it (for directories
getting killed), since we rely on it for readdir/rmdir race
prevention.

2) rename()/mount() protection has another bogosity - we unhash
the target before we'd checked that it's not a mountpoint.  Fixed.

3) ancient bogosity in pivot_root() - we locked i_mutex on the
right directory, but checked S_DEAD on the different (and wrong)
one.  Noticed and fixed.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-05-15 07:16:33 -04:00
Michael Hennerich 8a3461e2cd USB: sl811-hcd: Fix device disconnect
A while ago I provided a patch that fixed device detection after device
removal (USB: sl811-hcd: Fix device disconnect).
Chris Brissette pointed out that the detection/removal counter method
to distinguish insert or remove my fail under certain conditions.
Latest SL811HS datasheet (Document 38-08008 Rev. *D) indicates that
bit 6 (SL11H_INTMASK_RD) of the Interrupt Status Register together with
bit 5 (SL11H_INTMASK_INSRMV) can be used to determine whether a device
has been inserted or removed.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-04-30 09:25:12 -07:00
Patrice Vilchez 869aa98c1d USB: ohci-at91: fix power management hanging
A hanging has been detected in ohci-at91 while going in suspend to ram. This is
due to asynchronous operations between ohci reset and ohci clocks shutdown.
This patch adds the reading of the control register between the reset of the
ohci and clocks stop. This "flush the writes" idea was taken from ohci-hcd.c
file (ohci_shutdown() function).

Signed-off-by: Patrice Vilchez <patrice.vilchez@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-04-30 09:25:12 -07:00
Daniel Mack 073900a28d USB: rename usb_buffer_alloc() and usb_buffer_free()
For more clearance what the functions actually do,

  usb_buffer_alloc() is renamed to usb_alloc_coherent()
  usb_buffer_free()  is renamed to usb_free_coherent()

They should only be used in code which really needs DMA coherency.

[added compatibility macros so we can convert things easier - gregkh]

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Pedro Ribeiro <pedrib@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-04-30 09:25:12 -07:00
Randy Dunlap 75181f386f USB: ti_usb: fix printk format warning
Fix printk format warning in usbserial/ti_usb:

drivers/usb/serial/ti_usb_3410_5052.c:1738: warning: format '%d' expects type 'int', but argument 5 has type 'size_t'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-04-30 09:25:11 -07:00
Julia Lawall 19c190f9e0 USB: gadget: s3c-hsotg: Add missing unlock
In an error handling case the lock is not unlocked.  The return is
converted to a goto, to share the unlock at the end of the function.

A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
expression E1;
identifier f;
@@

f (...) { <+...
* spin_lock_irqsave (E1,...);
... when != E1
* return ...;
...+> }
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-04-30 09:25:11 -07:00
Anand Gadiyar 6d60261009 USB: fix build on OMAPs if CONFIG_PM_RUNTIME is not set
With patch as1329 (USB: convert to the runtime PM framework),
we make USB_SUSPEND depend on PM_RUNTIME instead of CONFIG_PM.

Also, CONFIG_USB_OTG selects CONFIG_USB_SUSPEND.

If PM_RUNTIME is not enabled, and we try to enable USB_OTG,
we will end up with CONFIG_USB_SUSPEND selected. This is
due to a known bug with the select statement.

This makes the build break on various OMAP configs (which
have CONFIG_USB_OTG set by default, but do not yet have
CONFIG_PM_RUNTIME enabled).

Avoid this by changing the logic for CONFIG_USB_OTG from
"select USB_SUSPEND" to "depends on USB_SUSPEND"

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
CC: Michal Marek <mmarek@suse.cz>
CC: Tony Lindgren <tony@atomide.com>
CC: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-04-30 09:25:11 -07:00
Dan Carpenter 82a5eeb9f4 USB: oxu210hp: release spinlock on error path
Smatch complained about this missing spinlock.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-04-30 09:25:11 -07:00
Greg Kroah-Hartman 6f44bcb60b USB: serial: option: add cinterion device id
This adds a device id for a Cinterion device.

Reported-by: John Race <John.Race@roscom.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-04-30 09:25:11 -07:00
Mahesh Kuruganti fe30bc1b16 USB: serial: option: ZTEAC8710 Support with Device ID 0xffff
PATCH TO EXTEND SUPPORT TO AC8710 WITH 0xFFFF Product ID.

Signed-off-by: Mahesh Kuruganti <maheshkuruganti@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-04-30 09:25:11 -07:00
Simone Contini 18344a1cd5 USB: serial: pl2303: Hybrid reader Uniform HCR331
I tried a magnetic stripe reader
(http://www.kimaldi.com/kimaldi_eng/productos/lectores_de_tarjetas/lectores_tarjeta_chip_y_dni/lector_hibrido_uniform_hcr_331)
and I see that it is interfaced with a PL2303. I wrote a patch to use
your driver which simply adds the product ID for the device and it
seems working fine.


From: Simone Contini <s.contini@oltrelinux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-04-30 09:25:10 -07:00