]> Pileus Git - ~andy/linux/log
~andy/linux
13 years agoUSB: serial: enable async suspend for usb serial port device
Ming Lei [Tue, 13 Jul 2010 15:56:24 +0000 (23:56 +0800)]
USB: serial: enable async suspend for usb serial port device

Usb serial port device is child of its usb interface device, so
we can enable async suspend of usb serial port device to speedup
system suspend.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: musb: forward debug mode feature to gadget
stephane duverger [Mon, 12 Jul 2010 16:43:47 +0000 (18:43 +0200)]
USB: musb: forward debug mode feature to gadget

This is a patch for the musb usb controller.

It allows forwarding of the debug mode feature to its gadget in order
to be able to act as an ehci debug device.

This patch has been tested on an IGEPv2 board running a 2.6.35-rc1
kernel.

Signed-off-by: Stephane Duverger <stephane.duverger@gmail.com>
Cc: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: EHCI Debug Port Device Gadget
stephane duverger [Mon, 12 Jul 2010 16:37:53 +0000 (18:37 +0200)]
USB: EHCI Debug Port Device Gadget

This is a patch that implements an USB EHCI Debug Device using the
Gadget API. This patch applies to a 2.6.35-rc3 kernel.

The gadget needs a compliant usb controller that forwards the
USB_DEVICE_DEBUG_MODE feature to its gadget.

The gadget provides two configuration modes, one that only printk() the
received data, and one that exposes a serial device to userland
(/dev/ttyGSxxx).

The gadget has been tested on an IGEPv2 board running a 2.6.35-rc1
kernel. The debug port was fed on the host side by a 2.6.34 kernel.

Signed-off-by: Stephane Duverger <stephane.duverger@gmail.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: Remove unnecessary casts of private_data
Joe Perches [Mon, 12 Jul 2010 20:50:11 +0000 (13:50 -0700)]
USB: gadget: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: misc: Remove unnecessary casts of private_data
Joe Perches [Mon, 12 Jul 2010 20:50:12 +0000 (13:50 -0700)]
USB: misc: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: usb-skeleton: Remove unnecessary casts of private_data
Joe Perches [Mon, 12 Jul 2010 20:50:13 +0000 (13:50 -0700)]
USB: usb-skeleton: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: autoconvert trivial BKL users to private mutex
Arnd Bergmann [Sun, 11 Jul 2010 21:18:56 +0000 (23:18 +0200)]
USB: autoconvert trivial BKL users to private mutex

All these files use the big kernel lock in a trivial
way to serialize their private file operations,
typically resulting from an earlier semi-automatic
pushdown from VFS.

None of these drivers appears to want to lock against
other code, and they all use the BKL as the top-level
lock in their file operations, meaning that there
is no lock-order inversion problem.

Consequently, we can remove the BKL completely,
replacing it with a per-file mutex in every case.
Using a scripted approach means we can avoid
typos.

file=$1
name=$2
if grep -q lock_kernel ${file} ; then
    if grep -q 'include.*linux.mutex.h' ${file} ; then
            sed -i '/include.*<linux\/smp_lock.h>/d' ${file}
    else
            sed -i 's/include.*<linux\/smp_lock.h>.*$/include <linux\/mutex.h>/g' ${file}
    fi
    sed -i ${file} \
        -e "/^#include.*linux.mutex.h/,$ {
                1,/^\(static\|int\|long\)/ {
                     /^\(static\|int\|long\)/istatic DEFINE_MUTEX(${name}_mutex);

} }"  \
    -e "s/\(un\)*lock_kernel\>[ ]*()/mutex_\1lock(\&${name}_mutex)/g" \
    -e '/[      ]*cycle_kernel_lock();/d'
else
    sed -i -e '/include.*\<smp_lock.h\>/d' ${file}  \
                -e '/cycle_kernel_lock()/d'
fi

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: storage: freecom: Fixed several coding style issues.
Martin Enderleit [Sat, 10 Jul 2010 14:50:12 +0000 (16:50 +0200)]
usb: storage: freecom: Fixed several coding style issues.

Fixed several coding style issues in freecom.c.

Signed-off-by: Martin Enderleit <menderleit@gmail.com>
Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Cc: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: musb: do not override DMA mode in channel program
Anand Gadiyar [Thu, 8 Jul 2010 11:04:55 +0000 (16:34 +0530)]
USB: musb: do not override DMA mode in channel program

There is no reason for the DMA channel program to override the
DMA mode passed down by its caller. Use the passed parameter
directly, and let the caller handle the decision on which mode
is to be used.

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Acked-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: musb: Kill board specific pinmux from driver file
Anand Gadiyar [Thu, 8 Jul 2010 11:04:54 +0000 (16:34 +0530)]
USB: musb: Kill board specific pinmux from driver file

This pin-muxing is best done in the board files. The driver should
not do this explicitly.

Also, this code causes a warning to be thrown when OMAP2430 and OMAP3/4
support are enabled in the same kernel.

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Acked-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: ehci_omap: fix device detect issue with modules
Ajay Kumar Gupta [Thu, 8 Jul 2010 08:33:02 +0000 (14:03 +0530)]
USB: ehci_omap: fix device detect issue with modules

Currently devices don't get detected automatically if the ehci
module is inserted 2nd time onward. We need to disconnect and
reconnect the device for it to get detected and enumerated.

Resetting the USB PHY using PHY reset comamnd over ULPI fixes
this issue. Tested on OMAP3EVM.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Acked-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: ulpi: fix compilation warning
Ajay Kumar Gupta [Thu, 8 Jul 2010 08:33:01 +0000 (14:03 +0530)]
USB: ulpi: fix compilation warning

Fixes below compilation warning from ulpi.h

include/linux/usb/ulpi.h:145:
        warning: 'struct otg_io_access_ops' declared inside parameter list
include/linux/usb/ulpi.h:145:
         warning: its scope is only this definition or declaration,
         which is probably not what you want

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: musb: fix compilation warning in host only mode
Ajay Kumar Gupta [Thu, 8 Jul 2010 08:33:00 +0000 (14:03 +0530)]
USB: musb: fix compilation warning in host only mode

Fixes below compilation warning when host only configuration is
selected.
drivers/usb/musb/musb_core.c: In function 'musb_stage0_irq':
drivers/usb/musb/musb_core.c:711: warning: unused variable 'mbase'

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Acked-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: musb: use correct register widths in register dumps
Anand Gadiyar [Thu, 8 Jul 2010 08:32:59 +0000 (14:02 +0530)]
USB: musb: use correct register widths in register dumps

DMA_ADDR and DMA_COUNT are 32-bit registers, not 16-bit.

Marking them as 16-bit in the table causes only the lower
16-bits to be dumped and this is misleading.

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Acked-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: core: hcd-pci: use for_each_pci_dev()
Kulikov Vasiliy [Sat, 3 Jul 2010 16:04:47 +0000 (20:04 +0400)]
USB: core: hcd-pci: use for_each_pci_dev()

Use for_each_pci_dev() to simplify the code.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: serial: io_ti: Don't return 0 if writing the download record failed
Roel Kluin [Thu, 1 Jul 2010 22:36:43 +0000 (00:36 +0200)]
USB: serial: io_ti: Don't return 0 if writing the download record failed

If the write download record failed we shouldn't return 0.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: storage_common: comments updated
Michal Nazarewicz [Mon, 5 Jul 2010 14:38:04 +0000 (16:38 +0200)]
USB: gadget: storage_common: comments updated

Updated comment to describe why printing macros are needed even
thought they are copied form the composite.h.  Also, made multiline
comments follow the coding standard.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: compilation issue: missing TASK_INTERRUPTIBLE
stephane duverger [Tue, 29 Jun 2010 14:57:25 +0000 (16:57 +0200)]
USB: gadget: compilation issue: missing TASK_INTERRUPTIBLE

Here is the patch for the following issue:

drivers/usb/gadget/u_serial.c: In function ‘gs_start_tx’:
drivers/usb/gadget/u_serial.c:369: error: ‘TASK_INTERRUPTIBLE’ undeclared (first use in this function)
drivers/usb/gadget/u_serial.c:369: error: (Each undeclared identifier is reported only once
drivers/usb/gadget/u_serial.c:369: error: for each function it appears in.)
drivers/usb/gadget/u_serial.c: In function ‘gs_rx_push’:
drivers/usb/gadget/u_serial.c:546: error: ‘TASK_INTERRUPTIBLE’ undeclared (first use in this function)
drivers/usb/gadget/u_serial.c: In function ‘gs_close’:
drivers/usb/gadget/u_serial.c:857: error: ‘TASK_INTERRUPTIBLE’ undeclared (first use in this function)
drivers/usb/gadget/u_serial.c:857: error: implicit declaration of function ‘signal_pending’
drivers/usb/gadget/u_serial.c:857: error: implicit declaration of function ‘schedule_timeout’
drivers/usb/gadget/u_serial.c: In function ‘gserial_cleanup’:
drivers/usb/gadget/u_serial.c:1190: error: ‘TASK_UNINTERRUPTIBLE’ undeclared (first use in this function)
drivers/usb/gadget/u_serial.c:1190: error: implicit declaration of function ‘schedule’
drivers/usb/gadget/u_serial.c: In function ‘gserial_disconnect’:
drivers/usb/gadget/u_serial.c:1311: error: ‘TASK_INTERRUPTIBLE’ undeclared (first use in this function)

Signed-off-by: Stephane Duverger <stephane.duverger@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: EHCI: fix NULL pointer dererence in HCDs that use HCD_LOCAL_MEM
Andrea Righi [Mon, 28 Jun 2010 14:56:45 +0000 (16:56 +0200)]
USB: EHCI: fix NULL pointer dererence in HCDs that use HCD_LOCAL_MEM

If we use the HCD_LOCAL_MEM flag and dma_declare_coherent_memory() to
enforce the host controller's local memory utilization we also need to
disable native scatter-gather support, otherwise hcd_alloc_coherent() in
map_urb_for_dma() is called with urb->transfer_buffer == NULL, that
triggers a NULL pointer dereference.

We can also consider to add a WARN_ON() and return an error code to
better catch this problem in the future.

At the moment no driver seems to hit this bug, so I should
consider this a low-priority fix.

Signed-off-by: Andrea Righi <arighi@develer.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: xhci: trivial: use ARRAY_SIZE
Kulikov Vasiliy [Mon, 28 Jun 2010 11:55:46 +0000 (15:55 +0400)]
USB: xhci: trivial: use ARRAY_SIZE

Change sizeof(x) / sizeof(*x) to ARRAY_SIZE(x).

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: drivers/usb/Makefile: conditionally descend to 'early'
Nicolas Kaiser [Sun, 27 Jun 2010 15:27:51 +0000 (17:27 +0200)]
USB: drivers/usb/Makefile: conditionally descend to 'early'

Don't descend to the EARLY_PRINTK_DBGP directory
unless it is actually used.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: usblp: fixed switch, brace, whitespace and spacing coding style issues
Nicolas Kaiser [Fri, 25 Jun 2010 18:25:37 +0000 (20:25 +0200)]
USB: usblp: fixed switch, brace, whitespace and spacing coding style issues

Fixed switch, brace, whitespace and spacing coding style issues.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Acked-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: add runtime PM for PCI-based host controllers
Alan Stern [Fri, 25 Jun 2010 18:02:57 +0000 (14:02 -0400)]
USB: add runtime PM for PCI-based host controllers

This patch (as1386) adds runtime-PM support for PCI-based USB host
controllers.  By default autosuspend is disallowed; the user must
enable it by writing "auto" to the controller's power/control sysfs
attribute.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: UHCI: add support for Intel's wakeup flags
Alan Stern [Fri, 25 Jun 2010 18:02:49 +0000 (14:02 -0400)]
USB: UHCI: add support for Intel's wakeup flags

This patch (as1396) adds code to uhci-hcd to support the
vendor-specific wakeup settings found in Intel's ICHx hardware.  A
couple of unnecessary memory barriers are removed.  And the root hub
isn't put back into the "suspended" state if power was lost during a
system sleep -- there's not much point in doing so because the root hub
will be resumed shortly.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: fix race between root-hub wakeup & controller suspend
Alan Stern [Fri, 25 Jun 2010 18:02:35 +0000 (14:02 -0400)]
USB: fix race between root-hub wakeup & controller suspend

This patch (as1395) adds code to hcd_pci_suspend() for handling wakeup
races.  This is another general race pattern, similar to the "open
vs. unregister" race we're all familiar with.  Here, the race is
between suspending a device and receiving a wakeup request from one of
the device's suspended children.

In particular, if a root-hub wakeup is requested at about the same
time as the corresponding USB controller is suspended, and if the
controller is enabled for wakeup, then the controller should either
fail to suspend or else wake right back up again.

During system sleep this won't happen very much, especially since host
controllers generally aren't enabled for wakeup during sleep.  However
it is definitely an issue for runtime PM.  Something like this will be
needed to prevent the controller from autosuspending while waiting for
a root-hub resume to take place.  (That is, in fact, the common case,
for which there is an extra test.)

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: controller resume should check the root hub
Alan Stern [Fri, 25 Jun 2010 18:02:24 +0000 (14:02 -0400)]
USB: controller resume should check the root hub

This patch (as1394) adds code to ehci-hcd, ohci-hcd, and uhci-hcd for
automatically resuming the root hub when the controller is resumed, if
the root hub has a wakeup request pending on some port.

During resume from system sleep this doesn't matter, because the root
hubs will naturally be resumed along with every other device in the
system.  However it _will_ matter for runtime PM: If the controller is
suspended and a remote wakeup request is received then the controller
will autoresume, but we need to ensure that the root hub also
autoresumes.  Otherwise the wakeup request would be ignored, the
controller would go back to sleep, and the cycle would repeat a large
number of times (I saw this happen before the patch was written).

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: add do_wakeup parameter for PCI HCD suspend
Alan Stern [Fri, 25 Jun 2010 18:02:14 +0000 (14:02 -0400)]
USB: add do_wakeup parameter for PCI HCD suspend

This patch (as1385) adds a "do_wakeup" parameter to the pci_suspend
method used by PCI-based host controller drivers.  ehci-hcd in
particular needs to know whether or not to enable wakeup when
suspending a controller.  Although that information is currently
available through device_may_wakeup(), when support is added for
runtime suspend this will no longer be true.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: move PCI HCD resume routine
Alan Stern [Fri, 25 Jun 2010 18:02:03 +0000 (14:02 -0400)]
USB: move PCI HCD resume routine

This patch (as1384) moves the resume_common() routine in hcd-pci.c a
little higher in the source file to avoid forward references in an
upcoming patch.  It also replaces the "hibernated" argument with a
more general "event" argument, which will be useful when the routine
is called during a runtime resume.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: refactor the powermac-specific ASIC clock code
Alan Stern [Fri, 25 Jun 2010 18:01:49 +0000 (14:01 -0400)]
USB: refactor the powermac-specific ASIC clock code

This patch (as1383) takes the powermac-specific code from the PCI HCD
glue layer and encapsulates it in its own subroutine.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: g_fs: code cleanup
Michal Nazarewicz [Fri, 25 Jun 2010 14:29:27 +0000 (16:29 +0200)]
USB: gadget: g_fs: code cleanup

This commit cleans the g_fs gadget hopefully making it more
readable.  This is achieved by usage of the usb_string_ids_tab()
function for batch string IDs registration as well as
generalising configuration so that a single routine is
used to add each configuration and bind interfaces.  As an
effect, the code is shorter and has fewer #ifdefs.

Moreover, in some circumstances previous code #defined
CONFIG_USB_FUNCTIONFS_GENERIC macro to prevent a situation
where gadget with no configurations is built.  This code removes
the #define form source code and achieves the same effect using
select in Kconfig.

This patch also changes wording and names of the Kconfig options.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: convert usb_hcd bitfields into atomic flags
Alan Stern [Tue, 22 Jun 2010 20:39:10 +0000 (16:39 -0400)]
USB: convert usb_hcd bitfields into atomic flags

This patch (as1393) converts several of the single-bit fields in
struct usb_hcd to atomic flags.  This is for safety's sake; not all
CPUs can update bitfield values atomically, and these flags are used
in multiple contexts.

The flag fields that are set only during registration or removal can
remain as they are, since non-atomic accesses at those times will not
cause any problems.

(Strictly speaking, the authorized_default flag should become atomic
as well.  I didn't bother with it because it gets changed only via
sysfs.  It can be done later, if anyone wants.)

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: section mismatch warning fixed
Michal Nazarewicz [Mon, 21 Jun 2010 11:57:04 +0000 (13:57 +0200)]
USB: gadget: section mismatch warning fixed

In may gadgets bind and bind like functions were in a init section
as they were only run during initialisation.  However, being
callback functions they were referenced from structures in “normal”
sections.  Changing the tag from “__init” to “__ref” fixes the
warnings.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: f_mass_storage: added eject callback
Michal Nazarewicz [Mon, 21 Jun 2010 11:57:09 +0000 (13:57 +0200)]
USB: gadget: f_mass_storage: added eject callback

Added pre_eject() and post_eject() callbacks which are
called before and after removable logical unit is ejected.
The first can prevent logical unit from being ejected.

This commit also changes the way callbacks are passed to
the function from gadget.  A fsg_operations structure has
been created which lists all callbacks -- this is passed
to the fsg_config.

This is important because it changes the way thread_exits()
callback is passed.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: composite: added disconnect callback
Michal Nazarewicz [Mon, 21 Jun 2010 11:57:08 +0000 (13:57 +0200)]
USB: gadget: composite: added disconnect callback

Added a disconnect() callback to composite devices which
is called by composite glue when its disconnect callback
is called by gadget.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: g_multi: added documentation and INF files
Michal Nazarewicz [Mon, 21 Jun 2010 11:57:07 +0000 (13:57 +0200)]
USB: gadget: g_multi: added documentation and INF files

A short documentation of the g_multi driver along with INF
files for Windows XP SP3 are provided.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: g_serial: INF file updated
Michal Nazarewicz [Mon, 21 Jun 2010 11:57:06 +0000 (13:57 +0200)]
USB: gadget: g_serial: INF file updated

Updated the INF file for g_serial gadget.  It should work with
most recent Windows systems now.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: g_ether: updated INF file
Michal Nazarewicz [Mon, 21 Jun 2010 11:57:05 +0000 (13:57 +0200)]
USB: gadget: g_ether: updated INF file

Updated the INF file for the g_ether gadget.  It should work with most
recent Windows systems now.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: g_multi: code clean up and refactoring
Michal Nazarewicz [Mon, 21 Jun 2010 11:57:03 +0000 (13:57 +0200)]
USB: gadget: g_multi: code clean up and refactoring

The Multifunction Composite Gadget have been cleaned up
and refactored so hopefully it looks prettier and works
at least as good as before changes.

A Kconfig has also been fixed to make it impossible to build
FunctionFS gadget with no configurations.  With this patch, if
RNDIS is not chosen by the user CDC is force-selected.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: f_mass_storage: dead code removed
Michal Nazarewicz [Fri, 18 Jun 2010 13:59:43 +0000 (15:59 +0200)]
USB: gadget: f_mass_storage: dead code removed

The ep0req_name was never used in f_mass_storage hence it may
be safely removed from the code.  It was a leftover from File
Storage Gadget which used it for debug messages.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: f_fs: use usb_string_ids_n()
Michal Nazarewicz [Wed, 16 Jun 2010 10:08:00 +0000 (12:08 +0200)]
USB: gadget: f_fs: use usb_string_ids_n()

Use usb_string_ids_n() function to simplify string ids
registeration.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: composite: usb_string_ids_*() functions added
Michal Nazarewicz [Wed, 16 Jun 2010 10:07:59 +0000 (12:07 +0200)]
USB: gadget: composite: usb_string_ids_*() functions added

usb_string_ids_tab() and usb_string_ids_n() functions added to
the composite framework.  The first accepts an array of
usb_string object and for each registeres a string id and the
second registeres a given number of ids and returns the first.

This may simplify string ids registration since gadgets and
composite functions won't have to call usb_string_id() several
times and each time check for errer status -- all this will be
done with a single call.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: f_fs: functionfs_add() renamed to functionfs_bind_config()
Michal Nazarewicz [Wed, 16 Jun 2010 10:07:58 +0000 (12:07 +0200)]
USB: gadget: f_fs: functionfs_add() renamed to functionfs_bind_config()

FunctionFS had a bit unique name for function used to add it
to USB configuration.  Renamed as to match naming convention
of other functions.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: f_mass_storage: fsg_add() renamed to fsg_bind_config()
Michal Nazarewicz [Wed, 16 Jun 2010 10:07:57 +0000 (12:07 +0200)]
USB: gadget: f_mass_storage: fsg_add() renamed to fsg_bind_config()

Mass Storage Function had a bit unique name for function
used to add it to USB configuration.  Renamed as to match
naming convention of other functions.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: g_mass_storage: static data instead of dynamic allocation
Michal Nazarewicz [Wed, 16 Jun 2010 10:07:56 +0000 (12:07 +0200)]
USB: gadget: g_mass_storage: static data instead of dynamic allocation

This patch changes msg_do_config() function so that it uses
a static object for a fsg_common structure instead of dynamically
allocated.  This is a micro-optimisation.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: mon: kill BKL usage
Arnd Bergmann [Tue, 1 Jun 2010 21:04:45 +0000 (23:04 +0200)]
USB: mon: kill BKL usage

compat_ioctl does not use the BKL, so I assume that
the native function does not need it either.

The open function is already protected by the
driver's mutex, the BKL is probably not needed
here either.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: gadget: Do not take BKL for gadget->ops->ioctl
Arnd Bergmann [Tue, 1 Jun 2010 21:04:44 +0000 (23:04 +0200)]
usb: gadget: Do not take BKL for gadget->ops->ioctl

There is no gadget driver in the tree that
actually implements the ioctl operation, so
obviously it is not necessary to hold the
BKL around the call.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Michał Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB-BKL: Remove BKL use in uhci-debug
Andi Kleen [Tue, 1 Jun 2010 21:04:43 +0000 (23:04 +0200)]
USB-BKL: Remove BKL use in uhci-debug

BKL was not really needed, just came from earlier push downs.

The only part that's a bit dodgy is the lseek function. Would
need another lock or atomic access to fpos on 32bit?
Better to have a libfs lseek

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB-BKL: Remove BKL use for usb serial driver probing
Andi Kleen [Tue, 1 Jun 2010 21:04:42 +0000 (23:04 +0200)]
USB-BKL: Remove BKL use for usb serial driver probing

The usb serial driver initialization tried to use the BKL to stop
driver modules from unloading, but that didn't work anyways.

There was already some code to do proper try_module_get,
but it was conditional on having a new probe interface.
I checked all the low level drivers and they all have proper
.owner = THIS_MODULE, so it's ok to always use.

The other problem was the usb_serial_driver_list needing
protection by a lock. This was broken anyways because unregister
did not necessarily have the BKL.

I extended the extending table_lock mutex to protect this case too.

With these changes the BKL can be removed here.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB-BKL: Convert usb_driver ioctl to unlocked_ioctl
Andi Kleen [Tue, 1 Jun 2010 21:04:41 +0000 (23:04 +0200)]
USB-BKL: Convert usb_driver ioctl to unlocked_ioctl

And audit all the users. None needed the BKL.  That was easy
because there was only very few around.

Tested with allmodconfig build on x86-64

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
From: Andi Kleen <ak@linux.intel.com>

13 years agoUSB-BKL: Remove lock_kernel in usbfs update_sb()
Andi Kleen [Tue, 1 Jun 2010 21:04:40 +0000 (23:04 +0200)]
USB-BKL: Remove lock_kernel in usbfs update_sb()

The code this is attempting to lock against does not use the BKL,
so it's not needed.

Most likely this code is still broken/racy (Al Viro also thinks so),
but removing the BKL should not make it worse than before.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: atm: fixed spacing and indentation coding style issues
Nicolas Kaiser [Thu, 17 Jun 2010 09:55:49 +0000 (11:55 +0200)]
usb: atm: fixed spacing and indentation coding style issues

Fixed spacing and indentation coding style issues.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: Add a serial number parameter to g_file_storage module
Yann Cantin [Sat, 5 Jun 2010 21:06:31 +0000 (23:06 +0200)]
USB: Add a serial number parameter to g_file_storage module

This patch add a serial number parameter to the g_file_storage
module. There's validity checks against the string passed to comply
with the specs.

Signed-off-by: Yann Cantin <yann.cantin@laposte.net>
Cc: Michał Nazarewicz <m.nazarewicz@samsung.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: conexant: fixed spacing and brace coding style issues
Nicolas Kaiser [Wed, 16 Jun 2010 16:56:05 +0000 (18:56 +0200)]
usb: conexant: fixed spacing and brace coding style issues

Fixed spacing and brace coding style issues.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: langwell_udc.c: printk needs a (unsigned long long) cast for a dma_t
Joe Perches [Fri, 11 Jun 2010 02:20:43 +0000 (19:20 -0700)]
USB: gadget: langwell_udc.c: printk needs a (unsigned long long) cast for a dma_t

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoRevert "USB: Adding support for HTC Smartphones to ipaq"
Leann Ogasawara [Thu, 10 Jun 2010 22:49:24 +0000 (15:49 -0700)]
Revert "USB: Adding support for HTC Smartphones to ipaq"

ipaq already had this device id defined:

{ USB_DEVICE(0x0BB4, 0x00CF) }, /* HTC USB Modem */

Revert the commit which adds the duplicate entry.

This reverts commit 04cab1329336d4577d6638360c905e360934b425.

Originally-by: Ben Collins <ben.collins@canonical.com>
Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: option: Remove duplicate AMOI_VENDOR_ID
Leann Ogasawara [Thu, 10 Jun 2010 21:51:51 +0000 (14:51 -0700)]
USB: option: Remove duplicate AMOI_VENDOR_ID

AMOI_VENDOR_ID is defined twice.  Remove the duplicate entry and move
the AMOI_PRODUCT_9508 definition to be grouped with the other AMOI
product definitions.

Originally-by: Ben Collins <ben.collins@ubuntu.com>
Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: EHCI: EHCI 1.1 addendum: Enable Per-port change detect bits
Alek Du [Fri, 4 Jun 2010 07:47:56 +0000 (15:47 +0800)]
USB: EHCI: EHCI 1.1 addendum: Enable Per-port change detect bits

This patch will enable Per-port event feature defined in EHCI 1.1
addendum. This feature addresses an issue where HCD is currently
required to read and parse PORTSC for all enabled root hub ports. With
this patch, the overhead will be reduced.

Signed-off-by: Alek Du <alek.du@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: EHCI: EHCI 1.1 addendum: Basic LPM feature support
Alek Du [Fri, 4 Jun 2010 07:47:55 +0000 (15:47 +0800)]
USB: EHCI: EHCI 1.1 addendum: Basic LPM feature support

With this patch, the LPM capable EHCI host controller can put device
into L1 sleep state which is a mode that can enter/exit quickly, and
reduce power consumption.

Signed-off-by: Jacob Pan <jacob.jun.pan@intel.com>
Signed-off-by: Alek Du <alek.du@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: EHCI: EHCI 1.1 addendum: preparation
Alek Du [Fri, 4 Jun 2010 07:47:54 +0000 (15:47 +0800)]
USB: EHCI: EHCI 1.1 addendum: preparation

EHCI 1.1 addendum introduced several energy efficiency extensions for
EHCI USB host controllers:
1. LPM (link power management)
2. Per-port change
3. Shorter periodic frame list
4. Hardware prefetching

This patch is intended to define the HW bits and debug interface for
EHCI 1.1 addendum. The LPM and Per-port change patches will be sent out
after this patch.

Signed-off-by: Jacob Pan <jacob.jun.pan@intel.com>
Signed-off-by: Alek Du <alek.du@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: throw away custom hex digit methods
Andy Shevchenko [Tue, 15 Jun 2010 14:04:44 +0000 (17:04 +0300)]
usb: throw away custom hex digit methods

Recent kernel has common method to convert hex digit to its value.

Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: isd200.c: Remove unnecessary kmalloc cast
Joe Perches [Tue, 1 Jun 2010 03:23:19 +0000 (20:23 -0700)]
USB: isd200.c: Remove unnecessary kmalloc cast

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: host: Eliminate NULL dereference
Julia Lawall [Thu, 27 May 2010 16:10:08 +0000 (18:10 +0200)]
USB: host: Eliminate NULL dereference

The test above allows std to be NULL, so check that std is not NULL before
doing the dereference.

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

// <smpl>
@r exists@
expression E,E1;
identifier f;
statement S1,S2,S3;
@@

if ((E == NULL && ...) || ...)
{
  ... when != if (...) S1 else S2
      when != E = E1
* E->f
  ... when any
}
else S3
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: otg.h: Fix the mixup in parameters order.
Igor Grinberg [Thu, 27 May 2010 06:32:13 +0000 (09:32 +0300)]
USB: otg.h: Fix the mixup in parameters order.

otg_io_write() function does not follow the declaration of
struct otg_io_access_ops.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: core endpoint: Fix Coding Styles
csanchez@neurowork.net [Tue, 25 May 2010 15:53:17 +0000 (10:53 -0500)]
USB: core endpoint: Fix Coding Styles

Fixed coding styles in the core usb endpoint.

Signed-off-by: Carlos Sánchez Acosta <csanchez@neurowork.net>
Signed-off-by: Alejandro Sánchez Acosta <asanchez@neurowork.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: core driver: Fix Coding Styles
csanchez@neurowork.net [Tue, 25 May 2010 15:38:22 +0000 (10:38 -0500)]
USB: core driver: Fix Coding Styles

Fixed coding styles in the core usb driver.

Signed-off-by: Carlos Sánchez Acosta <csanchez@neurowork.net>
Signed-off-by: Alejandro Sánchez Acosta <asanchez@neurowork.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: Documentation/usb/linux.inf: Checkpatch cleanup
Andrea Gelmini [Sun, 23 May 2010 19:56:43 +0000 (21:56 +0200)]
USB: Documentation/usb/linux.inf: Checkpatch cleanup

Documentation/usb/linux.inf:66: ERROR: trailing whitespace
Documentation/usb/linux.inf:67: ERROR: trailing whitespace
Documentation/usb/linux.inf:98: ERROR: trailing whitespace
Documentation/usb/linux.inf:99: ERROR: trailing whitespace
Documentation/usb/linux.inf:115: ERROR: trailing whitespace
Documentation/usb/linux.inf:116: ERROR: trailing whitespace
Documentation/usb/linux.inf:120: ERROR: trailing whitespace
Documentation/usb/linux.inf:121: ERROR: trailing whitespace
Documentation/usb/linux.inf:122: ERROR: trailing whitespace
Documentation/usb/linux.inf:123: ERROR: trailing whitespace
Documentation/usb/linux.inf:144: ERROR: trailing whitespace
Documentation/usb/linux.inf:145: ERROR: trailing whitespace
Documentation/usb/linux.inf:146: ERROR: trailing whitespace
Documentation/usb/linux.inf:147: ERROR: trailing whitespace
Documentation/usb/linux.inf:158: ERROR: trailing whitespace

Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: Documentation/usb/hotplug.txt: Checkpatch cleanup
Andrea Gelmini [Sun, 23 May 2010 19:56:42 +0000 (21:56 +0200)]
USB: Documentation/usb/hotplug.txt: Checkpatch cleanup

Documentation/usb/hotplug.txt:13: ERROR: trailing whitespace
Documentation/usb/hotplug.txt:87: ERROR: trailing whitespace

Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: Documentation/usb/ehci.txt: Checkpatch cleanup
Andrea Gelmini [Sun, 23 May 2010 19:56:41 +0000 (21:56 +0200)]
USB: Documentation/usb/ehci.txt: Checkpatch cleanup

Documentation/usb/ehci.txt:12: ERROR: trailing whitespace

Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: Use memdup_user
Julia Lawall [Sat, 22 May 2010 08:26:22 +0000 (10:26 +0200)]
USB: gadget: Use memdup_user

Use memdup_user when user data is immediately copied into the
allocated region.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression from,to,size,flag;
position p;
identifier l1,l2;
@@

-  to = \(kmalloc@p\|kzalloc@p\)(size,flag);
+  to = memdup_user(from,size);
   if (
-      to==NULL
+      IS_ERR(to)
                 || ...) {
   <+... when != goto l1;
-  -ENOMEM
+  PTR_ERR(to)
   ...+>
   }
-  if (copy_from_user(to, from, size) != 0) {
-    <+... when != goto l2;
-    -EFAULT
-    ...+>
-  }
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: EHCI: make CONFIG_USB_EHCI_TT_NEWSCHED default to Y
Alan Stern [Fri, 21 May 2010 21:08:21 +0000 (17:08 -0400)]
USB: EHCI: make CONFIG_USB_EHCI_TT_NEWSCHED default to Y

This patch (as1382) changes the USB_EHCI_TT_NEWSCHED Kconfig option to
be non-experimental and to default to Y.  This option has existed for
a long time, and I have not heard any complaints concerning it.  By
contrast, several people have reported that their devices could be
made to work only by enabling the option.

The point of changing the default is to cause the option to be enabled
by distros that simply use the default settings for esoteric things
like this.

This change was motivated by Bugzilla #15649.

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>
13 years agoUSB: iuu_phoenix: Add support for different baud rates.
James Courtier-Dutton [Fri, 21 May 2010 10:53:25 +0000 (11:53 +0100)]
USB: iuu_phoenix: Add support for different baud rates.

Signed-off-by: James Courtier-Dutton <James@superbug.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: xhci: Remove obsolete debugging printk.
Sarah Sharp [Mon, 7 Jun 2010 16:11:33 +0000 (09:11 -0700)]
USB: xhci: Remove obsolete debugging printk.

When code to manipulate the command register was refactored from
xhci_run() to xhci_start(), a debugging statement was left behind that no
longer applies.  Remove that statement.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reported-by: Sergei Shtylyov <sshtylyov@mvista.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: speedtouch: fixed more brace and spacing coding style issues
Nicolas Kaiser [Wed, 9 Jun 2010 18:43:03 +0000 (20:43 +0200)]
USB: speedtouch: fixed more brace and spacing coding style issues

Fixed spacing coding style issues.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: speedtouch: fixed brace and spacing coding style issues
Nicolas Kaiser [Wed, 9 Jun 2010 18:22:03 +0000 (20:22 +0200)]
USB: speedtouch: fixed brace and spacing coding style issues

Fixed brace coding style issues.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: UHCI: acquire spinlock before calling start_rh()
Alan Stern [Wed, 9 Jun 2010 21:34:39 +0000 (17:34 -0400)]
USB: UHCI: acquire spinlock before calling start_rh()

This patch (as1392) fixes a bug in uhci-hcd: The start_rh() routine is
supposed to be called with the private spinlock held.  If an IRQ comes
in at just the wrong time, the driver will think the controller has
died when in fact it simply hasn't start yet.

The patch also addresses some issues that may prevent an URB from
being unlinked after the controller has stopped.  This is an abnormal
occurrence (ordinarily the controller stops only when the entire bus
is suspended and hence there are no active URBs), so the pathways
haven't gotten much testing.  These two changes may be a little more
than is strictly necessary, but clearly they won't hurt.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: add check to detect host controller hardware removal
Alan Stern [Wed, 9 Jun 2010 21:34:27 +0000 (17:34 -0400)]
USB: add check to detect host controller hardware removal

This patch (as1391) fixes a problem that can occur when USB host
controller hardware is hot-unplugged.  If no interrupts are generated
by the unplug then the HCD may not realize that the controller is
gone, and the subsequent unbind may hang waiting for interrupts that
never arrive.

The solution (for PCI-based controllers) is to call the HCD's
interrupt handler at the start of usb_hcd_pci_remove().  If the
hardware is gone, the handler will realize this when it tries to read
the controller's status register.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: don't stop root-hub status polls too soon
Alan Stern [Wed, 9 Jun 2010 21:34:17 +0000 (17:34 -0400)]
USB: don't stop root-hub status polls too soon

This patch (as1390) fixes a problem that crops up when a UHCI host
controller is unbound from uhci-hcd while there are still some active
URBs.  The URBs have to be unlinked when the root hub is unregistered,
and uhci-hcd relies upon root-hub status polls as part of its
unlinking procedure.  But usb_hcd_poll_rh_status() won't make those
status calls if hcd->rh_registered is clear, and the flag is cleared
_before_ the unregistration takes place.

Since hcd->rh_registered is used for other things and needs to be
cleared early, the solution is to add a new flag (rh_pollable) and use
it instead.  It gets cleared _after_ the root hub is unregistered.

Now that the status polls don't end too soon, we have to make sure
they also don't occur too late -- after the root hub's usb_device
structure or the HCD's private structures are deallocated.  Therefore
the patch adds usb_get_device() and usb_put_device() calls to protect
the root hub structure, and it adds an extra del_timer_sync() to
prevent the root-hub timer from causing an unexpected status poll.

This additional complexity would not be needed if the HCD framework
had provided separate stop() and release() callbacks instead of just
stop().  This lack could be fixed at some future time (although it
would require changes to every host controller driver); when that
happens this patch won't be needed any more.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: fix failure path in usb_add_hcd()
Alan Stern [Wed, 9 Jun 2010 21:34:05 +0000 (17:34 -0400)]
USB: fix failure path in usb_add_hcd()

This patch (as1389) fixes some errors in the failure pathway of
usb_add_hcd().  The actions it takes ought to be exactly the same as
those taken by usb_remove_hcd(), but they aren't.

In one case (removal of the usb_bus_attr_group), the two routines are
brought into agreement by changing usb_remove_hcd().  All the other
discrepancies are fixed by changing usb_add_hcd().

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux...
Linus Torvalds [Tue, 10 Aug 2010 21:13:35 +0000 (14:13 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k:
  zorro: Fix reading of proc/bus/zorro/* in small chunks
  zorro: BKL removal
  m68k/mac: Fix RTC on PMU machines
  m68k/mac: Add color classic ii support
  arch/m68k/sun3/leds.c: Checkpatch cleanup

13 years agoMerge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6
Linus Torvalds [Tue, 10 Aug 2010 21:01:26 +0000 (14:01 -0700)]
Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6

* 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6:
  [S390] dasd: tunable missing interrupt handler
  [S390] dasd: allocate fallback cqr for reserve/release
  [S390] topology: use default MC domain initializer
  [S390] initrd: change default load address
  [S390] cmm, smsgiucv_app: convert sender to uppercase
  [S390] cmm: add missing __init/__exit annotations
  [S390] cio: use all available paths for some internal I/O
  [S390] ccwreq: add ability to use all paths
  [S390] cio: ccw_device_online_store return -EINVAL in case of missing driver
  [S390] cio: Log the response from the unit check handler
  [S390] cio: CHSC SIOSL Support

13 years agoMerge branch 'bkl/ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic...
Linus Torvalds [Tue, 10 Aug 2010 20:58:28 +0000 (13:58 -0700)]
Merge branch 'bkl/ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing

* 'bkl/ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing:
  staging: Pushdown bkl to easycap ioctl handlers
  autofs/autofs4: Move compat_ioctl handling into fs
  v4l: Convert v4l2-dev to unlocked_ioctl
  ia64/perfmon: Convert to unlocked_ioctl
  sunrpc: Remove duplicated #include
  ncpfs: Remove duplicated #include

13 years agoMerge branch 'kmemleak' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas...
Linus Torvalds [Tue, 10 Aug 2010 20:58:11 +0000 (13:58 -0700)]
Merge branch 'kmemleak' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-2.6-cm

* 'kmemleak' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-2.6-cm:
  kmemleak: Fix typo in the comment
  lib/scatterlist: Hook sg_kmalloc into kmemleak (v2)
  kmemleak: Add DocBook style comments to kmemleak.c
  kmemleak: Introduce a default off mode for kmemleak
  kmemleak: Show more information for objects found by alias

13 years agoU6715 16550A serial driver support
Philippe Langlais [Thu, 29 Jul 2010 15:13:57 +0000 (17:13 +0200)]
U6715 16550A serial driver support

UART Features extract from STEricsson U6715 data-sheet (arm926 SoC for mobile phone):
* Fully compatible with industry standard 16C550 and 16C450 from various
manufacturers
* RX and TX 64 byte FIFO reduces CPU interrupts
* Full double buffering
* Modem control signals include CTS, RTS, (and DSR, DTR on UART1 only)
* Automatic baud rate selection
* Manual or automatic RTS/CTS smart hardware flow control
* Programmable serial characteristics:
– Baud rate generation (50 to 3.25M baud)
– 5, 6, 7 or 8-bit characters
– Even, odd or no-parity bit generation and detection
– 1, 1.5 or 2 stop bit generation
* Independent control of transmit, receive, line status, data set interrupts and FIFOs
* Full status-reporting capabilities
* Separate DMA signaling for RX and TX
* Timed interrupt to spread receive interrupt on known duration
* DMA time-out interrupt to allow detection of end of reception
* Carkit pulse coding and decoding compliant with USB carkit control interface [40]

In 16550A auto-configuration, if the fifo size is 64 then it's an U6 16550A port
Add set_termios hook & export serial8250_do_set_termios to change uart
clock following baudrate

Signed-off-by: Philippe Langlais <philippe.langlais@stericsson.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoChar: nozomi, set tty->driver_data appropriately
Jiri Slaby [Thu, 29 Jul 2010 09:46:32 +0000 (11:46 +0200)]
Char: nozomi, set tty->driver_data appropriately

Sorry, one more fix, this one depends on the other, so this is rather 2/2.
--

tty->driver_data is used all over the code, but never set. This
results in oopses like:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000130
IP: [<ffffffff814a0040>] mutex_lock+0x10/0x40
...
Pid: 2157, comm: modem-manager Not tainted 2.6.34.1-0.1-desktop #1 2768DR7/2768DR7
RIP: 0010:[<ffffffff814a0040>]  [<ffffffff814a0040>] mutex_lock+0x10/0x40
RSP: 0018:ffff88007b16fa50  EFLAGS: 00010286
RAX: 0000000000000000 RBX: 0000000000000130 RCX: 0000000000000003
RDX: 0000000000000003 RSI: 0000000000000286 RDI: 0000000000000130
RBP: 0000000000001000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000130
R13: 0000000000000001 R14: 0000000000000000 R15: ffff88007b16feb4
...
Call Trace:
 [<ffffffffa077690d>] ntty_write_room+0x4d/0x90 [nozomi]
...

Set tty->driver_data to the computed port in .install to not recompute it in
every place where needed. Switch .open to use driver_data too.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Alan Cox <alan@linux.intel.com>
Cc: stable <stable@kernel.org> [.34, .35]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoChar: nozomi, fix tty->count counting
Jiri Slaby [Thu, 29 Jul 2010 09:09:47 +0000 (11:09 +0200)]
Char: nozomi, fix tty->count counting

Currently ntty_install omits to increment tty count and we get the
following warnings:
Warning: dev (noz2) tty->count(0) != #fd's(1) in tty_open

So to fix that, add one tty->count++ there.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Alan Cox <alan@linux.intel.com>
Cc: stable <stable@kernel.org> [.34, .35]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial: max3107: Fix gpiolib support
Alan Cox [Tue, 27 Jul 2010 07:16:05 +0000 (08:16 +0100)]
serial: max3107: Fix gpiolib support

Because of the way gpiolib works we actually need to ifdef this in our
header file

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agohsu: call PCI pm hooks in suspend/resume function
Feng Tang [Tue, 27 Jul 2010 07:20:52 +0000 (08:20 +0100)]
hsu: call PCI pm hooks in suspend/resume function

Also add check for dma controller or the uart ports.

Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agohsu: some code cleanup
Feng Tang [Tue, 27 Jul 2010 07:20:42 +0000 (08:20 +0100)]
hsu: some code cleanup

Major changes are:
* refine the comments in the driver
* remove unused member from structure "hsu_port"
* extended spin_lock protoction for dma mode in port_irq()

Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agohsu: add a periodic timer to check dma rx channel
Feng Tang [Tue, 27 Jul 2010 07:20:32 +0000 (08:20 +0100)]
hsu: add a periodic timer to check dma rx channel

A general problem for uart rx dma channel is you never know when
and how much data will be received, so usually preset it a DMA
descriptor with a big size, and rely on DMA RX timeout IRQ to
know there is some data in rx channel.

For a RX data size of multiple of MOTSR, there will be no timeout
IRQ issued, thus OS will never be notified about that.

This is a work around for that, current timer frequency is 5 times
per second, it should vary according to the baud rate

When future silicon version fix the problem, this workaround need
be removed

Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agohsu: driver for Medfield High Speed UART device
Feng Tang [Tue, 27 Jul 2010 07:20:22 +0000 (08:20 +0100)]
hsu: driver for Medfield High Speed UART device

This is a PCI & UART driver, which suppors both PIO and DMA mode
UART operation. It has 3 identical UART ports and one internal
DMA controller.

Current FW will export 4 pci devices for hsu: 3 uart ports and 1
dma controller, each has one IRQ line. And we need to discuss the
device model, one PCI device covering whole HSU should be a better
model, but there is a problem of how to export the 4 IRQs info

Current driver set the highest baud rate to 2746800bps, which is
easy to scale down to 115200/230400.... To suport higher baud rate,
we need add special process, change DLAB/DLH/PS/DIV/MUL registers
all together.

921600 is the highest baud rate that has been tested with Bluetooth
modem connected to HSU port 0. Will test more when there is right
BT firmware.

Current version contains several work around for A0's Silicon bugs

Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agomxser: remove unnesesary NULL check
Kulikov Vasiliy [Fri, 23 Jul 2010 16:34:53 +0000 (20:34 +0400)]
mxser: remove unnesesary NULL check

mxser_transmit_chars(tty, port) is called only from mxser_interrupt().
NULL check is performed in mxser_interrupt() so it is redundant here.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Acked-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial: add support for OX16PCI958 card
Lytochkin Boris [Mon, 26 Jul 2010 06:02:26 +0000 (10:02 +0400)]
serial: add support for OX16PCI958 card

Signed-off-by: Lytochkin Boris <lytboris@gmail.com>
Tested-by: Lytochkin Boris <lytboris@gmail.com>
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial: 68328serial.c: remove dead (ALMA_ANS | DRAGONIXVZ | M68EZ328ADS)
Christoph Egger [Tue, 20 Jul 2010 22:26:54 +0000 (15:26 -0700)]
serial: 68328serial.c: remove dead (ALMA_ANS | DRAGONIXVZ | M68EZ328ADS)

(ALMA_ANS | DRAGONIXVZ | M68EZ328ADS) doesn't exist in Kconfig, therefore
remove all references to it from the source code.

Signed-off-by: Christoph Egger <siccegge@cs.fau.de>
Acked-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agotimbuart: use __devinit and __devexit macros for probe and remove
Richard Röjfors [Tue, 20 Jul 2010 22:26:53 +0000 (15:26 -0700)]
timbuart: use __devinit and __devexit macros for probe and remove

Move the probe and remove functions to the devinit and devexit sections.

Signed-off-by: Richard Röjfors <richard.rojfors@pelagicore.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial: MMIO32 support for 8250_early.c
Samium Gromoff [Tue, 20 Jul 2010 22:26:51 +0000 (15:26 -0700)]
serial: MMIO32 support for 8250_early.c

Provide MMIO32 support in 8250_early (aka earlycon)

[randy.dunlap@oracle.com: fix printk format warnings]
[akpm@linux-foundation.org: fix printk args some more]
Signed-off-by: Samium Gromoff <_deepfire@feelingofgreen.ru>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial: mcf: don't take spinlocks in already protected functions
Yury Georgievskiy [Tue, 20 Jul 2010 22:26:50 +0000 (15:26 -0700)]
serial: mcf: don't take spinlocks in already protected functions

Don't take the port spinlock in uart functions where the serial core
already takes care of locking/unlocking them.

The code would actually lock up on architectures where spinlocks are
implemented.

Also protect calling mcf_rx_chars/mcf_tx_chars in the interrupt handler by
the port spinlock and use IRQ_RETVAL to return from isr.

[akpm@linux-foundation.org: make irq-handler return value more explicit]
Signed-off-by: Yury Georgievskiy <ygeorgie@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Acked-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial: general fixes in the serial_rs485 structure
Claudio Scordino [Tue, 20 Jul 2010 22:26:47 +0000 (15:26 -0700)]
serial: general fixes in the serial_rs485 structure

Fix several issues related to the RS485 interface:

 - It adds the flag SER_RS485_RTS_BEFORE_SEND that was missing from the
   serial_rs485 structure (even if "delay_rts_before_send" was existing)

 - It adds a further "delay_rts_after_send" field for those drivers that
   can have a delay after send (e.g., atmel_serial)

 - It fixes the usage of the structure in the atmel_serial driver (where
   "delay_rts_before_send" should be used instead of "delay_rts_after_send").

Signed-off-by: Claudio Scordino <claudio@evidence.eu.com>
Signed-off-by: Bernhard Roth <br@pwrnet.de>
Cc: Philippe De Muyter <phdm@macqel.be>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial: fix missing bit coverage of ASYNC_FLAGS
John Villalovos [Tue, 20 Jul 2010 22:26:46 +0000 (15:26 -0700)]
serial: fix missing bit coverage of ASYNC_FLAGS

It seems that currently ASYNC_FLAGS is one bit short of covering all the
bits of the ASYNC user flags.  In particular it does not cover the
ASYNC_AUTOPROBE bit.

ASYNCB_LAST_USER and ASYNCB_AUTOPROBE are both equal to 15.

Therefore:
ASYNC_AUTOPROBE = 1000 0000 0000 0000
ASYNC_FLAGS     = 0111 1111 1111 1111

So ASYNC_FLAGS is not covering the ASYNC_AUTOPROBE bit.

This patch fixes the issue and with the patch the values will be:
ASYNC_AUTOPROBE = 1000 0000 0000 0000
ASYNC_FLAGS     = 1111 1111 1111 1111

As a side note, doing a "git grep" I didn't find any use of
ASYNC_AUTOPROBE or ASYNCB_AUTOPROBE in the kernel, besides this include
file.

Signed-off-by: John Villalovos <john.l.villalovos@intel.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial: "altera_uart: simplify altera_uart_console_putc()" checkpatch fixes
Andrew Morton [Tue, 20 Jul 2010 22:26:10 +0000 (15:26 -0700)]
serial: "altera_uart: simplify altera_uart_console_putc()" checkpatch fixes

ERROR: code indent should use tabs where possible
#32: FILE: drivers/serial/altera_uart.c:397:
+^I         ALTERA_UART_STATUS_TRDY_MSK))$

total: 1 errors, 0 warnings, 39 lines checked

./patches/altera_uart-simplify-altera_uart_console_putc.patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

This fix got lost when someone merged "altera_uart: simplify
altera_uart_console_putc()".  Please don't lose fixes.  Please don't write
of mere patches which have trivial checkpatch errors.

Cc: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial: crisv10: formatting of pointers in printk()
Kulikov Vasiliy [Wed, 14 Jul 2010 18:04:42 +0000 (22:04 +0400)]
serial: crisv10: formatting of pointers in printk()

Use %p instead of %08x in printk().

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>