firefly-linux-kernel-4.4.55.git
16 years agoUSB: remove info() macro from usb network drivers
Greg Kroah-Hartman [Mon, 18 Aug 2008 20:21:04 +0000 (13:21 -0700)]
USB: remove info() macro from usb network drivers

USB should not be having it's own printk macros, so remove info() and
use the system-wide standard of dev_info() wherever possible.

Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove info() macro from remaining usb drivers
Greg Kroah-Hartman [Mon, 18 Aug 2008 20:21:04 +0000 (13:21 -0700)]
USB: remove info() macro from remaining usb drivers

USB should not be having it's own printk macros, so remove info() and
use the system-wide standard of dev_info() wherever possible.  In the
few places that will not work out, use a basic printk().

Clean up the remaining usages of this in the drivers/usb/ directory.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove info() macro from usb/misc drivers
Greg Kroah-Hartman [Mon, 18 Aug 2008 20:21:04 +0000 (13:21 -0700)]
USB: remove info() macro from usb/misc drivers

USB should not be having it's own printk macros, so remove info() and
use the system-wide standard of dev_info() wherever possible.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove info() macro from usb/serial drivers
Greg Kroah-Hartman [Mon, 18 Aug 2008 20:21:04 +0000 (13:21 -0700)]
USB: remove info() macro from usb/serial drivers

USB should not be having it's own printk macros, so remove info() and
use the system-wide standard of dev_info() wherever possible.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove warn macro from HID core
Greg Kroah-Hartman [Wed, 15 Oct 2008 18:30:07 +0000 (11:30 -0700)]
USB: remove warn macro from HID core

There were two stragglers that got missed in the last merge of the HID tree that forgot to change the warn() calls to dev_warn().  This patch fixes them up.

Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove warn() macro from usb drivers
Greg Kroah-Hartman [Thu, 14 Aug 2008 16:37:34 +0000 (09:37 -0700)]
USB: remove warn() macro from usb drivers

USB should not be having it's own printk macros, so remove warn() and
use the system-wide standard of dev_warn() wherever possible.  In the
few places that will not work out, use a basic printk().

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove warn() macro from usb net drivers
Greg Kroah-Hartman [Thu, 14 Aug 2008 16:37:34 +0000 (09:37 -0700)]
USB: remove warn() macro from usb net drivers

USB should not be having it's own printk macros, so remove warn() and
use the system-wide standard of dev_warn() wherever possible.  In the
few places that will not work out, use a basic printk().

Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove warn() macro from usb media drivers
Greg Kroah-Hartman [Thu, 14 Aug 2008 16:37:34 +0000 (09:37 -0700)]
USB: remove warn() macro from usb media drivers

USB should not be having it's own printk macros, so remove warn() and
use the system-wide standard of dev_warn() wherever possible.  In the
few places that will not work out, use a basic printk().

Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove warn() macro from usb input drivers
Greg Kroah-Hartman [Thu, 14 Aug 2008 16:37:34 +0000 (09:37 -0700)]
USB: remove warn() macro from usb input drivers

USB should not be having it's own printk macros, so remove warn() and
use the system-wide standard of dev_warn() wherever possible.  In the
few places that will not work out, use a basic printk().

Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb/fsl_qe_udc: clear data toggle on clear halt request
Li Yang [Wed, 24 Sep 2008 07:50:27 +0000 (15:50 +0800)]
usb/fsl_qe_udc: clear data toggle on clear halt request

Fix to comply with USB spec.

Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb/fsl_qe_udc: fix response to get status request
Li Yang [Wed, 24 Sep 2008 07:50:26 +0000 (15:50 +0800)]
usb/fsl_qe_udc: fix response to get status request

The original code didn't respond correctly to get status request on
device and endpoint.  Although normal operations can work without the
fix.  It is not compliant with USB spec chapter9 and fails USBCV ch9
tests.  The patch fix this and a few style/typo problems.

Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agofsl_usb2_udc: Fix oops on probe failure.
Will Newton [Tue, 12 Aug 2008 14:39:17 +0000 (15:39 +0100)]
fsl_usb2_udc: Fix oops on probe failure.

In some circumstances when fsl_udc_probe fails udc_controller is freed but
the pointer remains non-NULL. fsl_udc_remove will then try and teardown
the partly initialized and freed controller structure resulting in an oops.
This patch ensures udc_controller is either NULL or fully initialized after
fsl_udc_probe.

Signed-off-by: Will Newton <will.newton@gmail.com>
Acked-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agofsl_usb2_udc: Add a wmb before priming endpoint.
Will Newton [Tue, 12 Aug 2008 14:39:16 +0000 (15:39 +0100)]
fsl_usb2_udc: Add a wmb before priming endpoint.

Add a wmb to fsl_queue_td before priming the endpoint. This ensures that the
modifications to the QH are seen by the hardware.

Added comment as suggested by Felipe Balbi.

Signed-off-by: Will Newton <will.newton@gmail.com>
Acked-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agofsl_usb2_udc: Make fsl_queue_td return type void.
Will Newton [Tue, 12 Aug 2008 14:39:15 +0000 (15:39 +0100)]
fsl_usb2_udc: Make fsl_queue_td return type void.

fsl_queue_td always returns 0. Make it void and remove checks for non-zero
return in callers.

Signed-off-by: Will Newton <will.newton@gmail.com>
Acked-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agofsl_usb2_udc: Uninline udc_reset_ep_queue.
Will Newton [Tue, 12 Aug 2008 14:39:14 +0000 (15:39 +0100)]
fsl_usb2_udc: Uninline udc_reset_ep_queue.

Uninline udc_reset_ep_queue and remove it's unused return value.

Signed-off-by: Will Newton <will.newton@gmail.com>
Acked-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agofsl_usb2_udc: Rename the arguments of the fsl_writel macro.
Will Newton [Tue, 12 Aug 2008 14:39:13 +0000 (15:39 +0100)]
fsl_usb2_udc: Rename the arguments of the fsl_writel macro.

Rename the arguments of the fsl_writel macro to match their use.
Remove a couple of unnecessary prototypes.

Signed-off-by: Will Newton <will.newton@gmail.com>
Acked-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agofsl_usb2_udc: Initialize spinlock earlier.
Will Newton [Tue, 12 Aug 2008 14:39:12 +0000 (15:39 +0100)]
fsl_usb2_udc: Initialize spinlock earlier.

Move spinlock initialization earlier so we can turn shared irq handler
debugging on safely.

Signed-off-by: Will Newton <will.newton@gmail.com>
Acked-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agofsl_usb2_udc: Clean up whitespace in /proc debugging output.
Will Newton [Tue, 12 Aug 2008 14:39:11 +0000 (15:39 +0100)]
fsl_usb2_udc: Clean up whitespace in /proc debugging output.

Missing spaces were causing the /proc debugging output to be rather
unreadable.

Signed-off-by: Will Newton <will.newton@gmail.com>
Acked-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agofsl_usb2_udc: Clean up whitespace in errors and warnings.
Will Newton [Tue, 12 Aug 2008 14:39:10 +0000 (15:39 +0100)]
fsl_usb2_udc: Clean up whitespace in errors and warnings.

VDBG always outputs a trailing \n.

Signed-off-by: Will Newton <will.newton@gmail.com>
Acked-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agofsl_usb2_udc: Fix some sparse warnings and remove redundant code.
Will Newton [Tue, 12 Aug 2008 14:39:09 +0000 (15:39 +0100)]
fsl_usb2_udc: Fix some sparse warnings and remove redundant code.

Fix some sparse "integer used as NULL pointer" warnings.
Remove some unnecessary volatiles and static initialization.
Remove some unused struct members and reorder to improve packing.
Remove a few unneeded includes.

Signed-off-by: Will Newton <will.newton@gmail.com>
Acked-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agofsl_usb2_udc: Remove check for udc == NULL in dr_controller_setup.
Will Newton [Tue, 12 Aug 2008 14:39:08 +0000 (15:39 +0100)]
fsl_usb2_udc: Remove check for udc == NULL in dr_controller_setup.

Remove check for udc == NULL in dr_controller_setup. All callers of
this function have already dereferenced udc at some point.

Signed-off-by: Will Newton <will.newton@gmail.com>
Acked-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agofsl_usb2_udc: Make dr_ep_setup function static.
Will Newton [Tue, 12 Aug 2008 14:39:07 +0000 (15:39 +0100)]
fsl_usb2_udc: Make dr_ep_setup function static.

Make dr_ep_setup function static as it's never used outside this file.

Signed-off-by: Will Newton <will.newton@gmail.com>
Acked-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix up problems in the vtusb driver
Stephen Ware [Wed, 8 Oct 2008 17:53:56 +0000 (10:53 -0700)]
USB: fix up problems in the vtusb driver

Add range check on buffer sizes passed in from user space
(max is 8*PAGE_SIZE) which will work for the most common
spectrometers even at pages as small as 1K.

Add kref to vst device structure to preserve reference to the
usb object until we truly are done with it.

From: Stephen Ware <stephen.ware@eqware.net>
From: Dennis O'Brien <dennis.obrien@eqware.net>
Signed-off-by: Dennis O'Brien <dennis.obrien@eqware.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: OHCI: fix endless polling behavior
Alan Stern [Thu, 9 Oct 2008 19:40:23 +0000 (15:40 -0400)]
USB: OHCI: fix endless polling behavior

This patch (as1149) fixes an obscure problem in OHCI polling.  In the
current code, if the RHSC interrupt status flag turns on at a time
when RHSC interrupts are disabled, it will remain on forever:

The interrupt handler is the only place where RHSC status
gets turned back off;

The interrupt handler won't turn RHSC status off because it
doesn't turn off status flags if the corresponding interrupt
isn't enabled;

RHSC interrupts will never get enabled because
ohci_root_hub_state_changes() doesn't reenable RHSC if RHSC
status is on!

As a result we will continue polling indefinitely instead of reverting
to interrupt-driven operation, and the root hub will not autosuspend.
This particular sequence of events is not at all unusual; in fact
plugging a USB device into an OHCI controller will usually cause it to
occur.

Of course, this is a bug.  The proper thing to do is to turn off RHSC
status just before reading the actual port status values.  That way
either a port status change will be detected (if it occurs before the
status read) or it will turn RHSC back on.  Possibly both, but that
won't hurt anything.

We can still check for systems in which RHSC is totally broken, by
re-reading RHSC after clearing it and before reading the port
statuses.  (This re-read has to be done anyway, to post the earlier
write.)  If RHSC is on but no port-change statuses are set, then we
know that RHSC is broken and we can avoid re-enabling it.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: option: add Pantech cards
Dan Williams [Fri, 10 Oct 2008 10:41:16 +0000 (06:41 -0400)]
USB: option: add Pantech cards

Add some Pantech mobile broadband IDs.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: hub.c: Add initial_descriptor_timeout module parameter for usbcore
Jaroslav Kysela [Fri, 10 Oct 2008 14:24:45 +0000 (16:24 +0200)]
USB: hub.c: Add initial_descriptor_timeout module parameter for usbcore

This patch adds initial_descriptor_timeout module parameter for usbcore.ko
to allow modify initial 64-byte USB_REQ_GET_DESCRIPTOR timeout for
non-standard devices.

For example, the SATA8000 device from DATAST0R Technology Corp
requires about 10 seconds to send reply (probably it waits until
inserted disk is ready for operation).

Also, this patch adds missing usbcore parameters to
Documentation/kernel-parameters.txt.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Export if an interface driver supports autosuspend.
Sarah Sharp [Mon, 6 Oct 2008 21:45:46 +0000 (14:45 -0700)]
USB: Export if an interface driver supports autosuspend.

Create a new sysfs file per interface named supports_autosuspend.  This
file returns true if an interface driver's .supports_autosuspend flag is
set.  It also returns true if the interface is unclaimed (since the USB
core will autosuspend a device if an interface is not claimed).

This new sysfs file will be useful for user space scripts to test whether
a USB device correctly auto-suspends.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: EHCI: fix remote-wakeup support for ARC/TDI core
Alan Stern [Mon, 6 Oct 2008 15:25:53 +0000 (11:25 -0400)]
USB: EHCI: fix remote-wakeup support for ARC/TDI core

This patch (as1147) fixes the remote-wakeup support for EHCI
controllers using the ARC/TDI "embedded-TT" core.  These controllers
turn off the RESUME bit by themselves when a port resume is complete;
hence we need to keep separate track of which ports are suspended or
in the process of resuming.

The patch also makes a couple of small improvements in ehci_irq(),
replacing reads of the command register with the value already stored
in a local variable.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Thomas Reitmayr <treitmayr@devbase.at>
CC: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: snoop processes opening usbfs device files
Alan Stern [Mon, 6 Oct 2008 15:24:26 +0000 (11:24 -0400)]
USB: snoop processes opening usbfs device files

This patch (as1148) adds a new "snoop" message to usbfs when a device
file is opened, identifying the process responsible.  This comes in
extremely handy when trying to determine which program is doing some
unwanted USB access.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Option / AnyData new modem, same ID
Jon K Hellan [Fri, 3 Oct 2008 08:36:16 +0000 (10:36 +0200)]
USB: Option / AnyData new modem, same ID

The AnyData ADU-310 series of wireless modems uses the same product ID as the ADU-E100 series.

Signed-off-by: Jon K Hellan <hellan@acm.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: EHCI: log a warning if ehci-hcd is not loaded first
Alan Stern [Thu, 2 Oct 2008 15:48:13 +0000 (11:48 -0400)]
USB: EHCI: log a warning if ehci-hcd is not loaded first

This patch (as1139) adds a warning to the system log whenever ehci-hcd
is loaded after ohci-hcd or uhci-hcd.  Nowadays most distributions are
pretty good about not doing this; maybe the warning will help convince
anyone still doing it wrong.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org> [2.6.27]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: EHCI, OHCI, UHCI: remove version numbers
Alan Stern [Thu, 2 Oct 2008 15:47:15 +0000 (11:47 -0400)]
USB: EHCI, OHCI, UHCI: remove version numbers

This patch (as1145) removes the essentially useless driver-version
strings from ehci-hcd, ohci-hcd, and uhci-hcd.  It also unifies the
form of the banner lines they display upon loading and adds a missing
test for usb_disabled() to ehci-hcd.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: anchor API changes needed for btusb
Oliver Neukum [Mon, 25 Aug 2008 20:40:25 +0000 (22:40 +0200)]
USB: anchor API changes needed for btusb

This extends the anchor API as btusb needs for autosuspend.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ftdi-elan: Always pass usb_bulk_msg() a timeout in milliseconds.
Sarah Sharp [Mon, 29 Sep 2008 17:58:35 +0000 (10:58 -0700)]
USB: ftdi-elan: Always pass usb_bulk_msg() a timeout in milliseconds.

The kernel doc for usb_bulk_msg() says the timeout for a bulk message should be
specified in milliseconds.  The ftdi-elan driver converts milliseconds to
jiffies before passing the timeout to usb_bulk_msg().  This is mostly harmless,
since it will just lead to very long timeouts, but was obviously not the intent
of the original author.

Signed-off-by: Sarah Sharp <sarah.a.sharp@intel.com>
Acked-by: Tony Olech <tony.olech@elandigitalsystems.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: isp1760: Use an IS_ERR test rather than a NULL test
Julien Brunel [Wed, 24 Sep 2008 16:00:36 +0000 (18:00 +0200)]
USB: isp1760: Use an IS_ERR test rather than a NULL test

In case of error, the function isp1760_register returns an ERR
pointer, but never returns a NULL pointer. So after a call to this
function, a NULL test should be replaced by an IS_ERR test. Moreover,
we have noticed that:
(1) the result of isp1760_register is assigned through the function
pci_set_drvdata without an error test,
(2) if the call to isp1760_register fails, the current function
(isp1761_pci_probe) returns 0, and if it succeeds, it returns -ENOMEM,
which seems odd.

Thus, we suggest to move the test before the call to pci_set_drvdata
to correct (1), and to turn it into a non IS_ERR test to correct (2).

The semantic match that finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@bad_null_test@
expression x,E;
statement S1, S2;
@@
x =  isp1760_register(...)
... when != x = E
* if (x == NULL)
S1 else S2
// </smpl>

Signed-off-by: Julien Brunel <brunel@diku.dk>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: improve ehci_watchdog's side effect in CPU power management
Yi Yang [Thu, 25 Sep 2008 09:25:44 +0000 (17:25 +0800)]
USB: improve ehci_watchdog's side effect in CPU power management

ehci_watchdog will wake up CPU very frequently so that CPU
stays at C3 very short, average residence time is about 50
ms on Aspire One, but we expect it should be about 1 second
or more, so this kind of periodic timer is very bad for power
saving.

We can't remove this timer because of some bad USB controller
chipset, but at least we should reduce its side effect to as
possible as low.

This patch can make CPU stay at C3 longer, average residence time
is about twice as long as original.

Please consider to apply it, thanks

Signed-off-by: Yi Yang <yi.y.yang@intel.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: UHCI: improve scheduling of interrupt URBs
Alan Stern [Thu, 25 Sep 2008 20:59:57 +0000 (16:59 -0400)]
USB: UHCI: improve scheduling of interrupt URBs

This patch (as1140) adds a little intelligence to the interrupt-URB
scheduler in uhci-hcd.  Right now the scheduler is stupid; every URB
having the same period is assigned to the same slot.  Thus a large
group of period-N URBs can fill their slot and cause -ENOSPC errors
even when all the lower-period slots are empty.

With the patch, if an URB doesn't fit in its assigned slot then the
scheduler will try using lower-period slots.  This will provide
greater flexibility.  As an example, the driver will be able to handle
more than just three or four mice, which the current driver cannot.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ti_usb_3410_5052: removed duplicated include
Huang Weiyi [Thu, 25 Sep 2008 05:11:28 +0000 (13:11 +0800)]
USB: ti_usb_3410_5052: removed duplicated include

Removed duplicated #include <linux/firmware.h> in
drivers/usb/serial/ti_usb_3410_5052.c.

Signed-off-by: Huang Weiyi <hwy@cn.fujitsu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb: vstusb.c : new driver for spectrometers used by Vernier Software & Technology...
Stephen Ware [Tue, 30 Sep 2008 18:39:38 +0000 (11:39 -0700)]
usb: vstusb.c : new driver for spectrometers used by Vernier Software & Technology, Inc.

This patch adds the vstusb driver to the drivers/usb/misc directory.
This driver provides support for Vernier Software & Technology
spectrometers, all made by Ocean Optics. The driver provides both IOCTL
and read()/write() methods for sending raw data to spectrometers across
the bulk channel. Each method allows for a configured timeout.

From: Stephen Ware <stephen.ware@eqware.net>
Signed-off-by: Dennis O'Brien <dennis.obrien@eqware.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb gadget: cdc ethernet notification bugfix
David Brownell [Sun, 7 Sep 2008 04:33:49 +0000 (21:33 -0700)]
usb gadget: cdc ethernet notification bugfix

Bugfix for the new CDC Ethernet code:  as part of activating the
network interface's USB link, make sure its link management code
knows whether the interface is open or not.

Without this fix, the link won't work right when it's brought up
before the link is active ... because the initial notification it
sends will have the wrong link state (down, not up).  Makes it
hard to bridge these links (on the host side), among other things.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: stable <stable@kernel.org> [2.6.27]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: omap_udc: sync with OMAP tree
Tony Lindgren [Thu, 4 Sep 2008 23:25:14 +0000 (16:25 -0700)]
USB: omap_udc: sync with OMAP tree

Sync up USB parts of the omap_udc support in mainline with the OMAP tree.
This patch addresses some OMAP2 differences ... there's another, with
respect to the double-buffering issue with PIO-IN in omap_ep_setup()
(which is now out of sync with the comments), but it's not clear right
now how to address that.

From: Tony Lindgren <tony@atomide.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ohci-omap: handle other omap15xx chips
Tony Lindgren [Thu, 4 Sep 2008 23:29:55 +0000 (16:29 -0700)]
USB: ohci-omap: handle other omap15xx chips

Sync up USB parts of the ohci-omap support in mainline with the OMAP tree.
This patch supports another first generation OMAP1 part: not just the
OMAP 1510 (and its catalog version, the OMAP 5910), but also OMAP 310.

From: Tony Lindgren <tony@atomide.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb: musb: remove dead code from procfs
Felipe Balbi [Thu, 11 Sep 2008 08:53:25 +0000 (11:53 +0300)]
usb: musb: remove dead code from procfs

When removing the procfs file, I forgot to remove some
code that created and removed that file. Here's a patch
to fix it. Ideally this patch will be melded into the patch
removing the procfs file, don't know if it's possible still.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb: musb: general cleanup to musbhsdma.c
Felipe Balbi [Thu, 11 Sep 2008 08:53:24 +0000 (11:53 +0300)]
usb: musb: general cleanup to musbhsdma.c

Basically getting rid of CaMeLcAsE, but also adding
missing lines and spaces.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb: musb_hdrc build fixes
David Brownell [Thu, 11 Sep 2008 08:53:23 +0000 (11:53 +0300)]
usb: musb_hdrc build fixes

Minor musb_hdrc updates:

  - so it'll build on DaVinci, given relevant platform updates;
      * remove support for an un-shipped OTG prototype
      * rely on gpiolib framework conversion for the I2C GPIOs
      * the <asm/arch/hdrc_cnf.h> mechanism has been removed

  - catch comments up to the recent removal of the per-SOC header
    with the silicon configuration data;

  - and remove two inappropriate "inline" declarations which
    just bloat host side code.

There are still some more <asm/arch/XYZ.h> ==> <mach/XYZ.h>
changes needed in this driver, catching up to the relocation
of most of the include/asm-arm/arch-* contents.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Cc: stable <stable@kernel.org> [2.6.27]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb: musb: do not mess up count number and CSR0 register value
Bryan Wu [Thu, 11 Sep 2008 08:53:22 +0000 (11:53 +0300)]
usb: musb: do not mess up count number and CSR0 register value

Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoOMAP:MUSB: Corrects urb unlink function path
Ajay Kumar Gupta [Thu, 11 Sep 2008 08:53:21 +0000 (11:53 +0300)]
OMAP:MUSB: Corrects urb unlink function path

Fixes kernel panic while ISO IN transfer is aborted.Replaced
usb_hcd_unlink_urb_from_ep() from musb_giveback() to __musb_giveback()
to make sure urb is unlinked before giveback when __musb_giveback() is
called from musb_urb_dequeue().

Acquired musb->lock() before usb_hcd_unlink_urb_from_ep() within in
enqueue path.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoOMAP:MUSB: Fixes the TT programming.
Ajay Kumar Gupta [Thu, 11 Sep 2008 08:53:20 +0000 (11:53 +0300)]
OMAP:MUSB: Fixes the TT programming.

Fixes enumeration failures when a USB device attached to a LS hub is
connected to OMAP EVM via HS hub. This is fixed by correctly
programming hub address register in enqueue path.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agomusb: io: only define read/write stubs if they're not defined yet
Felipe Balbi [Thu, 11 Sep 2008 08:53:19 +0000 (11:53 +0300)]
musb: io: only define read/write stubs if they're not defined yet

For those archs which don't provide read/write friends we
provide our own implementation so musb driver won't break
compilation.

This is temporary fix until a better solution comes from
upstream. Idealy, <linux/io.h> would provide those calls
if the architecture did not provide them yet. In that case
being possible to remove all those stubs from musb_io.h

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Fix s3c2410_udc usb speed handling
Yauhen Kharuzhy [Fri, 12 Sep 2008 16:02:23 +0000 (09:02 -0700)]
USB: Fix s3c2410_udc usb speed handling

The new composite framework revealed a weakness in the
s3c2410_udc driver gadget register function. Instead of
checking if speed asked for was USB_LOW_SPEED upon
usb_gadget_register() to deny service, it checked only
for USB_FULL_SPEED, thus denying service to usb high
speed capable gadgets (like g_ether).

Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb gadget: USB_GADGET_VBUS_DRAW Kconfig option
David Brownell [Fri, 12 Sep 2008 16:39:06 +0000 (09:39 -0700)]
usb gadget: USB_GADGET_VBUS_DRAW Kconfig option

Offer a "how much VBUS power to request" configuration option
for USB gadgets that aren't using board-specific customization
of their gadget or (composite) configuration drivers.

Also remove a couple pointless "depends on USB_GADGET" bits
from the Kconfig text; booleans inside an "if USB_GADGET" will
already have that dependency.

Based on a patch from Justin Clacherty.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Justin Clacherty <justin@redfish-group.com>
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoMUSB: Add sanity check for maximum number of endpoints
Kevin Hilman [Mon, 15 Sep 2008 10:09:31 +0000 (12:09 +0200)]
MUSB: Add sanity check for maximum number of endpoints

There is no check if platform code passes in more endpoints (num_eps)
than the maximum number of enpoints (MUSB_C_NUM_EPS.)  The result is
that allocate_instance() happily writes past the end of 'struct musb'
corrupting memory.

This patch adds a BUG() if the platform code requests more than the max.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Acked-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb: remove code associated with !CONFIG_PPC_MERGE
Kumar Gala [Mon, 22 Sep 2008 22:00:07 +0000 (15:00 -0700)]
usb: remove code associated with !CONFIG_PPC_MERGE

Now that arch/ppc is gone we don't need CONFIG_PPC_MERGE anymore remove
the dead code associated with !CONFIG_PPC_MERGE.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousbmon: fix tiny race exposed by the fastboot patches
Arjan van de Ven [Mon, 22 Sep 2008 22:00:10 +0000 (15:00 -0700)]
usbmon: fix tiny race exposed by the fastboot patches

usbmon registers the notifier chain, takes the bus lock and then goes to
scan the existing devices for hooking up.

Unfortunately, if usb_mon gets initialized while USB bus discovery is
going on, it's possible that usbmon gets a notifier on one cpu (which runs
without USB locks), and the scan is going on and also finds the new bus,
resulting in a double sysfs registration, which then produces a WARNING.

Pete Zaitcev did the bug diagnostics on this one

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
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: change hub initialization sleeps to delayed_work
Alan Stern [Mon, 22 Sep 2008 18:44:26 +0000 (14:44 -0400)]
USB: change hub initialization sleeps to delayed_work

This patch (as1137) changes the hub_activate() routine, replacing the
power-power-up and debounce delays with delayed_work calls.  The idea
is that on systems where the USB stack is compiled into the kernel
rather than built as modules, these delays will no longer block the
boot thread.  At least 100 ms is saved for each root hub, which can
add up to a significant savings in total boot time.

Arjan van de Ven was very pleased to see that this shaved 700 ms off
his computer's boot time.  Since his total boot time is on the order
of two seconds, the improvement is considerable.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ehci-dbg: fix reading less content of periodic file
Ming Lei [Thu, 18 Sep 2008 15:06:38 +0000 (23:06 +0800)]
USB: ehci-dbg: fix reading less content of periodic file

This patch fix 2 problems about reading periodic file:

1. The "..." after a interrupt qh is missed because buffer pointer is
   not moved.

2. After setting p.ptr as NULL, its next qh or itd will be omited and
   can't be stored in debug buffer.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ehci-dbg: increase debug buffer size for periodic file
Ming Lei [Thu, 18 Sep 2008 15:06:21 +0000 (23:06 +0800)]
USB: ehci-dbg: increase debug buffer size for periodic file

This patch is based on the following ideas:

1. Some usb devices (such as usb video class) have endpoints of high
   interval attribute, so reading "periodic" file need more debug buffer
   to accommodate the qh or itd schedule information.  For example, 4KB
   buffer is not enough for a single interrupt qh of 2ms period.

2. print a %p need 16 byte buffer on 64-bits arch, but 8 byte on 32-bits
   arch. Add a extra bonus for 64-bits arch.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb: gadget: workaround storage command size issues
Felipe Balbi [Thu, 18 Sep 2008 23:00:02 +0000 (02:00 +0300)]
usb: gadget: workaround storage command size issues

Try to workaround issues with bad SCSI implementations
by ignoring the command size error.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: g_printer: fix handling zero-length packet
SangSu Park [Mon, 22 Sep 2008 22:41:15 +0000 (15:41 -0700)]
USB: g_printer: fix handling zero-length packet

g_printer doesn't have to check whether the data size is a multiple of
MaxPacketSize, because device controller driver already make that check.

Signed-off-by: SangSu Park<sangsu@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: David Brownell <david-b@pacbell.net>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Fix spelling in usb/serial.h
Geoff Levand [Sat, 20 Sep 2008 21:41:47 +0000 (14:41 -0700)]
USB: Fix spelling in usb/serial.h

Fixes a minor typo in the comments for usb_set_serial_data.

Signed-off-by: Geoff Levand <geoff@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Fix doc for usb_autopm_enable
Geoff Levand [Sat, 20 Sep 2008 21:41:47 +0000 (14:41 -0700)]
USB: Fix doc for usb_autopm_enable

Correct errors in the descriptions for usb_autopm_enable
and usb_autopm_disable in the USB PM doc.

Signed-off-by: Geoff Levand <geoff@infradead.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB Serial: Sierra: debug message fix
Kevin Lloyd [Wed, 17 Sep 2008 04:05:24 +0000 (21:05 -0700)]
USB Serial: Sierra: debug message fix

This patch moves dbg calls to dev_dbg where possible. It also fixes some
issues with a previous submission aiming to do the same thing.

Signed-off-by: Kevin Lloyd <klloyd@sierrawireless.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: RESET_RESUME needs to block autosuspend when remote wakeup is needed
Oliver Neukum [Mon, 15 Sep 2008 15:29:28 +0000 (17:29 +0200)]
USB: RESET_RESUME needs to block autosuspend when remote wakeup is needed

Reset upon resumption will wipe the input buffer and is therefore
a reason to not suspend if remote wakeup is requested because
the driver needs that data.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ftdi_sio: fix 'product' parameter description
Paulius Zaleckas [Wed, 10 Sep 2008 14:18:46 +0000 (17:18 +0300)]
USB: ftdi_sio: fix 'product' parameter description

Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb core: fix USB_OTG_BLACKLIST_HUB typo
Peter Korsgaard [Mon, 8 Sep 2008 08:14:47 +0000 (10:14 +0200)]
usb core: fix USB_OTG_BLACKLIST_HUB typo

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Documentation/usb/anchors.txt #2
Oliver Neukum [Tue, 2 Sep 2008 12:16:11 +0000 (14:16 +0200)]
USB: Documentation/usb/anchors.txt #2

This adds Documentation for the extensions of the anchor API.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoOHCI: Allow broken controllers to auto-stop
Alan Stern [Wed, 3 Sep 2008 20:38:32 +0000 (16:38 -0400)]
OHCI: Allow broken controllers to auto-stop

This patch (as1134) attempts to improve the way we handle OHCI
controllers with broken Root Hub Status Change interrupt support.  In
these controllers the RHSC interrupt bit essentially never turns off,
making RHSC interrupts useless -- they have to remain permanently
disabled.

Such controllers should still be allowed to turn off their root hubs
when no devices are attached.  Polling for new connections can
continue while the root hub is suspended.  The patch implements this
feature.  (It won't have much effect unless CONFIG_PM is enabled and
CONFIG_USB_SUSPEND is disabled, but since the overhead is very small
we may as well do it.)

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb-storage: report underflow with no sense data
Alan Stern [Tue, 2 Sep 2008 14:12:11 +0000 (10:12 -0400)]
usb-storage: report underflow with no sense data

This patch (as1118) addresses a problem with certain USB mass-storage
devices.  These devices sometimes return less data than asked for and
then provide no sense data to explain the problem.  Currently
usb-storage leaves it up to the SCSI layer to decide how this should
be handled, and the SCSI layer interprets the lack of sense data to
mean that nothing went wrong.  But if we got less data than required
then something definitely _did_ go wrong, and we should say so.

The patch tells the SCSI layer to retry the command when this sort of
thing happens.  Retrying may not solve the underlying problem, but
it's better than believing that data was transferred when it wasn't.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb: add Freescale QE/CPM USB peripheral controller driver
Li Yang [Tue, 2 Sep 2008 11:58:10 +0000 (19:58 +0800)]
usb: add Freescale QE/CPM USB peripheral controller driver

Some of Freescale SoC chips have a QE or CPM co-processor which
supports full speed USB.  The driver adds device mode support
of both QE and CPM USB controller to Linux USB gadget.  The
driver is tested with MPC8360 and MPC8272, and should work with
other models having QE/CPM given minor tweaks.

Signed-off-by: Xie Xiaobo <X.Xie@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: drivers/usb/misc: Use an IS_ERR test rather than a NULL test
Julien Brunel [Mon, 1 Sep 2008 08:57:27 +0000 (10:57 +0200)]
USB: drivers/usb/misc: Use an IS_ERR test rather than a NULL test

In case of error, the function backlight_device_register returns an
ERR pointer, but never returns a NULL pointer. So a NULL test that may
come after a call to this function should be strengthened by an IS_ERR
test.

The semantic match that finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@match_bad_null_test@
expression x, E;
statement S1,S2;
@@
x = backlight_device_register(...)
... when != x = E
* if (x != NULL)
S1 else S2
// </smpl>

Signed-off-by: Julien Brunel <brunel@diku.dk>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove unused #include <version.h>
Huang Weiyi [Sat, 23 Aug 2008 05:56:30 +0000 (13:56 +0800)]
USB: remove unused #include <version.h>

The driver(s) below do not use LINUX_VERSION_CODE nor KERNEL_VERSION.
  drivers/usb/gadget/pxa27x_udc.c

This patch removes the said #include <version.h>.

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb gadget: defer obex enumeration
David Brownell [Tue, 19 Aug 2008 00:45:25 +0000 (17:45 -0700)]
usb gadget: defer obex enumeration

Some USB peripheral controller drivers support software control
over the data pullup.  Use those controls to prevent the OBEX
function from enumerating until the userspace server has opened
the /dev/ttyGS* node it will use to implement protocol chitchat
with the USB host.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb gadget: cdc obex glue
Felipe Balbi [Tue, 19 Aug 2008 00:39:30 +0000 (17:39 -0700)]
usb gadget: cdc obex glue

The following patch introduces a new f_obex.c function driver.
It allows userspace obex servers to use usb as transport layer
for their messages.

[ dbrownell@users.sourceforge.net: various fixes and cleanups ]

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb gadget: function activation/deactivation
David Brownell [Tue, 19 Aug 2008 00:38:22 +0000 (17:38 -0700)]
usb gadget: function activation/deactivation

Add a new mechanism to the composite gadget framework, letting
functions deactivate (and reactivate) themselves.  Think of it
as a refcounted wrapper for the software pullup control.

A key example of why to use this mechanism involves functions that
require a userspace daemon.  Those functions shuld use this new
mechanism to prevent the gadget from enumerating until those daemons
are activated.  Without this mechanism, hosts would see devices that
malfunction until the relevant daemons start.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: gadget: net2280: implement set_wedge
Alan Stern [Thu, 14 Aug 2008 19:49:11 +0000 (15:49 -0400)]
USB: gadget: net2280: implement set_wedge

This patch (as1132) implements the set_wedge() method for net2280.
This method is necessary for strict USBCV compliance in
g_file_storage.

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: gadget: dummy_hcd: implement set_wedge
Alan Stern [Thu, 14 Aug 2008 19:48:30 +0000 (15:48 -0400)]
USB: gadget: dummy_hcd: implement set_wedge

This patch (as1131) implements the set_wedge() method for dummy_hcd.
This method is necessary for strict USBCV compliance in
g_file_storage.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb: gadget Kconfig cleanup
David Brownell [Fri, 15 Aug 2008 00:04:48 +0000 (17:04 -0700)]
usb: gadget Kconfig cleanup

This reorders the list of USB peripheral controller drivers so it's
more common for the initial (default) value to be relevant:  put the
SOC integrated silicon up front, discrete stuff last.  Alphabetize.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Let some USB host controllers get IRQ flags from resource
Marc Zyngier [Mon, 18 Aug 2008 11:08:42 +0000 (13:08 +0200)]
USB: Let some USB host controllers get IRQ flags from resource

[This version fixes a thinko in the r8a66597 driver]

This patch let a few discrete USB host controllers drivers (isp116x-hcd,
r8a66597-hcd and sl811-hcd) obtain IRQ flags from their IORESOURCE_IRQ
resource if configured as such, much like it's been done for the smc91x
driver.

It spares people writing support for specific boards the burden to
configure the interrupt controller independantly, and keeps all IRQ
related information in a single resource.

HCD that are integrally part of a SoC have been left aside, as there
is probably no "wiring" options...

Tested on an Xscale PXA-255 based platform with isp116x-hcd.

Signed-off-by: Marc Zyngier <marc.zyngier@altran.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoub: remove sg_stat
Pete Zaitcev [Mon, 4 Aug 2008 23:15:40 +0000 (17:15 -0600)]
ub: remove sg_stat

Remove forgotten code related to sg_stat[].

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: extend poisoning to anchors
Oliver Neukum [Tue, 29 Jul 2008 14:18:47 +0000 (16:18 +0200)]
USB: extend poisoning to anchors

this extends the poisoning concept to anchors. This way poisoning
will work with fire and forget drivers.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: kill URBs permanently
Oliver Neukum [Tue, 29 Jul 2008 13:26:15 +0000 (15:26 +0200)]
USB: kill URBs permanently

looking at usb_kill_urb() it seems to me that it is unnecessarily lenient.
In the use case of disconnect() you never want to use the URB again
(for the same device) But leaving urb->reject elevated will make it easier
to avoid races between read/write and disconnect.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agodrivers/usb/class/usblp.c: adjust error handling code
Julia Lawall [Wed, 16 Jul 2008 16:00:42 +0000 (18:00 +0200)]
drivers/usb/class/usblp.c: adjust error handling code

In this code, it is possible to tell statically whether usblp will be NULL
in the error handling code.

Oliver Neukum suggested to make a goto to the final return rather than
return directly.

The semantic match that finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
identifier f,err,l,l1;
type T;
expression x,E;
statement S;
@@

x = NULL
... when != goto l1;
* x = f(...)
... when != x
err = E;
goto l;
...
* if (x != NULL)
  S
return err;
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: add USB test and measurement class driver
Greg Kroah-Hartman [Tue, 26 Aug 2008 23:22:06 +0000 (16:22 -0700)]
USB: add USB test and measurement class driver

This driver was originaly written by Stefan Kopp, but massively
reworked by Greg for submission.

Thanks to Felipe Balbi <me@felipebalbi.com> for lots of work in cleaning
up this driver.

Thanks to Oliver Neukum <oliver@neukum.org> for reviewing previous
versions and pointing out problems.

Cc: Stefan Kopp <stefan_kopp@agilent.com>
Cc: Marcel Janssen <korgull@home.nl>
Cc: Felipe Balbi <me@felipebalbi.com>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Added driver for a Delcom USB 7-segment LED Display
Harrison Metzger [Thu, 14 Aug 2008 16:29:32 +0000 (11:29 -0500)]
USB: Added driver for a Delcom USB 7-segment LED Display

Added basic support for a Delcom USB 7-segment LED Display

Signed-off by: Harrison Metzger <harrisonmetz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Add Oceanic product ID to ftdi_sio
Vladimir Vukicevic [Sat, 4 Oct 2008 00:08:43 +0000 (17:08 -0700)]
USB: Add Oceanic product ID to ftdi_sio

Add Oceanic PID to ftdi_sio driver

Oceanic dive computers (such as the VT3 --
http://www.oceanicworldwide.com/p_computers_vt3.html) all use an onboard
FTDI serial converter, with the FTDI vid and a  PID of 0xf460.  The
attached patch adds that pid to ftdi_sio; driver  connects to my VT3
after that.

Signed-off-by: Vladimir Vukicevic <vladimir@pobox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: option.c remove duplicate device ids now supported in hso.c
Denis Joseph Barrow [Tue, 30 Sep 2008 14:49:22 +0000 (16:49 +0200)]
USB: option.c remove duplicate device ids now supported in hso.c

Remove duplicate device ids which are now supported by drivers/usb/net/hso.c

Signed-off-by: Denis Joseph Barrow <D.Barow@option.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: option: add Ericsson F3507g and Dell 5530
Dan Williams [Wed, 24 Sep 2008 15:49:19 +0000 (11:49 -0400)]
USB: option: add Ericsson F3507g and Dell 5530

Add a few more mobile broadband cards.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
Linus Torvalds [Fri, 17 Oct 2008 16:50:12 +0000 (09:50 -0700)]
Merge git://git./linux/kernel/git/gregkh/staging-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (25 commits)
  staging: at76_usb wireless driver
  Staging: workaround build system bug
  Staging: Lindent sxg.c
  Staging: SLICOSS: Call pci_release_regions at driver exit
  Staging: SLICOSS: Fix remaining type names
  Staging: SLICOSS: Fix warnings due to static usage
  Staging: SLICOSS: lots of checkpatch fixes
  Staging: go7007 v4l fixes
  Staging: Fix gcc warnings in sxg
  Staging: add echo cancelation module
  Staging: add wlan-ng prism2 usb driver
  Staging: add w35und wifi driver
  Staging: USB/IP: add host driver
  Staging: USB/IP: add client driver
  Staging: USB/IP: add common functions needed
  Staging: add the go7007 video driver
  Staging: add me4000 pci data collection driver
  Staging: add me4000 firmware files
  Staging: add sxg network driver
  Staging: add Alacritech slicoss network driver
  ...

Fixed up conflicts due to taint flags changes and MAINTAINERS cleanup in
MAINTAINERS, include/linux/kernel.h and kernel/panic.c.

16 years agoMerge branch 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
Linus Torvalds [Fri, 17 Oct 2008 16:33:39 +0000 (09:33 -0700)]
Merge branch 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6

* 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6: (47 commits)
  hwmon: (adm1026) Prevent log spamming
  hwmon: (adm1026) Fix debug messages
  hwmon: (adm1029) Use mask for fan_div value
  hwmon: (adt7470) Add documentation
  hwmon: (ibmaem) Automatically load on IBM systems via DMI
  hwmon: (ibmpex) Automatically load on IBM systems via DMI
  hwmon: (w83781d) Use new style driver binding
  hwmon: (w83781d) Stop abusing struct i2c_client for ISA devices
  hwmon: (w83781d) Make ISA interface depend on CONFIG_ISA
  hwmon: (w83781d) Additional information about AS99127F PWM
  hwmon: (w83781d) Detect alias chips
  hwmon: (w83781d) Refactor beep enable handling
  hwmon: Drop dead links to old National Semiconductor chip datasheets
  hwmon: (w83791d) add support for thermal cruise mode
  hwmon: (w83791d) add pwm_enable support
  hwmon: (w83791d) add manual PWM support
  hwmon: (w83791d) fan 4/5 pins can also be used for gpio
  hwmon: (max1619) Use inline functions instead of macros
  hwmon: (it87) Fix thermal sensor type values
  hwmon: (lm78) Convert to a new-style i2c driver
  ...

16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Fri, 17 Oct 2008 16:30:35 +0000 (09:30 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: Fix debugfs_create_dir's error checking method for sound/soc/
  ALSA: ASoC: Convert playpaq_wm8510 to bulk route registration API
  ALSA: kernel docs: fix sound/core/ kernel-doc
  ALSA: Handle NULL jacks in snd_jack_report()
  ALSA: hda - Fix PCM type of Nvidia HDMI devices

16 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
Linus Torvalds [Fri, 17 Oct 2008 16:29:55 +0000 (09:29 -0700)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block

* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  block: remove __generic_unplug_device() from exports
  block: move q->unplug_work initialization
  blktrace: pass zfcp driver data
  blktrace: add support for driver data
  block: fix current kernel-doc warnings
  block: only call ->request_fn when the queue is not stopped
  block: simplify string handling in elv_iosched_store()
  block: fix kernel-doc for blk_alloc_devt()
  block: fix nr_phys_segments miscalculation bug
  block: add partition attribute for partition number
  block: add BIG FAT WARNING to CONFIG_DEBUG_BLOCK_EXT_DEVT
  softirq: Add support for triggering softirq work on softirqs.

16 years agoMerge branch 'for-linus' of git://www.jni.nu/cris
Linus Torvalds [Fri, 17 Oct 2008 16:09:48 +0000 (09:09 -0700)]
Merge branch 'for-linus' of git://www.jni.nu/cris

* 'for-linus' of git://www.jni.nu/cris:
  CRIS: proper defconfig setup
  [CRIS] Rename boot-linkscripts and fix the path to them.

16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
Linus Torvalds [Fri, 17 Oct 2008 16:00:23 +0000 (09:00 -0700)]
Merge git://git./linux/kernel/git/jejb/scsi-misc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (39 commits)
  [SCSI] sd: fix compile failure with CONFIG_BLK_DEV_INTEGRITY=n
  libiscsi: fix locking in iscsi_eh_device_reset
  libiscsi: check reason why we are stopping iscsi session to determine error value
  [SCSI] iscsi_tcp: return a descriptive error value during connection errors
  [SCSI] libiscsi: rename host reset to target reset
  [SCSI] iscsi class: fix endpoint id handling
  [SCSI] libiscsi: Support drivers initiating session removal
  [SCSI] libiscsi: fix data corruption when target has to resend data-in packets
  [SCSI] sd: Switch kernel printing level for DIF messages
  [SCSI] sd: Correctly handle all combinations of DIF and DIX
  [SCSI] sd: Always print actual protection_type
  [SCSI] sd: Issue correct protection operation
  [SCSI] scsi_error: fix target reset handling
  [SCSI] lpfc 8.2.8 v2 : Add statistical reporting control and additional fc vendor events
  [SCSI] lpfc 8.2.8 v2 : Add sysfs control of target queue depth handling
  [SCSI] lpfc 8.2.8 v2 : Revert target busy in favor of transport disrupted
  [SCSI] scsi_dh_alua: remove REQ_NOMERGE
  [SCSI] lpfc 8.2.8 : update driver version to 8.2.8
  [SCSI] lpfc 8.2.8 : Add MSI-X support
  [SCSI] lpfc 8.2.8 : Update driver to use new Host byte error code DID_TRANSPORT_DISRUPTED
  ...

16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Fri, 17 Oct 2008 15:58:52 +0000 (08:58 -0700)]
Merge git://git./linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  net: Remove CONFIG_KMOD from net/ (towards removing CONFIG_KMOD entirely)
  ipv4: Add a missing rcu_assign_pointer() in routing cache.
  [netdrvr] ibmtr: PCMCIA IBMTR is ok on 64bit
  xen-netfront: Avoid unaligned accesses to IP header
  lmc: copy_*_user under spinlock
  [netdrvr] myri10ge, ixgbe: remove broken select INTEL_IOATDMA

16 years agohwmon: (adm1026) Prevent log spamming
Jean Delvare [Fri, 17 Oct 2008 15:51:20 +0000 (17:51 +0200)]
hwmon: (adm1026) Prevent log spamming

When debugging is enabled, the adm1026 driver currently logs the
message "Setting VID from GPIO11-15" 108 times each time you run
"sensors". Once should be enough.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Philip Pokorny <ppokorny@penguincomputing.com>
16 years agohwmon: (adm1026) Fix debug messages
Jean Delvare [Fri, 17 Oct 2008 15:51:20 +0000 (17:51 +0200)]
hwmon: (adm1026) Fix debug messages

* Add missing new-line to one debug message.
* Remove leading colon from 3 debug messages.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Philip Pokorny <ppokorny@penguincomputing.com>
16 years agohwmon: (adm1029) Use mask for fan_div value
Corentin Labbe [Fri, 17 Oct 2008 15:51:20 +0000 (17:51 +0200)]
hwmon: (adm1029) Use mask for fan_div value

This is my patch for testing correct values of fan div in adm1029 and
prevent a division by 0 for some (unlikely) register values.

Signed-off-by: Corentin Labbe <corentin.labbe@geomatys.fr>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agohwmon: (adt7470) Add documentation
Darrick J. Wong [Fri, 17 Oct 2008 15:51:20 +0000 (17:51 +0200)]
hwmon: (adt7470) Add documentation

Add at least the bare minimum of documentation for this chip.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agohwmon: (ibmaem) Automatically load on IBM systems via DMI
Darrick J. Wong [Fri, 17 Oct 2008 15:51:19 +0000 (17:51 +0200)]
hwmon: (ibmaem) Automatically load on IBM systems via DMI

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agohwmon: (ibmpex) Automatically load on IBM systems via DMI
Darrick J. Wong [Fri, 17 Oct 2008 15:51:19 +0000 (17:51 +0200)]
hwmon: (ibmpex) Automatically load on IBM systems via DMI

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>