GitHub/LineageOS/android_kernel_motorola_exynos9610.git
17 years agoUSB: usb/dma doc updates
David Brownell [Mon, 2 Jul 2007 06:33:12 +0000 (23:33 -0700)]
USB: usb/dma doc updates

This patch updates some of the documentation about DMA buffer management
for USB, and ways to avoid extra copying.  Our understanding of the issues
has improved over time.

 - Most drivers should *avoid* the dma-coherent allocators.  There are
   a few exceptions (like the HID driver).

 - Some methods are currently commented out; it seems folk writing
   USB drivers aren't doing performance tuning at that level yet.

 - Just avoid highmem; there's no good way to pass an "I can do highmem
   DMA" capability through a driver stack.  This is easy, everything
   already avoids highmem.  But it'd be nice if x86_32 systems with much
   physical memory could use it directly with network adapters and mass
   storage devices.  (Patch, anyone?)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: drivers/usb/storage/unusual_devs.h whitespace cleanup
S.Caglar Onur [Wed, 4 Jul 2007 20:52:47 +0000 (13:52 -0700)]
USB: drivers/usb/storage/unusual_devs.h whitespace cleanup

Following patch removes trailing whitespaces at the ends of lines and converts
smarttabs/whitespaces into real tabs.

Signed-off-by: S.Caglar Onur <caglar@pardus.org.tr>
Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: remove Makefile reference to obsolete OHCI_AT91
Robert P. J. Day [Mon, 9 Jul 2007 19:03:13 +0000 (12:03 -0700)]
USB: remove Makefile reference to obsolete OHCI_AT91

Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: io_*: remove bogus termios no change checks
Alan Cox [Mon, 9 Jul 2007 19:03:12 +0000 (12:03 -0700)]
USB: io_*: remove bogus termios no change checks

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>
17 years agoUSB: mos7720: remove bogus no termios change check
Alan Cox [Mon, 9 Jul 2007 19:03:12 +0000 (12:03 -0700)]
USB: mos7720: remove bogus no termios change check

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>
17 years agoUSB: visor and whiteheat: remove bogus termios change checks
Alan Cox [Mon, 9 Jul 2007 19:03:11 +0000 (12:03 -0700)]
USB: visor and whiteheat: remove bogus termios change checks

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>
17 years agoUSB: pl2303: remove bogus checks and fix speed support to use tty_get_baud_rate()
Alan Cox [Mon, 9 Jul 2007 19:03:10 +0000 (12:03 -0700)]
USB: pl2303: remove bogus checks and fix speed support to use tty_get_baud_rate()

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>
17 years agoUSB: mos7840.c: turn this into a serial driver
Alan Cox [Mon, 9 Jul 2007 19:03:10 +0000 (12:03 -0700)]
USB: mos7840.c: turn this into a serial driver

The MOS driver is "interesting", in a bad kind of 'how the hell did this
get merged' kind of way

- Remove the bogus termios change check
- Remove the duplicate code for half the ioctls
- Remove the supporting code to duplicate the ioctl code

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>
17 years agoUSB: make the usb_device numa_node get assigned from controller
Yinghai Lu [Mon, 9 Jul 2007 19:03:09 +0000 (12:03 -0700)]
USB: make the usb_device numa_node get assigned from controller

So we can use dev_to_node(&usb_dev->dev) later in kmalloc_node to dma buffer

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Cc: Andi Kleen <ak@suse.de>
Acked-by: Christoph Lameter <clameter@sgi.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: ftdi_sio: fix oops due to processing workarounds too early
Oliver Neukum [Mon, 9 Jul 2007 19:03:08 +0000 (12:03 -0700)]
USB: ftdi_sio: fix oops due to processing workarounds too early

Fix an oops that happens in relation with applying work arounds for buggy
ftdi_sio devices.  The quirks were handled too early because due to changes in
the initialisation of usb serial devices the device was not fully initialised
when the old hook was called.

Addresses bug 8564

Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: drivers/block/ub.c: use list_for_each_entry()
Matthias Kaehlcke [Mon, 9 Jul 2007 19:03:07 +0000 (12:03 -0700)]
USB: drivers/block/ub.c: use list_for_each_entry()

Low performance USB storage driver: Use list_for_each_entry() instead
of list_for_each()

Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: fix gregkh-usb-usb-use-menuconfig-objects
Jan Engelhardt [Mon, 9 Jul 2007 19:03:06 +0000 (12:03 -0700)]
USB: fix gregkh-usb-usb-use-menuconfig-objects

Generally, Jens Axboe was against 'default y', so I'll have some patches to
remove it.

Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: Make usb-autosuspend timer 1 sec jiffy aligned
Venki Pallipadi [Mon, 9 Jul 2007 19:03:06 +0000 (12:03 -0700)]
USB: Make usb-autosuspend timer 1 sec jiffy aligned

Make usb autosuspend timers 1sec jiffy aligned.

This helps to reduce the frequency at which the CPU must be taken out of a
lower-power state.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: Don't autosuspend Blackberry devices.
Jeremy Katz [Tue, 19 Jun 2007 21:16:10 +0000 (17:16 -0400)]
USB: Don't autosuspend Blackberry devices.

Blackberry devices charge over USB.  By autosuspending the port, they are
not able to charge reliably.

Signed-off-by: Jeremy Katz <katzj@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: Support Blackberry Pearl with berry_charge
Jeremy Katz [Tue, 19 Jun 2007 21:15:38 +0000 (17:15 -0400)]
USB: Support Blackberry Pearl with berry_charge

The Blackberry Pearl (8100) needs similar tweaks as older Blackberry models
to be able to charge when connected via USB.  The Pearl also adds an
additional need to go into a separate mode for fully accessing the device;
do that by default as well.

Changes based on the changes from bcharge in the barry project
(http://barry.sf.net)

Signed-off-by: Jeremy Katz <katzj@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: add IAD support to usbfs and sysfs
Craig W. Nadler [Sat, 16 Jun 2007 03:14:35 +0000 (23:14 -0400)]
USB: add IAD support to usbfs and sysfs

USB_IAD: Adds support for USB Interface Association Descriptors.

This patch adds support to the USB host stack for parsing, storing, and
displaying Interface Association Descriptors. In /proc/bus/usb/devices
lines starting with A: show the fields in an IAD. In sysfs if an
interface on a USB device is referenced by an IAD the following files
will be added to the sysfs directory for that interface:
iad_bFirstInterface, iad_bInterfaceCount, iad_bFunctionClass, and
iad_bFunctionSubClass, iad_bFunctionProtocol

Signed-off-by: Craig W. Nadler <craig@nadler.us>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: mos7720: change developer email addresses
Greg Kroah-Hartman [Mon, 25 Jun 2007 08:08:01 +0000 (01:08 -0700)]
USB: mos7720: change developer email addresses

Update the original developer's email addresses at their request.

Cc: Vijaya Kumar <vijaykumar.gn@gmail.com>
Cc: Ajay Kumar <naanuajay@yahoo.com>
Cc: Gurudeva <ngurudeva@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: Fix off-by-1 error in the scatter-gather library
Alan Stern [Thu, 21 Jun 2007 20:26:46 +0000 (16:26 -0400)]
USB: Fix off-by-1 error in the scatter-gather library

The loop in usb_sg_wait() is structured in a way that makes it hard to
tell, when the loop exits, whether or not the last URB submission
succeeded.  This patch (as928) changes it from a "for" loop to a
"while" loop and keeps "i" always equal to the number of successful
submissions.  This fixes an off-by-one error which can show up when
the first URB submission fails.

The patch also removes a couple of lines that initialize fields which
don't need to be initialized.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: Don't resume root hub if the controller is suspended
Alan Stern [Thu, 21 Jun 2007 20:25:35 +0000 (16:25 -0400)]
USB: Don't resume root hub if the controller is suspended

Root hubs can't be resumed if their parent controller device is still
suspended.  This patch (as925) adds a check for that condition in
hcd_bus_resume() and prevents it from being treated as a fatal
controller failure.

ehci-hcd is updated to add the corresponding test.  Unnecessary
debugging messages are removed from uhci-hcd and dummy-hcd.  The
error return code from dummy-hcd is changed to -ESHUTDOWN, the same as
the others.  ohci-hcd doesn't need any changes.

Suspend handling in the non-PCI host drivers is somewhat hit-and-miss.
This patch shouldn't have any effect on them.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: Remove usages of dev->power.power_state
Alan Stern [Thu, 21 Jun 2007 20:25:17 +0000 (16:25 -0400)]
USB: Remove usages of dev->power.power_state

This patch (as922) removes all but one of the remaining vestiges of
dev->power.power_state from usbcore.  The only usage left must remain
until the deprecated "power/state" sysfs attribute is gone.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: usblp: add dynamic URBs, fix races
Pete Zaitcev [Thu, 21 Jun 2007 19:44:56 +0000 (12:44 -0700)]
USB: usblp: add dynamic URBs, fix races

This patch's main bulk aims to make usblp the premier driver for code
pillaging once again. The code is as streamlined as possible and is bug-free
as possible. The usb-skeleton performs the same function, but is somewhat
abstract. The usblp is usb-skeleton which is actually used by many.

Since I combed a few small bugs away, this also fixes the small races we
had in usblp for a while. For example, now it's possible for several threads
to make write(2) calls (sounds silly, but consider a printer for paper
record, where every line of text is self-contained and thus it's all right
to have them interleaved). Also gone are issues with interrupts using
barriers dangerously.

This patch makes use of Oliver's anchor, and so it must trail the anchor
patch on the way to Linus.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: Pete's taking over usblp
Pete Zaitcev [Thu, 21 Jun 2007 22:18:35 +0000 (15:18 -0700)]
USB: Pete's taking over usblp

Vojtech agreed to pass usblp over to me, so if you find bugs don't bug him.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Vojtech Pavlik <vojtech@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: fsl_usb2_udc: fix bug for portsc bit masking
Li Yang [Tue, 19 Jun 2007 09:33:48 +0000 (17:33 +0800)]
USB: fsl_usb2_udc: fix bug for portsc bit masking

Fix a bug that PORT_TYPE and PORT_WIDTH aren't masked correctly in portsc.

Signed-off-by: Christopher Cason <chris.cason@nec.com.au>
Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: autosuspend for usblcd
Oliver Neukum [Wed, 13 Jun 2007 15:13:31 +0000 (17:13 +0200)]
USB: autosuspend for usblcd

this patch implements autosuspend for the usblcd driver. It uses
the new usb_anchor infrastructure. Many thanks to Georges for testing.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Cc: Georges Toth <g.toth@e-biz.lu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb gadget: Rename husb2dev -> usba
Haavard Skinnemoen [Thu, 14 Jun 2007 16:01:45 +0000 (18:01 +0200)]
usb gadget: Rename husb2dev -> usba

husb2dev was the internal name of the USB Device Controller on
AT32AP7000. Rename it to "atmel_usba", which is closer to the official
name used in documentation and marketing material.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: Add URB_FREE_BUFFER flag and the logic behind it
Marcel Holtmann [Wed, 13 Jun 2007 06:02:11 +0000 (08:02 +0200)]
USB: Add URB_FREE_BUFFER flag and the logic behind it

USB: Add URB_FREE_BUFFER flag for freeing the transfer buffer

In some cases it is not needed that the driver keeps track of the
transfer buffer of an URB. It can be simply freed along with the
URB itself when the reference count goes down to zero. The new
flag URB_FREE_BUFFER enables this behavior.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: Fix up full-speed bInterval values in high-speed interrupt descriptor
Laurent Pinchart [Tue, 12 Jun 2007 19:47:17 +0000 (21:47 +0200)]
USB: Fix up full-speed bInterval values in high-speed interrupt descriptor

Many device manufacturers are using full-speed bInterval values in high-speed
interrupt endpoint descriptors. If the bInterval value is greater than 16,
assume the device uses full-speed descriptors and fix the value accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: usb-skeleton: use anchors in pre/post reset
Oliver Neukum [Mon, 11 Jun 2007 12:55:51 +0000 (14:55 +0200)]
USB: usb-skeleton: use anchors in pre/post reset

use anchors in pre/post_reset

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: usb-skeleton" use anchors in suspend/resume handling
Oliver Neukum [Mon, 11 Jun 2007 12:55:08 +0000 (14:55 +0200)]
USB: usb-skeleton" use anchors in suspend/resume handling

use anchors in suspend/resume handling

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: usb-skeleton: use anchors in disconnect handling
Oliver Neukum [Mon, 11 Jun 2007 12:54:02 +0000 (14:54 +0200)]
USB: usb-skeleton: use anchors in disconnect handling

use anchors in disconnect handling

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: ir_usb: Clean up the worst of it, remove exciting 'crash on open' feature
Alan Cox [Fri, 22 Jun 2007 13:44:54 +0000 (14:44 +0100)]
USB: serial: ir_usb: Clean up the worst of it, remove exciting 'crash on open' feature

- Drivers don't call ldisc termios methods. They certainly don't call
them the way this one does - remove wrong call
- The tty buffer code isn't designed to be abused from IRQ handlers and
the new buffering removes the need for the uglies involved - fix them
- Style
- Remove incorrect baud and change handling for termios changes

The driver now has some style, but not a lot - it goes insane if you have
two dongles for example as it continues to use global variables for per
dongle state. That bit isn't my problem.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: belkin_sa: Various needed fixes
Alan Cox [Fri, 22 Jun 2007 13:40:18 +0000 (14:40 +0100)]
USB: serial: belkin_sa: Various needed fixes

Use the baud rate stuff from the kernel don't parse CBAUD directly
Remove pointless and wrong 'no change' check

Could do with some good testing as well but again better than adding &&
BROKEN

(The use of BELKIN_SA_BAUD() might seem a bit odd but x/a = b and x/b =
a (rounded for integers)).

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: ark3116.c: Mixed fixups
Alan Cox [Fri, 22 Jun 2007 13:36:29 +0000 (14:36 +0100)]
USB: serial: ark3116.c: Mixed fixups

o Don't parse the cflag for baud rates, its not valid to do so
any more and this driver got it wrong anyway
o Don't do clever termios change checks in drivers and get them
wrong (arguably we should do some smart ones in the tty core but
stty to change nothing is *not* a common or critical path

I don't have the hardware so if you can test this carefully please do. I
thought fixing it up this far was better than marking it and other bits of
USB serial && BROKEN

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: sierra: cleanup the startup and shutdown path
Greg Kroah-Hartman [Wed, 20 Jun 2007 05:22:23 +0000 (14:22 +0900)]
USB: sierra: cleanup the startup and shutdown path

This removes the ugly code that was copied from the keyspan driver and
allocates the in urbs in a much shorter code path that can be understood
easier.

Also turned off the interrupt urb when no port was open as it's not nice
to keep the bus busy for no good reason at all (this should be a power
savings.)

All in all, this saved over 40 lines of code and cleaned things up
better.

Cc: Kevin Lloyd <linux@sierrawireless.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: sierra: remove incorrect usage of the urb status field
Greg Kroah-Hartman [Wed, 20 Jun 2007 05:22:23 +0000 (14:22 +0900)]
USB: sierra: remove incorrect usage of the urb status field

You can't rely on the fact that the status really is correct like it was.

Also simplified the write path and now we allocate the urb and data on
the fly, instead of trying to do that really odd timeout check which I
am guessing doesn't really work properly.  This should speed up the
device by keeping the hardware queue full easier.

As a benefit, this reduces the size of the driver.

Cc: Kevin Lloyd <linux@sierrawireless.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: whiteheat: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: whiteheat: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: visor: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: visor: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: ti_usb_3410_5052: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: ti_usb_3410_5052: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Al Borchers <alborchers@steinerpoint.com>
Cc: Peter Berger <pberger@brimson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: sierra: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: sierra: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Kevin Lloyd <linux@sierrawireless.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: safe_serial: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: safe_serial: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Stuart Lynne <sl@lineo.com>
Cc: Tom Rushworth <tbr@lineo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: pl2303: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: pl2303: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: oti6858: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: oti6858: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: option: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: option: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Matthias Urlichs <smurf@smurf.noris.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: omninet: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: omninet: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: navman: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: navman: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: mos7840: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: mos7840: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Paul Schroeder <pschroeder@uplogix.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: mos7720: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: mos7720: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: VijayaKumar G.N. <vijaykumar@aspirecom.net>
Cc: AjayKumar <ajay@aspirecom.net>
Cc: Gurudeva N. <gurudev@aspirecom.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: mct_u232: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: mct_u232: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Wolfgang Grandegger <wolfgang@ces.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: kobil_sct: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: kobil_sct: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Thomas Wahrenbruch <linuxusb@kobil.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: kl5kusb105: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: kl5kusb105: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Utz-Uwe Haus <haus@uuhaus.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: keyspan_pda: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: keyspan_pda: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: keyspan: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: keyspan: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: ir-usb: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: ir-usb: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Gary Brubaker <xavyer@ix.netcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: ipw: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: ipw: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Roelf Diedericks <roelfd@inet.co.za>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: ipaq: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: ipaq: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Ganesh Varadarajan <ganesh@veritas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: io_ti: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: io_ti: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Al Borchers <alborchers@steinerpoint.com>
Cc: Peter Berger <pberger@brimson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: io_edgeport: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: io_edgeport: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Al Borchers <alborchers@steinerpoint.com>
Cc: Peter Berger <pberger@brimson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: generic: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: generic: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: garmin_gps: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: garmin_gps: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Hermann Kneissel <herkne@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: ftdi_sio: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: ftdi_sio: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Kuba Ober <kuba@mareimbrium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: empeg: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: empeg: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Gary Brubaker <xavyer@ix.netcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: digi_acceleport: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: digi_acceleport: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Peter Berger <pberger@brimson.com>
Cc: Al Borchers <borchers@steinerpoint.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: cypress_m8: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: cypress_m8: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Lonnie Mendez <dignome@gmail.com>
Cc: Neil Whelchel <koyama@firstlight.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: cyberjack: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: cyberjack: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: <support@reiner-sct.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: belkin_sa: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: belkin_sa: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: airprime: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: airprime: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: serial: aircable: clean up urb->status usage
Greg Kroah-Hartman [Fri, 15 Jun 2007 22:44:13 +0000 (15:44 -0700)]
USB: serial: aircable: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Cc: <linux-usb-devel@lists.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: fix up license wording on some of my usb-serial drivers
Greg Kroah-Hartman [Tue, 12 Jun 2007 18:43:37 +0000 (11:43 -0700)]
USB: fix up license wording on some of my usb-serial drivers

Also update the copyright date on the pl2303 driver, as it was out of date.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: free DMA mappings if enqueue fails
Pete Zaitcev [Fri, 8 Jun 2007 20:37:49 +0000 (13:37 -0700)]
usb: free DMA mappings if enqueue fails

This patch releases DMA resources if enqueue fails in the HCD.

Linux had this bug ever since we converted from virt_to_bus for 2.4.
It is difficult to hit. A user would need a significant memory pressure
or some other unusual condition.

It was reported to me by IBM. They ran a management application for
RSA II adapters which sent Bulk requests to an Interrupt endpoint.
Submissions got rejected by HCD due to an invalid interval value
and the swiotlb pool became depleted in the matter of hours.

We fixed the invalid interval issue in devio.c separately, but this
seems to be a bug worth fixing as well.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: Handle bogus low-speed Bulk endpoints
Alan Stern [Fri, 8 Jun 2007 19:25:02 +0000 (15:25 -0400)]
USB: Handle bogus low-speed Bulk endpoints

A noticeable number of low-speed devices mistakenly include
descriptors for Bulk endpoints, which is forbidden by the USB spec.
In an attempt to make such devices more usable, this patch (as924)
converts the descriptors to Interrupt with an interval of 1 ms.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agosynchronization in usb_serial_put
Benny Halevy [Tue, 15 May 2007 08:15:27 +0000 (11:15 +0300)]
synchronization in usb_serial_put

I think there is a race between usb_serial_put() and
usb_serial_get_by_index() (and get_free_serial()) with regards
to handling the serial port refcount.

usb_serial_get_by_index() gets a reference on the serial port under
table_lock while return_serial releases all the returned ports
from the table under the same lock.  However, the table_lock is not
taken around the call to kref_put, theoretically allowing to sneak
in and grab a reference after kref_put has already determined that
the reference count is zero (and before calling destroy_serial)
causing use after free.

Signed-off-by: Benny Halevy <bhalevy@ns1.bhalevy.com>
Cc: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: io_ti: sleep with spinlock held detected by automatic tool
Oliver Neukum [Tue, 5 Jun 2007 08:50:48 +0000 (10:50 +0200)]
USB: io_ti: sleep with spinlock held detected by automatic tool

this fixes the sleep found with the automatic tool.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoehci-hub: improved over-current recovery
Christian Engelmayer [Wed, 30 May 2007 18:04:48 +0000 (11:04 -0700)]
ehci-hub: improved over-current recovery

According to the USB Specification Revision 2.0 chapter 11.12.5
a hub experiencing an over-current condition must place all
affected ports in the powered-off state. It seems that some root
hubs need port power to be cycled by software in order to get back
to normal functionality after an over-current condition ... like
the EHCI implementation on an MPC8343E.

Signed-off-by: Christian Engelmayer <christian.engelmayer@frequentis.com>
Signed-off-by: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: usb host side can be configured given PCMCIA
David Brownell [Thu, 7 Jun 2007 21:13:26 +0000 (14:13 -0700)]
USB: usb host side can be configured given PCMCIA

Platforms with PCMCIA support can implement host-side USB with "sl811_cs",
so make sure this menu shows up on platforms with PCMCIA.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: usb-storage: use kthread_stop() for the control thread
Alan Stern [Thu, 7 Jun 2007 21:12:25 +0000 (17:12 -0400)]
USB: usb-storage: use kthread_stop() for the control thread

This patch (as923) makes usb-storage's control thread use
kthread_should_stop()/kthread_stop().  The scanning thread can't be
similarly converted until the core kthread implementation allows
threads to call do_exit().

The advantage of this change is that we can now be certain the control
thread has terminated before storage_disconnect() returns.  This will
simplify the locking requirements when autosuspend support is added.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB Gadget driver for Samsung s3c2410 ARM SoC
Arnaud Patard [Thu, 7 Jun 2007 04:05:49 +0000 (21:05 -0700)]
USB Gadget driver for Samsung s3c2410 ARM SoC

This patch adds the support for the Usb Device Controller on Samsung
S3C24xx SoCs.  This driver passes all tests from testusb (including #13)
and has been tested on S3C2410, S3C24212, and S3C2440 SoCs.

Whitespace updates, minor cleanups by David

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Cc: Herbert Pƶtzl <herbert@13thfloor.at>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: PS3: USB system-bus rework
Geoff Levand [Wed, 6 Jun 2007 03:04:35 +0000 (20:04 -0700)]
USB: PS3: USB system-bus rework

USB HCD glue updates to reflect the new PS3 unifed device support.
 - Fixed remove() routine.
 - Added shutdown() routine.
 - Added request_mem_region() call.
 - Fixed MODULE_ALIAS().
 - Made a proper fix for the hack done to support muti-platform in commit
   48fda45120a819ca40cadc50144b55bff1c4c78d.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: option: fix usage of urb->status abuse
Alan Stern [Tue, 5 Jun 2007 23:46:26 +0000 (16:46 -0700)]
USB: option: fix usage of urb->status abuse

Might fix bug 8561

On Mon, 4 Jun 2007, Paulo Pereira wrote:

> The patch that you send is not resolving the problem... :(
> I stil have Kernel panic after 45/60 min of work with Ktorrent/Amule...
>
> The Drump is:
>
> Call Trace:
> [<c055fb36>] usb_hcd_submit+0xb1/0x763
> [<f9276488>] ipt_do_table+0x2c7/0x2ef [ip_tables]
> [<f929a6d7>] nf_ct_deliver_cached_events+0x41/0x96 [nf_conntrak]
> [<f9288254>] ipv4_confirm+0x36/0c3b [nf_conntrack_ipv4]
> [<c05ce7c2>] tcp_v4_rcv+0x827/0x899
> [<c05afcc0>] nf_hook_slow+0x4d/0xb5
> [<c042826f>] irq_enter+0x19/0x23
> [<c042826f>] irq_enter+0x19/0x23
> [<c040794c>] do_IRQ+0xbd/0xd1
> [<f90893c9>] option_write+0xa7/0xef [option]

Okay, from this it looks like there's a problem in the option.c serial
driver.  Glancing at the code, it's obvious why: The thing totally
abuses the USB API.

Try applying this patch; it should help.

From: Alan Stern <stern@rowland.harvard.edu>
Cc: Paulo Pereira <pfmp.404@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: fsl_usb2_udc: Get max ep number from DCCPARAMS register
Li Yang [Thu, 7 Jun 2007 04:13:44 +0000 (21:13 -0700)]
USB: fsl_usb2_udc: Get max ep number from DCCPARAMS register

Currently the driver is expecting max ep number in platform
data which isn't passing this information.  This patch fix
the problem by reading it from DCCPARAMS(Device Controller
Capability Parameters) register.  The change also need some
reordering of the probe code.

Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: fsl_usb2_udc: replace deprecated irq flag
Li Yang [Thu, 7 Jun 2007 08:07:18 +0000 (16:07 +0800)]
USB: fsl_usb2_udc: replace deprecated irq flag

Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: add power/persist device attribute
Alan Stern [Wed, 30 May 2007 19:39:33 +0000 (15:39 -0400)]
USB: add power/persist device attribute

This patch (as920) adds an extra level of protection to the
USB-Persist facility.  Now it will apply by default only to hubs; for
all other devices the user must enable it explicitly by setting the
power/persist device attribute.

The disconnect_all_children() routine in hub.c has been removed and
its code placed inline.  This is the way it was originally as part of
hub_pre_reset(); the revised usage in hub_reset_resume() is
sufficiently different that the code can no longer be shared.
Likewise, mark_children_for_reset() is now inline as part of
hub_reset_resume().  The end result looks much cleaner than before.

The sysfs interface is updated to add the new attribute file, and
there are corresponding documentation updates.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: unify reset_resume and normal resume
Alan Stern [Wed, 30 May 2007 19:38:58 +0000 (15:38 -0400)]
USB: unify reset_resume and normal resume

This patch (as919) unifies the code paths used for normal resume and
for reset-resume.  Earlier I had failed to note a section in the USB
spec which requires the host to resume a suspended port before
resetting it if the attached device is enabled for remote wakeup.
Since the port has to be resumed anyway, we might as well reuse the
existing code.

The main changes are:

usb_reset_suspended_device() is eliminated.

usb_root_hub_lost_power() is moved down next to the
hub_reset_resume() routine, to which it is logically
related.

finish_port_resume() does a port reset() if the device's
reset_resume flag is set.

usb_port_resume() doesn't check whether the port is initially
enabled if this is a USB-Persist sort of resume.

Code to perform the port reset is added to the resume pathway
for the non-CONFIG_USB_SUSPEND case.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: add reset_resume method
Alan Stern [Wed, 30 May 2007 19:38:16 +0000 (15:38 -0400)]
USB: add reset_resume method

This patch (as918) introduces a new USB driver method: reset_resume.
It is called when a device needs to be reset as part of a resume
procedure (whether because of a device quirk or because of the
USB-Persist facility), thereby taking over a role formerly assigned to
the post_reset method.  As a consequence, post_reset no longer needs
an argument indicating whether it is being called as part of a
reset-resume.  This separation of functions makes the code clearer.

In addition, the pre_reset and post_reset method return types are
changed; they now must return an error code.  The return value is
unused at present, but at some later time we may unbind drivers and
re-probe if they encounter an error during reset handling.

The existing pre_reset and post_reset methods in the usbhid,
usb-storage, and hub drivers are updated to match the new
requirements.  For usbhid the post_reset routine is also used for
reset_resume (duplicate method pointers); for the other drivers a new
reset_resume routine is added.  The change to hub.c looks bigger than
it really is, because mark_children_for_reset_resume() gets moved down
next to the new hub_reset_resume() routine.

A minor change to usb-storage makes the usb_stor_report_bus_reset()
routine acquire the host lock instead of requiring the caller to hold
it already.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: remove excess code from hub.c
Alan Stern [Wed, 30 May 2007 19:35:16 +0000 (15:35 -0400)]
USB: remove excess code from hub.c

This patch (as917) removes a now-unnecessary level of subroutine
nesting from hub.c.  Since usb_port_suspend() does nothing but call
hub_port_suspend(), and usb_port_resume() does nothing but call
hub_port_resume(), there's no reason to keep the routines separate.

Also included in the patch are a few cosmetic changes involving
whitespace and use of braces.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: separate root and non-root suspend/resume
Alan Stern [Wed, 30 May 2007 19:34:36 +0000 (15:34 -0400)]
USB: separate root and non-root suspend/resume

This patch (as916) completes the separation of code paths for suspend
and resume of root hubs as opposed to non-root devices.  Root hubs
will be power-managed through their bus_suspend and bus_resume
methods, whereas normal devices will use usb_port_suspend() and
usb_port_resume().

Changes to the hcd_bus_{suspend,resume} routines mostly represent
motion of code that was already present elsewhere.  They include:

Adding debugging log messages,

Setting the device state appropriately, and

Adding a resume recovery time delay.

Changes to the port-suspend and port-resume routines in hub.c include:

Removal of checks for root devices (since they will never
be triggered), and

Removal of checks for NULL or invalid device pointers (these
were left over from earlier kernel versions and aren't needed
at all).

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: remove __usb_port_suspend
Alan Stern [Wed, 30 May 2007 20:51:28 +0000 (16:51 -0400)]
USB: remove __usb_port_suspend

This patch (as915b) combines the public routine usb_port_suspend() and
the private routine __usb_port_suspend() into a single function.

By removing the explicit mention of otg_port in the call to
__usb_port_suspend(), we prevent a possible error in which the system
tries to perform HNP on the wrong port when a non-targeted device is
plugged into a non-OTG port.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: Fix NEC OHCI chip silicon bug
Michael Hanselmann [Thu, 31 May 2007 21:34:27 +0000 (23:34 +0200)]
USB: Fix NEC OHCI chip silicon bug

This patch fixes a silicon bug in some NEC OHCI chips. The bug appears
at random times and is very, very difficult to reproduce. Without the
following patch, Linux would shut the chip and its associated devices
down. In Apple PowerBooks this leads to an unusable keyboard and mouse
(SSH still working). The idea of restarting the chip is taken from
public Darwin code.

Signed-off-by: Michael Hanselmann <linux-kernel@hansmi.ch>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: Disable file_storage USB_CONFIG_ATT_WAKEUP
Tony Lindgren [Tue, 29 May 2007 16:57:41 +0000 (09:57 -0700)]
USB: Disable file_storage USB_CONFIG_ATT_WAKEUP

Disable file_storage USB_CONFIG_ATT_WAKEUP as it requires
user interaction during Chapter 9 tests.

Signed-off-by: Tony Lindgren <tony@atomide.com
Signed-off-by: Felipe Balbi <felipe.lima@indt.org.br>
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>
17 years agoUSB: EHCI: Safe endianness for transfer buffers after reset in case of HUB with TT
Vladimir Barinov [Wed, 23 May 2007 16:07:48 +0000 (20:07 +0400)]
USB: EHCI: Safe endianness for transfer buffers after reset in case of HUB with TT

This patch fixes the endianness select for transfer buffers in EHCI
controllers that have Transaction Translator built in the hub.  Also I
cleaned it up to make rid of magic numbers.

Signed-off-by: Vladimir Barinov <vbarinov@ru.mvista.com>
Cc: <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: digi_acceleport further buffer clean up
Al Borchers [Wed, 23 May 2007 19:24:53 +0000 (12:24 -0700)]
USB: digi_acceleport further buffer clean up

Some further cleanup after Oliver's patch to update the tty
buffering.  The input buffer is not used at all anymore, so
I removed it.

Signed-off-by: Al Borchers <alborchers@steinerpoint.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: whiteheat driver update
Oliver Neukum [Thu, 24 May 2007 11:52:51 +0000 (13:52 +0200)]
USB: whiteheat driver update

this is an update of the whiteheat driver. It fixes:

- switch from spinlocks to mutexes to prevent sleeping with a spinlock held
- locking to stop races with disconnect
- error handling for commands that time out

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: usb-skeleton: usb anchor to implement flush
Oliver Neukum [Fri, 25 May 2007 11:42:56 +0000 (13:42 +0200)]
USB: usb-skeleton: usb anchor to implement flush

This patch set introduces usb_anchor and uses it to implement all modern
APIs in the skeleton driver.

- proper error reporting in the skeleton driver
- implementation of flush()

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: introduce usb_anchor
Oliver Neukum [Fri, 25 May 2007 11:40:56 +0000 (13:40 +0200)]
USB: introduce usb_anchor

- introduction of usb_anchor and its methods

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB Core: hub.c: prevent re-enumeration on HNP
Vikram Pandita [Sat, 26 May 2007 04:31:07 +0000 (21:31 -0700)]
USB Core: hub.c: prevent re-enumeration on HNP

Patch is to prevent the OTG host of doing 3 times enumeration of
device when the Host suspends for HNP.  The error code used in
this case is ENOTSUPP.

Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
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>
17 years agoUSB: usb serial gadget, sparse fixes
David Brownell [Sat, 26 May 2007 03:40:31 +0000 (20:40 -0700)]
USB: usb serial gadget, sparse fixes

Fix a few serial gadget issues reported by the latest "sparse":
some functions should have been defined as static, not just
declared that way.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: flow control fix for pl2303
t.sefzick [Wed, 25 Apr 2007 13:05:22 +0000 (15:05 +0200)]
USB: flow control fix for pl2303

in order to be able to switch back to 'flow-control none'
after having activated 'flow-control rts/cts', I made
a small change to 'pl2303.c'.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: generic usb serial to new buffering scheme
Oliver Neukum [Mon, 7 May 2007 10:09:33 +0000 (12:09 +0200)]
USB: generic usb serial to new buffering scheme

the generic driver also had its own buffering.

Signed-off-by: Oliver Neukum <oneukum@suse.de_
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: Digi AccelePort adapted to new tty buffering
Oliver Neukum [Mon, 7 May 2007 11:16:58 +0000 (13:16 +0200)]
USB: Digi AccelePort adapted to new tty buffering

this fixes the flushing trouble due to its own buffering for this driver.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Cc: Al Borchers <alborchers@steinerpoint.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: visor driver adapted to new tty buffering
Oliver Neukum [Mon, 7 May 2007 08:37:08 +0000 (10:37 +0200)]
USB: visor driver adapted to new tty buffering

the new tty buffering code allows usb drivers to stop private buffering.
In fact we must do so to allow flushing to work correctly. This does so
for the visor driver.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: export <linux/usb_gadgetfs> as <linux/usb/gadgetfs.h>
David Brownell [Tue, 15 May 2007 02:36:41 +0000 (19:36 -0700)]
USB: export <linux/usb_gadgetfs> as <linux/usb/gadgetfs.h>

Make sure gadgetfs userspace interface is properly exported:

 - Move <linux/usb_gadgetfs.h> to <linux/usb/gadgetfs.h>;
 - Export it using Kbuild;
 - Add an #include guard;
 - Correct some internal documentation;
 - Update struct layout so it's the same on 32/64 bit kernels.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>