linux-2.6
16 years agoPCI Hotplug: pciehp: remove needless hp_slot calculation
Kenji Kaneshige [Fri, 9 Nov 2007 08:29:42 +0000 (17:29 +0900)] 
PCI Hotplug: pciehp: remove needless hp_slot calculation

Remove needless hp_slot calculation. This has no functional changes.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI Hotplug: pciehp: remove needless members from struct controller
Kenji Kaneshige [Fri, 9 Nov 2007 08:30:29 +0000 (17:30 +0900)] 
PCI Hotplug: pciehp: remove needless members from struct controller

Remove needless members from struct controller. This has no functional
changes.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI Hotplug: acpiphp: remove unneeded acpi_get_name function call
MUNEDA Takahiro [Fri, 9 Nov 2007 10:06:20 +0000 (19:06 +0900)] 
PCI Hotplug: acpiphp: remove unneeded acpi_get_name function call

acpi_get_name() is called before and after dbg(). The latter is
useless and should be removed.

Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI Hotplug: acpiphp: fix trivial typos
MUNEDA Takahiro [Fri, 9 Nov 2007 10:07:02 +0000 (19:07 +0900)] 
PCI Hotplug: acpiphp: fix trivial typos

fix trivial typos.

Signed-off-by: MUNEDA Takahiro <muneda.takahiro@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCIe: fix double initialization bug
Mark Lord [Wed, 21 Nov 2007 23:07:55 +0000 (15:07 -0800)] 
PCIe: fix double initialization bug

Earlier patches to split out the hardware init for PCIe hotplug resulted in
some one-time initializations being redone on every resume cycle.  Eg.
irq/polling initialization.

This patch splits the hardware init into two parts, and separates the
one-time initializations from those so that they only ever get done once,
as intended.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCIE: Make use of the previously split out pcie_init_enable_events() function
Mark Lord [Wed, 28 Nov 2007 23:12:00 +0000 (15:12 -0800)] 
PCIE: Make use of the previously split out pcie_init_enable_events() function

Make use of the previously split out pcie_init_enable_events() function
to reinitialize the hotplug hardware on resume from suspend, but only
when pciehp_force==1.  Otherwise behaviour is unmodified.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: more fixes for PCIe Hotplug so that it works with ExpressCard slots on Dell...
Mark Lord [Wed, 28 Nov 2007 23:11:46 +0000 (15:11 -0800)] 
PCI: more fixes for PCIe Hotplug so that it works with ExpressCard slots on Dell notebooks (and others?) in conjunction with modparam of pciehp_force=1

Split out the hotplug hardware initialization code from pcie_init()
into pcie_init_enable_events(), without changing any functionality.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCIE: fix PCIe Hotplug so that it works with ExpressCard slots on Dell notebooks...
Mark Lord [Wed, 28 Nov 2007 23:11:28 +0000 (15:11 -0800)] 
PCIE: fix PCIe Hotplug so that it works with ExpressCard slots on Dell notebooks (and others?) in conjunction with modparam of pciehp_force=1.

Fix pciehp_probe() to deal with ExpressCard cards
that were inserted prior to the driver being loaded.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: Add missing "space" in printk messages
Joe Perches [Tue, 20 Nov 2007 01:48:29 +0000 (17:48 -0800)] 
PCI: Add missing "space" in printk messages

Signed-off-by: Joe Perches <joe@perches.com>
Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: export pci_restore_msi_state()
Linas Vepstas [Wed, 7 Nov 2007 21:43:59 +0000 (15:43 -0600)] 
PCI: export pci_restore_msi_state()

PCI error recovery usually involves the PCI adapter being reset.
If the device is using MSI, the reset will cause the MSI state
to be lost; the device driver needs to restore the MSI state.

The pci_restore_msi_state() routine is currently protected
by CONFIG_PM; remove this, and also export the symbol, so
that it can be used in a modle.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agopci hotplug: fix rpaphp directory naming
Linas Vepstas [Mon, 26 Nov 2007 07:51:37 +0000 (23:51 -0800)] 
pci hotplug: fix rpaphp directory naming

Fix presentation of the slot number in the /sys/bus/pci/slots
directory to match that used in the majority of other drivers.

> Greg said:
> How is anyone supposed to write sane managability tools in the
> presence
> of such anarchy?
>
> > ~ # cat /sys/bus/pci/slots/0000:00:02.2/phy_location
> > U787A.001.DNZ00Z5-P1-C2
>
> Right.  This should look like:
>
> # cat /sys/bus/pci/slots/U787A.001.DNZ00Z5-P1-C2/address
> 0000:00:02

This patch implements exactly what you describe. Boot tested.
I assume you really mean it -- if so, then please review and
ack the patch !?

I have absolutely no clue if this breaks any existing IBM tools.
I'm pretty sure it doesn't ... but attention Mike Strosaker! does it?

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Cc: <strosake@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: Unhide the SMBus on the HP xw4100
Jean Delvare [Wed, 21 Nov 2007 17:29:06 +0000 (18:29 +0100)] 
PCI: Unhide the SMBus on the HP xw4100

Unhide the SMBus on the HP xw4100. This gives access to a hardware
monitoring chip (ADT7463) and to the memory module SPD EEPROMs. I
checked that ACPI wasn't accessing the SMBus, so it should be safe.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: More Sanity checks for DMAR
Fenghua Yu [Wed, 21 Nov 2007 23:07:14 +0000 (15:07 -0800)] 
PCI: More Sanity checks for DMAR

Add and changes a few sanity checks in dmar.c.

1.  The haw field in ACPI DMAR table in VT-d spec doesn't describe the
   range of haw.  But since DMA page size is 4KB in DMA remapping, haw
   should be at least 4KB.  The current VT-d code in dmar.c returns failure
   when haw==0.  This sanity check is not accurate and execution can pass
   when haw is less than one page size 4KB.  This patch changes the haw
   sanity check to validate if haw is less than 4KB.

2. Add dmar_rmrr_units verification.

3. Add parse_dmar_table() verification.

[akpm@linux-foundation.org: coding-style fixes]

Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Acked-by: mark gross <mgross@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: drivers/pci/quirks.c: coding-style cleanup
Andrew Morton [Wed, 21 Nov 2007 23:07:13 +0000 (15:07 -0800)] 
PCI: drivers/pci/quirks.c: coding-style cleanup

Remove lots of space-before-) instances.  Perhaps these were a workaround for
problems in some long-dead cpp version.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: remove additional pci_scan_child_bus() prototype
Adrian Bunk [Wed, 21 Nov 2007 23:07:12 +0000 (15:07 -0800)] 
PCI: remove additional pci_scan_child_bus() prototype

There's already a prototype for pci_scan_child_bus() at the correct place in
pci.h, so there's no reason for an additional one.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: always export pci_scan_single_device
Adrian Bunk [Wed, 21 Nov 2007 23:07:11 +0000 (15:07 -0800)] 
PCI: always export pci_scan_single_device

This patch fixes the following build error with CONFIG_HOTPLUG=n:

  MODPOST 2137 modules
ERROR: "pci_scan_single_device" [drivers/edac/i82875p_edac.ko] undefined!

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Doug Thompson <norsk5@yahoo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: remove unneeded lock_kernel() in drivers/pci/syscall.c.
Diego Woitasen [Wed, 21 Nov 2007 23:07:08 +0000 (15:07 -0800)] 
PCI: remove unneeded lock_kernel() in drivers/pci/syscall.c.

sys_pciconfig_{read,write}() are protected against PCI removal with the
reference count in struct pci_dev.  The concurrency of
pci_user_{read,write}_config_* functions are already protected by pci_lock
in drivers/pci/access.c.

Signed-off-by: Diego Woitasen <diego@woitasen.com.ar>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: get rid of pci_dev::{vendor,device}_compatible fields
Lennert Buytenhek [Wed, 21 Nov 2007 23:07:07 +0000 (15:07 -0800)] 
PCI: get rid of pci_dev::{vendor,device}_compatible fields

The vendor_compatible and device_compatible fields in struct pci_dev aren't
used anywhere, and are somewhat pointless.  Assuming that these are
historical artifacts, remove them.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: Mem Policy: fix mempolicy usage in pci driver
Lee Schermerhorn [Wed, 21 Nov 2007 23:07:05 +0000 (15:07 -0800)] 
PCI: Mem Policy: fix mempolicy usage in pci driver

In an attempt to ensure memory allocation from the local node, the pci
driver temporarily replaces the current task's memory policy with the
system default policy.  Trying to be a good citizen, the driver then call's
mpol_get() on the new policy.  When it's finished probing, it undoes the
'_get by calling mpol_free() [on the system default policy] and then
restores the current task's saved mempolicy.

A couple of issues here:

1) it's never necessary to set a task's mempolicy to the
   system default policy in order to get system default
   allocation behavior.  Simply set the current task's
   mempolicy to NULL and allocations will fall back to
   system default policy.

2) we should never [need to] call mpol_free() on the system
   default policy.  [I plan on trapping this with a VM_BUG_ON()
   in a subsequent patch.]

This patch removes the calls to mpol_get() and mpol_free()
and uses NULL for the temporary task mempolicy to effect
default allocation behavior.

Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>
Acked-by: Christoph Lameter <clameter@sgi.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: VIA CX700 quirk to disable PCI Bus Parking
Tim Yamin [Thu, 1 Nov 2007 23:14:54 +0000 (23:14 +0000)] 
PCI: VIA CX700 quirk to disable PCI Bus Parking

PCI Bus Parking and PCI Master read caching on the VIA CX700 is buggy and
can lead to problems such as USB2.0 packet loss if a VT6212L controller
is on the PCI bus. It's disabled by default, but some BIOSes turn these
features on and this patch reverts the configuration to the safe defaults.

Signed-off-by: Tim Yamin <tim.yamin@zonbu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: quirk_vialatency: Omit reading pci revision ID
Auke Kok [Mon, 29 Oct 2007 21:55:02 +0000 (14:55 -0700)] 
PCI: quirk_vialatency: Omit reading pci revision ID

Don't read the revision ID unnecessary since the PCI subsystem
fills this field in already.

Updated to fix a thinko bug in a previously sent patch.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: hotplug: Link fakephp last
Alex Chiang [Fri, 12 Oct 2007 23:20:33 +0000 (16:20 -0700)] 
PCI: hotplug: Link fakephp last

Currently, fakephp will claim all devices; we really only want it
to claim those not in slots.

Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: hotplug: pci_hotplug_core whitespace fix
Alex Chiang [Fri, 12 Oct 2007 23:20:32 +0000 (16:20 -0700)] 
PCI: hotplug: pci_hotplug_core whitespace fix

Remove superfluous space.

Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: hotplug: acpiphp: Remove unused variable from acpiphp
Alex Chiang [Fri, 12 Oct 2007 23:20:31 +0000 (16:20 -0700)] 
PCI: hotplug: acpiphp: Remove unused variable from acpiphp

Remove unused variable from acpiphp.

Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: hotplug: remove Experimental
Kristen Carlson Accardi [Fri, 12 Oct 2007 23:20:30 +0000 (16:20 -0700)] 
PCI: hotplug: remove Experimental

Remove EXPERIMENTAL from PCI Hot Plug.

Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: hotplug: Switch to pci_get_bus_and_slot
Joonwoo Park [Fri, 12 Oct 2007 23:20:29 +0000 (16:20 -0700)] 
PCI: hotplug: Switch to pci_get_bus_and_slot

Thank you so much for your check & advise.
This time, I've tried on ibmphp_core.c, is it OK?

Signed-off-by: Joonwoo Park <joonwpark81@gmail.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agopcie: utilize pcie transaction pending bit
Shaohua Li [Wed, 24 Oct 2007 02:45:08 +0000 (10:45 +0800)] 
pcie: utilize pcie transaction pending bit

PCIE has a mechanism to wait for Non-Posted request to complete. I think
pci_disable_device is a good place to do this.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agopcie port driver: correctly detect native PME feature
Shaohua Li [Wed, 24 Oct 2007 02:43:23 +0000 (10:43 +0800)] 
pcie port driver: correctly detect native PME feature

Native PME is capability of root port or root complex event collector.
It's not determined by PCI PME capability.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: drivers/pci/: remove unused exports
Adrian Bunk [Sat, 27 Oct 2007 01:06:33 +0000 (03:06 +0200)] 
PCI: drivers/pci/: remove unused exports

This patch removes the following unused exports:
- remove the following unused EXPORT_SYMBOL's:
 - pci-acpi.c: pci_osc_support_set
 - proc.c: pci_proc_detach_bus
- remove the following unused EXPORT_SYMBOL_GPL's:
  - bus.c: pci_walk_bus
  - probe.c: pci_create_bus
  - setup-res.c: pci_claim_resource

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: drivers/pci/rom.c: #if 0 two functions
Adrian Bunk [Sat, 27 Oct 2007 01:06:25 +0000 (03:06 +0200)] 
PCI: drivers/pci/rom.c: #if 0 two functions

This patch #if 0's the following unused global functions:
- rom.c: pci_map_rom_copy()
- rom.c: pci_remove_rom()

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: make pci_restore_bars() static
Adrian Bunk [Sat, 27 Oct 2007 01:06:22 +0000 (03:06 +0200)] 
PCI: make pci_restore_bars() static

This patch makes the needlessly global pci_restore_bars() static.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agox86: fix bootup crash in native_read_tsc()
Ingo Molnar [Fri, 1 Feb 2008 22:45:18 +0000 (23:45 +0100)] 
x86: fix bootup crash in native_read_tsc()

fix bootup crash in native_read_tsc() that was reported on an Athlon-XP
and bisected. The correct feature boundary for X86_FEATURE_MFENCE_RDTSC
is not XMM but XMM2.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
Linus Torvalds [Fri, 1 Feb 2008 22:58:02 +0000 (09:58 +1100)] 
Merge git://git./linux/kernel/git/bart/ide-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (100 commits)
  ide: move hwif_register() call out of ide_probe_port()
  ide: factor out code for tuning devices from ide_probe_port()
  ide: move handling of I/O resources out of ide_probe_port()
  ide: make probe_hwif() return an error value
  ide: use ide_remove_port_from_hwgroup in init_irq()
  ide: prepare init_irq() for using ide_remove_port_from_hwgroup()
  ide: factor out code removing port from hwgroup from ide_unregister()
  ide: I/O resources are released too early in ide_unregister()
  ide: cleanup ide_system_bus_speed()
  ide: remove needless zeroing of hwgroup fields from init_irq()
  ide: remove unused ide_hwgroup_t fields
  ide_platform: remove struct hwif_prop
  ide: remove hwif->present manipulations from hwif_init()
  ide: move wait_hwif_ready() documentation in the right place
  ide: fix handling of busy I/O resources in probe_hwif()
  <linux/hdsmart.h> is not used by kernel code
  ide: don't include <linux/hdsmart.h>
  ide-floppy: cleanup header
  ide: update/add my Copyrights
  ide: delete filenames/versions from comments
  ...

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Add a .show_options super operation to usbfs.

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

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

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

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

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

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

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

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

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

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

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

usb: ohci-sm501 driver V2

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

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

usb: dma bounce buffer support V4

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

add support for SuperH OHCI.

supported CPU are:
 - SH7720
 - SH7721
 - SH7763

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Small updates to the EHCI driver's ISO support:

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

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

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

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

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

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

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

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

EHCI Glue driver for Intel IXP4XX EHCI USB controller

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

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

There is also a small style fix around this comment,

/* unlock here as tower_delete frees dev */

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

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

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

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

Use debugfs instead of /proc/driver/udc

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

Various small at91_udc cleanups:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Use gpio_vbus instead of udc_is_connected for udc on tosa.

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

Add a missing dependency which goofs up the xconfig display.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Spotted by Daniel Walker.

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

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

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

Convert USB mon driver from nopage to fault.

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

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

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

A tester with actual hardware would be useful

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>