Commit Graph

55934 Commits

Author SHA1 Message Date
Evgeniy Polyakov f89735c4e2 w1: added w1 reset command
Command which allows to reset the bus.

Signed-off-by: Evgeniy Polyakov <zbr@ioremap.net>
Cc: Paul Alfille <paul.alfille@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-08 08:31:14 -08:00
Evgeniy Polyakov 325a06fb13 w1: move w1 commands from defines to enum
Signed-off-by: Evgeniy Polyakov <zbr@ioremap.net>
Cc: Paul Alfille <paul.alfille@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-08 08:31:13 -08:00
Evgeniy Polyakov c7e26631d2 w1: allow master IO commands
This small patchset extendes existing commands with reset, master IO and
status messages.  Reset is used to reset the bus for given master device,
master IO command allows to initiate IO against bus itself not selecting
slave device first, which can be used to probe the device for example.
And status messages carry command completion status back to the userspace
(namely very useful to get -ENODEV from when requested device was not
found).

Great thanks to Paul Alfille of OWFS for testing and commands suggestions.

This patch:

Allow starting of IO not against already found slave devices, but against
the bus itself, which can be used for example to probe devices.

[akpm@linux-foundation.org: reindent switch statements]
Signed-off-by: Evgeniy Polyakov <zbr@ioremap.net>
Cc: Paul Alfille <paul.alfille@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-08 08:31:13 -08:00
Evgeniy Polyakov 3b8384070e w1: list slaves commands
Initiates search (or alarm search) and returns all found devices to
userspace.  Found devices are not added into the system (i.e.  they are
not attached to family devices or bus masters), it will be done via (if
was not done yet) usual timed searching.

Signed-off-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-08 08:31:13 -08:00
Evgeniy Polyakov 9be62e0b2f w1: add touch block command
Writes and returns sampled data back to userspace.

Signed-off-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-08 08:31:13 -08:00
Evgeniy Polyakov 610705e780 w1: add list masters w1 command
This patch series introduces and extends several userspace commands
used with netlink protocol.

Touch block command allows to write data and return sampled data to
the userspace.

Extended search and alarm seach commands to return list of slave
devices found during given search.

List masters command allows to send all registered master IDs to the
userspace.

Great thanks to Paul Alfille (owfs) who
tested this implementation and wrote w1-to-network daemon
http://sourceforge.net/projects/w1repeater/ and

Frederik Deweerdt and Randy Dunlap for review.

This patch:

Returns list of registered bus master devices.

Signed-off-by: Evgeniy Polyakov <zbr@ioremap.net>
Cc: Paul Alfille <paul.alfille@gmail.com>
Cc: Frederik Deweerdt <frederik.deweerdt@xprog.eu>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-08 08:31:13 -08:00
Sascha Hauer a5fd9139f7 w1: add 1-wire master driver for i.MX27 / i.MX31
This patch adds support for the 1-wire master interface for i.MX27 and
i.MX31.

Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Evgeniy Polyakov <zbr@ioremap.net>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-08 08:31:13 -08:00
David Smith 09f50c9542 tpm: clean up tpm_nsc driver for platform_device suspend/resume compliance
Signed-off-by: Marcel Selhorst <tpm@selhorst.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-08 08:31:12 -08:00
Matthew Garrett ad8f07ccad misc: add dell-laptop driver
Add a driver for controlling Dell-specific backlight and rfkill interfaces.
This driver makes use of the dcdbas interface to the Dell firmware to
allow the backlight and rfkill interfaces on Dell systems to be driven
through the standardised sysfs interfaces.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: Matt Domsch <Matt_Domsch@dell.com>
Cc: Ivo van Doorn <ivdoorn@gmail.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-08 08:31:12 -08:00
Matthew Garrett 3cab7fd964 dcdbas: export functionality for use in other drivers
The dcdbas code allows calls to be made into the firmware on Dell systems.
 Exporting this to other drivers allows them to implement Dell-specific
functionality in a safe way.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: Matt Domsch <Matt_Domsch@dell.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-08 08:31:12 -08:00
Jüri Reitel 74d88eb293 rtc-ds1307: remove legacy probe() checks
Remove RTC register value checks from the rtc-ds1307 probe() function.
They were left over from the legacy style I2C driver, which had to defend
against finding a non-RTC chip when the driver was probed.

Also fix a minor glitch in the alarm support: DS1307 chips don't have
alarms, so name those methods after one of the chips which actually *do*
have alarms (DS1337).

Signed-off-by: Jüri Reitel <juri.reitel@liewenthal.ee>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Sebastien Barre <sbarre@sdelcc.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Acked-by: Jean Delvare <khali@linux-fr.org>
Cc: Rodolfo Giometti <giometti@enneenne.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-08 08:31:00 -08:00
BARRE Sebastien fed40b734c rtc-ds1307: SMBus compatibility
Change i2c access functions to SMBus access functions in order to use the
ds1307 with SMBus adapter.

Signed-off-by: Sebastien Barre <sbarre@sdelcc.com>
Acked-by: David Brownell <david-b@pacbell.net>
Tested-by: David Brownell <david-b@pacbell.net>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Acked-by: Jean Delvare <khali@linux-fr.org>
Cc: Rodolfo Giometti <giometti@enneenne.com>
Tested-by: Sebastien Barre <sbarre@sdelcc.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-08 08:30:59 -08:00
Alex Zeffertt 1107ba885e xen: add xenfs to allow usermode <-> Xen interaction
The xenfs filesystem exports various interfaces to usermode.  Initially
this exports a file to allow usermode to interact with xenbus/xenstore.

Traditionally this appeared in /proc/xen.  Rather than extending procfs,
this patch adds a backward-compat mountpoint on /proc/xen, and provides
a xenfs filesystem which can be mounted there.

Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-08 08:30:59 -08:00
Qinghuang Feng d8220347da drivers/xen/xenbus/xenbus_client.c: cleanup kerneldoc
no argument named @xbt in xenbus_switch_state(), remove it.

Signed-off-by: Qinghuang Feng <qhfeng.kernel@gmail.com>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-08 08:30:59 -08:00
Russell King d8f2f1808a [ARM] fix pxa930_trkball build errors
drivers/input/mouse/pxa930_trkball.c: In function `pxa930_trkball_probe':
drivers/input/mouse/pxa930_trkball.c:189: error: `ret' undeclared (first use in this function)
drivers/input/mouse/pxa930_trkball.c:230: error: `ret' undeclared (first use in this function)

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-01-08 16:29:44 +00:00
Russell King 934848daa3 [ARM] Fix realview build
arch/arm/mach-realview/platsmp.c:140: error: 'jiffies' undeclared (first use in this function)
drivers/amba/bus.c:246: error: 'NO_IRQ' undeclared (first use in this function)

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-01-08 16:29:41 +00:00
Ben Dooks 2fafae3f6d [ARM] Ensure CONFIG_SERIAL_SAMSUNG_UARTS is always set.
Always set CONFIG_SERIAL_SAMSUNG_UARTS when building any
of the S3C platforms as even if the driver is not selected
there it is still the facility for the machine files to
register configuration data for the possibility of the
driver being built.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-01-08 16:24:14 +00:00
Richard Purdie c835ee7f41 backlight: Add suspend/resume support to the backlight core
Add suspend/resume support to the backlight core and enable use of it
by appropriate drivers.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-01-08 15:37:43 +00:00
Zhang Rui 9be1df98bc bd->props.brightness doesn't reflect the actual backlight level.
Always invoke backlight_update_status when users want to change
the backlight.

For setups where brightness change is an expensive operation,
this could be done in the driver rather than the core.

http://bugzilla.kernel.org/show_bug.cgi?id=12249

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-01-08 14:11:30 +00:00
Robert Richter d2852b932f Merge branch 'oprofile/ring_buffer' into oprofile/oprofile-for-tip 2009-01-08 14:27:34 +01:00
Mark Brown 0081e8020e leds: Add WM8350 LED driver
The voltage and current regulators on the WM8350 AudioPlus PMIC can be
used in concert to provide a power efficient LED driver.  This driver
implements support for this within the standard LED class.

Platform initialisation code should configure the LED hardware in the
init callback provided by the WM8350 core driver.  The callback should
use wm8350_isink_set_flash(), wm8350_dcdc25_set_mode() and
wm8350_dcdc_set_slot() to configure the operating parameters of the
regulators for their hardware and then then use wm8350_register_led() to
instantiate the LED driver.

This driver was originally written by Liam Girdwood, though it has been
extensively modified since then.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-01-08 12:38:58 +00:00
Riku Voipio 934cd3f979 leds: leds-pcs9532 - Move i2c work to a workqueque
Apparently these might be called under atomic context,
and i2c operations may sleep. BUG found by
Ross Burton <ross@burtonini.com>

Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-01-08 12:38:58 +00:00
Sven Wegener f785d022ad leds: leds-pca9532 - fix memory leak and properly handle errors
When the registration fails, we need to release the memory we allocated.
Also we need to save the error from led_classdev_register and propagate
it up, else we'll return success, even if we failed.

Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-01-08 12:38:58 +00:00
Sven Wegener 12276efcc8 leds: Fix wrong loop direction on removal in leds-ams-delta
We want to go upwards, not downwards.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-01-08 12:38:58 +00:00
Yoichi Yuasa ec1496193d leds: fix Cobalt Raq LED dependency
Cobalt Raq LEDs require LEDS_CLASS=y.

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-01-08 12:38:57 +00:00
Sven Wegener 5a48503d3c leds: Fix sparse warning in leds-ams-delta
drivers/leds/leds-ams-delta.c:154:2: warning: returning void-valued expression

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-01-08 12:38:57 +00:00
Sven Wegener ff8649affc leds: Fixup kdoc comment to match parameter names
Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
Signed-off-by: Richard Purdie <rpurdie@intel.linux.com>
2009-01-08 12:38:57 +00:00
Sven Wegener 0d73357910 leds: eds-pca9532: mark pca9532_event() static
Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-01-08 12:38:57 +00:00
Constantin Baranov ec9a943ce9 leds: ALIX.2 LEDs driver
Driver for PC Engines ALIX.2 and ALIX.3 LEDs.

Signed-off-by: Constantin Baranov <const@mimas.ru>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-01-08 12:38:57 +00:00
Dmitry Baryshkov 0ec561f4b6 backlight: Support VGA/QVGA mode switching in tosa_lcd
LCD driver on tosa requires reprogramming TG after mode
switching. Add support for switching to QVGA mode.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-01-08 12:37:28 +00:00
Pavel Machek 9a2c61a921 backlight: Catch invalid input in sysfs attributes
Check input properly in backlight, echo > brightness should not turn off
the backlight.

[akpm@linux-foundation.org: coding-style fixes]
[akpm@linux-foundation.org: fix printk warning]
Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-01-08 12:37:28 +00:00
Denis V. Lunev 866bbdba77 backlight: Value of ILI9320_RGB_IF2 register should not be hardcoded
It is stored in the board specific file
  ./arch/arm/mach-s3c2412/mach-jive.c
as .rgb_if2.

Actually, the value is correct, only semantic is wrong.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-01-08 12:37:28 +00:00
Akinobu Mita b4a11d3da2 backlight: crbllcd_bl - Use platform_device_register_simple()
Use platform_device_register_simple() and also fix error
handling when platform_device_alloc() fails (cr_backlight_driver
is left registered).

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-01-08 12:37:28 +00:00
Akinobu Mita 6cd6f35a4b backlight: progear_bl - Use platform_device_register_simple()
Use platform_device_register_simple() and also fix error
handling when platform_device_alloc() fails (progearbl_driver
is left registered).

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-01-08 12:37:28 +00:00
Akinobu Mita 3bcdcc0e66 backlight: hp680_bl - Use platform_device_register_simple()
Use platform_device_register_simple() and also fix error
handling when platform_device_alloc() fails (hp680_bl_driver
is left registered).

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-01-08 12:37:28 +00:00
Benjamin Krill 5886188dc7 serial: Add driver for the Cell Network Processor serial port NWP device
Add support for the nwp serial device which is connected to a DCR bus. It
uses the of_serial device driver to determine necessary properties from
the device tree.  The supported device is added as serial port number 85.

NWP stands for network processor and it is part of the QPACE - Quantum
Chromodynamics Parallel Computing on the Cell Broadband Engine project.
The implementation is a lightweight uart implementation with the focus
to consume as little resources as possible and it is connected to a
DCR bus.

Signed-off-by: Benjamin Krill <ben@codiert.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-01-08 16:25:18 +11:00
Ingo Molnar 19b0bd025d powerpc/cell: Use correct types in beat files
Only pass the address of a u64 if that is what the function requires.

[Split out of a larger patch - sfr]
[update comment - sfr]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-01-08 16:25:16 +11:00
Geoff Levand 2efd72af0f mtd/ps3vram: Use _PAGE_NO_CACHE in memory ioremap
Use _PAGE_NO_CACHE for gpu memory ioremap.  Also,
add __iomem attribute to gpu memory pointer and
change use of memset() to memset_io().

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-01-08 16:25:15 +11:00
Geoff Levand 60c0c5987b mtd/ps3vram: Use msleep in waits
Replace the use of udelay() with msleep() in the looping wait routines
ps3vram_notifier_wait() and ps3vram_wait_ring().

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-01-08 16:25:15 +11:00
Geoff Levand 993e62e674 mtd/ps3vram: Use proper kernel types
Replace the use of stdint.h types with kernel types
in the ps3vram driver.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-01-08 16:25:15 +11:00
Geoff Levand f259d74e03 mtd/ps3vram: Cleanup ps3vram driver messages
Cleanup the ps3vram driver messages.  Add a new struct device pointer
variable dev to struct ps3vram_priv and use dev_dbg(), pr_dbg(), etc.
where appropriate.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-01-08 16:25:15 +11:00
Geoff Levand e7dd54cf17 mtd/ps3vram: Remove ps3vram debug routines
Remove the ps3vram debug routines ps3vram_dump_ring() and
ps3vram_dump_reports().  These routines are not needed.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-01-08 16:25:14 +11:00
Geert Uytterhoeven 0a2d15b928 mtd/ps3vram: Add modalias support to the ps3vram driver
Update ps3vram driver to use the new ps3 three id modalias support.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-01-08 16:25:14 +11:00
Jim Paris cffb4add03 mtd/ps3vram: Add ps3vram driver for accessing video RAM as MTD
Add ps3vram driver, which exposes unused video RAM on the PS3 as a MTD
device suitable for storage or swap.  Fast data transfer is achieved
using a local cache in system RAM and DMA transfers via the GPU.

Signed-off-by: Vivien Chappelier <vivien.chappelier@free.fr>
Signed-off-by: Jim Paris <jim@jtan.com>
Acked-by: Geoff Levand <geoffrey.levand@am.sony.com>
Acked-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-01-08 16:25:14 +11:00
Kamalesh Babulal d2b4397bf8 powerpc: Fix iseries drivers build failure without CONFIG_VIOPATH
iSeries dependent drivers fail to build, when CONFIG_VIOPATH is disabled.

Fix the problem by making those drivers select it.

Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-01-08 16:25:14 +11:00
Stephen Hemminger d9d6f46b42 hp100: update to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 18:13:49 -08:00
Stephen Hemminger 403413e50d b44: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 18:10:49 -08:00
Stephen Hemminger 3a1a27fa46 atp: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 18:10:24 -08:00
Stephen Hemminger 887e53d2d1 amd8111e: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 18:09:58 -08:00
Stephen Hemminger b1da683d17 slip: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 18:09:36 -08:00
Stephen Hemminger c4a80d7e67 uwb: convert devices to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: David Vrabel <david.vrabel@csr.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 18:09:07 -08:00
Stephen Hemminger 5ec38f3023 gadget: convert devices to new API
Convert to net_device_ops

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 18:05:39 -08:00
Stephen Hemminger e8ac9c55f2 xpnet: convert devices to new API
Convert to net_device_ops and internal net_device_stats

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 18:05:11 -08:00
Stephen Hemminger 4805fc7653 fusion: convert devices to new API
Convert to net_device_ops and internal net_device_stats

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 18:04:45 -08:00
Stephen Hemminger d700555bda I4l: convert to net_device_ops
Add net_device_ops and use interal stats 

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Karsten Keil <kkeil@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 18:04:17 -08:00
Stephen Hemminger 0e2445fbdd hysdn: convert to net_device_ops and other updates
Several API problems fixed:
  * use proper allocation
  * handle renames
  * convert to net_device_ops
  * use internal net_device_stats

This driver is putrid (as in old and rotten), so I doubt any one uses it.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 18:03:43 -08:00
Stephen Hemminger fb875333c8 dvb: update network device to current API
Use internal network_device_stats that exist in network device and
net_device_ops. Compile tested only.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 18:02:53 -08:00
Stephen Hemminger 2a97e6b735 windbond: convert devices to new API
Convert to net_device_ops and internal net_device_stats

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 18:02:26 -08:00
Stephen Hemminger dfefe02bfd uli526x: convert devices to new API
Convert to net_device_ops and internal net_device_stats

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 18:01:40 -08:00
Stephen Hemminger 2765df5898 dmfe: convert to new API
Convert to internal net_device-stats and net_device_ops

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 18:01:20 -08:00
Stephen Hemminger 1034c9f69a xircom: convert devices to new API
Convert to net_device_ops and internal net_device_stats

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 18:00:55 -08:00
Stephen Hemminger 0b9a5b05b2 de4x5: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 18:00:31 -08:00
Stephen Hemminger 90d8743d03 de2104x: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 17:59:47 -08:00
Stephen Hemminger f4266cf34d tulip: convert devices to new API
Convert to net_device_ops and internal net_device_stats

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 17:59:15 -08:00
Stephen Hemminger 633a277e2a sundance: update to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 17:58:43 -08:00
Stephen Hemminger 4fc8006e00 starfire: update to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 17:58:17 -08:00
Stephen Hemminger e287157f15 fealnx: update to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 17:57:47 -08:00
Stephen Hemminger 2b7d0c7039 natsemi: update to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 17:57:19 -08:00
Stephen Hemminger d49d19c962 sb1000: update to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 17:56:54 -08:00
Stephen Hemminger a7d1de25dc ns83820: fix net_device_ops support
The vlan_rx_register fuction is now in net_device_ops

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 17:36:07 -08:00
Stephen Hemminger 97488c5b2d sis190: update to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 17:35:41 -08:00
Stephen Hemminger b8aa76a2bd de600: update to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 17:34:36 -08:00
Stephen Hemminger 1f5ec79b8e enc28j60: update to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 17:30:09 -08:00
Stephen Hemminger 8bdd555366 typhoon: update to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 17:29:46 -08:00
Stephen Hemminger 3bc124dd02 pcnet32: update to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 17:29:16 -08:00
Stephen Hemminger d9a811d5fd sungem: update to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 17:28:54 -08:00
Stephen Hemminger 2f89d12e98 sunhme: update to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 17:28:35 -08:00
Stephen Hemminger 805524cbcf epic100: update to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 17:27:39 -08:00
Stephen Hemminger 391c5e6e18 tlan: update to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 17:27:15 -08:00
Stephen Hemminger ed8cf436ca plip: update to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 17:26:48 -08:00
Stephen Hemminger 04fb5f735e ipg: update to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 17:26:14 -08:00
Stephen Hemminger 83d6f0352c cassini: update to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 17:25:41 -08:00
Stephen Hemminger ab638e69ff phonet: update to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 17:24:34 -08:00
Linus Torvalds 9e42d0cf50 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
  sparc64: Work around branch tracer warning.
  sparc64: Fix unsigned long long warnings in drivers.
  sparc64: Use unsigned long long for u64.
  sparc: refactor code in fault_32.c
  sparc64: refactor code in init_64.c
  sparc64: refactor code in viohs.c
  sparc: make proces_ver_nack a bit more readable
2009-01-07 17:23:53 -08:00
Stephen Hemminger 43a67304a3 appletalk: convert ipddp to net_device_ops
Use internal element in network device for stats as well.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 17:22:19 -08:00
Linus Torvalds 97c440ba41 Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6:
  V4L/DVB (10191a): Update MAINTAINERS entries on media drivers
  V4L/DVB (10190): cx88: Fix some Kbuild troubles
  V4L/DVB (10189): dm1105: Fix build with INPUT=m and DVB_DM1105=y
  V4L/DVB (10185): Use negated usb_endpoint_xfer_control, etc
  V4L/DVB (10182): tda8290: fix TDA8290 + TDA18271 initialization
  V4L/DVB (10181): v4l2-device: Fix some sparse warnings
  V4L/DVB (10180): drivers/media: Fix a number of sparse warnings
  V4L/DVB (10179): tda8290: Fix two sparse warnings
  V4L/DVB (10178): dvb_frontend: Fix some sparse warnings due to static symbols
  V4L/DVB (10177): Fix sparse warnings on em28xx
  V4L/DVB (10176b): pxa-camera: fix redefinition warnings and missing DMA definitions
  V4L/DVB (10176a): Switch remaining clear_user_page users over to clear_user_highpage
2009-01-07 17:22:04 -08:00
Mauro Carvalho Chehab e32fadc4c2 V4L/DVB (10190): cx88: Fix some Kbuild troubles
As Randy Dunlap <randy.dunlap@oracle.com> reported, cx88 has some compilation issues:

drivers/built-in.o: In function `cx88_call_i2c_clients':
(.text+0x20af17): undefined reference to `videobuf_dvb_get_frontend'
drivers/built-in.o: In function `cx8802_probe':
cx88-mpeg.c:(.devinit.text+0x268c4): undefined reference to `videobuf_dvb_alloc_frontend'
cx88-mpeg.c:(.devinit.text+0x268ea): undefined reference to `videobuf_dvb_dealloc_frontends'

With those configs:

CONFIG_VIDEO_CX88=y
CONFIG_VIDEO_CX88_BLACKBIRD=y
CONFIG_VIDEO_CX88_DVB=m
CONFIG_DVB_CORE=m

After carefully examining the code, with the current code, several cx88 drivers
(cx8800, cx8802, cx88_dvb and cx88_blackbird) should be compiled as a module,
if one of them is marked as such. Just fixing Kconfig could create a very complex
set of rules. Also, this hides a problem with the current approach where the dvb
functionality weren't confined inside dvb module.

What happens is that:
	- cx88-i2c (part of cx8800) has some special rules if DVB;
	- cx88-mpeg (cx8802 module) has also part of DVB init code;
	- cx88-dvb has the rest of the dvb code;
	- cx88-blackbird can be used with cx88-mpeg, having cx88-dvb or not.

So, instead of doing some tricks at Kconfig and wait for a next breakage,
this patch moves the dvb code inside cx88-i2c and cx88-mpeg into cx88-dvb.

Another problem is that cx8802 were being compiled, even without cx88-dvb
and cx88-blackbird modules.

While on this code, let's fix also a reported problem:
http://www.linuxtv.org/pipermail/linux-dvb/2009-January/031225.html

A solution for the issue were proposed here:
http://www.mail-archive.com/linux-media@vger.kernel.org/msg00021.html

Thanks to Randy, Andy, Gregoire and Thomas for helping us to detect
and solve the issues.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-07 22:18:56 -02:00
Mauro Carvalho Chehab 571d864c68 V4L/DVB (10189): dm1105: Fix build with INPUT=m and DVB_DM1105=y
As reported by Randy Dunlap <randy.dunlap@oracle.com>:

With CONFIG_INPUT=m and CONFIG_DVB_DM1105=y:

drivers/built-in.o: In function `input_sync':
dm1105.c:(.text+0x120c33): undefined reference to `input_event'
drivers/built-in.o: In function `dm1105_emit_key':
dm1105.c:(.text+0x120c6c): undefined reference to `input_event'
dm1105.c:(.text+0x120c82): undefined reference to `input_event'
dm1105.c:(.text+0x120cb2): undefined reference to `input_event'
dm1105.c:(.text+0x120cd1): undefined reference to `input_event'
drivers/built-in.o: In function `dm1105_ir_init':
(.devinit.text+0xd8ae): undefined reference to `input_allocate_device'
drivers/built-in.o: In function `dm1105_ir_init':
(.devinit.text+0xd9f6): undefined reference to `input_register_device'
drivers/built-in.o: In function `dm1105_ir_init':
(.devinit.text+0xda09): undefined reference to `input_free_device'
drivers/built-in.o: In function `dm1105_ir_exit':
(.devexit.text+0xcde): undefined reference to `input_unregister_device'

This is due to the lack of a dependency between dm1105 and CONFIG_INPUT

Cc: Igor M. Liplianin <liplianin@me.by>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-07 22:18:56 -02:00
Julia Lawall 2230c3c803 V4L/DVB (10185): Use negated usb_endpoint_xfer_control, etc
This patch extends 134179823b by using
usb_endpoint_xfer_control, usb_endpoint_xfer_isoc, usb_endpoint_xfer_bulk,
and usb_endpoint_xfer_int in the negated case as well.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@ struct usb_endpoint_descriptor *epd; @@

- (usb_endpoint_type(epd) != \(USB_ENDPOINT_XFER_CONTROL\|0\))
+ !usb_endpoint_xfer_control(epd)

@@ struct usb_endpoint_descriptor *epd; @@

- (usb_endpoint_type(epd) != \(USB_ENDPOINT_XFER_ISOC\|1\))
+ !usb_endpoint_xfer_isoc(epd)

@@ struct usb_endpoint_descriptor *epd; @@

- (usb_endpoint_type(epd) != \(USB_ENDPOINT_XFER_BULK\|2\))
+ !usb_endpoint_xfer_bulk(epd)

@@ struct usb_endpoint_descriptor *epd; @@

- (usb_endpoint_type(epd) != \(USB_ENDPOINT_XFER_INT\|3\))
+ !usb_endpoint_xfer_int(epd)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-07 22:18:56 -02:00
Michael Krufky 439b72b69e V4L/DVB (10182): tda8290: fix TDA8290 + TDA18271 initialization
Don't call tda8290_init_tuner unless we have either a TDA8275 or TDA8275A
present. Calling this function will cause a TDA18271 to get sick, so we
should only call it when needed.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-07 22:18:55 -02:00
Mauro Carvalho Chehab 432663375b V4L/DVB (10181): v4l2-device: Fix some sparse warnings
/home/v4l/master/v4l/v4l2-device.c:32:2: warning: Using plain integer as NULL pointer
/home/v4l/master/v4l/v4l2-device.c:64:2: warning: Using plain integer as NULL pointer

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-07 22:18:55 -02:00
Mauro Carvalho Chehab ffbc5f8814 V4L/DVB (10180): drivers/media: Fix a number of sparse warnings
anysee.c:44:5: warning: symbol 'dvb_usb_anysee_delsys' was not declared. Should it be static?
cx24116.c:378:3: warning: symbol 'CX24116_MODFEC_MODES' was not declared. Should it be static?
stb0899_algo.c:57:5: warning: symbol 'stb0899_get_srate' was not declared. Should it be static?
stb0899_algo.c:766:6: warning: symbol 'Log2Int' was not declared. Should it be static?
stb0899_drv.c:137:20: warning: symbol 'stb0899_quant_tab' was not declared. Should it be static?
stb0899_drv.c:180:20: warning: symbol 'stb0899_est_tab' was not declared. Should it be static?
stb0899_drv.c:220:5: warning: symbol '_stb0899_read_reg' was not declared. Should it be static?
budget-ci.c:1348:23: warning: symbol 'tt3200_stb6100_config' was not declared. Should it be static?
/home/v4l/master/v4l/cx25840-core.c:190:6: warning: symbol 'cx25840_work_handler' was not declared. Should it be static?
/home/v4l/master/v4l/m5602_s5k83a.c:116:6: warning: symbol 's5k83a_dump_registers' was not declared. Should it be static?

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-07 22:18:55 -02:00
Mauro Carvalho Chehab 4c27f1a4da V4L/DVB (10179): tda8290: Fix two sparse warnings
/home/v4l/master/v4l/tda8290.c:233:7: warning: symbol 'i' shadows an earlier one
/home/v4l/master/v4l/tda8290.c:178:3: warning: symbol 'fm_mode' was not declared. Should it be static?

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-07 22:18:55 -02:00
Mauro Carvalho Chehab 072ce0c509 V4L/DVB (10178): dvb_frontend: Fix some sparse warnings due to static symbols
/home/v4l/master/v4l/dvb_frontend.c:838:19: warning: symbol 'dtv_cmds' was not declared. Should it be static?
/home/v4l/master/v4l/dvb_frontend.c:1035:6: warning: symbol 'dtv_property_dump' was not declared. Should it be static?
/home/v4l/master/v4l/dvb_frontend.c:1066:5: warning: symbol 'is_legacy_delivery_system' was not declared. Should it be static?
/home/v4l/master/v4l/dvb_frontend.c:1080:6: warning: symbol 'dtv_property_cache_sync' was not declared. Should it be static?
/home/v4l/master/v4l/dvb_frontend.c:1132:6: warning: symbol 'dtv_property_legacy_params_sync' was not declared. Should it be static?
/home/v4l/master/v4l/dvb_frontend.c:1187:6: warning: symbol 'dtv_property_adv_params_sync' was not declared. Should it be static?
/home/v4l/master/v4l/dvb_frontend.c:1222:6: warning: symbol 'dtv_property_cache_submit' was not declared. Should it be static?
/home/v4l/master/v4l/dvb_frontend.c:1253:5: warning: symbol 'dtv_property_process_get' was not declared. Should it be static?
/home/v4l/master/v4l/dvb_frontend.c:1362:5: warning: symbol 'dtv_property_process_set' was not declared. Should it be static?

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-07 22:18:55 -02:00
Mauro Carvalho Chehab 26cdc76b2c V4L/DVB (10177): Fix sparse warnings on em28xx
/home/v4l/master/v4l/em28xx-core.c:396:25: warning: symbol 'outputs' was not declared. Should it be static?
/home/v4l/master/v4l/em28xx-input.c:324:6: warning: symbol 'em28xx_ir_start' was not declared. Should it be static?
/home/v4l/master/v4l/em28xx-cards.c:1925:5: warning: symbol 'em28xx_init_dev' was not declared. Should it be static?

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-07 22:18:55 -02:00
Eric Miao cfbaf4dfe7 V4L/DVB (10176b): pxa-camera: fix redefinition warnings and missing DMA definitions
1. now pxa_camera.c uses ioremap() for register access, pxa_camera.h is
   totally useless. Remove it.

2. <asm/dma.h> does no longer include <mach/dma.h>, include the latter
   file explicitly

 delete mode 100644 drivers/media/video/pxa_camera.h

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-07 22:18:55 -02:00
Guennadi Liakhovetski c0cd5010e5 V4L/DVB (10176a): Switch remaining clear_user_page users over to clear_user_highpage
Not all architectures provide clear_user_page(), but clear_user_highpage()
is available everywhere at least via the compatibility inline function.

Is this the "trivial patch" that's required for these two drivers?

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-07 22:18:54 -02:00
Harvey Harrison d599edcaea staging: __FUNCTION__ is gcc-specific, use __func__
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-07 15:48:54 -08:00
Harvey Harrison 9b4778f680 trivial: replace last usages of __FUNCTION__ in kernel
__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-07 15:48:54 -08:00
Linus Torvalds b424e8d3b4 Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6
* 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: (98 commits)
  PCI PM: Put PM callbacks in the order of execution
  PCI PM: Run default PM callbacks for all devices using new framework
  PCI PM: Register power state of devices during initialization
  PCI PM: Call pci_fixup_device from legacy routines
  PCI PM: Rearrange code in pci-driver.c
  PCI PM: Avoid touching devices behind bridges in unknown state
  PCI PM: Move pci_has_legacy_pm_support
  PCI PM: Power-manage devices without drivers during suspend-resume
  PCI PM: Add suspend counterpart of pci_reenable_device
  PCI PM: Fix poweroff and restore callbacks
  PCI: Use msleep instead of cpu_relax during ASPM link retraining
  PCI: PCIe portdrv: Add kerneldoc comments to remining core funtions
  PCI: PCIe portdrv: Rearrange code so that related things are together
  PCI: PCIe portdrv: Fix suspend and resume of PCI Express port services
  PCI: PCIe portdrv: Add kerneldoc comments to some core functions
  x86/PCI: Do not use interrupt links for devices using MSI-X
  net: sfc: Use pci_clear_master() to disable bus mastering
  PCI: Add pci_clear_master() as opposite of pci_set_master()
  PCI hotplug: remove redundant test in cpq hotplug
  PCI: pciehp: cleanup register and field definitions
  ...
2009-01-07 15:41:01 -08:00
Linus Torvalds 7c7758f99d Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (123 commits)
  wimax/i2400m: add CREDITS and MAINTAINERS entries
  wimax: export linux/wimax.h and linux/wimax/i2400m.h with headers_install
  i2400m: Makefile and Kconfig
  i2400m/SDIO: TX and RX path backends
  i2400m/SDIO: firmware upload backend
  i2400m/SDIO: probe/disconnect, dev init/shutdown and reset backends
  i2400m/SDIO: header for the SDIO subdriver
  i2400m/USB: TX and RX path backends
  i2400m/USB: firmware upload backend
  i2400m/USB: probe/disconnect, dev init/shutdown and reset backends
  i2400m/USB: header for the USB bus driver
  i2400m: debugfs controls
  i2400m: various functions for device management
  i2400m: RX and TX data/control paths
  i2400m: firmware loading and bootrom initialization
  i2400m: linkage to the networking stack
  i2400m: Generic probe/disconnect, reset and message passing
  i2400m: host/device procotol and core driver definitions
  i2400m: documentation and instructions for usage
  wimax: Makefile, Kconfig and docbook linkage for the stack
  ...
2009-01-07 15:37:24 -08:00
Linus Torvalds 67acd8b4b7 Merge git://git.kernel.org/pub/scm/linux/kernel/git/arjan/linux-2.6-async
* git://git.kernel.org/pub/scm/linux/kernel/git/arjan/linux-2.6-async:
  async: don't do the initcall stuff post boot
  bootchart: improve output based on Dave Jones' feedback
  async: make the final inode deletion an asynchronous event
  fastboot: Make libata initialization even more async
  fastboot: make the libata port scan asynchronous
  fastboot: make scsi probes asynchronous
  async: Asynchronous function calls to speed up kernel boot
2009-01-07 15:35:47 -08:00
David Miller b13d3720ec topology: Fix sparc64 build.
Due to changeset ba84be2338 ("remove
linux/hardirq.h from asm-generic/local.h") the sparc64 build started
failing on drivers/base/topology.c:

  drivers/base/topology.c: In function ‘show_physical_package_id’:
  drivers/base/topology.c:103: error: implicit declaration of function ‘cpu_data’
  drivers/base/topology.c:103: error: request for member ‘proc_id’ in something not a structure or union
  drivers/base/topology.c: In function ‘show_core_id’:
  drivers/base/topology.c:106: error: request for member ‘core_id’ in something not a structure or union

Adding the obvious fix of including asm/cpudata.h into asm/topology.h on
sparc64 doesn't fix it, in fact it makes things worse because of the
header file dependency chain:

	linux/gfp.h --> linux/mmzone.h --> linux/topology.h -->
	asm/topology.h --> asm/cpudata.h --> linux/percpu.h -->
	linux/slab.h

which results in:

  include/linux/slub_def.h: In function ‘kmalloc_large’:
  include/linux/slub_def.h:209: error: implicit declaration of function ‘__get_free_pages’
  include/linux/slub_def.h:209: error: ‘__GFP_COMP’ undeclared (first use in this function)
  include/linux/slub_def.h:209: error: (Each undeclared identifier is reported only once
  include/linux/slub_def.h:209: error: for each function it appears in.)
  include/linux/slub_def.h:209: warning: cast to pointer from integer of different size

The simplest thing to do is to add yet another one-off hack like parts
of the guilty changeset did, by putting an explicit linux/hardirq.h
include into drivers/base/topology.c

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-07 15:34:47 -08:00
Andrew Vasquez ffda8c7dc4 [SCSI] qla2xxx: Update version number to 8.03.00-k1.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-01-07 15:52:04 -06:00
Andrew Vasquez 3a03eb797c [SCSI] qla2xxx: Add ISP81XX support.
Codes to support new FCoE boards.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-01-07 15:51:44 -06:00
Andrew Vasquez 444786d7fd [SCSI] qla2xxx: Use proper request/response queues with MQ instantiations.
Original code would inadvertanly place I/Os on the default
request-queue.  Also, correctly pass in the proper MSI-X vector
during response-queue initialization.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-01-07 15:51:20 -06:00
Andrew Vasquez d63ab53394 [SCSI] qla2xxx: Correct MQ-chain information retrieval during a firmware dump.
Original code would not read request/response queue pointers.
Also, collapse code into a helper qla25xx_copy_mq() function in
preparation for newer ISP parts.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-01-07 15:50:59 -06:00
Andrew Vasquez bb99de6703 [SCSI] qla2xxx: Collapse EFT/FCE copy procedures during a firmware dump.
In preparation for new ISP types with varying dump procedures.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-01-07 15:50:31 -06:00
Andrew Vasquez 3fd67cdf9e [SCSI] qla2xxx: Don't pollute kernel logs with ZIO/RIO status messages.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-01-07 15:50:09 -06:00
Andrew Vasquez 124f85e6cc [SCSI] qla2xxx: Don't fallback to interrupt-polling during re-initialization with MSI-X enabled.
ROMs in recent ISPs have MSI-X support, so it's no longer
necessary for the driver to fallback to interrupt polling during
ISP re-initialization.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-01-07 15:49:45 -06:00
Andrew Vasquez 1ded85e285 [SCSI] qla2xxx: Remove support for reading/writing HW-event-log.
Software should not touch this region of flash, as the firmware
will be the only writer and consumer of the region.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-01-07 15:49:15 -06:00
Robert Richter 14f0ca8eae oprofile: make new cpu buffer functions part of the api
This patch creates the new functions

 oprofile_write_reserve()
 oprofile_add_data()
 oprofile_write_commit()

and makes them part of the oprofile api.

Signed-off-by: Robert Richter <robert.richter@amd.com>
2009-01-07 22:48:15 +01:00
Al Viro 574df408ed [SCSI] cxgb3i: add missing include
it needs scatterlist.h - indirect chain of includes doesn't work on a
lot of targets.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Karen Xie <kxie@chelsio.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-01-07 15:48:01 -06:00
Robert Richter ebf8d974e2 oprofile: remove #ifdef CONFIG_OPROFILE_IBS in non-ibs code
The ifdefs can be removed since the code is no longer ibs specific and
can be used for other purposes as well. IBS specific code is only in
op_model_amd.c.

Signed-off-by: Robert Richter <robert.richter@amd.com>
2009-01-07 22:47:56 +01:00
Robert Richter 1acda878e2 oprofile: use new data sample format for ibs
The new ring buffer implementation allows the storage of samples with
different size. This patch implements the usage of the new sample
format to store ibs samples in the cpu buffer. Until now, writing to
the cpu buffer could lead to incomplete sampling sequences since IBS
samples were transfered in multiple samples. Due to a full buffer,
data could be lost at any time. This can't happen any more since the
complete data is reserved in advance and then stored in a single
sample.

Signed-off-by: Robert Richter <robert.richter@amd.com>
2009-01-07 22:47:23 +01:00
Robert Richter bd7dc46f77 oprofile: add op_cpu_buffer_get_data()
This function provides access to attached data of a sample. It returns
the size of data including the current value. Also,
op_cpu_buffer_get_size() is available to check if there is data
attached.

Signed-off-by: Robert Richter <robert.richter@amd.com>
2009-01-07 22:45:46 +01:00
Robert Richter d9928c25a6 oprofile: add op_cpu_buffer_add_data()
This function can be used to attach data to a sample. It returns the
remaining free buffer size that has been reserved with
op_cpu_buffer_write_reserve().

Signed-off-by: Robert Richter <robert.richter@amd.com>
2009-01-07 22:41:47 +01:00
Robert Richter ae735e9964 oprofile: rework implementation of cpu buffer events
Special events such as task or context switches are marked with an
escape code in the cpu buffer followed by an event code or a task
identifier. There is one escape code per event. To make escape
sequences also available for data samples the internal cpu buffer
format must be changed. The current implementation does not allow the
extension of event codes since this would lead to collisions with the
task identifiers. To avoid this, this patch introduces an event mask
that allows the storage of multiple events with one escape code. Now,
task identifiers are stored in the data section of the sample. The
implementation also allows the usage of custom data in a sample. As a
side effect the new code is much more readable and easier to
understand.

Signed-off-by: Robert Richter <robert.richter@amd.com>
2009-01-07 22:40:47 +01:00
Robert Richter 2d87b14cf8 oprofile: modify op_cpu_buffer_read_entry()
This implements the support of samples with attached data.

Signed-off-by: Robert Richter <robert.richter@amd.com>
2009-01-07 22:40:02 +01:00
Robert Richter 2cc28b9f26 oprofile: add op_cpu_buffer_write_reserve()
This function prepares the cpu buffer to write a sample.

Struct op_entry is used during operations on the ring buffer while
struct op_sample contains the data that is stored in the ring
buffer. Struct entry can be uninitialized. The function reserves a
data array that is specified by size. Use op_cpu_buffer_write_commit()
after preparing the sample. In case of errors a null pointer is
returned, otherwise the pointer to the sample.

Signed-off-by: Robert Richter <robert.richter@amd.com>
2009-01-07 22:37:44 +01:00
Robert Richter d358e75fc4 oprofile: rename variables in add_ibs_begin()
This unifies usage of variable names within oprofile.

Signed-off-by: Robert Richter <robert.richter@amd.com>
2009-01-07 22:35:42 +01:00
Robert Richter d0e233846d oprofile: rename add_sample() in cpu_buffer.c
Rename the fucntion to op_add_sample() since there is a collision with
another one with the same name in buffer_sync.c.

Signed-off-by: Robert Richter <robert.richter@amd.com>
2009-01-07 22:35:26 +01:00
James Bottomley 79ed242972 [SCSI] scsi_lib: fix DID_RESET status problems
Andrew Vaszquez said:
> There's a problem that is causing commands returned by the LLD with
> a DID_RESET status to be reissued with cleared cmd->sdb data which
> in our tests are manifesting in firmware detected overruns.  Here's
> a snippet of a READ_10 scsi_cmnd upon completion by the storage

The problem is caused by:

commit b60af5b0ad
Author: Alan Stern <stern@rowland.harvard.edu>
Date:   Mon Nov 3 15:56:47 2008 -0500

    [SCSI] simplify scsi_io_completion()

Because scsi_release_buffers() is called before commands that go
through the ACTION_RETRY and ACTION_DELAYED_RETRY legs are requeued.
However, they're not re-prepared, so nothing ever reallocates the
buffer resources to them.  Fix this by releasing the buffers only if
we're not going to go down these legs (but scsi_release_buffers() on
all legs including two in scsi_end_request(); this latter needs a
special version __scsi_release_buffers() because the final one can be
called after the request has been freed, so the bidi test in
scsi_release_buffers(), which touches the request has to be skipped).

Reported-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-01-07 15:15:44 -06:00
Jaswinder Singh Rajput 9ac32e1bc0 firmware: convert e100 driver to request_firmware()
Thanks to David Woodhouse for help.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-07 12:59:17 -08:00
Linus Torvalds daf4b805c1 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
  firewire: reorder struct fw_card for better cache efficiency
  firewire: fix resetting of bus manager retry counter
  firewire: improve refcounting of fw_card
  firewire: typo in comment
  firewire: fix small memory leak at module removal
  firewire: fw-sbp2: remove unnecessary locking
  ieee1934: dv1394: interrupt enabling/disabling broken on big-endian
  ieee1394: dv1394: annotate frame input/output structs as little endian
  ieee1394: eth1394: trivial sparse annotations
  ieee1394: mark bus_info_data as a __be32 array
  ieee1394: replace CSR_SET_BUS_INFO_GENERATION macro
  ieee1394: pcilynx: trivial endian annotation
  ieee1394: ignore nonzero Bus_Info_Block.max_rom, fetch config ROM in quadlets
  ieee1394: consolidate uses of IEEE1934_BUSID_MAGIC
  ieee1394: ohci1394: flush MMIO writes before delay in initialization
  ieee1394: ohci1394: pass error codes from request_irq through
  ieee1394: ohci1394: don't leave interrupts enabled during suspend/resume
  ieee1394: mark all hpsb_address_ops instances as const
  ieee1394: replace a GFP_ATOMIC by GFP_KERNEL allocation
2009-01-07 12:05:32 -08:00
Linus Torvalds 2f2408a88c Merge branch 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
* 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6: (29 commits)
  hwmon: Fix various typos
  hwmon: Check for ACPI resource conflicts
  hwmon: (lm70) Add TI TMP121 support
  hwmon: (lm70) Code streamlining and cleanup
  hwmon: Deprecate the fscher and fscpos drivers
  hwmon: (fschmd) Add watchdog support
  hwmon: (fschmd) Cleanups for watchdog support
  hwmon: (i5k_amb) Load automatically on all 5000/5400 chipsets
  hwmon: (it87) Add support for the ITE IT8720F
  hwmon: Don't overuse I2C_CLIENT_MODULE_PARM
  hwmon: Add LTC4245 driver
  hwmon: (f71882fg) Fix fan_to/from_reg prototypes
  hwmon: (f71882fg) Printout fan modes
  hwmon: (f71882fg) Add documentation
  hwmon: (f71882fg) Fix auto_channels_temp temp numbering with f8000
  hwmon: (f71882fg) Add missing pwm3 attr for f71862fg
  hwmon: (f71882fg) Add F8000 support
  hwmon: (f71882fg) Remove the fan_mode module option
  hwmon: (f71882fg) Separate max and crit alarm and beep
  hwmon: (f71882fg) Check for hwmon powerdown state
  ...
2009-01-07 11:59:51 -08:00
Linus Torvalds fa7b906e7f Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6:
  i2c: Use snprintf to set adapter names
  Input: apanel - convert to new i2c binding
  i2c: Drop I2C_CLASS_CAM_DIGITAL
  i2c: Drop I2C_CLASS_CAM_ANALOG and I2C_CLASS_SOUND
  i2c: Drop I2C_CLASS_ALL
  i2c: Get rid of remaining bus_id access
  i2c: Replace bus_id with dev_name(), dev_set_name()
2009-01-07 11:59:27 -08:00
Linus Torvalds 08249903ea Merge git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6:
  avr32: Move syscalls.h under arch/avr32/include/asm/
  avr32: Define DIE_OOPS
  avr32: Remove DMATEST from defconfigs
  arch/avr32: Eliminate NULL test and memset after alloc_bootmem
  avr32: data param to at32_add_device_mci() must be non-NULL
  atmel-mci: move atmel-mci.h file to include/linux
  avr32: Hammerhead board support
  avr32: Allow reserving multiple pins at once
  favr-32: Remove deprecated call
  MIMC200: Remove deprecated call
  avr: struct device - replace bus_id with dev_name(), dev_set_name()
  avr32: Introducing asm/syscalls.h
2009-01-07 11:58:30 -08:00
Alan Cox 30aafdba6f touchscreen: Fix build of da9034
Missing an include and thus breaks the x86-64 build.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-07 11:34:14 -08:00
Linus Torvalds 57c44c5f6f Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (24 commits)
  trivial: chack -> check typo fix in main Makefile
  trivial: Add a space (and a comma) to a printk in 8250 driver
  trivial: Fix misspelling of "firmware" in docs for ncr53c8xx/sym53c8xx
  trivial: Fix misspelling of "firmware" in powerpc Makefile
  trivial: Fix misspelling of "firmware" in usb.c
  trivial: Fix misspelling of "firmware" in qla1280.c
  trivial: Fix misspelling of "firmware" in a100u2w.c
  trivial: Fix misspelling of "firmware" in megaraid.c
  trivial: Fix misspelling of "firmware" in ql4_mbx.c
  trivial: Fix misspelling of "firmware" in acpi_memhotplug.c
  trivial: Fix misspelling of "firmware" in ipw2100.c
  trivial: Fix misspelling of "firmware" in atmel.c
  trivial: Fix misspelled firmware in Kconfig
  trivial: fix an -> a typos in documentation and comments
  trivial: fix then -> than typos in comments and documentation
  trivial: update Jesper Juhl CREDITS entry with new email
  trivial: fix singal -> signal typo
  trivial: Fix incorrect use of "loose" in event.c
  trivial: printk: fix indentation of new_text_line declaration
  trivial: rtc-stk17ta8: fix sparse warning
  ...
2009-01-07 11:31:52 -08:00
Jiri Kosina 7605274914 HID: fix hid->hiddev initialization in hiddev_connect()
Commit 079034073f ("HID: hiddev cleanup -- handle all error conditions
properly") by mistake removed proper initialization of hid->hiddev pointer
in hiddev_connect() in case usb_register_dev() succeeds for the hiddev node.
Put it properly back in place.

Reported-and-tested-by: Gabriel C <nix.or.die@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-07 11:30:57 -08:00
Stephen Rothwell 7ddccb234c IB/ehca: spin_lock_irqsave() takes an unsigned long
The flags argument to spin_lock_irqsave() should really be unsigned
long.  This will also help prevent some warnings when we change u64 to
unsigned long long.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2009-01-07 11:24:36 -08:00
Rafael J. Wysocki f6dc1e5e3d PCI PM: Put PM callbacks in the order of execution
Put PM callbacks in drivers/pci/pci-driver.c in the order in which
they are executed which makes it much easier to follow the code.

No functional changes should result from this.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:19:43 -08:00
Rafael J. Wysocki d67e37d793 PCI PM: Run default PM callbacks for all devices using new framework
It should be quite clear that it generally makes sense to execute
the default PM callbacks (ie. the callbacks used for handling
suspend, hibernation and resume of PCI devices without drivers) for
all devices.  Of course, the drivers that provide legacy PCI PM
support (ie. the ->suspend, ->suspend_late, ->resume_early
or ->resume hooks in the pci_driver structure), carry out these
operations too, so we can't do it for devices with such drivers.
Still, we can make the default PM callbacks run for devices with
drivers using the new framework (ie. implement the pm object), since
there are no such drivers at the moment.

This also simplifies the code and makes it smaller.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:19:39 -08:00
Rafael J. Wysocki 98e6e286d7 PCI PM: Register power state of devices during initialization
Use the observation that the power state of a PCI device can be
loaded into its pci_dev structure as soon as pci_pm_init() is run for
it and make that happen.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:18:04 -08:00
Rafael J. Wysocki ad8cfa1def PCI PM: Call pci_fixup_device from legacy routines
The size of drivers/pci/pci-driver.c can be reduced quite a bit
if pci_fixup_device() is called from the legacy PM callbacks, so make
it happen.

No functional changes should result from this.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:17:23 -08:00
Rafael J. Wysocki bb80894543 PCI PM: Rearrange code in pci-driver.c
Rename two functions and rearrange code in drivers/pci/pci-driver.c
so that it's easier to follow.  In particular, separate invocations
of the legacy callbacks from the rest of the new callbacks' code.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:16:53 -08:00
Rafael J. Wysocki 734104292f PCI PM: Avoid touching devices behind bridges in unknown state
It generally is better to avoid accessing devices behind bridges that
may not be in the D0 power state, because in that case the bridges'
secondary buses may not be accessible.  For this reason, during the
early phase of resume (ie. with interrupts disabled), before
restoring the standard config registers of a device, check the power
state of the bridge the device is behind and postpone the restoration
of the device's config space, as well as any other operations that
would involve accessing the device, if that state is not D0.

In such cases the restoration of the device's config space will be
retried during the "normal" phase of resume (ie. with interrupts
enabled), so that the bridge can be put into D0 before that happens.

Also, save standard configuration registers of PCI devices during the
"normal" phase of suspend (ie. with interrupts enabled), so that the
bridges the devices are behind can be put into low power states (we
don't put bridges into low power states at the moment, but we may
want to do it in the future and it seems reasonable to design for
that).

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:16:05 -08:00
Rafael J. Wysocki 07e836e8d1 PCI PM: Move pci_has_legacy_pm_support
Move pci_has_legacy_pm_support() closer to the functions that
call it.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:15:31 -08:00
Rafael J. Wysocki 571ff7584b PCI PM: Power-manage devices without drivers during suspend-resume
PCI devices without drivers can be put into low power states during
suspend with the help of pci_prepare_to_sleep() and prevented from
generating wake-up events during resume with the help of
pci_enable_wake().  However, it's better not to put bridges into
low power states during suspend, because that might result in entire
bus segments being powered off.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:15:18 -08:00
Rafael J. Wysocki fa58d305d9 PCI PM: Add suspend counterpart of pci_reenable_device
PCI devices without drivers are not disabled during suspend and
hibernation, but they are enabled during resume, with the help of
pci_reenable_device(), so there is an unbalanced execution of
pcibios_enable_device() in the resume code path.

To correct this introduce function pci_disable_enabled_device()
that will disable the argument device, if it is enabled when the
function is being run, without updating the device's pci_dev
structure and use it in the suspend code path to balance the
pci_reenable_device() executed during resume.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:14:40 -08:00
Rafael J. Wysocki c9b9972b3c PCI PM: Fix poweroff and restore callbacks
pci_fixup_device() is called too early in pci_pm_poweroff() and too
late in pci_pm_restore().  Moreover, pci_pm_restore_noirq() calls
pci_fixup_device() twice and in a wrong way.  Fix that.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:14:07 -08:00
Andrew Patterson 987a4c783a PCI: Use msleep instead of cpu_relax during ASPM link retraining
The cpu_relax() function can be a noop on certain architectures like
IA-64 when CPU threads are disabled, so use msleep instead during link
retraining busy/wait loop.

Introduce define LINK_RETRAIN_TIMEOUT instead of hard-coding timeout in
pcie_aspm_configure_common_clock.

Use time_after() to avoid jiffy wraparound when checking for expired
timeout.

After timeout expires, recheck link status register link training bit
instead of checking for expired timeout to avoid possible false
positive.

Note that Matthew Wilcox came up with the first rough version of this
patch.

Reviewed-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:28 -08:00
Rafael J. Wysocki d9347371c5 PCI: PCIe portdrv: Add kerneldoc comments to remining core funtions
Add kerneldoc comments to the reamining functions in
drivers/pci/pcie/portdrv_core.c .

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:27 -08:00
Rafael J. Wysocki fa6c993736 PCI: PCIe portdrv: Rearrange code so that related things are together
Rearrange code in drivers/pci/pcie/portdrv_bus.c and
drivers/pci/pcie/portdrv_core.c so that related functions and data
structures are closer together.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:27 -08:00
Rafael J. Wysocki e7ae884866 PCI: PCIe portdrv: Fix suspend and resume of PCI Express port services
There is a problem with the suspend and resume of PCI Express port
service devices that the ->suspend() and ->resume() routines of each
service device are called twice in each suspend-resume cycle, which
is obviously wrong.

The scenario is that first, the PCI Express port driver calls
suspend and resume routines of each port service driver from its
pcie_portdrv_suspend() and pcie_portdrv_resume() callbacks,
respectively (which is correct), and second, the pcie_port_bus_type
driver calls them from its ->suspend() and ->resume() callbacks
(which is not correct, because it doesn't happen at the right time).

The solution is to remove the ->suspend() and ->resume() callbacks
from pcie_port_bus_type and the associated functions.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:26 -08:00
Rafael J. Wysocki facf6d1627 PCI: PCIe portdrv: Add kerneldoc comments to some core functions
Add kerneldoc comments to some functions in
drivers/pci/pcie/portdrv_core.c, since the code in there is not
easy to follow without any additional description.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:25 -08:00
Ben Hutchings ef1bba28bf net: sfc: Use pci_clear_master() to disable bus mastering
pci_disable_device() disables many features, like MSI-X, which we
never reenable in efx_reset().  Further, calls to pci_enable_device()
and pci_disable_device() must be matched since the nesting count was
introduced, so switch to using pci_clear_master() instead.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:24 -08:00
Ben Hutchings 6a479079c0 PCI: Add pci_clear_master() as opposite of pci_set_master()
During an online device reset it may be useful to disable bus-mastering.
pci_disable_device() does that, and far more besides, so is not suitable
for an online reset.

Add pci_clear_master() which does just this.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Reviewed-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:23 -08:00
Julia Lawall b8d9cb2a22 PCI hotplug: remove redundant test in cpq hotplug
func is checked not to be NULL a few lines before.

A simplified version of the semantic patch that makes this change is as
follows: (http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r exists@
local idexpression x;
expression E;
position p1,p2;
@@

if (x@p1 == NULL || ...) { ... when forall
   return ...; }
... when != \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\|&x\)
(
x@p2 == NULL
|
x@p2 != NULL
)

// another path to the test that is not through p1?
@s exists@
local idexpression r.x;
position r.p1,r.p2;
@@

... when != x@p1
(
x@p2 == NULL
|
x@p2 != NULL
)

@fix depends on !s@
position r.p1,r.p2;
expression x,E;
statement S1,S2;
@@

(
- if ((x@p2 != NULL) || ...)
  S1
|
- if ((x@p2 == NULL) && ...) S1
|
- BUG_ON(x@p2 == NULL);
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:22 -08:00
Kenji Kaneshige 322162a71b PCI: pciehp: cleanup register and field definitions
Clean up register definitions related to PCI Express Hot plug.

  - Add register definitions into include/linux/pci_regs.h, and use
    them instead of pciehp's locally definied register definitions.
  - Remove pciehp's locally defined register definitions
  - Remove unused register definitions in pciehp.
  - Some minor cleanups.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:22 -08:00
Kenji Kaneshige 67f6533802 PCI: pciehp: ignore undefined bit in link status register
Bit 10 in Link Status register used to be defined as Training Error in
the PCI Express 1.0a specification. But it was removed by Training Error
ECN and is no longer defined. So pciehp must ignore the value read from
it.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:21 -08:00
Shaohua Li 46bbdfa44c PCI: keep ASPM link state consistent throughout PCIe hierarchy
In a PCIe hierarchy with a switch present, if the link state of an
endpoint device is changed, we must check the whole hierarchy from the
endpoint device to root port, and for each link in the hierarchy, the new
link state should be configured. Previously, the implementation checked
the state but forgot to configure the links between root port to switch.
Fixes Novell bz #448987.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Tested-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:20 -08:00
Bjorn Helgaas a19f5df7d9 PCI: use dev_printk for PCI bus resource mssages
Since pci_bus has a struct device, use dev_printk directly instead
of faking it by hand.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:19 -08:00
Stephen Hemminger db5679437a PCI: add interface to set visible size of VPD
The VPD on all devices may not be 32K. Unfortunately, there is no
generic way to find the size, so this adds a simple API hook
to reset it.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:18 -08:00
Stephen Hemminger 287d19ce2e PCI: revise VPD access interface
Change PCI VPD API which was only used by sysfs to something usable
in drivers.
   * move iteration over multiple words to the low level
   * use conventional types for arguments
   * add exportable wrapper

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:17 -08:00
Stephen Hemminger 1120f8b816 PCI: handle long delays in VPD access
Accessing the VPD area can take a long time.  The existing
VPD access code fails consistently on my hardware. There are comments
in the SysKonnect vendor driver that it can take up to 13ms per word.

Change the access routines to:
  * use a mutex rather than spinning with IRQ's disabled and lock held
  * have a much longer timeout
  * call cond_resched while spinning

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Reviewed-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:16 -08:00
Bjorn Helgaas 68feac87de PCI: add pci_common_swizzle() for INTx swizzling
This patch adds pci_common_swizzle(), which swizzles INTx values all the
way up to a root bridge.

This common implementation can replace several architecture-specific
ones.  This should someday be combined with pci_get_interrupt_pin(),
but I left it separate for now to make reviewing easier.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:12 -08:00
Kenji Kaneshige e8c331e963 PCI hotplug: introduce functions for ACPI slot detection
Some ACPI related PCI hotplug code can be shared among PCI hotplug
drivers. This patch introduces the following functions in
drivers/pci/hotplug/acpi_pcihp.c to share the code, and changes
acpiphp and pciehp to use them.

- int acpi_pci_detect_ejectable(struct pci_bus *pbus)
  This checks if the specified PCI bus has ejectable slots.

- int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle)
  This checks if the specified handle is ejectable ACPI PCI slot. The
  'pbus' parameter is needed to check if 'handle' is PCI related ACPI
  object.

This patch also introduces the following inline function in
include/linux/pci-acpi.h, which is useful to get ACPI handle of the
PCI bridge from struct pci_bus of the bridge's secondary bus.

- static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus)
  This returns ACPI handle of the PCI bridge which generates PCI bus
  specified by 'pbus'.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:11 -08:00
Kenji Kaneshige e046cbd6c0 PCI: pciehp: add auto option to pciehp_detect_mode
ACPI based hot-pluggable PCIe slot detection logic was added to
prevent the problem non hot-pluggable PCIe slot was detected as
hot-pluggable. The slot detection logic can be selected through
'pciehp_detect_mode', but it would be better if it is selected
automatically.

This patch adds 'auto' option for 'pciehp_detect_mode'. When it is
specified, pciehp judges which 'acpi' or 'pcie' should be used. It
seems that the physical slot number is duplicated among some slots on
most of the platforms with the above-mentioned problem. So 'auto' mode
uses this information to judge which 'acpi' or 'pcie' should be
used. That is, if duplicated physical slot numbers are detected,
'acpi' mode is used. This method is not perfect, but it's realistic.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:10 -08:00
Kenji Kaneshige c9ffa5a586 PCI: pciehp: add ACPI based slot detection
There is a problem that some non hot-pluggable PCIe slots are detected
as hot-pluggable by pciehp on some platforms. The immediate cause of
this problem is that hot-plug capable bit in the Slot Capabilities
register is set even for non hot-pluggable slots on those platforms.
It seems a BIOS/hardware problem, but we need workaround about that.

Some of those platforms define hot-pluggable PCIe slots on ACPI
namespace properly, while hot-plug capable bit in the Slot
Capabilities register is set improperly. So using ACPI namespace
information in pciehp to detect PCIe hot-pluggable slots would be a
workaround.

This patch adds 'pciehp_detect_mode' module option. When 'acpi' is
specified, pciehp uses ACPI namespace information to detect PCIe
hot-pluggable slots.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:10 -08:00
Rusty Russell 873392ca51 PCI: work_on_cpu: use in drivers/pci/pci-driver.c
This uses work_on_cpu(), rather than altering the cpumask of the
thread which we happen to be.

Note the cleanups:

1) I've removed the CONFIG_NUMA test, since dev_to_node() returns -1
   for !CONFIG_NUMA anyway and the compiler will eliminate it.

2) No need to reset mempolicy to default (a bad idea anyway) since
   work_on_cpu is run from a workqueue.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:09 -08:00
Rafael J. Wysocki a79d682f78 PCI PM: Split PCI Express port suspend-resume
Suspend-resume of PCI Express ports has recently been moved into
_suspend_late() and _resume_early() callbacks, but some functions
executed from there should not be called with interrupts disabled,
eg. pci_enable_device().  For this reason, split the suspend-resume
of PCI Express ports into parts to be executed with interrupts
disabled and with interrupts enabled.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:08 -08:00
Rafael J. Wysocki f06fc0b6f8 PCI PM: Fix pci_update_current_state
Currently, PCI devices without the PM capability that are power
manageable by the platform (eg. ACPI) are not handled correctly
by pci_set_power_state(), because their current_state field is not
updated to reflect the new power state of the device.  Fix this by
making pci_update_current_state() accept additional argument
representing the power state of the device as set by the platform.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:08 -08:00
Jesse Barnes eb9c39d031 PCI: set device wakeup capable flag if platform support is present
When PCI devices are initialized, we check whether they support PCI PM
caps and set the device can_wakeup flag if so.  However, some devices
may have platform provided wakeup events rather than PCI PME signals, so
we need to set can_wakeup in that case too.  Doing so should allow
wakeups from many more devices, especially on cost constrained systems.

Reported-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Joseph Chan <JosephChan@via.com.tw>
Acked-by: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:07 -08:00
Yu Zhao 876e501ab2 PCI: factor pci_bus_add_child() from pci_bus_add_devices()
This patch splits a new function, pci_bus_add_child(), from
pci_bus_add_devices(). The new function can be used to register PCI
buses to the device core.

Signed-off-by: Yu Zhao <yu.zhao@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:06 -08:00
Yu Zhao 3fa16fdb48 PCI: cleanup pci_bus_add_devices()
Cleanup pci_bus_add_devices() by negating the conditional and
continuing, rather than having a single conditional take up the whole
body.

Signed-off-by: Yu Zhao <yu.zhao@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:05 -08:00
Yu Zhao 613e7ed6f7 PCI: add a new function to map BAR offsets
Add a function to map a given resource number to a corresponding
register so drivers can get the offset and type of device specific BARs.

Signed-off-by: Yu Zhao <yu.zhao@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:04 -08:00
Yu Zhao 3789fa8a2e PCI: allow pci_alloc_child_bus() to handle a NULL bridge
Allow pci_alloc_child_bus() to allocate buses without bridge devices.
Some SR-IOV devices can occupy more than one bus number, but there is no
explicit bridges because that have internal routing mechanism.

Signed-off-by: Yu Zhao <yu.zhao@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:03 -08:00
Yu Zhao 0b400c7ed4 PCI: export __pci_read_base()
Export __pci_read_base() so it can be used by whole PCI subsystem.

Signed-off-by: Yu Zhao <yu.zhao@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:02 -08:00
Yu Zhao bc5f5a8277 PCI: remove unnecessary condition check in pci_restore_bars()
Remove the unnecessary number of resources condition checks because
the pci_update_resource() will check availability of the resources.

Signed-off-by: Yu Zhao <yu.zhao@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:01 -08:00
Yu Zhao fde09c6d8f PCI: define PCI resource names in an 'enum'
This patch moves all definitions of the PCI resource names to an 'enum',
and also replaces some hard-coded resource variables with symbol
names. This change eases introduction of device specific resources.

Reviewed-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Yu Zhao <yu.zhao@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:01 -08:00
Yu Zhao 14add80b51 PCI: remove unnecessary arg of pci_update_resource()
This cleanup removes unnecessary argument 'struct resource *res' in
pci_update_resource(), so it takes same arguments as other companion
functions (pci_assign_resource(), etc.).

Signed-off-by: Yu Zhao <yu.zhao@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:00 -08:00
Yu Zhao 6a49d81200 PCI: enhance pci_ari_enabled()
Change parameter of pci_ari_enabled() from 'pci_dev' to 'pci_bus'.

ARI forwarding on the bridge mostly concerns the subordinate devices
rather than the bridge itself. So this change will make the function
easier to use.

Signed-off-by: Yu Zhao <yu.zhao@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:59 -08:00
Adam Jackson 999da9fd48 PCI quirks: piix3: warn softer about enabling passive release
All the other quirks are dev_info() not dev_err(), this one isn't special.
This makes 'quiet' boot in qemu really quiet.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:58 -08:00
Trent Piepho 92425a405e PCI: Make settable sysfs attributes more consistent
PCI devices have three settable boolean attributes, enable,
broken_parity_status, and msi_bus.

The store functions for these would silently interpret "0x01" as false,
"1llogical" as true, and "true" would be (silently!) ignored and do
nothing.

This is inconsistent with typical sysfs handling of settable attributes,
and just plain doesn't make much sense.

So, use strict_strtoul(), which was created for this purpose.  The store
functions will treat a value of 0 as false, non-zero as true, and return
-EINVAL for a parse failure.

Additionally, is_enabled_store() and msi_bus_store() return -EPERM if
CAP_SYS_ADMIN is lacking, rather than silently doing nothing.  This is more
typical behavior for sysfs attributes that need a capability.

And msi_bus_store() will only print the "forced subordinate bus ..."
warning if the MSI flag was actually forced to a different value.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:58 -08:00
Andrew Morton 1684f5ddd4 PCI: uninline pci_ioremap_bar()
It's too large to be inlined.

Acked-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:57 -08:00
Alan Stern bebd590ca2 PCI: fix incorrect error return in pci_enable_wake
This patch (as1186) fixes a minor mistake in pci_enable_wake().  When
the routine is asked to disable remote wakeup, it should not return an
error merely because the device is not allowed to do wakeups!

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:56 -08:00
Bjorn Helgaas f0e88af855 PCI: parisc: use generic pci_swizzle_interrupt_pin()
Use the generic pci_swizzle_interrupt_pin() instead of arch-specific code.

Acked-by: Kyle McMartin <kyle@infradead.org>
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:55 -08:00
Bjorn Helgaas 57c2cf71c1 PCI: add pci_swizzle_interrupt_pin()
This patch adds pci_swizzle_interrupt_pin(), which implements the
INTx swizzling algorithm specified in Table 9-1 of the "PCI-to-PCI
Bridge Architecture Specification," revision 1.2.

There are many architecture-specific implementations of this
swizzle that can be replaced by this common one.

Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:50 -08:00
Bjorn Helgaas 878f2e50fd PCI: use config space encoding in pci_get_interrupt_pin()
This patch makes pci_get_interrupt_pin() return values encoded
the same way as the "Interrupt Pin" value in PCI config space,
i.e., 1=INTA, ..., 4=INTD.

pirq_bios_set() is the only in-tree caller of pci_get_interrupt_pin()
and pci_get_interrupt_pin() is not exported.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: hpa@zytor.com
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:48 -08:00
Bjorn Helgaas 98d3333a13 PCI hotplug: cpqphp: use config space PCI interrupt pin encoding
This patch changes cpqphp to use interrupt pin values just as they
come from PCI config space, i.e., 1=INTA, ..., 4=INTD.

pcibios_set_irq_routing() takes pin arguments in the range 0=INTA, ...,
3=INTD, so we'll adjust the pin just before calling it.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:47 -08:00
Bjorn Helgaas 0e331bf1c4 PCI: pcie port driver: remove extra printks
These printks don't contain enough information to be useful.  I think it
would be more useful to have a message when a service driver binds to a
root port.  That could contain the service type, the interrupt mode and
IRQ, etc.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:46 -08:00
Bjorn Helgaas 29935282f2 PCI: make PCI bus resource messages more meaningful
Change PCI bus resource messages so they have a bit more context
and look like the rest of PCI, e.g.,

    - bus: 00 index 0 io port: [0x00-0xffff]
    - bus: 00 index 1 mmio: [0x000000-0xffffffff]
    + pci 0000:00: bus resource 0 io : [0x00-0xffff]
    + pci 0000:00: bus resource 1 mem: [0x000000-0xffffffff]

This also changes them from KERN_INFO to KERN_DEBUG.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:44 -08:00
Alex Chiang 2a9d35219c PCI hotplug: acpiphp whitespace cleanup
Clean up whitespace.

Setting 'let c_space_errors=1' in .vimrc shows all sorts of
ugliness. ;)

Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:42 -08:00
Ingo Molnar 104bafcfab PCI: Don't carp about BAR allocation failures in quiet boot
These are easy to trigger (more or less harmlessly) with multiple video
cards, since the ROM BAR will typically not be given any space by the
BIOS bridge setup.  No reason to punish quiet boot for this.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:42 -08:00
Hidetoshi Seto a367f74cb6 PCI hotplug: aerdrv: fix a typo in error message
"TLP" is an acronym for "Transaction Layer Packet."

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:41 -08:00
Rafael J. Wysocki 63f4898ace PCI: handle PCI state saving with interrupts disabled
Since interrupts will soon be disabled at PCI resume time, we need to
pre-allocate memory to save/restore PCI config space (or use GFP_ATOMIC,
but this is safer).

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:40 -08:00
Linus Torvalds 894886e5d3 PCI: extend on the ICH motherboard IO decode quirk list
This adds more LPC controller IO range decode quirks for the Intel ICH
family of chipsets. They differ a bit between the older ICH6 chipset and
the more modern layout of the ICH7-ICH10 chipsets.

This patch just prints out the IO decode information found by the quirks,
but eventually we may want to add them to the resource tree, in order to
know to avoid allocating things over them.

That's especially true if it turns out that any firmware ends up putting
the magic motherboard resources in an address range that we use for
dynamic allocations (ie above PCIBIOS_MIN_IO, which is 0x1000 on x86).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Greg KH <greg@kroah.com>
Cc: Frans Pop <elendil@planet.nl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:39 -08:00
Rafael J. Wysocki 90d25f246d PCI: Suspend and resume PCI Express ports with interrupts disabled
I don't see why the suspend and resume of PCI Express ports should be
handled with interrupts enabled and it may even lead to problems in
some situations.  For this reason, move the suspending and resuming
of PCI Express ports into ->suspend_late() and ->resume_early()
callbacks executed with interrupts disabled.

This patch addresses the regression from 2.6.26 tracked as
http://bugzilla.kernel.org/show_bug.cgi?id=12121 .

Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:38 -08:00
Chris Wright c70e0d9dfe PCI: pci-stub module to reserve pci device
When doing device assignment with KVM there's currently nothing to
protect the device from having a driver in the host as well as the guest.
This trivial module just binds the pci device on the host to a stub
driver so that a real host driver can't bind to the device.  It has no
pci id table, it supports only dynamic ids.

 # echo "8086 10f5" > /sys/bus/pci/drivers/pci-stub/new_id
 # echo -n 0000:00:19.0 > /sys/bus/pci/drivers/e1000e/unbind
 # echo -n 0000:00:19.0 > /sys/bus/pci/drivers/pci-stub/bind
 # ls -l /sys/bus/pci/devices/0000:00:19.0/driver
 lrwxrwxrwx 1 root root 0 2008-11-25 19:10 /sys/bus/pci/devices/0000:00:19.0/driver -> ../../../bus/pci/drivers/pci-stub

Cc: "Kay, Allen M" <allen.m.kay@intel.com>
Cc: "Nakajima, Jun" <jun.nakajima@intel.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:38 -08:00
Chris Wright 2debb4d201 PCI: allow pci driver to support only dynids
commit b41d6cf38e (PCI: Check dynids driver_data value for validity)
requires all drivers to include an id table to try and match
driver_data.  Before validating driver_data check driver has an id
table.

Acked-by: Jean Delvare <khali@linux-fr.org>
Cc: Milton Miller <miltonm@bga.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:37 -08:00
Matthew Garrett 56ee325e25 PCI/ACPI: acpiphp: Identify more removable slots
According to section 6.3.6 of the ACPI spec, the presence of an _RMV
method that evaluates to 1 is sufficient to indicate that a slot is
removable without needing an eject method. This patch refactors the
ejectable slot detection code a little in order to flag these slots as
ejectable and register them. Acpihp then binds to the expresscard slot
on my HP test machine.

Acked-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:36 -08:00
Taku Izumi 86d8698027 pci-acpi: Cleanup _OSC evaluation code
Cleanup _OSC evaluation code.  Some whitespace changes and a few other
minor cleanups.

Reviewed-by: Andrew Patterson <andrew.patterson@hp.com>
Tested-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:35 -08:00
Taku Izumi e0fa3b43df PCI/ACPI: Remove unnecessary _OSC evaluation for control request
If a control had already been granted, we don't need to re-evaluate
_OSC for it because firmware may not reject control of any feature it
has previously granted control to.

Reviewed-by: Andrew Patterson <andrew.patterson@hp.com>
Tested-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:35 -08:00
Taku Izumi 753e3aca73 PCI: revert additional _OSC evaluation
Reverts adf411b819.

The commit adf411b819 was based on the
improper assumption that queried result was not updated when _OSC
support field was changed. But, in fact, queried result is updated
whenever _OSC support field was changed through __acpi_query_osc().
As a result, the commit adf411b819 only
introduced unnecessary additional _OSC evaluation...

Tested-by: Andrew Patterson <andrew.patterson@hp.com>
Reviewed-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:34 -08:00
Julia Lawall 4ba7d0f0eb drivers/pci/hotplug: Add missing pci_dev_get
pci_get_slot does a pci_dev_get, so pci_dev_put needs to be called in an
error case.

An alterative would be to move the test_and_set_bit before the call to
pci_get_slot.

The problem was fixed using the following semantic patch.
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
local idexpression *n;
statement S1,S2;
expression E,E1;
expression *ptr != NULL;
type T,T1;
@@

(
if (!(n = pci_get_slot(...))) S1
|
n = pci_get_slot(...)
)
<... when != pci_dev_put(n)
    when != if (...) { <+... pci_dev_put(n) ...+> }
    when != true !n  || ...
    when != n = (T)E
    when != E = n
if (!n || ...) S2
...>
(
  return \(0\|<+...n...+>\|ptr\);
|
+ pci_dev_put(n);
return ...;
|
pci_dev_put(n);
|
n = (T1)E1
|
E1 = n
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:33 -08:00
Arjan van de Ven e8de1481fd resource: allow MMIO exclusivity for device drivers
Device drivers that use pci_request_regions() (and similar APIs) have a
reasonable expectation that they are the only ones accessing their device.
As part of the e1000e hunt, we were afraid that some userland (X or some
bootsplash stuff) was mapping the MMIO region that the driver thought it
had exclusively via /dev/mem or via various sysfs resource mappings.

This patch adds the option for device drivers to cause their reserved
regions to the "banned from /dev/mem use" list, so now both kernel memory
and device-exclusive MMIO regions are banned.
NOTE: This is only active when CONFIG_STRICT_DEVMEM is set.

In addition to the config option, a kernel parameter iomem=relaxed is
provided for the cases where developers want to diagnose, in the field,
drivers issues from userspace.

Reviewed-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:32 -08:00
Andrew Patterson 2361694191 ACPI/PCI: remove obsolete _OSC capability support functions
The acpi_query_osc, __pci_osc_support_set, pci_osc_support_set, and
pcie_osc_support_set functions have been obsoleted in favor of setting
these capabilities during root bridge discovery with
pci_acpi_osc_support.  There are no longer any callers of these
functions, so remove them.

Signed-off-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:32 -08:00
Andrew Patterson 07ae95f988 ACPI/PCI: PCI MSI _OSC support capabilities called when root bridge added
The _OSC capability OSC_MSI_SUPPORT is set when the root bridge is added
with pci_acpi_osc_support(), so we no longer need to do it in the PCI
MSI driver.  Also adds the function pci_msi_enabled, which returns true
if pci=nomsi is not on the kernel command-line.

Signed-off-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:31 -08:00
Andrew Patterson eb9188bdb9 ACPI/PCI: PCIe AER _OSC support capabilities called when root bridge added
The _OSC capability OSC_EXT_PCI_CONFIG_SUPPORT is set when the root
bridge is added with pci_acpi_osc_support(), so we no longer need to do
it in the PCIe AER driver.

Signed-off-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:30 -08:00
Andrew Patterson 3e1b16002a ACPI/PCI: PCIe ASPM _OSC support capabilities called when root bridge added
The _OSC capabilities OSC_ACTIVE_STATE_PWR_SUPPORT and
OSC_CLOCK_PWR_CAPABILITY_SUPPORT are set when the root bridge is added
with pci_acpi_osc_support(), so we no longer need to do it in the ASPM
driver.  Also add the function pcie_aspm_enabled, which returns true if
pcie_aspm=off is not on the kernel command-line.

Signed-off-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:29 -08:00
Andrew Patterson 0ef5f8f615 ACPI/PCI: PCI extended config _OSC support called when root bridge added
The _OSC capability OSC_EXT_PCI_CONFIG_SUPPORT is set when the root
bridge is added with pci_acpi_osc_support() if we can access PCI
extended config space.

This adds the function pci_ext_cfg_avail which returns true if we can
access PCI extended config space (offset greater than 0xff). It
currently only returns false if arch=x86 and raw_pci_ext_ops is not set
(which might happen if pci=nommcfg is set on the kernel command-line).

Signed-off-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:28 -08:00
Andrew Patterson 990a7ac564 ACPI/PCI: call _OSC support during root bridge discovery
Add pci_acpi_osc_support() and call it when a PCI bridge is added.  This
allows us to avoid having every individual PCI root bridge driver call
_OSC support for every root bridge in their probe functions, a
significant savings in boot time.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:27 -08:00
Benjamin Herrenschmidt d3a54014e2 PCI: Add legacy_io/mem to all busses
Currently, only PHBs get the legacy_* files, which makes it tricky for
userland to get access to the legacy space.  This commit exposes them in
every bus, since even child buses may forward legacy cycles if
configured properly.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:25 -08:00
Sheng Yang 1ca887970a PCI: Extend pci_reset_function() to support PCI Advanced Features
Some PCI devices implement PCI Advanced Features, which means they
support Function Level Reset(FLR).  Implement support for that in
pci_reset_function.

Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:25 -08:00
Sheng Yang d91cdc7455 PCI: Refactor pci_reset_function()
Separate out function level reset so that pci_reset_function can be more
easily extended.

Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:23 -08:00
Kay Sievers 1a9271331a PCI: struct device - replace bus_id with dev_name(), dev_set_name()
This patch is part of a larger patch series which will remove
the "char bus_id[20]" name string from struct device. The device
name is managed in the kobject anyway, and without any size
limitation, and just needlessly copied into "struct device".

To set and read the device name dev_name(dev) and dev_set_name(dev)
must be used. If your code uses static kobjects, which it shouldn't
do, "const char *init_name" can be used to statically provide the
name the registered device should have. At registration time, the
init_name field is cleared, to enforce the use of dev_name(dev) to
access the device name at a later time.

We need to get rid of all occurrences of bus_id in the entire tree
to be able to enable the new interface. Please apply this patch,
and possibly convert any remaining remaining occurrences of bus_id.

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-Off-By: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:23 -08:00
Jesse Barnes bfb0f330a6 PCI: fixup whitespace in quirks.c
Had a space before tab in do_fixups, prototype wasn't wrapped properly either.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:22 -08:00
Kenji Kaneshige c7b4fee380 PCI hotplug: pciehp: remove unnecessary wait after turning power off
The pciehp driver waits for 1000 msec after turning power off to make
sure the power has been completely removed. But this 1000 msec wait is
not needed if a slot doesn't implement power control because software
cannot control the power. Power will be automatically removed at adapter
removal time on such a slot

Tested-by: "Phil Endecott" <phil_pibbu_endecott@chezphil.org>
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:21 -08:00
Jesse Barnes 9eff02e204 PCI: check mmap range of /proc/bus/pci files too
/proc/bus/pci allows you to mmap resource ranges too, so we should probably be
checking to make sure the mapping is somewhat valid.  Uses the same code as the recent sysfs mmap range checking patch from Linus.

Acked-by: David Miller <davem@davemloft.net>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:20 -08:00
Inaky Perez-Gonzalez 143ee2d555 i2400m: Makefile and Kconfig
Integrate the i2400m driver into the kernel's build and Kconfig.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:22 -08:00
Inaky Perez-Gonzalez 514ec71f72 i2400m/SDIO: TX and RX path backends
Implements the backend so that the generic driver can TX/RX to/from
the SDIO device.

For RX, when data is ready the SDIO IRQ is fired and that will
allocate an skb, put all the data there and then pass it to the
generic driver RX code for processing and delivery.

TX, when kicked by the generic driver, will schedule work on a
driver-specific workqueue that pulls data from the TX FIFO and sends
it to the device until it drains it.

Thread contexts are needed as SDIO functions are blocking.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:22 -08:00
Inaky Perez-Gonzalez 020bb6f30b i2400m/SDIO: firmware upload backend
This implements the backends for the generic driver (i2400m) to be
able to load firmware to the SDIO device.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:22 -08:00
Inaky Perez-Gonzalez a0848826bf i2400m/SDIO: probe/disconnect, dev init/shutdown and reset backends
Implements probe/disconnect for the SDIO device, as well as main
backends for the generic driver to control the SDIO device
(bus_dev_start(), bus_dev_stop() and bus_reset()).

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:22 -08:00
Inaky Perez-Gonzalez 17d559af96 i2400m/SDIO: header for the SDIO subdriver
This contains the common function declaration and constants for the
SDIO driver for the 2400m Wireless WiMAX Connection and it's debug
level settings.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:22 -08:00
Inaky Perez-Gonzalez a8ebf98f54 i2400m/USB: TX and RX path backends
Implements the backend so that the generic driver can TX/RX to/from
the USB device.

TX is implemented with a kthread sitting in a never-ending loop that
when kicked by the generic driver's TX code will pull data from the TX
FIFO and send it to the device until it drains it. Then it goes back
sleep, waiting for another kick.

RX is implemented in a similar fashion, but reads are kicked in by the
device notifying in the interrupt endpoint that data is ready. Device
reset notifications are also sent via the notification endpoint.

We need a thread contexts to run USB autopm functions (blocking) and
to process the received data (can get to be heavy in processing
time).

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:21 -08:00
Inaky Perez-Gonzalez 795038107b i2400m/USB: firmware upload backend
This implements the backends for the generic driver (i2400m) to be
able to load firmware to the USB device.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:21 -08:00
Inaky Perez-Gonzalez f398e4240f i2400m/USB: probe/disconnect, dev init/shutdown and reset backends
Implements probe/disconnect for the USB device, as well as main
backends for the generic driver to control the USB device
(bus_dev_start(), bus_dev_stop() and bus_reset()).

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:21 -08:00
Inaky Perez-Gonzalez 11a7d0e314 i2400m/USB: header for the USB bus driver
This contains the common function declaration and constants for the
USB driver for the 2400m Wireless WiMAX Connection, as well as it's
debug level settings.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:21 -08:00
Inaky Perez-Gonzalez c71228caf9 i2400m: debugfs controls
Expose knobs to control the device (induce reset, power saving,
querying tx or rx stats, internal debug information and debug level
manipulation).

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:20 -08:00
Inaky Perez-Gonzalez 3a35a1d0bd i2400m: various functions for device management
This is a collection of functions used to control the device (plus a
few helpers).

There are utilities for handling TLV buffers, hooks on the device's
reports to act on device changes of state [i2400m_report_hook()], on
acks to commands [i2400m_msg_ack_hook()], a helper for sending
commands to the device and blocking until a reply arrives
[i2400m_msg_to_dev()], a few high level commands for manipulating the
device state, powersaving mode and configuration plus the routines to
setup the device once communication is established with it
[i2400m_dev_initialize()].

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:19 -08:00
Inaky Perez-Gonzalez aa5a7acabe i2400m: RX and TX data/control paths
Handling of TX/RX data to/from the i2400m device (IP packets, control
and diagnostics). On RX, this parses the received read transaction
from the device, breaks it in chunks and passes it to the
corresponding subsystems (network and control).

Transmission to the device is done through a software FIFO, as
data/control frames can be coalesced (while the device is reading the
previous tx transaction, others accumulate). A FIFO is used because at
the end it is resource-cheaper that scatter/gather over USB. As well,
most traffic is going to be download (vs upload).

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:19 -08:00
Inaky Perez-Gonzalez 467cc396fb i2400m: firmware loading and bootrom initialization
Implements the firmware loader (using the bus-specific driver's
backends for the actual upload). The most critical thing in here is
the piece that puts the device in boot-mode from any other
(undetermined) state, otherwise, it is just pushing the bytes from the
firmware file to the device.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:19 -08:00
Inaky Perez-Gonzalez ce6cde9280 i2400m: linkage to the networking stack
Implementation of the glue to the network stack so the WiMAX device
shows up as an Ethernet device.

Initially we shot for implementing a Pure IP device -- however, the
world seems to turn around Ethernet devices. Main issues were with the
ISC DHCP client and servers (as they don't understand types other than
Ethernet and Token Ring).

We proceeded to register with IANA the PureIP hw type, so that DHCP
requests could declare such. We also created patches to the main ISC
DHCP versions to support it. However, until all that permeates into
deployments, there is going to be a long time.

So we moved back to wrap Ethernet frames around the PureIP device. At
the time being this has overhead; we need to reallocate with space for
an Ethernet header. The reason is the device-to-host protocol
coalesces many network packets into a single message, so we can't
introduce Ethernet headers without overwriting valid data from other
packets.

Coming-soon versions of the firmware have this issue solved.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:18 -08:00
Inaky Perez-Gonzalez 024f7f31ed i2400m: Generic probe/disconnect, reset and message passing
Implements the generic probe and disconnect functions that will be
called by the USB and SDIO driver's probe/disconnect functions.

Implements the backends for the WiMAX stack's basic operations:
message passing, rfkill control and reset.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:18 -08:00
Inaky Perez-Gonzalez ea24652d25 i2400m: host/device procotol and core driver definitions
The wimax/i2400m.h defines the structures and constants for the
host-device protocols:

 - boot / firmware upload protocol

 - general data transport protocol

 - control protocol

It is done in such a way that can also be used verbatim by user space.

drivers/net/wimax/i2400m.h defines all the APIs used by the core,
bus-generic driver (i2400m) and the bus specific drivers
(i2400m-BUSNAME). It also gives a roadmap to the driver
implementation.

debug-levels.h adds the core driver's debug settings.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:18 -08:00
Greg Kroah-Hartman 5aa637505f USB: add siemens_mpi usb-serial "stub" driver
This driver got rescued from a few years ago and was requested to be
added.  So I cleaned it up, ported it to the latest kernel version and
here it is.

Cc: Thomas Hergenhahn <thomas.hergenhahn@suse.de>
Cc: Emmanuele <iemmav@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:13 -08:00
Greg Kroah-Hartman 57262b82d6 USB: add new opticon serial driver
This is for the serial mode of the Opticon barcode scanner.

Cc: Kees Stoop <kees.stoop@opticon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:13 -08:00
Marcin Slusarz 327d74f6b6 USB: emi26: fix oops on load
Fix oops introduced by commit ae93a55bf9
(emi26: use request_firmware()):

usb 1-1: new full speed USB device using uhci_hcd and address 2
usb 1-1: configuration #1 chosen from 1 choice
emi26 - firmware loader 1-1:1.0: emi26_probe start
usb 1-1: firmware: requesting emi26/loader.fw
usb 1-1: firmware: requesting emi26/bitstream.fw
usb 1-1: firmware: requesting emi26/firmware.fw
usb 1-1: emi26_set_reset - 1
usb 1-1: emi26_set_reset - 0
BUG: unable to handle kernel NULL pointer dereference at 00000000
IP: [<f80dc487>] emi26_probe+0x2f7/0x620 [emi26]
*pde = 00000000
Oops: 0000 [#1] SMP
last sysfs file: /sys/devices/pci0000:00/0000:00:1d.0/usb1/1-1/firmware/1-1/loading
Modules linked in: emi26(+) ipv6 cpufreq_ondemand coretemp arc4 ecb iwl3945 irtty_sir sir_dev nsc_ircc ehci_hcd uhci_hcd mac80211 irda usbcore snd_hda_intel thinkpad_acpi rfkill hwmon led_class e1000e snd_pcm cfg80211 snd_timer crc_ccitt snd snd_page_alloc aes_generic

Pid: 5082, comm: modprobe Not tainted (2.6.28 #2) 17023QG
EIP: 0060:[<f80dc487>] EFLAGS: 00010206 CPU: 0
EIP is at emi26_probe+0x2f7/0x620 [emi26]
EAX: 0000015c EBX: 00000000 ECX: c1ffd9c0 EDX: 00000000
ESI: 0000015c EDI: f6bb215c EBP: f6bb0400 ESP: f00ebcfc
 DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
Process modprobe (pid: 5082, ti=f00ea000 task=f5c7c700 task.ti=f00ea000)
Stack:
 0000015c 000000a5 f6a67cb8 f80dc7e0 c01c6262 fbef2986 f6bb2000 00008fe0
 0000015c f715f748 f715f740 f715f738 f715f748 f6a67c00 f80dd040 f80dcfc0
 f6bb0400 fbacb290 f6a67c94 fbae0160 c01c70bf 00000000 f6a67c1c 00000000
Call Trace:
 [<c01c6262>] sysfs_add_one+0x12/0x50
 [<fbacb290>] usb_probe_interface+0xa0/0x140 [usbcore]
 [<c01c70bf>] sysfs_create_link+0xf/0x20
 [<c02dead2>] driver_probe_device+0x82/0x180
 [<fbac9eeb>] usb_match_id+0x3b/0x50 [usbcore]
 [<c02dec4e>] __driver_attach+0x7e/0x80
 [<c02de27a>] bus_for_each_dev+0x3a/0x60
 [<c02de956>] driver_attach+0x16/0x20
 [<c02debd0>] __driver_attach+0x0/0x80
 [<c02de7b1>] bus_add_driver+0x1a1/0x220
 [<c02dee4d>] driver_register+0x4d/0x120
 [<c024e622>] idr_get_empty_slot+0xf2/0x290
 [<fbacab71>] usb_register_driver+0x81/0x100 [usbcore]
 [<f806c000>] emi26_init+0x0/0x14 [emi26]
 [<c0101126>] do_one_initcall+0x36/0x1b0
 [<c01c5e70>] sysfs_ilookup_test+0x0/0x10
 [<c0197a61>] ifind+0x31/0x90
 [<c01c6229>] __sysfs_add_one+0x59/0x80
 [<c01c64e4>] sysfs_addrm_finish+0x14/0x1c0
 [<c0175ca3>] __vunmap+0xa3/0xd0
 [<c014b854>] load_module+0x1544/0x1640
 [<c014b9d7>] sys_init_module+0x87/0x1b0
 [<c0187f41>] sys_read+0x41/0x70
 [<c01032a5>] sysenter_do_call+0x12/0x21
 [<c03d0000>] wait_for_common+0x40/0x110
Code: 66 c1 e8 08 66 09 d0 75 a5 31 d2 89 e8 e8 72 fc ff ff 85 c0 0f 88 9a 02 00 00 b8 fa 00 00 00 e8 30 46 05 c8 8b 74 24 28 8b 5e 04 <8b> 03 89 44 24 1c 0f c8 89 44 24 1c 0f b7 4b 04 c7 44 24 20 00
EIP: [<f80dc487>] emi26_probe+0x2f7/0x620 [emi26] SS:ESP 0068:f00ebcfc
---[ end trace 2eefa13825431230 ]---

After the last "package" of firmware data is sent to the device, we dereference
NULL pointer (on access to rec->addr). Fix it.

Reported--by: David Flatz <david@upcs.at>
Tested-by: David Flatz <david@upcs.at>
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: stable <stable@kernel.org> [2.6.27, 2.6.28]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:13 -08:00
SangSu Park 32e7fea282 USB: Fix goku_udc usb speed handling
The usb gadget framework revealed weakness in the godu_udc
gadget driver register function. Instead of checking if
speed asked for was USB_LOW_SPEED upon usb_gadget_register()
to deny service, it checked only for USB_FULL_SPEED, thus
denying service to usb high speed capable gadgets.

Signed-off-by: SangSu Park <sangsu@gmail.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:13 -08:00
Mark Lord ed0c7720d2 USB: fix minor nit in usbfs checking
One minor nit did show up, though.  The patch below
seems to make more sense than the code does without it.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:13 -08:00
Alan Stern 2caf7fcdb8 USB: re-enable interface after driver unbinds
This patch (as1197) fixes an error introduced recently.  Since a
significant number of devices can't handle Set-Interface requests, we
no longer call usb_set_interface() when a driver unbinds from an
interface, provided the interface is already in altsetting 0.  However
the interface still does get disabled, and the call to
usb_set_interface() was the only thing re-enabling it.  Since the
interface doesn't get re-enabled, further attempts to use it fail.

So the patch adds a call to usb_enable_interface() when a driver
unbinds and the interface is in altsetting 0.  For this to work
right, the interface's endpoints have to be re-enabled but their
toggles have to be left alone.  Therefore an additional argument is
added to usb_enable_endpoint() and usb_enable_interface(), a flag
indicating whether or not the endpoint toggles should be reset.

This is a forward-ported version of a patch which fixes Bugzilla
#12301.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: David Roka <roka@dawid.hu>
Reported-by: Erik Ekman <erik@kryo.se>
Tested-by: Erik Ekman <erik@kryo.se>
Tested-by: Alon Bar-Lev <alon.barlev@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:13 -08:00
Alan Stern df718962bf USB: cancel pending Set-Config requests if userspace gets there first
This patch (as1195) eliminates a potential problem identified by
Oliver Neukum.  When a driver queues an asynchronous Set-Config
request using usb_driver_set_configuration(), the request should be
cancelled if userspace changes the configuration first.  The patch
introduces a linked list of pending async Set-Config requests, and
uses it to invalidate the requests for a particular device whenever
that device's configuration is set.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:12 -08:00
Alan Stern 6fd9086a51 USB: automatically enable wakeup for PCI host controllers
This patch (as1193b) enables wakeup during initialization for all PCI
host controllers, and it removes some code (and comments!) that are no
longer needed now that the PCI core automatically initializes wakeup
settings for all new devices.

The idea is that the bus should initialize wakeup, and the bus glue
or controller driver should enable it.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:12 -08:00
Alan Stern a0d4922da2 USB: fix up suspend and resume for PCI host controllers
This patch (as1192) rearranges the USB PCI host controller suspend and
resume and resume routines:

	Use pci_wake_from_d3() for enabling and disabling wakeup,
	instead of pci_enable_wake().

	Carry out the actual state change while interrupts are
	disabled.

	Change the order of the preparations to agree with the
	general recommendation for PCI devices, instead of
	messing around with the wakeup settings while the device
	is in D3.

		In .suspend:
			Call the underlying driver to disable IRQ
				generation;
			pci_wake_from_d3(device_may_wakeup());
			pci_disable_device();

		In .suspend_late:
			pci_save_state();
			pci_set_power_state(D3hot);
			(for PPC_PMAC) Disable ASIC clocks

		In .resume_early:
			(for PPC_PMAC) Enable ASIC clocks
			pci_set_power_state(D0);
			pci_restore_state();

		In .resume:
			pci_enable_device();
			pci_set_master();
			pci_wake_from_d3(0);
			Call the underlying driver to reenable IRQ
				generation

	Add the necessary .suspend_late and .resume_early method
	pointers to the PCI host controller drivers.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:12 -08:00
Alan Stern a81a81a25d USB: storage: set CAPACITY_HEURISTICS flag for bad vendors
This patch (as1194) makes usb-storage set the CAPACITY_HEURISTICS flag
for all devices made by Nokia, Nikon, or Motorola.  These companies
seem to include the READ CAPACITY bug in all of their devices.

Since cell phones and digital cameras rely on flash storage, which
always has an even number of sectors, setting CAPACITY_HEURISTICS
shouldn't cause any problems.  Not even if the companies wise up and
start making devices without the bug.

A large number of unusual_devs entries are now unnecessary, so the
patch removes them.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:12 -08:00
Alan Stern c838ea4626 USB: storage: make the "quirks=" module parameter writable
This patch (as1190) makes usb-storage's "quirks=" module parameter
writable, so that users can add entries for their devices at runtime
with no need to reboot or reload usb-storage.

New codes are added for the SANE_SENSE, CAPACITY_HEURISTICS, and
CAPACITY_OK flags.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:12 -08:00
Alan Stern 25ff1c316f USB: storage: add last-sector hacks
This patch (as1189b) adds some hacks to usb-storage for dealing with
the growing problems involving bad capacity values and last-sector
accesses:

	A new flag, US_FL_CAPACITY_OK, is created to indicate that
	the device is known to report its capacity correctly.  An
	unusual_devs entry for Linux's own File-backed Storage Gadget
	is added with this flag set, since g_file_storage always
	reports the correct capacity and since the capacity need
	not be even (it is determined by the size of the backing
	file).

	An entry in unusual_devs.h which has only the CAPACITY_OK
	flag set shouldn't prejudice libusual, since the device will
	work perfectly well with either usb-storage or ub.  So a
	new macro, COMPLIANT_DEV, is added to let libusual know
	about these entries.

	When a last-sector access succeeds and the total number of
	sectors is odd (the unexpected case, in which guessing that
	the number is even might cause trouble), a WARN is triggered.
	The kerneloops.org project will collect these warnings,
	allowing us to add CAPACITY_OK flags for the devices in
	question before implementing the default-to-even heuristic.
	If users want to prevent the stack dump produced by the WARN,
	they can disable the hack by adding an unusual_devs entry
	for their device with the CAPACITY_OK flag.

	When a last-sector access fails three times in a row and
	neither the FIX_CAPACITY nor the CAPACITY_OK flag is set,
	we assume the last-sector bug is present.  We replace the
	existing status and sense data with values that will cause
	the SCSI core to fail the access immediately rather than
	retry indefinitely.  This should fix the difficulties
	people have been having with Nokia phones.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:11 -08:00
David Brownell 9ebd961664 USB: otg: twl4030 transceiver driver
Add driver for the high speed USB-OTG transceiver in TI's TWL4030
family of chips.

Given this and various other pending patches, OMAP3 hardware like
that from beagleboard.org, gumstix.com (Overo), and openpandora.org
should now have basic USB host and peripheral connectivity with
mainline kernels.  Ditto for less widely-available boards.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:11 -08:00
Darius Augulis 2a4f136fbd USB: add imx udc gadget driver
Implementation of USB device driver integrated in Freescale's i.MXL
processor.

Adds USB device driver for i.MXL.

Signed-off-by: Darius Augulis <augulis.darius@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:11 -08:00
Oliver Neukum 856395d6e1 USB: extension of anchor API to unpoison an anchor
This extension allows unpoisoning an anchor allowing drivers that
resubmit URBs to reuse an anchor for methods like resume()

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:11 -08:00
Thomas Hommel 42c65396d4 USB: isp1760: don't auto disable Port1 on ISP1761
There is no need to disable port 1 on ISP1761. That port could
be used as an OTG port which would require a different init
sequence. However we don't have OTG support (yet) so we can use
it as a normal USB port.
This patch allows port 1 to be used a normal Port on the ISP1761.

Signed-off-by: Thomas Hommel <Thomas.Hommel@gefanuc.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:09 -08:00
Dan Williams 281b064f23 USB: unusual dev for Option N.V. ZeroCD modems
Many newer Option mobile broadband devices initially provide a
usb-storage "driver CD" device that's pretty useless on Linux since
any software on it most likely wouldn't be compatible with your
kernel or distro anyway.  Thus, by default just kill the driver
CD device by sending the SCSI 'rezero' command, but allow override
of the default behavior via usb-storage module parameter so users
can keep the ZeroCD device if they really want to.  Inspired by
the Sierra TruInstall patch.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Cc: Peter Henn <p.henn@option.com
Cc: Denis Joseph Barrow <D.Barow@option.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:09 -08:00
Ming Lei 49367d8f1d USB: mark "reject" field of struct urb as atomic_t
It is enough to protect accesses to reject field of urb
by marking it as atomic_t,also it is the only reason of
existence of usb_reject_lock,so remove the lock to make
code more clean.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Acked-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:08 -08:00
Alan Stern 3b23dd6f8a USB: utilize the bus notifiers
This patch (as1185) makes usbcore take advantage of the bus
notifications sent out by the driver core.  Now we can create all our
device and interface attribute files before the device or interface
uevent is broadcast.

A side effect is that we no longer create the endpoint "pseudo"
devices at the same time as a device or interface is registered -- it
seems like a bad idea to try registering an endpoint before the
registration of its parent is complete.  So the routines for creating
and removing endpoint devices have been split out and renamed, and
they are called explicitly when needed.  A new bitflag is used for
keeping track of whether or not the interface's endpoint devices have
been created, since (just as with the interface attributes) they vary
with the altsetting and hence can be changed at random times.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:08 -08:00
Wu Fengguang b9cef6c319 USB: make printk messages more searchable
USB: make printk messages more searchable

Make USB printk messages long and straightforward.  One of these
decorated USB error messages cost me non-trivial efforts to locate.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:08 -08:00
Bryan Wu e22b582e91 USB: musb: Kill some compiling warning in musb Blackfin part
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:08 -08:00
Bryan Wu 7833414d4f USB: musb: Blackfin provides read/write I/O accessor in header files
Don't redefine the functions in musb driver

Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:08 -08:00
Bryan Wu 085ad4067b USB: musb: add Blackfin Kconfig options and Makefile
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:08 -08:00
Bryan Wu c6cf8b003e USB: musb: add Blackfin specific configuration to MUSB
Some config registers are not avaiable in Blackfin, we have to comment them out.

v1-v2:
 - remove Blackfin specific header file
 - add Blackfin register version to musb_regs.h header file

Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:07 -08:00
Bryan Wu 6995eb68aa USB: musb: enable low level DMA operation for Blackfin
- DMA registers in Blackfin have different layout
- DMA interrupt flags need to be cleared by software

Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:07 -08:00
Bryan Wu 2c557a4a98 USB: musb: add Blackfin version low level register accessing helper functions
add Blackfin version low level register accessing helper functions

Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:07 -08:00
Robin Getz d426e60dbf USB: musb: Make sure we program the correct values in only when necessary.
Make sure we program the correct values in only when necessary.

Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:07 -08:00
Bryan Wu 0c6a881844 USB: musb: add Blackfin driver to MUSB framework (v2)
- replace MUSB_FIFOSIZE register to MUSB_TXCOUNT, cause no MUSB_FIFOSIZE
   register on Blackfin
- use #ifdef to replace #if defined()

Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:07 -08:00
Alan Stern c20b15fde5 USB: usb-storage: merge DPCM support into SDDR09
The DPCM subdriver is a little peculiar, in that it's meant to support
devices where LUN 0 is Compact Flash and uses the CB transport whereas
LUN 1 is SmartMedia and uses the SDDR09 transport.  Thus DPCM isn't
really a transport in itself; it's more like a demultiplexer.

Much of the DPCM code is part of the SDDR09 subdriver already, and the
remaining part is fairly small.  This patch (as1182) moves that extra
piece into sddr09.c, thereby eliminating dpcm.c.  Also eliminated is
the Kconfig entry for DPCM support; it is now listed as part of the
SDDR09 entry.

In order to make sure that the semantics are the same as before, each
unusual_devs entry for DPCM is now present twice: once with DPCM
support if SDDR09 is configured (as before), and once with the
SINGLE_LUN flag and CB support otherwise.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:06 -08:00
Greg Kroah-Hartman f1632df36b USB: option: increase outgoing buffer size and number
This should speed up the option driver's upload speed quite a bit.  It has been tested by a number of different people on different devices with success.

Cc: Roland Wolters <roland.wolters@credativ.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:06 -08:00
Greg Kroah-Hartman 50de36f7af USB: serial: fix up urb->status usage
Some of the usb-serial drivers are starting to use urb->status in ways
they should not be doing.  This fixes up some of them to prevent that.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:06 -08:00
Karl Bongers 6013bbbab0 USB: isp1760: Fix probe in PCI glue code
Contains fixes so probe on x86 PCI runs, apparently I'm first to try
this. Several fixes to memory access to probe host scratch register.
Previously would bug check on chip_addr var used uninitialized.
Scratch reg write failed in one instance due to 16-bit initial access
mode, so added "& 0x0000ffff" to the readl as fix.
Includes some general cleanup - remove global vars, organize memory map
resource use.

Signed-off-by: Karl Bongers <kbongers@jged.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:04 -08:00
Sebastian Andrzej Siewior 6c0735687d USB: isp1760: use a specific PLX bridge instead of any bdridge
this driver can't handle (of course) any brdige class devices. So we
now are just active on one specific bridge which should be only the
isp1761 chip behind a PLX bridge.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Tested-by: Karl Bongers <kblists08@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:04 -08:00
Felipe Balbi 889394b1eb USB: gadget: don't wait for completion twice
In some obscure scenarios e.g. passing a 0-byte backing file
storage, wait_for_completion() would wait forever in fsg_cleanup().

Prevent it by completing the thread in fsg_bind() error path.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:03 -08:00
Roel Kluin 619b572ae2 USB: serial: usb_debug: Make static
Sparse asked whether these could be static.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:03 -08:00
Alan Stern 65bfd2967c USB: Enhance usage of pm_message_t
This patch (as1177) modifies the USB core suspend and resume
routines.  The resume functions now will take a pm_message_t argument,
so they will know what sort of resume is occurring.  The new argument
is also passed to the port suspend/resume and bus suspend/resume
routines (although they don't use it for anything but debugging).

In addition, special pm_message_t values are used for user-initiated,
device-initiated (i.e., remote wakeup), and automatic suspend/resume.
By testing these values, drivers can tell whether or not a particular
suspend was an autosuspend.  Unfortunately, they can't do the same for
resumes -- not until the pm_message_t argument is also passed to the
drivers' resume methods.  That will require a bigger change.

IMO, the whole Power Management framework should have been set up this
way in the first place.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:03 -08:00
Alan Stern 4ec06d6296 USB: utilize round_jiffies_up_relative()
This patch (as1178) uses the new round_jiffies_up_relative() routine
for setting the autosuspend delayed_work timer.  It's appropriate
since we don't care too much about the exact length of the delay, but
we don't want it to be too short (rounded down).

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:03 -08:00
Tony Lindgren 3cb22d6586 USB: otg: sharable otg transceiver ops
Move otg_get/set/put_transceiver() from omap specific code
to common otg.c so other upcoming drivers can share them.

[ dbrownell@users.sourceforge.net: move to drivers/usb/otg, dox ]

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Felipe Balbi <me@felipebalbi.com>
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:03 -08:00
Philipp Zabel 68144e0cc9 USB: otg: add otg_put_transceiver()
As Russell King points out, calling put_device(otg_transceiver->dev)
directly in driver cleanup paths makes assumptions about otg_transceiver
internals.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:02 -08:00
Philipp Zabel 6084f1bf0c USB: otg: gpio_vbus transceiver stub
gpio_vbus provides simple GPIO VBUS sensing for peripheral
controllers with an internal transceiver.
Optionally, a second GPIO can be used to control D+ pullup.

It also interfaces with the regulator framework to limit charging
currents when powered via USB. gpio_vbus requests the regulator
supplying "vbus_draw" and can enable/disable it or limit its
current depending on USB state.

[dbrownell@users.sourceforge.net: use drivers/otg, cleanups ]

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:02 -08:00
David Brownell b8da8677d4 USB: move isp1301_omap to drivers/usb/otg
This moves the isp1301-omap driver from the drivers/i2c/chips
directory (which will be shrinking) into a new drivers/usb/otg
directory (which will grow, with more drivers and utilities).

Note that OTG infrastructure needs to be initialized before
either host or peripheral side USB support, and may be needed
before for pure host or pure peripheral configurations.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:02 -08:00
Ben Dooks ea99ecfdc8 USB: gadget: s3c2410_udc uses standard GPIO calls
Change the gpio code in the s3c2410_udc to use the
generic gpio calls instead of the s3c24xx specific
gpio functions.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:02 -08:00
David Brownell b40fc2a256 USB: gadget: pxa25x_udc vbus sense initialization
Some code in the pxa25x_udc driver wrongly expects the value
of is_vbus_present() to be 0/1, not zero/nonzero ... cope.
Issue noted by Jaya Kumar <jayakumar.lkml@gmail.com>

This bug has been around since July 2007, and has a simple
workaround:  unplug the Linux gadget, then re-plug it.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Jaya Kumar <jayakumar.lkml@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:02 -08:00
Felipe Balbi c48a515525 USB: musb: check if set_irq_wake succeded and remember it
Without it, in platforms that don't provide irq_chip.set_wake(),
like omap, musb will WARN() on driver removal.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:01 -08:00
David Brownell bb1c9ef1b4 USB: musb: host side diagnostics tweaks
Random host-side MUSB updates, mostly relating to better diagnostics:

 + Improve diagnostics on host side:
    - tx flush fifo:
       * Avoid hundreds of duplicate TX FIFONOTEMPTY messages
       * make "Can't flush TX fifo" a warning, and say which endpoint
    - giveback:
       * use correct status code
       * show completion function name not just URB pointer
    - Fix annoying "1 bytes" (should be "1 byte")

 + Be more consistent about failing init of unusable fifo_mode

It's not clear why that "can't flush TX fifo" message appears, though
it might relate to disconnection; I see it not infrequently

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:59 -08:00
David Brownell 71783e0def USB: musb: minor locking fix
Minor locking fix for musb_hdrc on OMAP3 and OMAP2430:
don't read DEVCTL without holding the spinlock, since
an IRQ could come in and corrupt things.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:59 -08:00
Kevin Hilman 58e660266d USB: musb: build fixes for DaVinci
- update includes after asm/arch --> mach headers move
- adds musb_platform_set_mode() stub

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:58 -08:00
David Brownell 96a274d1da USB: musb: sysfs mode updates
Fix three omissions in the "mode" sysfs attribute support:
  (a) inability to report errors;
  (b) no DaVinci support ... just report an error;
  (c) for omap2430, accepting unsupportable values

The 2430 stuff is still odd....

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:58 -08:00
David Lopo aa69a8093f USB: gadget: MIPS ci13xxx_udc
MIPS USB IP core family device controller
Currently it only supports IP part number CI13412.

[dbrownell@users.sourceforge.net: minor comment tweaks]

Signed-off-by: David Lopo <dlopo@chipidea.mips.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:58 -08:00
Julia Lawall bb9496c6f7 USB: gadget: change simple_strtol to simple_strtoul
Since num is unsigned, it would seem better to use simple_strtoul that
simple_strtol.

A simplified version of the semantic patch that makes this change is as
follows: (http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r2@
long e;
position p;
@@

e = simple_strtol@p(...)

@@
position p != r2.p;
type T;
T e;
@@

e = 
- simple_strtol@p
+ simple_strtoul
  (...)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:58 -08:00
Rusty Russell 785895ff1f USB: Don't use __module_param_call; use core_param.
Impact: cleanup

Found this when I changed args to __module_param_call.  We now have
core_param for exactly this, but Greg assures me "nousb" is used as a
module parameter, so we need the #ifdef MODULE.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:58 -08:00
Alan Stern 96983d2d86 USB: storage: set bounce limit for non-DMA-capable host controllers
This patch (as1175) makes usb-storage set a SCSI device's
request-queue bounce limit such that all buffers will be located in
addressable memory (i.e., not in high memory) if the host controller's
dma_mask is NULL.  This is necessary when the host controller doesn't
support DMA: If a buffer is in high memory then the both the virtual
and DMA addresses produced by the scatter-gather library will be NULL,
preventing the HCD from accessing the buffer's data.

In particular, the isp1760 driver needs this when used on a system
with more than 1 GB of memory.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Tested-by: Thomas Hommel <Thomas.Hommel@gefanuc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:57 -08:00
Alan Stern 3dae534531 USB: usb-storage: merge ATAPI and QIC-157 protocol routines
This patch (as1174) merges usb-storage's QIC-157 and ATAPI protocol
routines.  Since the two functions are identical, there's no reason to
keep them separate.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:57 -08:00
Alan Stern 64648a9dc4 USB: usb-storage: merge CB and CBI transport routines
This patch (as1173) merges usb-storage's CB and CBI transports into a
single routine.  So much of their code is common, it's silly to keep
them separate.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:57 -08:00
Alan Stern 12aae68a20 USB: g_file_storage: add CD-ROM emulation
This patch (as1172) adds the ability to emulate a CD-ROM drive to
g_file_storage.  The emulation is limited, since it presents as a disc
containing a single data track and no audio tracks.  Still, it may
come in useful on occasion.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:57 -08:00
Ben Efros dbe6e0c023 USB: storage: Flag devices known to support SANE_SENSE
Add a few devices known to have support for larger sense buffers.
Supporting SANE_SENSE does not necessarily mean SAT-1 or SAT-2 is fully
supported.

Depends on SANE_SENSE patch [1].  Incorporates the Maxtor and Western
Digital devices originally submitted by Matthieu CASTET [2]. 

[1] https://lists.one-eyed-alien.net/pipermail/usb-storage/2008-November/004181.html
[2] http://marc.info/?l=linux-usb&m=121762869915609&w=2

Signed-off-by: Ben Efros <ben@pc-doctor.com>
Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:57 -08:00
Ben Efros 1537e0ad94 USB: storage devices and SAT
Add the SANE SENSE flag to indicate that a device is capable of handling
more than 18-bytes of sense data.  This functionality is required for
USB-ATA bridges implementing SAT.  A future patch will actually enable this
function for several devices.

The logic behind this is that we can detect support for SANE_SENSE in a few ways:
 1) ATA PASS THROUGH (12) or (16) execute successfully
 2) SPC-3 or higher is in use
 3) A previous CHECK CONDITION occurred with sense format 70-73 and had
    a length greater than 18-bytes total

Signed-off-by: Ben Efros <ben@pc-doctor.com>
Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:55 -08:00
Alan Stern a658367dae USB: usb-storage: remove us->sensebuf
This patch (as1171) removes us->sensebuf, since it isn't used anywhere.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:54 -08:00
Alan Stern f9dc8f99e5 usb-storage: clean up unusual_devs.h
This patch (as1170) removes some duplicate entries in unusual_devs.h
and rearranges a few others to put the list in proper numerical order.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:54 -08:00
Alan Stern 6cd132015d USB: announce new devices earlier
This patch (as1166) changes usb_new_device().  Now new devices will be
announced in the log _prior_ to being registered; this way the "new
device" lines will appear before all the output from driver probing,
which seems much more logical.

Also, the patch adds a call to usb_stop_pm() to the failure pathway,
so that the parent's count of unsuspended children will remain correct
if registration fails.  In order for this to work properly, the code
to increment that count has to be moved forward, before the first
point where a failure can occur.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:54 -08:00
Pete Zaitcev f150fa1afb USB: Allow usbmon as a module even if usbcore is builtin
usbmon can only be built as a module if usbcore is a module too. Trivial
changes to the relevant Kconfig and Makefile (and a few trivial changes
elsewhere) allow usbmon to be built as a module even if usbcore is
builtin.

This is verified to work in all 9 permutations (3 correctly prohibited
by Kconfig, 6 build a suitable result).

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:54 -08:00
Qinghuang Feng 5e5b0e5d6a USB: serial: ipw.c: mark {__init|__exit} for usb_ipw_{init|exit}
mark {__init|__exit} for usb_ipw_{init|exit} ()

Signed-off-by: Qinghuang Feng <qhfeng.kernel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:54 -08:00
Qinghuang Feng 1c53e6cb80 USB: gadget: pxa27x_udc.c: cleanup kernel-doc
no argument named @index in pio_irq_disable, and
no argument named @req in inc_ep_stats_bytes,
remove them.

Signed-off-by: Qinghuang Feng <qhfeng.kernel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:54 -08:00
Magnus Damm 0a2e5b9b8a USB: m66592 and r8a66597 resource changes
Use the more common platform_get_resource() together with index instead
of depending on the resource name and platform_get_resource_by_name().
Replace the resource_len() implementation with resource_size().

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:53 -08:00
Jean Delvare 3a407e7391 USB: Convert ohci-pnx4008 to a new-style i2c driver
The legacy i2c binding model will go away soon, convert ohci-pnx4008
to use the new binding model instead.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:53 -08:00
Inaky Perez-Gonzalez dc023dceec USB: Introduce usb_queue_reset() to do resets from atomic contexts
This patch introduces a new call to be able to do a USB reset from an
atomic contect. This is quite helpful in USB callbacks to handle
errors (when the only thing that can be done is to do a device
reset).

It is done queuing a work struct that will do the actual reset. The
struct is "attached" to an interface so pending requests from an
interface are removed when said interface is unbound from the driver.

The call flow then becomes:

usb_queue_reset_device()
  __usb_queue_reset_device() [workqueue]
    usb_reset_device()

usb_probe_interface()
  usb_cancel_queue_reset()      [error path]

usb_unbind_interface()
  usb_cancel_queue_reset()

usb_driver_release_interface()
  usb_cancel_queue_reset()

Note usb_cancel_queue_reset() needs smarts to try not to unqueue when
it is actually being executed. This happens when we run the reset from
the workqueue: usb_reset_device() is called and on interface unbind
time, usb_cancel_queue_reset() would be called. That would deadlock on
cancel_work_sync(). To avoid that, we set (before running
usb_reset_device()) usb_intf->reset_running and clear it inmediately
after returning.

Patch is against 2.6.28-rc2 and depends on
http://marc.info/?l=linux-usb&m=122581634925308&w=2 (as submitted by
Alan Stern).

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:53 -08:00
Alan Stern 9ac39f28b5 USB: add asynchronous autosuspend/autoresume support
This patch (as1160b) adds support routines for asynchronous autosuspend
and autoresume, with accompanying documentation updates.  There
already are several potential users of this interface, and others are
likely to arise as autosuspend support becomes more widespread.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:53 -08:00
Alan Stern d4f373e57d USB: usb-storage: add "quirks=" module parameter
This patch (as1163b) adds a "quirks=" module parameter to usb-storage.
This will allow people to make short-term changes to their
unusual_devs list without rebuilding the entire driver.  Testing will
become much easier, and less-sophisticated users will be able to
access their buggy devices after a simple config-file change instead
of having to wait for a new kernel release.

The patch also adds a documentation entry for usb-storage's
"delay_use" parameter, which has been around for years but but was
never listed among the kernel parameters.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:53 -08:00
Kay Sievers 74c71ebd8d oxu210hp-hcd.c: struct device - replace bus_id with dev_name(), dev_set_name()
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:52 -08:00
Kay Sievers 427c4f3334 usb: struct device - replace bus_id with dev_name(), dev_set_name()
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:52 -08:00
Vitaly Bordug 796bcae736 USB: powerpc: Workaround for the PPC440EPX USBH_23 errata [take 3]
A published errata for ppc440epx states, that when running Linux with
both EHCI and OHCI modules loaded, the EHCI module experiences a fatal
error when a high-speed device is connected to the USB2.0, and
functions normally if OHCI module is not loaded.

There used to be recommendation to use only hi-speed or full-speed
devices with specific conditions, when respective module was unloaded.
Later, it was observed that ohci suspend is enough to keep things
going, and it was turned into workaround, as explained below.

Quote from original descriprion:

The 440EPx USB 2.0 Host controller is an EHCI compliant controller.  In
USB 2.0 Host controllers, each EHCI controller has one or more companion
controllers, which may be OHCI or UHCI.  An USB 2.0 Host controller will
contain one or more ports.  For each port, only one of the controllers
is connected at any one time. In the 440EPx, there is only one OHCI
companion controller, and only one USB 2.0 Host port.
All ports on an USB 2.0 controller default to the companion
controller.  If you load only an ohci driver, it will have control of
the ports and any deviceplugged in will operate, although high speed
devices will be forced to operate at full speed.  When an ehci driver
is loaded, it explicitly takes control of the ports.  If there is a
device connected, and / or every time there is a new device connected,
the ehci driver determines if the device is high speed or not.  If it
is high speed, the driver retains control of the port.  If it is not,
the driver explicitly gives the companion controller control of the
port.

The is a software workaround that uses
Initial version of the software workaround was posted to
linux-usb-devel:

http://www.mail-archive.com/linux-usb-devel@lists.sourceforge.net/msg54019.html

and later available from amcc.com:
http://www.amcc.com/Embedded/Downloads/download.html?cat=1&family=15&ins=2

The patch below is generally based on the latter, but reworked to
powerpc/of_device USB drivers, and uses a few devicetree inquiries to
get rid of (some) hardcoded defines.

Signed-off-by: Vitaly Bordug <vitb@kernel.crashing.org>
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:52 -08:00
Anton Vorontsov cd40c4c45e USB: fsl_qe_udc: Check for muram allocation errors
The QE UDC doesn't check for cpm_muram_alloc() return values, this
might cause all sorts of misbehaviour when cpm_muram_alloc() failed
to allocate the muram memory.

While at at, change few dev_dbg() calls to dev_err(), so that the
driver would not die silently.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:52 -08:00
Alan Stern 011b15df46 USB: change interface to usb_lock_device_for_reset()
This patch (as1161) changes the interface to
usb_lock_device_for_reset().  The existing interface is apparently not
very clear, judging from the fact that several of its callers don't
use it correctly.  The new interface always returns 0 for success and
it always requires the caller to unlock the device afterward.

The new routine will not return immediately if it is called while the
driver's probe method is running.  Instead it will wait until the
probe is over and the device has been unlocked.  This shouldn't cause
any problems; I don't know of any cases where drivers call
usb_lock_device_for_reset() during probe.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:52 -08:00