]> err.no Git - linux-2.6/log
linux-2.6
16 years agoUSB: fix codingstyle issues in drivers/usb/core/*.c
Greg Kroah-Hartman [Wed, 30 Jan 2008 23:21:33 +0000 (15:21 -0800)]
USB: fix codingstyle issues in drivers/usb/core/*.c

Fixes a number of coding style issues in the remaining .c files in
drivers/usb/core/

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix codingstyle issues in drivers/usb/core/message.c
Greg Kroah-Hartman [Wed, 30 Jan 2008 23:21:33 +0000 (15:21 -0800)]
USB: fix codingstyle issues in drivers/usb/core/message.c

Fixes a number of coding style issues in the message.c file.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix codingstyle issues in drivers/usb/core/hcd-pci.c
Greg Kroah-Hartman [Wed, 30 Jan 2008 23:21:33 +0000 (15:21 -0800)]
USB: fix codingstyle issues in drivers/usb/core/hcd-pci.c

Fixes a number of coding style issues in the hcd-pci.c file.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix codingstyle issues in drivers/usb/core/devio.c
Greg Kroah-Hartman [Wed, 30 Jan 2008 23:21:33 +0000 (15:21 -0800)]
USB: fix codingstyle issues in drivers/usb/core/devio.c

Fixes a number of coding style issues in the devio.c file.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix codingstyle issues in drivers/usb/core/devices.c
Greg Kroah-Hartman [Wed, 30 Jan 2008 23:21:33 +0000 (15:21 -0800)]
USB: fix codingstyle issues in drivers/usb/core/devices.c

Fixes a number of coding style issues in the devices.c file.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix codingstyle issues in drivers/usb/core/*.h
Greg Kroah-Hartman [Wed, 30 Jan 2008 23:21:33 +0000 (15:21 -0800)]
USB: fix codingstyle issues in drivers/usb/core/*.h

Fixes a number of coding style issues in the USB internal header files.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix codingstyle issues in include/linux/usb/
Greg Kroah-Hartman [Wed, 30 Jan 2008 23:21:33 +0000 (15:21 -0800)]
USB: fix codingstyle issues in include/linux/usb/

Fixes a number of coding style issues in the USB public header files.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix codingstyle issues in include/linux/usb.h
Greg Kroah-Hartman [Wed, 30 Jan 2008 23:20:32 +0000 (15:20 -0800)]
USB: fix codingstyle issues in include/linux/usb.h

No logical code changes were made, but checkpatch.pl is much happier now.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: mark USB drivers as being GPL only
Greg Kroah-Hartman [Fri, 25 Jan 2008 17:12:21 +0000 (11:12 -0600)]
USB: mark USB drivers as being GPL only

Over two years ago, the Linux USB developers stated that they believed
there was no way to create a USB kernel driver that was not under the
GPL.  This patch moves the USB apis to enforce that decision.

There are no known closed source USB drivers in the wild, so this patch
should cause no problems.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: use a real vendor and product id for root hubs
Greg Kroah-Hartman [Mon, 28 Jan 2008 17:50:12 +0000 (09:50 -0800)]
USB: use a real vendor and product id for root hubs

Turns out that a company is out there using the vendor id of 0x0000 in
the wild, so use a real vendor/product id for the root hubs.

Now that the Linux Foundation has a real vendor id, we use that, and the
first product id:
0x1d6b is the vendor id of the Linux Foundation
0x0001 is the product id for Linux 1.1 root hubs
0x0002 is the product id for Linux 2.0 root hubs

The usb.ids file has already been updated with these values.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: mount options: fix usbfs
Miklos Szeredi [Thu, 24 Jan 2008 19:34:07 +0000 (20:34 +0100)]
USB: mount options: fix usbfs

Add a .show_options super operation to usbfs.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Fix usb_serial_driver structure for Kobil cardreader driver.
Stefan Bader [Fri, 25 Jan 2008 13:09:41 +0000 (08:09 -0500)]
USB: Fix usb_serial_driver structure for Kobil cardreader driver.

The device setup did miss to initialize the num_interrupt_out field, thus
failing to successfully complete the probe function.

Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Cc: stable <stable@kernel.org>
Cc: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb: ehci should use u16 for isochronous intervals
David Brownell [Thu, 24 Jan 2008 20:30:34 +0000 (12:30 -0800)]
usb: ehci should use u16 for isochronous intervals

While most isochronous endpoints have short polling intervals, the
EHCI driver won't necessarily handle larger ones correctly.

This patch switches to use a "u16" to represent those periods, not
a u8, since it can always work:  the largest expressible period
is 2^15 units ... not the previous too-short limit of 128 frames
(full or low speeds) or microframes (high speed, 32 frames).

This bug is essentially theoretical, since the few ISO endpoints
I've seen which don't use one transfer per frame are high speed
ones using more than that (including high bandwidth, 24 KB/msec).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb: ehci, remove false clear-reset path
David Brownell [Thu, 24 Jan 2008 20:39:43 +0000 (12:39 -0800)]
usb: ehci, remove false clear-reset path

Some of the "EHCI ports reset forever" problems may be explained by
code paths which wrongly flagged resets as complete.  This removes
two such paths; the ehci_hub_status_data() path should be the only one
to have an effect, since it was already properly flagged on the other
path.  (Issue noted by Minhyoung Kim <a9a9@lge.com>.)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Use menuconfig objects
Denis Cheng [Thu, 24 Jan 2008 08:36:31 +0000 (16:36 +0800)]
USB: Use menuconfig objects

commit 04d06ad0f1fdb499af84ae3d7969e2136a462f38 have added menuconfig support
for the whole USB Kconfig, but there are still menuconfig need for usb/serial,
usb/atm, and usb/gadget, so that the user can disable all the options in that
menu at once instead of having to disable each option separately.

Signed-off-by: Denis Cheng <crquan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb: ohci-sm501 driver
Magnus Damm [Wed, 23 Jan 2008 06:58:46 +0000 (15:58 +0900)]
usb: ohci-sm501 driver

usb: ohci-sm501 driver V2

This patch adds sm501 ohci support. It's all very straightforward with the
exception of dma_declare_coherent_memory() and HCD_LOCAL_MEM. Together they
are used to ensure that usb data is allocated using dma_alloc_coherent(),
and that only valid dma memory is used to allocate from. This driver is
a platform device, and the mfd driver sm501.c is already creating one
usb host controller instance per sm501.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb: dma bounce buffer support
Magnus Damm [Wed, 23 Jan 2008 06:58:35 +0000 (15:58 +0900)]
usb: dma bounce buffer support

usb: dma bounce buffer support V4

This patch adds dma bounce buffer support to the usb core. These buffers
can be enabled with the HCD_LOCAL_MEM flag, and they make sure that all data
passed to the host controller is allocated using dma_alloc_coherent().

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: last abuses of intfdata in close for usb-serial drivers
Oliver Neukum [Wed, 23 Jan 2008 11:28:45 +0000 (12:28 +0100)]
USB: last abuses of intfdata in close for usb-serial drivers

these drivers abused intfdata in close() as flags for binding.
That races with reprobing of those devices. This patch fixes that by using
the flag and the locks introduced with the patch against mos7720.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: kl5kusb105 don't flush to logically disconnected devices
Oliver Neukum [Tue, 22 Jan 2008 11:47:15 +0000 (12:47 +0100)]
USB: kl5kusb105 don't flush to logically disconnected devices

If disconnect() is called for a logical disconnect, no more IO must be
done after disconnect() returns, or the old and new drivers may conflict.
This patch avoids this by using the flag and lock introduced by the earlier
patch for the mos7720 driver.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: oti6858: cleanup
Alan Cox [Sat, 19 Jan 2008 16:02:37 +0000 (16:02 +0000)]
USB: oti6858: cleanup

- Rename the copied buffer functions from pl2303 to oti6858 to avodi
  confusion
- Initialise speeds properly
- Use modern baud rate handling
- Remove GSERIAL/SSERIAL ioctl hacks that reference termios unlocked

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: more serial drivers writing after disconnect
Oliver Neukum [Tue, 22 Jan 2008 12:56:18 +0000 (13:56 +0100)]
USB: more serial drivers writing after disconnect

this covers the rest of the obvious cases by using the flags
and locks to guard against disconnect which were introduced
in the earlier patch against mos7720.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: make sure usb serial drivers don't flush to logically disconnected devices
Oliver Neukum [Mon, 21 Jan 2008 16:44:10 +0000 (17:44 +0100)]
USB: make sure usb serial drivers don't flush to logically disconnected devices

If disconnect() is called for a logical disconnect, no more IO must be
done after disconnect() returns, or the old and new drivers may conflict.
This patch avoids this by using the flag and lock introduced by the earlier
patch for the mos7720 driver.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix memleak in ark3116 serial driver
Oliver Neukum [Tue, 22 Jan 2008 13:24:56 +0000 (14:24 +0100)]
USB: fix memleak in ark3116 serial driver

in an error case memory already allocated must be freed again.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: stop abuse of intfdata in cypress_m8
Oliver Neukum [Tue, 22 Jan 2008 14:54:54 +0000 (15:54 +0100)]
USB: stop abuse of intfdata in cypress_m8

this driver uses usb_get_intfdata() == NULL as a test for disconnect().
You must not do that as this races with probe(). By the time you test
your erstwhile interface may already be somebody else's interface.
This fixes the close() method of cypress_m8 to use the recently introduced
flag and use locking against disconnect() where required in close().

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: constify function pointer tables
Jan Engelhardt [Tue, 22 Jan 2008 19:51:11 +0000 (20:51 +0100)]
USB: constify function pointer tables

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: stop io performed by mos7720 upon close()
Oliver Neukum [Wed, 16 Jan 2008 16:18:52 +0000 (17:18 +0100)]
USB: stop io performed by mos7720 upon close()

This fixes a problem where the mos7720 driver will make io to a device from
which it has been logically disconnected. It does so by introducing a flag by
which the generic usb serial code can signal the subdrivers their
disconnection and appropriate locking.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: add support for SuperH OHCI
Yoshihiro Shimoda [Fri, 11 Jan 2008 13:56:15 +0000 (22:56 +0900)]
USB: add support for SuperH OHCI

add support for SuperH OHCI.

supported CPU are:
 - SH7720
 - SH7721
 - SH7763

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Acked-by: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ftdi_sio: remove very old changelog entries from the file.
Greg Kroah-Hartman [Tue, 9 Apr 2002 19:14:34 +0000 (12:14 -0700)]
USB: ftdi_sio: remove very old changelog entries from the file.

People keep trying to add entries to this section of the driver for
things.  That's what the Changelog is supposed to be for, not the .c
file.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: usbserial: provide ezusb functions for an external module.
Paul Chavent [Sat, 12 Jan 2008 14:23:17 +0000 (15:23 +0100)]
USB: usbserial: provide ezusb functions for an external module.

When building an external module, the ezusb_* functions are not defined
if we haven't loaded any built'in module that use them (whiteheat,
keyspan, ...).

This patch allow to build those functions even if we only have selected
the usbserial generic driver.

Signed-off-by: Paul Chavent <paul.chavent@fnac.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: EHCI: add a short delay to the bus_suspend routine
Alan Stern [Thu, 10 Jan 2008 16:14:53 +0000 (11:14 -0500)]
USB: EHCI: add a short delay to the bus_suspend routine

This patch (as1031) adds a short delay to the bus-suspend routine in
ehci-hcd.  Without it some devices disconnect when they should
suspend.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: EHCI: move del_timer_sync calls outside spinlocked region
Alan Stern [Thu, 10 Jan 2008 21:43:15 +0000 (16:43 -0500)]
USB: EHCI: move del_timer_sync calls outside spinlocked region

This patch (as1030b) moves a del_timer_sync() call outside the scope of a
spinlock, where it could cause a deadlock, and adds a new
del_timer_sync() call for the new IAA watchdog timer (it was omitted
by mistake).

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: usbfs: struct async is a fixed size structure
Pete Zaitcev [Sat, 5 Jan 2008 10:01:07 +0000 (02:01 -0800)]
USB: usbfs: struct async is a fixed size structure

The ISO descriptors are allocated separately in proc_submiturb for a fetch
from user mode, then tucked at the end of URB. This seems like a dead code.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ehci completes high speed ISO URBs sooner
David Brownell [Mon, 7 Jan 2008 08:47:42 +0000 (00:47 -0800)]
USB: ehci completes high speed ISO URBs sooner

This has some bugfixes for the EHCI driver's ISO transfer scanning
logic.  It was leaving ITDs and SITDs on the schedule too long, for
a few different reasons, which caused trouble.

  (a) Look at all microframes for high speed transfers, not just
the ones we expect to have finished.  This way transfers
ending mid-frame will complete without needing another IRQ.
This also minimizes bogus scheduling underruns (e.g. EL2NSYNC).

  (b) When we encounter an ISO transfer (either speed, but this
hits mostly at full speed) that's not yet been completed,
immediately stop scanning; we've caught up to the hardware,
no matter what other indications might say.

  (c) Always clean up ITDs (for high speed transfers) when the HC
is no longer running.

I'm not sure whether the last one has been observed before, but both
the others have been reported with "real world" audio and video code.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ehci: minor ISO updates, always support split ISO
David Brownell [Mon, 31 Dec 2007 07:45:19 +0000 (23:45 -0800)]
USB: ehci: minor ISO updates, always support split ISO

Small updates to the EHCI driver's ISO support:

 - Get rid of the Kconfig option for full speed ISO.  It may
   not be perfect yet, but it hasn't appeared to be dangerous
   and pretty much every configuration wants it.

 - Instead of two places to disable an empty periodic schedule
   after an ISO transfer completes, just have one.

 - After the periodic schedule is disabled, we can short-circuit
   the schedule scan ... it can't possibly have more work to do.

Assuming a typical config with split iso enabled, the only change
in behavior should be almost unobservable:  quicker termination
of periodic scans when the schedule gets emptied.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ehci saves some memory in ISO transfer descriptors
Karsten Wiese [Mon, 31 Dec 2007 05:55:05 +0000 (21:55 -0800)]
USB: ehci saves some memory in ISO transfer descriptors

In the EHCI driver, itd->usecs[8] is used in periodic_usecs(), indexed by
uframe.  For an ITD's unused uframes it is 0, else it contains the same
value as itd->stream->usecs.  To check if an ITD's uframe is used, we can
instead test itd->hw_transaction[uframe]:  if used, it will be nonzero no
matter what endianess is used.

This patch replaces those two uses, eliminates itd->usecs[], and saves
eight bytes from each ITD.

Signed-off-by: Karsten Wiese <fzu@wemgehoertderstaat.de>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: add ehci-ixp bus glue
Vladimir Barinov [Sun, 30 Dec 2007 23:21:11 +0000 (15:21 -0800)]
USB: add ehci-ixp bus glue

EHCI Glue driver for Intel IXP4XX EHCI USB controller

Signed-off-by: Vladimir Barinov <vbarinov@ru.mvista.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: misc: legousbtower: semaphore to mutex
Daniel Walker [Fri, 11 Jan 2008 16:45:44 +0000 (08:45 -0800)]
USB: misc: legousbtower: semaphore to mutex

The dev->sem conforms to mutex style usage. This patch converts it to use
the struct mutex type, and new API.

There is also a small style fix around this comment,

/* unlock here as tower_delete frees dev */

Where I broke the line up to meet the 80 char limit.

Signed-off-by: Daniel Walker <dwalker@mvista.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: add ehci-ppc-of bus glue (device-tree aware)
Valentine Barshak [Sun, 30 Dec 2007 23:28:50 +0000 (15:28 -0800)]
USB: add ehci-ppc-of bus glue (device-tree aware)

This adds device-tree-aware ehci-ppc-of driver.
The code is based on the ehci-ppc-soc driver by
Stefan Roese <sr@denx.de>.

Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: pxa2xx_udc: use debugfs not procfs
Dmitry Baryshkov [Sun, 30 Dec 2007 19:56:27 +0000 (11:56 -0800)]
USB: pxa2xx_udc: use debugfs not procfs

Use debugfs instead of /proc/driver/udc

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: at91_udc uses generic GPIO calls; minor cleanup
David Brownell [Sat, 5 Jan 2008 21:21:43 +0000 (13:21 -0800)]
USB: at91_udc uses generic GPIO calls; minor cleanup

Various small at91_udc cleanups:

 - Use generic GPIO calls, not older platform-specific ones
 - Use gpio_request()/gpio_free()
 - Use VERBOSE_DEBUG convention, not older VERBOSE
 - Fix sparse complaint about parameter type (changed to gfp_t)
 - Add missing newline to some rarely-seen debug messages
 - Fix some old cleanup bugs on probe() fault paths

Also add a mechanism whereby rm9200 gpios can drive the D+ pullup
through an inverting transistor, based on a patch from Steve Birtles.
Most UDC drivers supporting a GPIO based pullup should probably have
such an option, but testing it requries such a board in hand!

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Steve Birtles <arm_kernel_development@micromark.net.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ohci-at91 uses generic GPIO calls
David Brownell [Thu, 27 Dec 2007 19:19:49 +0000 (11:19 -0800)]
USB: ohci-at91 uses generic GPIO calls

Update the ohci-at91 bus glue to start understanding about the per-port
power switch GPIOs it's given (on the sam9263-ek and potentially other
boards).  For the moment this just claims them and forces them active
(assuming active-low power enables) whenever the HCD is loaded.

The assumption is still that board setup configures the GPIOs.  Using
gpio_request() tracks actual usage and guards against conflict.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Add documentation for USB suspend statistics.
Sarah Sharp [Thu, 17 Jan 2008 18:24:38 +0000 (10:24 -0800)]
USB: Add documentation for USB suspend statistics.

This documents two newly created files:
/sys/bus/usb/device/.../power/connected_duration
/sys/bus/usb/device/.../power/active_duration

Documentation was placed in Documentation/ABI/testing, since that's where the
documentation is for the other USB sysfs power files.

Signed-off-by: Sarah Sharp <sarah.a.sharp@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Export suspend statistics
Sarah Sharp [Sat, 22 Dec 2007 00:54:15 +0000 (16:54 -0800)]
USB: Export suspend statistics

This patch exports two statistics to userspace:
/sys/bus/usb/device/.../power/connected_duration
/sys/bus/usb/device/.../power/active_duration

connected_duration is the total time (in msec) that the device has
been connected.  active_duration is the total time the device has not
been suspended.  With these two statistics, tools like PowerTOP can
calculate the percentage time that a device is active, i.e. not
suspended or auto-suspended.

Users can also use the active_duration to check if a device is actually
autosuspended.  Currently, they can set power/level to auto and
power/autosuspend to a positive timeout, but there's no way to know from
userspace if a device was actually autosuspended without looking at the
dmesg output.  These statistics will be useful in creating an automated
userspace script to test autosuspend for USB devices.

Signed-off-by: Sarah Sharp <sarah.a.sharp@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: sierra driver - add update dtr logic
Kevin Lloyd [Thu, 10 Jan 2008 19:11:04 +0000 (11:11 -0800)]
USB: sierra driver - add update dtr logic

The following improvements were made:
 - Fixed control line issue where asserting DTR on ep5 would close ep2
 - Added support for calc_num_ports (will help support future composite
   devices)

Signed-off-by: Kevin Lloyd <linux@sierrawireless.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ftdi_sio: Support for more JTAG adaptors
Harald Welte [Tue, 1 Jan 2008 14:08:35 +0000 (15:08 +0100)]
USB: ftdi_sio: Support for more JTAG adaptors

[PATCH] ftdi_sio: add support for more FTDI based JTAG adaptors

There are more devices similar to the Olimex JTAG adaptor, in that the first
port of the FT2232C is used for JTAG, and only the second port is available as
UART.

I have thus renamed ftdi_olimex_{probe,quirk} to ftdi_jtag_{probe,quirk} and
added vendor/product ID's for the OpenMoko Neo1973 Debug Board as well as the
OOCDlink device.

I've also updated the KERN_INFO message sent to userspace to remove the word
'olimex' and an extra '\n' that was causing an empty line in dmesg.

Signed-off-by: Harald Welte <laforge@openmoko.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: io_ti: clean up termios handling
Alan Cox [Thu, 3 Jan 2008 16:57:33 +0000 (16:57 +0000)]
USB: io_ti: clean up termios handling

Don't pass NULL into termios functions when calling them internally
Remove all the crap which then checks for NULL which can't occur now
Clear CMSPAR as it is not supported
Report the baud rate back to the caller properly (See FIXME someone with
the docs)

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ti_usb: termios cleanups
Alan Cox [Thu, 3 Jan 2008 17:03:11 +0000 (17:03 +0000)]
USB: ti_usb: termios cleanups

Remove internal NULL passing in termios code
Remove all the if checks it causes
Encode the baud rate back properly
Clear CMSPAR as it is not supported

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: mos7720: clean up termios
Alan Cox [Thu, 3 Jan 2008 17:01:18 +0000 (17:01 +0000)]
USB: mos7720: clean up termios

Remove lots of NULL checks that can no longer occur
Encode the baud rate back into the termios (again someone with docs see
FIXME to improve this further)

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: tosa_udc_use_gpio_vbus.patch
Dmitry Baryshkov [Fri, 21 Dec 2007 09:18:01 +0000 (12:18 +0300)]
USB: tosa_udc_use_gpio_vbus.patch

Use gpio_vbus instead of udc_is_connected for udc on tosa.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix HCD Kconfig goofage
David Brownell [Fri, 21 Dec 2007 08:29:05 +0000 (00:29 -0800)]
USB: fix HCD Kconfig goofage

Add a missing dependency which goofs up the xconfig display.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: gadget: at91_udc minor fix (there is no number six)
David Brownell [Mon, 10 Dec 2007 06:53:09 +0000 (22:53 -0800)]
USB: gadget: at91_udc minor fix (there is no number six)

Fix a small glitch noted by Yannick Cote.  There is no endpoint number
six, so if a (broken) host wrongly tried to change or read status of
that endpoint, the driver could access reserved register space.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Yannick Cote <yanick@yanos.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix NULL pointer dereference on drivers/usb/serial/whiteheat.c
Oliver Neukum [Thu, 20 Dec 2007 11:23:03 +0000 (12:23 +0100)]
USB: fix NULL pointer dereference on drivers/usb/serial/whiteheat.c

Am Sonntag, 16. Dezember 2007 05:23:47 schrieb Andrew Morton:
> On Sat, 15 Dec 2007 07:08:52 -0800 (PST) bugme-daemon@bugzilla.kernel.org wrote:
>
> > http://bugzilla.kernel.org/show_bug.cgi?id=9573

> > There's a null pointer dereference on drivers/usb/serial/whiteheat.c as
> > follows:
> >
> > (1) line 613:  the test "if (port->tty)" implies that null is a legal value
> >     for "port->tty" at that point
> >
> > (2) neither firm_open nor firm_purge initialize "port->tty"

drivers/usb/serial/usb-serial::serial_open() sets port->tty
The check for NULL is bogus. This patch removes the check.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: gadget: ethernet error path potential oops fix
David Brownell [Wed, 19 Dec 2007 19:27:51 +0000 (11:27 -0800)]
USB: gadget: ethernet error path potential oops fix

Fix potential (never-observed) oops on rare error path,
bugzilla #9594.  Fix uses the same test as used earlier.

Also make the adjacent "else" block look like an "else" block
instead of hiding like a bug.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ehci potential oops fix on ARC/TDI cores
David Brownell [Wed, 19 Dec 2007 19:30:39 +0000 (11:30 -0800)]
USB: ehci potential oops fix on ARC/TDI cores

Kernel bugzilla entry #9569 reports a potential OOPS in some code
supporting the integrated root hub TT support used on ARC/TDI
derived cores.  (This seems to have been a longstanding issue.)

This patch cleans up usage of urb->dev->tt to avoid that potential
oops and also fixes some overly long lines.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: add Marvell Orion USB host support
Tzachi Perelstein [Sat, 1 Dec 2007 16:07:04 +0000 (11:07 -0500)]
USB: add Marvell Orion USB host support

Some glue bits for the on-chip USB host controller in the Marvell Orion
family of ARM SoCs, which is basically EHCI compatible.

Signed-off-by: Tzachi Perelstein <tzachi@marvell.com>
Reviewed-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ehci-hcd: fix sparse warning about shadowing 'status' symbol
Marcin Slusarz [Sun, 16 Dec 2007 02:25:13 +0000 (03:25 +0100)]
USB: ehci-hcd: fix sparse warning about shadowing 'status' symbol

fix warning:
drivers/usb/host/ehci-hcd.c:832:8: warning: symbol 'status' shadows an earlier one
drivers/usb/host/ehci-hcd.c:790:71: originally declared here

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: usbdevfs_urb: __user annotation
Marcin Slusarz [Sun, 16 Dec 2007 02:23:20 +0000 (03:23 +0100)]
USB: usbdevfs_urb: __user annotation

fix warning:
drivers/usb/core/devio.c:1226:20: warning: incorrect type in assignment (different address spaces)
drivers/usb/core/devio.c:1226:20:    expected void *usercontext
drivers/usb/core/devio.c:1226:20:    got void [noderef] <asn:1>*

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: usb/storage/initializers.c: fix signedness difference
Marcin Slusarz [Sun, 16 Dec 2007 02:21:29 +0000 (03:21 +0100)]
USB: usb/storage/initializers.c: fix signedness difference

fix warnings:
drivers/usb/storage/initializers.c:83:26: warning: incorrect type in argument 5 (different signedness)
drivers/usb/storage/initializers.c:83:26:    expected unsigned int *act_len
drivers/usb/storage/initializers.c:83:26:    got int *<noident>
drivers/usb/storage/initializers.c:89:26: warning: incorrect type in argument 5 (different signedness)
drivers/usb/storage/initializers.c:89:26:    expected unsigned int *act_len
drivers/usb/storage/initializers.c:89:26:    got int *<noident>

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: PS3: Fix EHCI ISO transfer bug
David Brownell [Mon, 17 Dec 2007 06:37:40 +0000 (22:37 -0800)]
USB: PS3: Fix EHCI ISO transfer bug

This adds a workaround for an issue reported with ISO transfers
on some EHCI controllers, most recently with VIA KT800 and PS3
EHCI silicon.

The issue is that the silicon doesn't necessarily seem to be done
using ISO DMA descriptors (itd, sitd) when it marks them inactive.
(One theory is that the ill-defined mechanism where hardware caches
periodic transfer descriptors isn't invalidating their state...)
With such silicon, quick re-use of those descriptors makes trouble.
Waiting until the next frame seems to be a sufficient workaround.

This patch ensures that the relevant descriptors aren't available
for immediate re-use.  It does so by not recycling them until after
issuing the completion callback which would reuse them by enqueueing
an URB and thus (re)allocating ISO DMA descriptors.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Geoff Levand <geoffrey.levand@am.sony.com>
Cc: Masashi Kimoto <Masashi_Kimoto@hq.scei.sony.co.jp>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Spelling fixes
Joe Perches [Mon, 17 Dec 2007 19:40:18 +0000 (11:40 -0800)]
USB: Spelling fixes

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: gadget: pxa2xx_udc supports inverted vbus
Dmitry Baryshkov [Fri, 7 Dec 2007 02:18:03 +0000 (18:18 -0800)]
USB: gadget: pxa2xx_udc supports inverted vbus

Some boards (like e.g. Tosa) invert the VBUS-detection signal:
it's low when a host is supplying VBUS, and high otherwise.
Allow specifying whether gpio_vbus value is inverted.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: testing driver: don't free a locked mutex
Andrew Morton [Fri, 14 Dec 2007 00:15:34 +0000 (16:15 -0800)]
USB: testing driver: don't free a locked mutex

Dopey thing to do and lockdep will (or should) warn.

Spotted by Daniel Walker.

Cc: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Cc: Daniel Walker <dwalker@mvista.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: testing driver: convert dev->sem to mutex
Matthias Kaehlcke [Fri, 14 Dec 2007 00:15:33 +0000 (16:15 -0800)]
USB: testing driver: convert dev->sem to mutex

USB testing driver: convert semaphore dev->sem to the mutex API

Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: mon nopage
Nick Piggin [Fri, 14 Dec 2007 00:15:35 +0000 (16:15 -0800)]
USB: mon nopage

Convert USB mon driver from nopage to fault.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Acked-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: mct232: speed, new termios and compliance cleanups
Alan Cox [Fri, 14 Dec 2007 00:15:29 +0000 (16:15 -0800)]
USB: mct232: speed, new termios and compliance cleanups

Signed-off-by: Alan Cox <alan@redhat.com>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: keyspan_pda: clean up speed handling
Alan Cox [Fri, 14 Dec 2007 00:15:28 +0000 (16:15 -0800)]
USB: keyspan_pda: clean up speed handling

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: belkin_sa: clean up for new style termios and speed handling, plus style
Alan Cox [Fri, 14 Dec 2007 00:15:26 +0000 (16:15 -0800)]
USB: belkin_sa: clean up for new style termios and speed handling, plus style

A tester with actual hardware would be useful

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: pl2303: Add autosuspend support to pl2303 usb serial converter.
Sarah Sharp [Fri, 14 Dec 2007 22:09:30 +0000 (14:09 -0800)]
USB: pl2303: Add autosuspend support to pl2303 usb serial converter.

Signed-off-by: Sarah Sharp <saharabeara@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: pl2303: Move pl2303 vendor specific init to probe function.
Sarah Sharp [Fri, 14 Dec 2007 22:08:35 +0000 (14:08 -0800)]
USB: pl2303: Move pl2303 vendor specific init to probe function.

Without this fix, the pl2303 usb-serial adapter would not suspend properly
unless it had been opened first.  A pl2303 type_1 chip will still break if the
system is hibernated while the RS-232 connector is powered by another system.
This was broken before, and a reset resume does not fix it.  All other suspend
and autosuspend scenarios work with ATEN pl2303 adaptors with HX and type_1 chips.

Signed-off-by: Sarah Sharp <saharabeara@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: pl2303: Cleanup FISH and SOUP macros in pl2303 driver.
Sarah Sharp [Fri, 14 Dec 2007 22:08:00 +0000 (14:08 -0800)]
USB: pl2303: Cleanup FISH and SOUP macros in pl2303 driver.

Replace the FISH and SOUP macros that violated the macro guidelines in CodingStyle.
Turn them into function calls with clearer variable names.

Signed-off-by: Sarah Sharp <saharabeara@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: dummy_hcd: change the default power budget
Alan Stern [Thu, 6 Dec 2007 16:10:39 +0000 (11:10 -0500)]
USB: dummy_hcd: change the default power budget

This patch (as1025) changes the default power budget for dummy-hcd to
500 mA and makes it a preprocessor parameter for easier testing.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: EHCI: add separate IAA watchdog timer
Alan Stern [Tue, 11 Dec 2007 21:05:30 +0000 (16:05 -0500)]
USB: EHCI: add separate IAA watchdog timer

This patch (as1028) was mostly written by David Brownell; I made only
a few changes (extra log info and a small bug fix -- which might
account for why David's version had to be reverted).  It adds a new
watchdog timer to the ehci-hcd driver to be used exclusively for
detecting lost or missing IAA notifications.

Previously a shared timer had been used, which may have led to some
problems as reported by Christian Hoffmann.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: add usbfs stubs for suspend and resume
Alan Stern [Tue, 4 Dec 2007 19:35:15 +0000 (14:35 -0500)]
USB: add usbfs stubs for suspend and resume

This patch (as1022b) adds stub methods for suspend and resume to the
usbfs driver.  There isn't much they can do since there's no way to
inform a user task about the events.  But it's important to have the
stubs, because an upcoming change to usbcore will automatically unbind
drivers that don't have those methods when a suspend occurs.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Edgeport USB Serial Converter: convert es_sem to mutex
Matthias Kaehlcke [Tue, 4 Dec 2007 15:15:40 +0000 (16:15 +0100)]
USB: Edgeport USB Serial Converter: convert es_sem to mutex

Edgeport USB Serial Converter: convert semaphore es_sem to the
mutex API

Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: updates to usb_reset_composite_device()
Alan Stern [Mon, 3 Dec 2007 20:44:29 +0000 (15:44 -0500)]
USB: updates to usb_reset_composite_device()

This patch (as1023) updates the code in usb_reset_composite_device():

Some local variable declarations are moved to inner loops.

The interface locks are not acquired.  This isn't necessary
any more; its only reason was to prevent an interface from
being suspended or resumed during the reset.  But now
interface power management is controlled by the USB device
lock, not by the interface lock.

The check for whether the interface is registered is removed.
There doesn't seem to be any reason for checking; a driver
for a non-registered interface deserves to be informed of
device resets just as much as any other.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: repair USBDEVFS_CONNECT ioctl
Alan Stern [Mon, 3 Dec 2007 20:42:10 +0000 (15:42 -0500)]
USB: repair USBDEVFS_CONNECT ioctl

For as long as I've known about it, the USBDEVFS_CONNECT ioctl hasn't
done what it's supposed to.  The current code reprobes _all_ the
unbound USB interfaces; this patch (as1021) makes it reprobe only the
interface for which it was called.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb: Remove OHCI useless masking/unmasking of WDH interrupt
Benjamin Herrenschmidt [Thu, 6 Dec 2007 21:29:46 +0000 (13:29 -0800)]
usb: Remove OHCI useless masking/unmasking of WDH interrupt

The OHCI driver's IRQ handler, while processing a WDH interrupt, masks
and unmasks it.  I believe this is both broken (the write may still be
posted during the donelist processing it's trying to safeguard) and
useless as this IRQ may not be reissued until it's acked (unless this
legacy code is an uncommented workaround for some chip erratum).

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: convert ehci debug files to use debugfs instead of sysfs
Tony Jones [Tue, 11 Sep 2007 21:07:31 +0000 (14:07 -0700)]
USB: convert ehci debug files to use debugfs instead of sysfs

We should not have multiple line files in sysfs, this moves the data to
debugfs instead, like the UHCI driver.

Signed-off-by: Tony Jones <tonyj@suse.de>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: convert ohci debug files to use debugfs instead of sysfs
Tony Jones [Tue, 11 Sep 2007 21:07:31 +0000 (14:07 -0700)]
USB: convert ohci debug files to use debugfs instead of sysfs

We should not have multiple line files in sysfs, this moves the data to
debugfs instead, like the UHCI driver.

Signed-off-by: Tony Jones <tonyj@suse.de>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: always announce a device has been added to the system
Greg Kroah-Hartman [Tue, 27 Nov 2007 06:11:55 +0000 (22:11 -0800)]
USB: always announce a device has been added to the system

Distros (like SuSE) want to know this information, to make it easier
to handle support issues.  Might as well let everyone benefit from this.
This is also enabled whenever CONFIG_USB_DEBUG is enabled, to help with
debugging.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: dummy_hcd: don't register drivers on the platform bus
Alan Stern [Tue, 20 Nov 2007 21:28:55 +0000 (16:28 -0500)]
USB: dummy_hcd: don't register drivers on the platform bus

This patch (as1017) makes dummy_hcd behave more like the other USB
peripheral controller drivers by no longer registering its
gadget driver on the platform bus.  Doing that has always been a
mistake, since a usb_gadget_driver isn't a platform_driver.  Instead
the gadget driver is left unregistered in sysfs.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: force handover port to companion when hub_port_connect_change fails
Balaji Rao [Wed, 21 Nov 2007 20:28:14 +0000 (01:58 +0530)]
USB: force handover port to companion when hub_port_connect_change fails

This patch hands over the port to the companion when the
hub_port_connect_change fails.

Signed-off-by: Balaji Rao <balajirrao@gmail.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: usb peripheral controller driver oops avoidance
Patrik Sevallius [Tue, 20 Nov 2007 17:32:00 +0000 (09:32 -0800)]
USB: usb peripheral controller driver oops avoidance

I'm having problem with oopses when rebooting, if I modprobe g_serial
and rmmod g_serial and do a reboot I get an oops in device_shutdown().
The reason seems to be that usb_gadget_unregister_driver() doesn't do
enough cleanup.  With this at91_udc patch I don't get the oops.

Signed-off-by: Patrik Sevallius <patrik.sevallius@enea.com>
[ Same bug was in other peripheral controller drivers; fixed ]
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: cyberjack: remove a unnecessary variable.
Andre Haupt [Tue, 20 Nov 2007 10:41:37 +0000 (11:41 +0100)]
USB: cyberjack: remove a unnecessary variable.

This also fixes a sparse warning that symbol 'result' shadows an earlier one.

Signed-off-by: Andre Haupt <andre@bitwigglers.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Prepare serial core for autosuspend.
Sarah Sharp [Wed, 14 Nov 2007 01:10:09 +0000 (17:10 -0800)]
USB: Prepare serial core for autosuspend.

Claim the interface for a USB to serial converter when the tty is open,
and release the interface when the tty is closed.

If a driver doesn't provide a resume function, use the generic resume
instead.

Make sure the generic resume function does not submit the URBs if we're
coming back from autosuspend.  On autoresume, we know that the open
function will be called next, which will attempt to submit the URBs.  If
we submit them in the resume function, the open will fail.

This works for:
 - autosuspend
 - suspending with the tty open or closed
 - hibernate with the tty closed

A hibernate (or a suspend that causes the USB subsystem to lose power)
has issues.  If you have the tty open when you hibernate, a new tty will
be created when the device re-enumerates during resume.

Signed-off-by: Sarah Sharp <sarah.a.sharp@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: gadget code switches to pr_err() and friends
David Brownell [Mon, 19 Nov 2007 20:58:36 +0000 (12:58 -0800)]
USB: gadget code switches to pr_err() and friends

We now have pr_err(), pr_warning(), and friends ... start using
them in the gadget stack instead of printk(KERN_ERR) and friends.
This gives us shorter lines and somewhat increased readability.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: don't change HC power state for a FREEZE
Alan Stern [Mon, 19 Nov 2007 20:57:45 +0000 (15:57 -0500)]
USB: don't change HC power state for a FREEZE

This patch (as1016) prevents PCI-based host controllers from
undergoing a power-state change during a FREEZE or a PRETHAW.  Such
changes are needed only during a SUSPEND.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: make ksuspend_usbd thread non-freezable
Alan Stern [Mon, 19 Nov 2007 15:15:02 +0000 (10:15 -0500)]
USB: make ksuspend_usbd thread non-freezable

This patch (as1012b) makes the ksuspend_usbd kernel thread
non-freezable.  Since the PM core has been changed to lock all devices
during a system sleep, the thread no longer needs to be frozen.  It
won't interfere with a system sleep because before trying to resume a
root hub device, it acquires the device's lock.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Drop unnecessary continue in a few drivers
Julia Lawall [Wed, 14 Nov 2007 08:15:16 +0000 (09:15 +0100)]
USB: Drop unnecessary continue in a few drivers

Continue is not needed at the bottom of a loop.

The semantic patch implementing this change is as follows:

@@
@@

for (...;...;...) {
   ...
   if (...) {
     ...
-   continue;
   }
}

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: linux/usb/Kbuild needs only "header-y", not "unifdef-y"
Robert P. J. Day [Wed, 14 Nov 2007 21:21:00 +0000 (16:21 -0500)]
USB: linux/usb/Kbuild needs only "header-y", not "unifdef-y"

Given that none of the referenced header files test the proprocessor
conditional __KERNEL__, there's no point "unifdef"fing them.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: usb_serial_console: allocate fake tty and termios before calling driver open...
Aristeu Rozanski [Tue, 13 Nov 2007 22:22:07 +0000 (17:22 -0500)]
USB: usb_serial_console: allocate fake tty and termios before calling driver open() method

The usb serial method set_termios() is called for the first time from
open() method in order to set up the termios structure with the default
device's settings, ignoring the current settings. Once it's initialized,
the next set_termios() calls will update the device with the
tty->termios settings.
Currently USB serial console code calls the driver open() method without
a tty and after that will allocate a fake tty and termios so the command
line arguments can be applied to the device
(console=ttyUSB0,115200,...). This makes the driver overwrite the
termios with the default settings and not applying the command line
options.

This patch changes usb_console_setup() to allocate the fake tty and
termios before the open() method is called.

Tested successfully with a pl2303

Signed-off-by: Aristeu Rozanski <arozansk@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: usb_serial: clean tty reference in the last close
Aristeu Rozanski [Mon, 12 Nov 2007 20:15:02 +0000 (15:15 -0500)]
USB: usb_serial: clean tty reference in the last close

When a usb serial adapter is used as console, the usb serial console
driver bumps the open_count on the port struct used but doesn't attach
a real tty to it (only a fake one temporaly). If this port is opened later
using the regular character device interface, the open method won't
initialize the port, which is the expected, and will receive a brand new
tty struct created by tty layer, which will be stored in port->tty.

When the last close is issued, open_count won't be 0 because of the
console usage and the port->tty will still contain the old tty value. This
is the last ttyUSB<n> close so the allocated tty will be freed by the
tty layer. The usb_serial and usb_serial_port are still in use by the
console, so port_free() won't be called (serial_close() ->
usb_serial_put() -> destroy_serial() -> port_free()), so the scheduled
work (port->work, usb_serial_port_work()) will still run. And
usb_serial_port_work() does:
(...)
        tty = port->tty;
        if (!tty)
                return;

        tty_wakeup(tty);
which causes (manually copied):

Faulting instruction address: 0x6b6b6b68
Oops: Kernel access of bad area, sig: 11 [#1]
PREEMPT PowerMac
Modules linked in: binfmt_misc ipv6 nfs lockd nfs_acl sunrpc dm_snapshot dm_mirror dm_mod hfsplus uinput ams input_polldev genrtc cpufreq_powersave i2c_powermac therm_adt746x snd_aoa_codec_tas snd_aoa_fabric_layout snd_aoa joydev snd_aoa_i2sbus snd_pcm_oss snd_mixer_oss snd_pcm snd_timer snd_page_alloc pmac_zilog serial_core evdev ide_cd cdrom snd appletouch soundcore snd_aoa_soundbus bcm43xx firmware_class usbhid ieee80211softmac ff_memless firewire_ohci firewire_core ieee80211 ieee80211_crypt crc_itu_t sungem sungem_phy uninorth_agp agpart ssb
NIP: 6b6b6b68 LR: c01b2108 CTR: 6b6b6b6b
REGS: c106de80 TRAP: 0400   Not tainted  (2.6.24-rc2)
MSR: 40009032 <EE,ME,IR,DR>  CR: 82004024  XER: 00000000
TASK = c106b4c0[5] 'events/0' THREAD: c106c000
GPR00: 6b6b6b6b c106df30 c106b4c0 c2d613a0 00009032 00000001 00001a00 00000001
GPR08: 00000008 00000000 00000000 c106c000 42004028 00000000 016ffbe0 0171a724
GPR16: 016ffcf4 00240e24 00240e70 016fee68 016ff9a4 c03046c4 c0327f50 c03046fc
GPR24: c106b6b9 c106b4c0 c101d610 c106c000 c02160fc c1eac1dc c2d613ac c2d613a0
NIP [6b6b6b68] 0x6b6b6b68
LR [c01b2108] tty_wakeup+0x6c/0x9c
Call Trace:
[c106df30] [c01b20e8] tty_wakeup+0x4c/0x9c (unreliable)
[c106df40] [c0216138] usb_serial_port_work+0x3c/0x78
[c106df50] [c00432e8] run_workqueue+0xc4/0x15c
[c106df90] [c0043798] worker_thread+0xa0/0x124
[c106dfd0] [c0048224] kthread+0x48/0x84
[c106dff0] [c00129bc] kernel_thread+0x44/0x60
Instruction dump:
XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
Slab corruption: size-2048 start=c2d613a0, len=2048
Redzone: 0x9f911029d74e35b/0x9f911029d74e35b.
Last user: [<c01b16d8>](release_one_tty+0xbc/0xf4)
050: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
Prev obj: start=c2d60b88, len=2048
Redzone: 0x9f911029d74e35b/0x9f911029d74e35b.
Last user: [<c00f30ec>](show_stat+0x410/0x428)
000: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
010: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b

This patch avoids this, clearing port->tty considering if the port is
used as serial console or not

Signed-off-by: Aristeu Rozanski <arozansk@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: usb_serial_console: fix command line parsing
Aristeu Rozanski [Mon, 12 Nov 2007 20:14:49 +0000 (15:14 -0500)]
USB: usb_serial_console: fix command line parsing

Currently usb serial console support ignores the device and always use
ttyUSB0.

Signed-off-by: Aristeu Rozanski <arozansk@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: cypress_cy7c63: updated contact/usage information
Oliver Bock [Sun, 11 Nov 2007 23:42:16 +0000 (00:42 +0100)]
USB: cypress_cy7c63: updated contact/usage information

here's a minor update to the cypress_cy7c63 driver
providing new contact and usage information.

From: Oliver Bock <bock@tfh-berlin.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: add Printer Gadget Driver
Craig W. Nadler [Sun, 11 Nov 2007 23:00:15 +0000 (15:00 -0800)]
USB: add Printer Gadget Driver

G_PRINTER: Adds a USB printer gadget driver for use in printer firmware.

This adds a USB printer gadget driver for use in printer firmware.
The printer gadget channels data between the USB host and a userspace
program driving the print engine. The user space program reads and
writes the device file /dev/g_printer to receive or send printer data.
It can use ioctl calls to the device file to get or set printer status.

Signed-off-by: Craig W. Nadler <craig@nadler.us>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: usb-storage: new "lockable" subclass 0x07
Alan Stern [Thu, 8 Nov 2007 20:15:28 +0000 (15:15 -0500)]
USB: usb-storage: new "lockable" subclass 0x07

This patch (as1011) adds a #define for the newly-created Lockable
(i.e., password-protected) subclass 0x07 for USB mass-storage devices.
The private ISD200 entry (which had been mapped to subclass 0x07) is
moved to 0xf0, which is unlikely to conflict with any official
subclass designation.

The US_SC_MIN and US_SC_MAX constants aren't used anywhere, so the
patch removes them.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Add missing "space" to printk messages
Joe Perches [Tue, 20 Nov 2007 01:53:33 +0000 (17:53 -0800)]
USB: Add missing "space" to printk messages

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: m66592-udc: Add support for SH7722 USBF
Yoshihiro Shimoda [Thu, 22 Nov 2007 12:00:30 +0000 (21:00 +0900)]
USB: m66592-udc: Add support for SH7722 USBF

Add support for SuperH SH7722 USB Function.

M66592 is similar to SH7722 USBF. It can support SH7722 USBF by
changing several M66592 code.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Acked-by: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: TI 3410/5052 USB Serial: convert td_open_close_lock to mutex
Matthias Kaehlcke [Wed, 21 Nov 2007 23:13:16 +0000 (15:13 -0800)]
USB: TI 3410/5052 USB Serial: convert td_open_close_lock to mutex

TI 3410/5052 USB Serial: convert semaphore td_open_close_lock to the mutex
API.

Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: device DMA support on OMAP2
Kyungmin Park [Wed, 21 Nov 2007 23:13:15 +0000 (15:13 -0800)]
USB: device DMA support on OMAP2

The current omap udc dosen't support the DMA mode and it has some problem
at setup time on OMAP2 with previous patch file.  I found that the code
assumes bulk out required the big data transfer.  But MODE SELECT(6) sent
the only 24 bytes.  it makes a problem.  So I implement the small packets
handling for it.

It is tested with both linux and windows.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: David Brownell <david-b@pacbell.net>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>