pandora-kernel.git
15 years agodriver core: move knode_bus into private structure
Greg Kroah-Hartman [Tue, 16 Dec 2008 20:26:21 +0000 (12:26 -0800)]
driver core: move knode_bus into private structure

Nothing outside of the driver core should ever touch knode_bus, so
move it out of the public eye.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver core: move knode_driver into private structure
Greg Kroah-Hartman [Tue, 16 Dec 2008 20:25:49 +0000 (12:25 -0800)]
driver core: move knode_driver into private structure

Nothing outside of the driver core should ever touch knode_driver, so
move it out of the public eye.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver core: move klist_children into private structure
Greg Kroah-Hartman [Tue, 16 Dec 2008 20:24:56 +0000 (12:24 -0800)]
driver core: move klist_children into private structure

Nothing outside of the driver core should ever touch klist_children, or
knode_parent, so move them out of the public eye.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver core: create a private portion of struct device
Greg Kroah-Hartman [Tue, 16 Dec 2008 20:23:36 +0000 (12:23 -0800)]
driver core: create a private portion of struct device

This is to be used to move things out of struct device that no code
outside of the driver core should ever touch.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver core: remove polling for driver_probe_done(v5)
Ming Lei [Sat, 21 Feb 2009 08:45:07 +0000 (16:45 +0800)]
driver core: remove polling for driver_probe_done(v5)

This patch removes 100ms polling for driver_probe_done in
wait_for_device_probe(), and uses wait_event() instead.
Removing polling in fs initialization may lead to
a faster boot.

This patch also changes the return type of wait_for_device_done()
from int to void.

This patch is against Arjan's patch in linux-next tree.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agosysfs: reference sysfs_dirent from sysfs inodes
Eric W. Biederman [Wed, 11 Feb 2009 21:20:23 +0000 (13:20 -0800)]
sysfs: reference sysfs_dirent from sysfs inodes

The sysfs_dirent serves as both an inode and a directory entry
for sysfs.  To prevent the sysfs inode numbers from being freed
prematurely hold a reference to sysfs_dirent from the sysfs inode.

[akpm@linux-foundation.org: add comment]
Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agosysfs: sysfs_add_one WARNs with full path to duplicate filename
Alex Chiang [Thu, 12 Feb 2009 17:56:59 +0000 (10:56 -0700)]
sysfs: sysfs_add_one WARNs with full path to duplicate filename

sysfs: sysfs_add_one WARNs with full path to duplicate filename

As a debugging aid, it can be useful to know the full path to a
duplicate file being created in sysfs.

We now will display warnings such as:

sysfs: cannot create duplicate filename '/foo'

when attempting to create multiple files named 'foo' in the sysfs
root, or:

sysfs: cannot create duplicate filename '/bus/pci/slots/5/foo'

when attempting to create multiple files named 'foo' under a
given directory in sysfs.

The path displayed is always a relative path to sysfs_root. The
leading '/' in the path name refers to the sysfs_root mount
point, and should not be confused with the "real" '/'.

Thanks to Alex Williamson for essentially writing sysfs_pathname.

Cc: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver-core: do not register a driver with bus_type not registered
Dave Young [Sat, 14 Feb 2009 13:23:22 +0000 (21:23 +0800)]
driver-core: do not register a driver with bus_type not registered

If the bus_type is not registerd, driver_register to that bus will cause oops.

I found this bug when test built-in usb serial drivers (ie. aircable driver)
with 'nousb' cmdline params.

In this patch:
1. set the bus->p=NULL when bus_register failed and unregisterd.
2. if bus->p is NULL, driver_register BUG_ON will be triggered.

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoscsi/m68k: Kill NCR_700_detect() warnings
Geert Uytterhoeven [Wed, 11 Mar 2009 08:23:52 +0000 (09:23 +0100)]
scsi/m68k: Kill NCR_700_detect() warnings

The patch from Ming Lei <tom.leiming@gmail.com> entitled:
    platform driver: fix incorrect use of 'platform_bus_type' with 'struct devic
introduced the following warnings on m68k, as `dev' is now a `struct
platform_device *' instead of a `struct device *':

| drivers/scsi/a4000t.c:64: warning: passing argument 3 of 'NCR_700_detect' from incompatible pointer type
| drivers/scsi/mvme16x_scsi.c:67: warning: passing argument 3 of 'NCR_700_detect' from incompatible pointer type
| drivers/scsi/bvme6000_scsi.c:61: warning: passing argument 3 of 'NCR_700_detect' from incompatible pointer type

I think the below is missing (untested on real hardware).

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoplatform driver: fix incorrect use of 'platform_bus_type' with 'struct device_driver'
Ming Lei [Fri, 6 Feb 2009 15:40:12 +0000 (23:40 +0800)]
platform driver: fix incorrect use of 'platform_bus_type' with 'struct device_driver'

This patch fixes the bug reported in
http://bugzilla.kernel.org/show_bug.cgi?id=11681.

"Lots of device drivers register a 'struct device_driver' with
the '.bus' member set to '&platform_bus_type'. This is wrong,
since the platform_bus functions expect the 'struct device_driver'
to be wrapped up in a 'struct platform_driver' which provides
some additional callbacks (like suspend_late, resume_early).
The effect may be that platform_suspend_late() uses bogus data
outside the device_driver struct as a pointer pointer to the
device driver's suspend_late() function or other hard to
reproduce failures."(Lothar Wassmann)

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUIO: Take offset into account when determining number of pages that can be mapped
Ian Abbott [Tue, 24 Feb 2009 17:22:59 +0000 (17:22 +0000)]
UIO: Take offset into account when determining number of pages that can be mapped

If a UIO memory region does not start on a page boundary but straddles one,
the number of actual pages that overlap the memory region may be calculated
incorrectly because the offset isn't taken into account.  If userspace sets
the mmap length to offset+size, it may fail with -EINVAL if UIO thinks it's
trying to allocate too many pages.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Cc: Hans J. Koch <hjk@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agouio: add the uio_aec driver
Brandon Philips [Tue, 27 Jan 2009 21:00:04 +0000 (13:00 -0800)]
uio: add the uio_aec driver

UIO driver for the Adrienne Electronics Corporation PCI time code
device.

This device differs from other UIO devices since it uses I/O ports instead of
memory mapped I/O. In order to make it possible for UIO to work with this
device a utility, uioport, can be used to read and write the ports.

uioport is designed to be a setuid program and checks the permissions of
the /dev/uio* node and if the user has write permissions it will use
iopl and out*/in* to access the device.

[1] git clone git://ifup.org/philips/uioport.git

Signed-off-by: Brandon Philips <brandon@ifup.org>
Signed-off-by: Hans J. Koch <hjk@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUIO: Add name attributes for mappings and port regions
Hans J. Koch [Tue, 6 Jan 2009 23:15:39 +0000 (00:15 +0100)]
UIO: Add name attributes for mappings and port regions

If a UIO device has several memory mappings, it can be difficult for userspace
to find the right one. The situation becomes even worse if the UIO driver can
handle different versions of a card that have different numbers of mappings.
Benedikt Spranger has such cards and pointed this out to me. Thanks, Bene!

To address this problem, this patch adds "name" sysfs attributes for each
mapping. Userspace can use these to clearly identify each mapping. The name
string is optional. If a driver doesn't set it, an empty string will be
returned, so this patch won't break existing drivers.

The same problem exists for port region information, so a "name" attribute is
added there, too.

Signed-off-by: Hans J. Koch <hjk@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoplatform: introduce module id table for platform devices
Eric Miao [Wed, 4 Feb 2009 03:52:40 +0000 (11:52 +0800)]
platform: introduce module id table for platform devices

Now platform_device is being widely used on SoC processors where the
peripherals are attached to the system bus, which is simple enough.

However, silicon IPs for these SoCs are usually shared heavily across
a family of processors, even products from different companies.  This
makes the original simple driver name based matching insufficient, or
simply not straight-forward.

Introduce a module id table for platform devices, and makes it clear
that a platform driver is able to support some shared IP and handle
slight differences across different platforms (by 'driver_data').
Module alias is handled automatically when a MODULE_DEVICE_TABLE()
is defined.

To not disturb the current platform drivers too much, the matched id
entry is recorded and can be retrieved by platform_get_device_id().

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoplatform: make better use of to_platform_{device,driver}() macros
Eric Miao [Sat, 31 Jan 2009 14:47:44 +0000 (22:47 +0800)]
platform: make better use of to_platform_{device,driver}() macros

This helps the code look more consistent and cleaner.

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver core: check bus->match without holding device lock
Ming Lei [Wed, 21 Jan 2009 15:27:47 +0000 (23:27 +0800)]
driver core: check bus->match without holding device lock

This patch moves bus->match out from driver_probe_device and
does not hold device lock to check the match between a device
and a driver.

The idea has been verified by the commit 6cd495860901,
which leads to a faster boot. But the commit 6cd495860901 has
the following drawbacks: 1),only does the quick check in
the path of __driver_attach->driver_probe_device, not in other
paths; 2),for a matched device and driver, check the same match
twice. It is a waste of cpu ,especially for some drivers with long
device id table (eg. usb-storage driver).

This patch adds a helper of driver_match_device to check the match
in all paths, and testes the match only once.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agosysfs: Take sysfs_mutex when fetching the root inode.
Eric W. Biederman [Wed, 21 Jan 2009 19:55:11 +0000 (11:55 -0800)]
sysfs: Take sysfs_mutex when fetching the root inode.

sysfs_get_inode ultimately calls sysfs_count_nlink when the a
directory inode is fectched.  sysfs_count_nlink needs to be
called under the sysfs_mutex to guard against the unlikely
but possible scenario that the root directory is changing
as we are counting the number entries in it, and just in
general to be consistent.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoSYSFS: use standard magic.h for sysfs
Qinghuang Feng [Wed, 14 Jan 2009 07:45:13 +0000 (15:45 +0800)]
SYSFS: use standard magic.h for sysfs

SYSFS_MAGIC has been added into magic.h, so only use that definition
in magic.h to avoid potential consistency problem.

Signed-off-by: Qinghuang Feng <qhfeng.kernel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver core: get rid of struct device's bus_id string array
Kay Sievers [Sun, 25 Jan 2009 14:17:37 +0000 (15:17 +0100)]
driver core: get rid of struct device's bus_id string array

Now that all users of bus_id is gone, we can remove it from struct
device.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: FHCI: use dev_name() in place of bus_id.
Sachin Sant [Mon, 16 Feb 2009 13:40:11 +0000 (19:10 +0530)]
USB: FHCI: use dev_name() in place of bus_id.

Replace references to bus_id with dev_name() to fix fhci driver build break.

drivers/usb/host/fhci-hcd.c:586: error: struct device has no member named bus_id
drivers/usb/host/fhci-hcd.c:653: error: struct device has no member named bus_id
drivers/usb/host/fhci-dbg.c:111: error: struct device has no member named bus_id

Signed-off-by: Sachin Sant <sachinp@in.ibm.com>
Acked-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoPS3: replace bus_id usage
Greg Kroah-Hartman [Mon, 26 Jan 2009 17:12:12 +0000 (09:12 -0800)]
PS3: replace bus_id usage

These simple debug statments should be using dev_dbg() instead of
accessing bus_id directly (or they should use device_name).

As bus_id is going away, this patch is necessary.

Acked-by: Geoff Levand <geoffrey.levand@am.sony.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:23 +0000 (16:38 -0700)]
usb: struct device - replace bus_id with dev_name(), dev_set_name()

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agowimax: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:23 +0000 (16:38 -0700)]
wimax: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: inaky.perez-gonzalez@intel.com
Cc: linux-wimax@intel.com
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agomfd: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:23 +0000 (16:38 -0700)]
mfd: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: sameo@openedhand.com
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agomca: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:23 +0000 (16:38 -0700)]
mca: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: James.Bottomley@HansenPartnership.com
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agogpio: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:23 +0000 (16:38 -0700)]
gpio: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: Michael Buesch <mb@bu3sch.de>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agoeisa: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)]
eisa: struct device - replace bus_id with dev_name(), dev_set_name()

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agodma: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)]
dma: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: Dan Williams <dan.j.williams@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agodio: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)]
dio: struct device - replace bus_id with dev_name(), dev_set_name()

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agoamba: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)]
amba: struct device - replace bus_id with dev_name(), dev_set_name()

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agov4l: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)]
v4l: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: mchehab@infradead.org
Cc: linux-media@vger.kernel.org
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agodrm: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)]
drm: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: airlied@linux.ie
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agonet: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)]
net: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: davem@davemloft.net
Cc: netdev@vger.kernel.org
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agortc: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)]
rtc: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: a.zummo@towertech.it
Cc: rtc-linux@googlegroups.com
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agopcmcia: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)]
pcmcia: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: linux-pcmcia@lists.infradead.org
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agotc: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)]
tc: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: macro@linux-mips.org
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agosh: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)]
sh: struct device - replace bus_id with dev_name(), dev_set_name()

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agoserial: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)]
serial: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: davem@davemloft.net
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agos390: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)]
s390: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: schwidefsky@de.ibm.com
Cc: linux-s390@vger.kernel.org
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agorapidio: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)]
rapidio: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: mporter@kernel.crashing.org
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agopci: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)]
pci: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: jbarnes@virtuousgeek.org
Cc: linux-pci@vger.kernel.org
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agomtd: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)]
mtd: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: dwmw2@infradead.org
Cc: linux-mtd@lists.infradead.org
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agommc: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)]
mmc: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: drzeus-mmc@drzeus.cx
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agozorro: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)]
zorro: struct device - replace bus_id with dev_name(), dev_set_name()

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agovideo: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)]
video: struct device - replace bus_id with dev_name(), dev_set_name()

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agospi: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)]
spi: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: dbrownell@users.sourceforge.net
Cc: spi-devel-general@lists.sourceforge.net
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agoedac: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)]
edac: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: dougthompson@xmission.com
Cc: bluesmoke-devel@lists.sourceforge.net
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agonetlink: add NETLINK_NO_ENOBUFS socket flag
Pablo Neira Ayuso [Tue, 24 Mar 2009 23:37:55 +0000 (16:37 -0700)]
netlink: add NETLINK_NO_ENOBUFS socket flag

This patch adds the NETLINK_NO_ENOBUFS socket flag. This flag can
be used by unicast and broadcast listeners to avoid receiving
ENOBUFS errors.

Generally speaking, ENOBUFS errors are useful to notify two things
to the listener:

a) You may increase the receiver buffer size via setsockopt().
b) You have lost messages, you may be out of sync.

In some cases, ignoring ENOBUFS errors can be useful. For example:

a) nfnetlink_queue: this subsystem does not have any sort of resync
method and you can decide to ignore ENOBUFS once you have set a
given buffer size.

b) ctnetlink: you can use this together with the socket flag
NETLINK_BROADCAST_SEND_ERROR to stop getting ENOBUFS errors as
you do not need to resync (packets whose event are not delivered
are drop to provide reliable logging and state-synchronization).

Moreover, the use of NETLINK_NO_ENOBUFS also reduces a "go up, go down"
effect in terms of performance which is due to the netlink congestion
control when the listener cannot back off. The effect is the following:

1) throughput rate goes up and netlink messages are inserted in the
receiver buffer.
2) Then, netlink buffer fills and overruns (set on nlk->state bit 0).
3) While the listener empties the receiver buffer, netlink keeps
dropping messages. Thus, throughput goes dramatically down.
4) Then, once the listener has emptied the buffer (nlk->state
bit 0 is set off), goto step 1.

This effect is easy to trigger with netlink broadcast under heavy
load, and it is more noticeable when using a big receiver buffer.
You can find some results in [1] that show this problem.

[1] http://1984.lsi.us.es/linux/netlink/

This patch also includes the use of sk_drop to account the number of
netlink messages drop due to overrun. This value is shown in
/proc/net/netlink.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomyri10ge: update firmware headers to 1.4.41
Brice Goglin [Tue, 24 Mar 2009 23:32:13 +0000 (16:32 -0700)]
myri10ge: update firmware headers to 1.4.41

Update myri10ge firmware headers to firmware version 1.4.41.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomacb: fix warning "warning: unused variable `dev' "
vibi sreenivasan [Tue, 24 Mar 2009 23:30:20 +0000 (16:30 -0700)]
macb: fix warning "warning: unused variable `dev' "

Removed unused variable dev

Signed-off-by: vibi sreenivasan <vibi_sreenivasan@cms.com>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoucc_geth: Convert to net_device_ops
Joakim Tjernlund [Fri, 20 Mar 2009 20:09:14 +0000 (21:09 +0100)]
ucc_geth: Convert to net_device_ops

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoUSB: qcserial: add device id for HP devices
Alexander Shumakovitch [Sat, 21 Mar 2009 04:50:16 +0000 (00:50 -0400)]
USB: qcserial: add device id for HP devices

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: isp1760: Add a delay before reading the SKIPMAP registers in isp1760-hcd.c
Catalin Marinas [Mon, 23 Mar 2009 12:38:16 +0000 (12:38 +0000)]
USB: isp1760: Add a delay before reading the SKIPMAP registers in isp1760-hcd.c

The data read from the SKIPMAP registers is not immediately available
after writing and the driver panics when a packet is enqueued from the
interrupt handler. This patch adds an ndelay(195) before these registers
are read (delay value mentioned in section 15.1.1.3 of the ISP1760 data
sheet).

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: allow malformed LANGID descriptors
Daniel Mack [Fri, 20 Mar 2009 18:58:57 +0000 (19:58 +0100)]
USB: allow malformed LANGID descriptors

When an USB hardware does not provide a valid LANGID, fall back to value
zero which is still a reasonable default for most devices.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: pxa27x_udc: typo fixes and code cleanups
Vernon Sauder [Fri, 20 Mar 2009 08:44:50 +0000 (01:44 -0700)]
USB: pxa27x_udc: typo fixes and code cleanups

This patch is a merge of patches :
 - fix function doc and debug
 - cleanup loop count
 - optimize code to remove local variable and extra check
 - init 'req' before use
 - add missing iounmap call

[dbrownell@users.sourceforge.net: capitalize IN/OUT directions in doc]

Signed-off-by: Vernon Sauder <vsauder@inhand.com>
[folded by Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: gadget: gadget zero uses new suspend/resume hooks
David Brownell [Thu, 19 Mar 2009 21:16:09 +0000 (14:16 -0700)]
USB: gadget: gadget zero uses new suspend/resume hooks

Use the new device-level suspend/resume hooks for Gadget Zero;
always enable them with the OTG test mode; and support remote
wakeup on both configurations even in non-OTG mode.

This ensures that both configurations can pass the USBCV remote
wakeup tests when the OTG test mode is enabled.  This changes
behavior by adding autoresume support to the loopback config
even in non-OTG mode; the test failure was that it didn't work
in OTG mode.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: gadget: composite device-level suspend/resume hooks
David Brownell [Thu, 19 Mar 2009 21:14:17 +0000 (14:14 -0700)]
USB: gadget: composite device-level suspend/resume hooks

Address one open question in the composite gadget framework:
Yes, we should have device-level suspend/resume callbacks
in addition to the function-level ones.  We have at least one
scenario (with gadget zero in OTG test mode) that's awkward
to handle without it.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: r8a66597-hcd: suspend/resume support
Yoshihiro Shimoda [Thu, 19 Mar 2009 05:18:15 +0000 (14:18 +0900)]
USB: r8a66597-hcd: suspend/resume support

Fix the problem that system cannot suspend.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: more u32 conversion after transfer_buffer_length and actual_length
Roel Kluin [Fri, 13 Mar 2009 11:19:18 +0000 (12:19 +0100)]
USB: more u32 conversion after transfer_buffer_length and actual_length

transfer_buffer_length and actual_length have become unsigned, therefore some
additional conversion of local variables, function arguments and print
specifications is desired.

A test for a negative urb->transfer_buffer_length became obsolete; instead
we ensure that it does not exceed INT_MAX. Also, urb->actual_length is always
less than urb->transfer_buffer_length.

rh_string() does no longer return -EPIPE in the case of an unsupported ID.
Instead its only caller, rh_call_control() does the check.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: Fix cp2101 USB serial device driver termios functions for console use
VomLehn [Thu, 12 Mar 2009 21:37:42 +0000 (14:37 -0700)]
USB: Fix cp2101 USB serial device driver termios functions for console use

This is really a follow up to the modifications Alan Cox made for commit
95da310e66ee8090119596c70ca8432e57f9a97f to pass a tty_struct to various
interface functions, which broke the serial configuration (termios) functions
when the device is being used as a console. These changes restore the
configuration to proper functioning both as a tty and as a console.  As Alan
notes in that commit, these changes will need to be tweaked when we have
a proper console abstraction.

Signed-off-by: David VomLehn <dvomlehn@cisco.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: CP2101 New Device ID
Alex Stephens [Tue, 17 Mar 2009 00:06:19 +0000 (00:06 +0000)]
USB: CP2101 New Device ID

One new device ID for CP2101 driver.

Signed-off-by: Alex Stephens alex@miranova.com
15 years agoUSB: ipaq: handle 4 endpoint devices
Mark Ellis [Mon, 9 Mar 2009 22:24:29 +0000 (22:24 +0000)]
USB: ipaq: handle 4 endpoint devices

The ipaq driver currently enforces one port on all devices. This
is correct for 2 and 3 endpoint devices, but with 4 endpoint devices
meaningful communication occurs on the second pair.

This patch allows 2 ports for 4 endpoint devices.

Signed-off-by: Mark Ellis <mark@mpellis.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: S3C: Move usb-control.h to platform include
Ben Dooks [Sat, 7 Mar 2009 11:44:21 +0000 (11:44 +0000)]
USB: S3C: Move usb-control.h to platform include

The usb-control.h is needed by ohci-s3c2410.c for both S3C24XX and S3C64XX
architectures, so move it to <plat/usb-control.h>

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: ohci-hcd: Add ARCH_S3C24XX to the ohci-s3c2410.c glue
Ben Dooks [Sat, 7 Mar 2009 11:44:10 +0000 (11:44 +0000)]
USB: ohci-hcd: Add ARCH_S3C24XX to the ohci-s3c2410.c glue

The ohci-s3c2410.c glue supports both CONFIG_ARCH_S3C2410 and
CONFIG_ARCH_S3C64XX so add it to the build of ohci-s3c2410.c

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: pedantic: spelling correction in comment for ch9.h
D.J. Capelis [Wed, 4 Mar 2009 18:27:52 +0000 (10:27 -0800)]
USB: pedantic: spelling correction in comment for ch9.h

Just noticed this during a grep, figured I might as well send it in.

From: D.J. Capelis <dev@capelis.dj>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: host: fix sparse warning: Using plain integer as NULL pointer
Hannes Eder [Fri, 27 Feb 2009 01:04:31 +0000 (02:04 +0100)]
USB: host: fix sparse warning: Using plain integer as NULL pointer

Fix this sparse warning:
 drivers/usb/host/oxu210hp-hcd.c:2687:42: warning: Using plain integer as NULL pointer

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: ohci-s3c2410: fix name of bus clock
Ben Dooks [Thu, 26 Feb 2009 23:03:15 +0000 (23:03 +0000)]
USB: ohci-s3c2410: fix name of bus clock

The USB bus clock is usb-bus-host, so print the correct name in the
dev_err() statement if we cannot find it.

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
15 years agoUSB: ohci-s3c2410: remove <mach/hardware.h> include
Ben Dooks [Thu, 26 Feb 2009 23:02:19 +0000 (23:02 +0000)]
USB: ohci-s3c2410: remove <mach/hardware.h> include

Remove the include of <mach/hardware.h>, as no definitions
from it are used by the OHCI driver.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: serial: rename cp2101 driver to cp210x
Greg Kroah-Hartman [Wed, 11 Mar 2009 18:03:49 +0000 (11:03 -0700)]
USB: serial: rename cp2101 driver to cp210x

Lots of users are getting confused about the cp2101 driver.  It really
does support more than just the cp2101 device, so rename it to cp210x to
try to prevent confusion.

Cc: Craig Shelley <craig@microtron.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: CP2101 Reduce Error Logging
Craig Shelley [Thu, 26 Feb 2009 22:21:51 +0000 (22:21 +0000)]
USB: CP2101 Reduce Error Logging

This patch lowers the logging priority of certain messages to prevent
users from flooding the log files.

Signed-off-by: Craig Shelley <craig@microtron.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: CP2101 Support AN205 baud rates
Craig Shelley [Thu, 26 Feb 2009 22:19:22 +0000 (22:19 +0000)]
USB: CP2101 Support AN205 baud rates

This patch adds support for the extended range of baud rates supported
by CP2102 and CP2103 devices described in SiLabs AN205.  An additional
function cp2101_quantise_baudrate rounds the baud rate as per AN205
Table 1.  A modification to the baud rate calculation removes a rounding
error, allowing the full range of baud rates to be used.

Signed-off-by: Craig Shelley <craig@microtron.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: use kzfree()
Johannes Weiner [Wed, 4 Mar 2009 20:06:15 +0000 (12:06 -0800)]
USB: use kzfree()

Use kzfree() instead of memset() + kfree().

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: usbfs: remove unneeded "inline" annotations
Alan Stern [Mon, 9 Mar 2009 17:44:48 +0000 (13:44 -0400)]
USB: usbfs: remove unneeded "inline" annotations

This patch (as1223) removes a bunch of unnecessary "inline"
annotations from the usbfs driver.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: don't send Set-Interface after reset
Alan Stern [Thu, 26 Feb 2009 15:21:02 +0000 (10:21 -0500)]
USB: don't send Set-Interface after reset

This patch (as1221) changes the way usbcore reinitializes a device
following a reset or a reset-resume.  Currently we call
usb_set_interface() for every interface in the active configuration;
this is to put the interface into the same altsetting as before the
reset and to make sure that the host's endpoint state matches the
device's endpoint state.

However, sending a Set-Interface request is a waste of time if an
interface was already in altsetting 0 before the reset, since it is
certainly in altsetting 0 afterward.  In addition, many devices can't
handle Set-Interface requests -- they crash when they receive them.

So instead, the patch adds code to check each interface.  If the
interface wasn't in altsetting 0 before the reset, we go head with the
Set-Interface request as before.  But if it was then we skip sending
the Set-Interface request, and we clear out the host-side endpoint
state by calling usb_disable_interface() followed by
usb_enable_interface().

The patch also adds a couple of new comments to explain what's going
on.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: remove phidget drivers from kernel tree.
Greg Kroah-Hartman [Thu, 5 Mar 2009 00:23:31 +0000 (16:23 -0800)]
USB: remove phidget drivers from kernel tree.

These devices are better controlled with the LGPL userspace library
found at:
http://www.phidgets.com/downloads.php?os_id=3
and full documentation at:
http://www.phidgets.com/documentation/web/cdoc/index.html

Cc: Chester Fitchett <fitchett@phidgets.com>
Acked-by: Sean Young <sean@mess.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: make actual_length in struct urb field u32
Greg Kroah-Hartman [Sat, 7 Mar 2009 05:31:03 +0000 (21:31 -0800)]
USB: make actual_length in struct urb field u32

actual_length should also be a u32 and not a signed value.  This patch
changes this field to be 'u32' to prevent any potential negative
conversion and comparison errors.

This triggered a few compiler warning messages when these fields were
being used with the min macro, so they have also been fixed up in this
patch.

Cc: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: make transfer_buffer_lengths in struct urb field u32
Greg Kroah-Hartman [Wed, 4 Mar 2009 00:44:13 +0000 (16:44 -0800)]
USB: make transfer_buffer_lengths in struct urb field u32

Roel Kluin pointed out that transfer_buffer_lengths in struct urb was
declared as an 'int'.  This patch changes this field to be 'u32' to
prevent any potential negative conversion and comparison errors.

This triggered a few compiler warning messages when these fields were
being used with the min macro, so they have also been fixed up in this
patch.

Cc: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: uhci: don't use pseudo negative values
Alan Stern [Thu, 5 Mar 2009 16:01:11 +0000 (11:01 -0500)]
USB: uhci: don't use pseudo negative values

The code in uhci-q.c doesn't have to use pseudo-negative values.  I did
it that way because it was easy and because it would give the expected
output during debugging.  But it doesn't have to work that way.  Here's
another approach.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: TWL: disable VUSB regulators when cable unplugged
Jouni Hogander [Fri, 20 Feb 2009 12:02:31 +0000 (14:02 +0200)]
USB: TWL: disable VUSB regulators when cable unplugged

This patch disables USB regulators VUSB1V5, VUSB1V8, and VUSB3V1
when the USB cable is unplugged to reduce power consumption.
Added a depencency from twl4030 usb driver to TWL_REGULATOR.

Signed-off-by: Jouni Hogander <jouni.hogander@nokia.com>
Signed-off-by: Kalle Jokiniemi <kalle.jokiniemi@digia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: usbmon: Add binary API v1
Pete Zaitcev [Fri, 20 Feb 2009 05:54:45 +0000 (22:54 -0700)]
USB: usbmon: Add binary API v1

This patch adds an extension to the binary API so it reaches parity with
existing text API (so-called "1u"). The extension delivers additional data,
such as ISO descriptors and the interrupt interval.

Signed-Off-By: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: ch341 serial: fix port number changed after resume
Ming Lei [Fri, 20 Feb 2009 13:23:09 +0000 (21:23 +0800)]
USB: ch341 serial: fix port number changed after resume

This patch fixes the following bug:
.plug ch341 usb serial port into a hub port;
.ch341 driver bound to the device and /dev/ttyUSB0 comes
.open /dev/ttyUSB0 by minicom and we can use the serial successfully
.suspend the ch341 usb serial device(such as: echo suspend > power/level)
.resume the ch341 usb serial device (such as: echo on > power/level)
.new port /dev/ttyUSB1 comes ,and the original /dev/ttyUSB0 still exists,
but is no longer usable by minicom

The patch adds suspend and resume callback to ch341 usb driver to prevent it
from unbinding during suspend. The /dev/ttyUSB0 is not released until being
closed, so /dev/ttyUSB1 comes after resume, and the original /dev/ttyUSB0 is
no longer usable by minicom. It is really a mess for a minicom user.

This patch also adds the reset_resume callback to make it usable after resuming
from STR or hibernation, for generally STR or hibernation will make the vbus
of root-hub lost.

Finally enable the driver's supports_autosuspend, for the device is in working
order with it.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: musb: partial DaVinci dm355 support
David Brownell [Tue, 24 Feb 2009 23:31:54 +0000 (15:31 -0800)]
USB: musb: partial DaVinci dm355 support

Partial support for DaVinci DM355, on the EVM board; peripheral
mode should work, once mainline merges DM355 support.  Missing:

  (a) renumbering the GPIO for DRVVBUS on the DM6446 EVM,
      when DAVINCI_N_GPIO increases;

  (b) disabling DM355_DEEPSLEEP.DRVVBUS_OVERRIDE so VBUS is
      driven according to the ID signal, if cpu_is_..._dm355()

The new PHY control bits are ignored on DM6446.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: musb: only turn off vbus in OTG hosts
Ajay Kumar Gupta [Tue, 24 Feb 2009 23:29:04 +0000 (15:29 -0800)]
USB: musb: only turn off vbus in OTG hosts

Except on DaVinci, VBUS is now switched off as part of idling the
USB link (after a_wait_bcon) whenever a device is disconnected
from host.  This is correct for OTG hosts, where either SRP or
an ID interrupt could turn VBUS on again.

However, for non-OTG hosts there's no way to turn VBUS on again,
so the host becomes unusable.  And the procfs entry which once
allowed a manual workaround for this is now gone.

This patch adds an is_otg_enabled() check before scheduling the
switch-off timer in disconnect path, supporting a "classic host"
mode where SRP is unavailable.

[ dbrownell@users.sourceforge.net: tweak patch description ]

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: musb: fix init oops crash with static FIFO config
Giuseppe GORGOGLIONE [Tue, 24 Feb 2009 23:27:34 +0000 (15:27 -0800)]
USB: musb: fix init oops crash with static FIFO config

Correct musb_read_fifosize() and musb_configure_ep0() functions
for the #ifndef BLACKFIN branch when the silicon uses static FIFO
configuration.  (Most current silicon configures this controller
to use dynamic FIFO configuration; some parts from ST don't, like
the STM STA2062.)

Signed-off-by: Giuseppe GORGOGLIONE <giuseppe.gorgoglione@st.com>
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>
15 years agoUSB: musb: NAK timeout scheme on bulk RX endpoint
Ajay Kumar Gupta [Tue, 24 Feb 2009 23:26:13 +0000 (15:26 -0800)]
USB: musb: NAK timeout scheme on bulk RX endpoint

Fixes endpoint starvation issue when more than one bulk QH is
multiplexed on the reserved bulk RX endpoint, which is normal
for cases like serial and ethernet adapters.

This patch sets the NAK timeout interval for such QHs, and when
a timeout triggers the next QH will be scheduled.  (This resembles
the bulk scheduling done in hardware by EHCI, OHCI, and UHCI.)

This scheme doesn't work for devices which are connected to a
high to full speed tree (transaction translator) as there is
no NAK timeout interrupt from the musb controller from such
devices.

Tested with PIO, Inventra DMA, CPPI DMA.

[ dbrownell@users.sourceforge.net:  fold in start_urb() update;
  clarify only for bulk RX; don't accidentally clear WZC bits ]

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Cc: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: musb: rewrite host periodic endpoint allocation
Sergei Shtylyov [Tue, 24 Feb 2009 23:23:34 +0000 (15:23 -0800)]
USB: musb: rewrite host periodic endpoint allocation

The current MUSB host code doesn't make use of all the available
FIFOs in for periodic transfers since it wrongly assumes the RX
and TX sides of any given hw_ep always share one FIFO.

Change:  use 'in_qh' and 'out_qh' fields of the 'struct musb_hw_ep'
to check the endpoint's business; get rid of the now-unused 'periodic'
array in the 'struct musb'.  Also optimize a loop induction variable
in the endpoint lookup code.

(Based on a previous patch from Ajay Kumar Gupta <ajay.gupta@ti.com>)

[ dbrownell@users.sourceforge.net: clarify description and origin
  of this fix; whitespace ]

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: composite: avoid inconsistent lock state
Felipe Balbi [Thu, 12 Feb 2009 13:09:47 +0000 (15:09 +0200)]
USB: composite: avoid inconsistent lock state

Avoid the following INFO from lock debugging:

[  369.126112] =================================
[  369.132063] [ INFO: inconsistent lock state ]
[  369.136457] 2.6.28-maemo1 #1
[  369.139387] ---------------------------------
[  369.143782] inconsistent {hardirq-on-W} -> {in-hardirq-W} usage.
[  369.149855] swapper/0 [HC1[1]:SC0[0]:HE0:SE1] takes:
[  369.154890]  (&cdev->lock){+-..}, at: [<bf1979f0>] composite_disconnect+0x1c/0]
[  369.163404] {hardirq-on-W} state was registered at:
[  369.168348]   [<c00788a8>] __lock_acquire+0x5d0/0x7d8
[  369.173506]   [<c0078b14>] lock_acquire+0x64/0x78
[  369.178266]   [<c0263a34>] _spin_lock+0x4c/0x80
[  369.182905]   [<bf19597c>] usb_function_deactivate+0x20/0x70 [g_nokia]
[  369.189527]   [<bf1a0a88>] 0xbf1a0a88
[  369.193281]   [<bf19f450>] 0xbf19f450
[  369.197004]   [<bf19fa3c>] 0xbf19fa3c
[  369.200758]   [<bf1a03a0>] 0xbf1a03a0
[  369.204481]   [<bf19f254>] 0xbf19f254
[  369.208204]   [<bf1a0158>] 0xbf1a0158
[  369.211927]   [<bf1a130c>] 0xbf1a130c
[  369.215650]   [<c01c21f0>] usb_gadget_register_driver+0x12c/0x28c
[  369.221846]   [<bf1a06bc>] 0xbf1a06bc
[  369.225569]   [<bf1a06e8>] 0xbf1a06e8
[  369.229322]   [<c002c2dc>] __exception_text_end+0x64/0x19c
[  369.234877]   [<c0081628>] sys_init_module+0x9c/0x194
[  369.240004]   [<c002c8e0>] ret_fast_syscall+0x0/0x2c
[  369.245039]   [<ffffffff>] 0xffffffff
[  369.248793] irq event stamp: 218356
[  369.252302] hardirqs last  enabled at (218355): [<c003a77c>] omap3_enter_idle+8
[  369.260420] hardirqs last disabled at (218356): [<c0264774>] __irq_svc+0x34/0x0
[  369.267927] softirqs last  enabled at (218348): [<c00585a4>] __do_softirq+0x134
[  369.275892] softirqs last disabled at (218335): [<c005899c>] irq_exit+0x60/0xb0
[  369.283308]
[  369.283308] other info that might help us debug this:
[  369.289930] no locks held by swapper/0.

Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: allow libusb to talk to unauthenticated WUSB devices
David Vrabel [Wed, 18 Feb 2009 14:43:47 +0000 (14:43 +0000)]
USB: allow libusb to talk to unauthenticated WUSB devices

To permit a userspace application to associate with WUSB devices
using numeric association, control transfers to unauthenticated WUSB
devices must be allowed.

This requires that wusbcore correctly sets the device state to
UNAUTHENTICATED, DEFAULT and ADDRESS and that control transfers can be
performed to UNAUTHENTICATED devices.

Signed-off-by: David Vrabel <david.vrabel@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: usb-storage: added missing MODULE_LICENSE("GPL") for usb-storage ums-* modules
Maciej Grela [Sat, 28 Feb 2009 20:39:20 +0000 (12:39 -0800)]
USB: usb-storage: added missing MODULE_LICENSE("GPL") for usb-storage ums-* modules

The lack of a MODULE_LICENSE macro in ums-* subdrivers prevented them
from loading. Needs to be applied after Alan Stern's usb-storage
subdriver separation patchset. Also added missing MODULE_DESCRIPTION and
MODULE_AUTHOR entries.

Signed-off-by: Maciej Grela <maciej.grela@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-storage: make onetouch a separate module
Alan Stern [Thu, 12 Feb 2009 19:48:33 +0000 (14:48 -0500)]
usb-storage: make onetouch a separate module

This patch (as1217) converts usb-storage's onetouch subdriver into a
separate module.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-storage: make karma a separate module
Alan Stern [Thu, 12 Feb 2009 19:48:26 +0000 (14:48 -0500)]
usb-storage: make karma a separate module

This patch (as1216) converts usb-storage's karma subdriver into a
separate module.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-storage: make alauda a separate module
Alan Stern [Thu, 12 Feb 2009 19:48:22 +0000 (14:48 -0500)]
usb-storage: make alauda a separate module

This patch (as1215) converts usb-storage's alauda subdriver into a
separate module.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-storage: make jumpshot a separate module
Alan Stern [Thu, 12 Feb 2009 19:48:19 +0000 (14:48 -0500)]
usb-storage: make jumpshot a separate module

This patch (as1214) converts usb-storage's jumpshot subdriver into a
separate module.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-storage: make datafab a separate module
Alan Stern [Thu, 12 Feb 2009 19:48:15 +0000 (14:48 -0500)]
usb-storage: make datafab a separate module

This patch (as1213) converts usb-storage's datafab subdriver into a
separate module.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-storage: make freecom a separate module
Alan Stern [Thu, 12 Feb 2009 19:48:11 +0000 (14:48 -0500)]
usb-storage: make freecom a separate module

This patch (as1212) converts usb-storage's freecom subdriver into a
separate module.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-storage: make shuttle_usbat a separate module
Alan Stern [Thu, 12 Feb 2009 19:48:08 +0000 (14:48 -0500)]
usb-storage: make shuttle_usbat a separate module

This patch (as1211) converts usb-storage's shuttle_usbat subdriver
into a separate module.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-storage: make cypress_atacb a separate module
Alan Stern [Thu, 12 Feb 2009 19:48:04 +0000 (14:48 -0500)]
usb-storage: make cypress_atacb a separate module

This patch (as1210) converts usb-storage's cypress_atacb subdriver
into a separate module.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-storage: make sddr55 a separate module
Alan Stern [Thu, 12 Feb 2009 19:47:59 +0000 (14:47 -0500)]
usb-storage: make sddr55 a separate module

This patch (as1209) converts usb-storage's sddr55 subdriver into a
separate module.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-storage: make isd200 a separate module
Alan Stern [Thu, 12 Feb 2009 19:47:54 +0000 (14:47 -0500)]
usb-storage: make isd200 a separate module

This patch (as1208) converts usb-storage's isd200 subdriver into a
separate module.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-storage: make sddr09 a separate module
Alan Stern [Thu, 12 Feb 2009 19:47:49 +0000 (14:47 -0500)]
usb-storage: make sddr09 a separate module

This patch (as1207) converts usb-storage's sddr09 subdriver into a
separate module.

An unexpected complication arises because of DPCM devices, in which
one LUN uses the sddr09 transport and one uses the standard CB
transport.  Since these devices can be used even when
USB_STORAGE_SDDR09 isn't configured, their entries in unusual_devs.h
require special treatment.  If SDDR09 isn't configured then the
entries remain in unusual_devs.h; if it is then the entries are
present in unusual_sddr09.h instead.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>