]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/log
linux-2.6-omap-h63xx.git
15 years agoACPICA: Add namespace node to operand object union
Bob Moore [Sat, 27 Sep 2008 02:22:09 +0000 (10:22 +0800)]
ACPICA: Add namespace node to operand object union

Add ACPI_NAMESPACE_NODE to the ACPI_OPERAND_OBJECT in order to
simplify code that accepts both of these objects. A common type
field is used to differentiate them.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPICA: Remove obsolete debug levels (WARN and ERROR)
Bob Moore [Sun, 28 Sep 2008 07:00:47 +0000 (15:00 +0800)]
ACPICA: Remove obsolete debug levels (WARN and ERROR)

Removed ACPI_DB_WARN and ACPI_DB_ERROR. These debug levels were
made obsolete by the ACPI_WARNING and ACPI_ERROR/ACPI_EXCEPTION
interfaces.  Also added ACPI_DB_EVENTS to correspond with the
existing ACPI_LV_EVENTS.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPI: replace ACPI_DEBUG_PRINT((ACPI_DB_ERROR, ...) with printk
Lin Ming [Sun, 28 Sep 2008 06:51:56 +0000 (14:51 +0800)]
ACPI: replace ACPI_DEBUG_PRINT((ACPI_DB_ERROR, ...) with printk

ACPI_DB_ERROR and ACPI_DB_WARN were removed from ACPICA core.
So replace ACPI_DEBUG_PRINT((ACPI_DB_ERROR, ...) with printk(KERN_ERR PREFIX ...)
and ACPI_DEBUG_PRINT((ACPI_DB_WARN, ...) with printk(KERN_WARNING PREFIX ...)

We do not use ACPI_ERROR/ACPI_WARNING since they're not exported, see
-------------------------------------------------------------
commit 6468463abd7051fcc29f3ee7c931f9bbbb26f5a4
Author: Len Brown <len.brown@intel.com>
Date:   Mon Jun 26 23:41:38 2006 -0400

    ACPI: un-export ACPI_ERROR() -- use printk(KERN_ERR...)

Signed-off-by: Len Brown <len.brown@intel.com>
-------------------------------------------------------------

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPICA: add preemption point after each opcode parse
Alexey Starikovskiy [Thu, 25 Sep 2008 17:40:30 +0000 (21:40 +0400)]
ACPICA: add preemption point after each opcode parse

Reference: http://marc.info/?l=linux-acpi&m=122236382701062&w=2

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Tested-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPICA: Update version to 20080729
Bob Moore [Mon, 4 Aug 2008 03:15:11 +0000 (11:15 +0800)]
ACPICA: Update version to 20080729

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPICA: x2APIC support: changes for MADT and SRAT ACPI tables
Bob Moore [Mon, 4 Aug 2008 02:42:47 +0000 (10:42 +0800)]
ACPICA: x2APIC support: changes for MADT and SRAT ACPI tables

Support for the x2APIC. There are 2 new subtables for the MADT and
one new subtable for the SRAT. Includes disassembler and acpisrc
support. Data from the Intel 64 Architecture x2APIC Specification,
June 2008.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPICA: Improve object conversion error messages
Bob Moore [Mon, 4 Aug 2008 02:41:29 +0000 (10:41 +0800)]
ACPICA: Improve object conversion error messages

Better error messages during object conversion from internal
to the external ACPI_OBJECT. Used for external calls to
acpi_evaluate_object.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPICA: Add function to decode reference obj types to strings
Bob Moore [Mon, 4 Aug 2008 02:40:09 +0000 (10:40 +0800)]
ACPICA: Add function to decode reference obj types to strings

Created for improved error messages.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPICA: Update version to 20080701
Bob Moore [Mon, 4 Aug 2008 02:12:31 +0000 (10:12 +0800)]
ACPICA: Update version to 20080701

Update version to 20080701.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPICA: Return method arg count from acpi_get_object_info
Bob Moore [Fri, 4 Jul 2008 02:53:58 +0000 (10:53 +0800)]
ACPICA: Return method arg count from acpi_get_object_info

Also update the debugger so that the correct number of arguments is
passed to the method. Prevents a warning message from the debugger.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPICA: Cleanup macro definition file.
Bob Moore [Mon, 4 Aug 2008 01:54:17 +0000 (09:54 +0800)]
ACPICA: Cleanup macro definition file.

Removed unused macros. Ensure that multiple parameters always have a space
after a comma. Cleanup some comments.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPICA: Fix warning for 64-bit build
Bob Moore [Fri, 15 Aug 2008 02:32:59 +0000 (04:32 +0200)]
ACPICA: Fix warning for 64-bit build

Fixes warning from exconfig.c on 64-bit build.

AK: This actually was fixed earlier in Linux, this just syncs with
AK: the version of the fix that went into the ACPCA codebase

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPICA: Add function to dereference returned reference objects
Lin Ming [Mon, 4 Aug 2008 05:22:10 +0000 (13:22 +0800)]
ACPICA: Add function to dereference returned reference objects

Examines the return object from a call to acpi_evaluate_object.
Any Index or RefOf references are automatically dereferenced in
an attempt to return something useful (these reference types
cannot be converted into an external ACPI_OBJECT.)
Lin Ming, Bob Moore.

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

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPICA: Return status from global init function
Yi Yang [Mon, 4 Aug 2008 02:30:09 +0000 (10:30 +0800)]
ACPICA: Return status from global init function

Return status from acpi_ut_init_globals. This is used by both
the kernel subsystem and the utilities such as iASL compiler.
The function could possibly fail when the caches are initialized.
Yang Yi.

Signed-off-by: Yi Yang <yi.y.yang@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPICA: Fix table compare code, length then data
Bob Moore [Fri, 4 Jul 2008 02:57:51 +0000 (10:57 +0800)]
ACPICA: Fix table compare code, length then data

Split the ACPI table compare. First check that the lengths match
exactly. Then compare the data.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPICA: Fix wrong resource descriptor length for 64-bit build
Bob Moore [Fri, 4 Jul 2008 02:56:13 +0000 (10:56 +0800)]
ACPICA: Fix wrong resource descriptor length for 64-bit build

The "minimal" descriptors such as EndTag are calculated as 12
bytes long, but the actual length in the internal descriptor is
16 because of the round-up to 8 on 64-bit build.

http://www.acpica.org/bugzilla/show_bug.cgi?id=728

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPICA: Allow same ACPI table to be loaded/unloaded more than once
Bob Moore [Fri, 4 Jul 2008 02:48:43 +0000 (10:48 +0800)]
ACPICA: Allow same ACPI table to be loaded/unloaded more than once

Without this change, a table cannot be loaded again once it has
been loaded/unloaded one time. The current mechanism does not
unregister a table upon an unload. During a load, if the same
table is found, this no longer returns an exception.

http://www.acpica.org/bugzilla/show_bug.cgi?id=722

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPICA: Add check for invalid handle in acpi_get_object_info
Fiodor Suietov [Fri, 4 Jul 2008 02:18:34 +0000 (10:18 +0800)]
ACPICA: Add check for invalid handle in acpi_get_object_info

Return AE_BAD_PARAMETER if input handle is invalid.

http://www.acpica.org/bugzilla/show_bug.cgi?id=474

Signed-off-by: Fiodor Suietov <fiodor.f.suietov@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPICA: Copy dynamically loaded tables to local buffer
Dennis Noordsij [Fri, 15 Aug 2008 01:37:58 +0000 (09:37 +0800)]
ACPICA: Copy dynamically loaded tables to local buffer

Previously, dynamically loaded tables were simply mapped, but on some machines
this memory is corrupted after suspend. Now copy the table to a local buffer.
For OpRegion case, added checksum verify. Use the table length from the table header,
not the region length. For Buffer case, use the table length also.

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

Signed-off-by: Dennis Noordsij <dennis.noordsij@helsinki.fi>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agosh: sh7785 pinmux support
Magnus Damm [Thu, 23 Oct 2008 02:30:10 +0000 (11:30 +0900)]
sh: sh7785 pinmux support

This patch implements pinmux tables for the sh7785 processor.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosata_via: load DEVICE register when CTL changes
Tejun Heo [Tue, 21 Oct 2008 15:45:57 +0000 (00:45 +0900)]
sata_via: load DEVICE register when CTL changes

VIA controllers clear DEVICE register when IEN changes.  Make sure
DEVICE is updated along with CTL.

This change is separated from Joseph Chan's larger patch.

  http://thread.gmane.org/gmane.linux.kernel.commits.mm/40640

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Joseph Chan <JosephChan@via.com.tw>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agolibata: set device class to NONE if phys_offline
Tejun Heo [Tue, 21 Oct 2008 15:31:34 +0000 (00:31 +0900)]
libata: set device class to NONE if phys_offline

Reset methods don't have access to phys link status for slave links
and may incorrectly indicate device presence causing unnecessary probe
failures for unoccupied links.  This patch clears device class to NONE
during post-reset processing if phys link is offline.

As on/offlineness semantics is strictly defined and used in multiple
places by the core layer, this won't change behavior for drivers which
don't use slave links.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agolibata-eh: fix slave link EH action mask handling
Tejun Heo [Tue, 21 Oct 2008 11:37:21 +0000 (20:37 +0900)]
libata-eh: fix slave link EH action mask handling

Slave link action mask is transferred to master link and all the EH
actions are taken by the master link.  ata_eh_about_to_do() and
ata_eh_done() are called with ATA_EH_ALL_ACTIONS to clear the slave
link actions during transfer.  This always sets ATA_PFLAG_RECOVERED
flag causing spurious "EH complete" messages.

Don't set ATA_PFLAG_RECOVERED for slave link actions.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agolibata: transfer EHI control flags to slave ehc.i
Tejun Heo [Tue, 21 Oct 2008 05:26:39 +0000 (14:26 +0900)]
libata: transfer EHI control flags to slave ehc.i

ATA_EHI_NO_AUTOPSY and ATA_EHI_QUIET are used to control the behavior
of EH.  As only the master link is visible outside EH, these flags are
set only for the master link although they should also apply to the
slave link, which causes spurious EH messages during probe and
suspend/resume.

This patch transfers those two flags to slave ehc.i before performing
slave autopsy and reporting.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agolibata-sff: fix ata_sff_post_internal_cmd()
Tejun Heo [Mon, 20 Oct 2008 04:10:21 +0000 (13:10 +0900)]
libata-sff: fix ata_sff_post_internal_cmd()

ata_sff_post_internal_cmd() needs to grab port lock before calling
ata_bmdma_stop() and also need to clear hsm_task_state.  Fix it.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agolibata: initialize port_task when !CONFIG_ATA_SFF
Tejun Heo [Mon, 20 Oct 2008 04:11:56 +0000 (13:11 +0900)]
libata: initialize port_task when !CONFIG_ATA_SFF

ap->port_task was not initialized if !CONFIG_ATA_SFF later triggering
lockdep warning.  Make sure it's initialized.

Reported by Larry Finger.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years ago9p: fix sparse warnings
Eric Van Hensbergen [Wed, 22 Oct 2008 23:54:47 +0000 (18:54 -0500)]
9p: fix sparse warnings

Several sparse warnings were introduced by patches accepted during the merge
window which weren't caught.  This patch fixes those warnings.

Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
15 years ago9p: rdma: RDMA Transport Support for 9P
Tom Tucker [Wed, 22 Oct 2008 23:47:39 +0000 (18:47 -0500)]
9p: rdma: RDMA Transport Support for 9P

This patch implements the RDMA transport provider for 9P. It allows
mounts to be performed over iWARP and IB capable network interfaces.

Signed-off-by: Tom Tucker <tom@opengridcomputing.com>
Signed-off-by: Latchesar Ionkov <lionkov@lanl.gov>
15 years ago9p: fix format warning
Eric Van Hensbergen [Wed, 22 Oct 2008 23:48:45 +0000 (18:48 -0500)]
9p: fix format warning

This patch fixes a format warning which appears on 64-bit builds.

Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
15 years ago9p: fix debug build error
Eric Van Hensbergen [Wed, 22 Oct 2008 23:47:40 +0000 (18:47 -0500)]
9p: fix debug build error

Fixes build problem with 9p when building with debug disabled.
Also contains some fixes for warnings which pop up when
CONFIG_NET_9P_DEBUG is disabled.

Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
15 years agoPCI hotplug: fix logic in Compaq hotplug controller bus speed setup
Julia Lawall [Wed, 22 Oct 2008 23:44:00 +0000 (16:44 -0700)]
PCI hotplug: fix logic in Compaq hotplug controller bus speed setup

The pattern !E && !E->fld is nonsensical.  The patch below updates this
according to the assumption that && should be ||.  But perhaps another
solution was intended.

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

// <smpl>
@disable and_comm@
expression E;
identifier fld;
@@

- !E && !E->fld
+ !E || !E->fld
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Reviewed-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoPCI: don't export linux/io.h from pci.h
Stephen Rothwell [Wed, 22 Oct 2008 02:39:55 +0000 (13:39 +1100)]
PCI: don't export linux/io.h from pci.h

Move the include of io.h down into the #ifdef __KERNEL__ protected
region.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoPCI: PCI_QUIRKS depends on PCI
Geert Uytterhoeven [Wed, 22 Oct 2008 06:53:25 +0000 (08:53 +0200)]
PCI: PCI_QUIRKS depends on PCI

commit 3d137310245e4cdc3e8c8ba1bea2e145a87ae8e3 ("PCI: allow quirks to be
compiled out") introduced CONFIG_PCI_QUIRKS, which now shows up in each
and every .config.  Fix this by making it depend on PCI.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoPCI hotplug: pciehp: poll data link layer link active
Kenji Kaneshige [Wed, 22 Oct 2008 05:31:44 +0000 (14:31 +0900)]
PCI hotplug: pciehp: poll data link layer link active

This patch adds polling mechanism for Data Link Layer Link Active bit
after turning power on, instead of waiting for 1000 msec. This reduces
reduce the unnecessary long wait.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoPCI hotplug: pciehp: fix possible memory leak in pcie_init
Kenji Kaneshige [Wed, 22 Oct 2008 05:30:15 +0000 (14:30 +0900)]
PCI hotplug: pciehp: fix possible memory leak in pcie_init

Fix the error paths in pcie_init to avoid leaking memory.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoPCI: Workaround invalid P2P bridge bus numbers
Benjamin Herrenschmidt [Mon, 20 Oct 2008 23:06:29 +0000 (10:06 +1100)]
PCI: Workaround invalid P2P bridge bus numbers

Some firmware fail to properly configure P2P bridges, leaving them
with invalid bus numbers. In some cases, this happens on some embedded
4xx boards as the result of the kernel allocating different bus space
than the firmware does to host bridges while not setting
pcibios_assign_all_busses() for various reasons. In other cases, it can
just be bogus firmware.

This adds some sanity checking to the PCI probing code. If a bridge is
found whose primary bus number doesn't match the bus it's sitting on,
or whose secondary bus number not strictly above it's primary bus
number, then the bridge bus numbers are deconfigured in the first pass
of pci_scan_bridge() to be re-assigned in the second pass.

Tested-by: "Ayman El-Khashab" <AymanE@tanisys.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoPCI Hotplug: fakephp: add duplicate slot name debugging
Alex Chiang [Mon, 20 Oct 2008 23:42:03 +0000 (17:42 -0600)]
PCI Hotplug: fakephp: add duplicate slot name debugging

The PCI core now manages slot names on behalf of slot detection
and slot hotplug drivers, including the handling of duplicate
slot names.

We can use the fakephp driver to help test the new functionality.
Add a 'dup_slots' module param to force fakephp to create multiple
slots with the same name. We can then verify that the PCI core
correctly renamed the slots.

sapphire:/sys/bus/pci/slots # modprobe fakephp dup_slots
sapphire:/sys/bus/pci/slots # ls
fake    fake-10  fake-3  fake-5  fake-7  fake-9
fake-1  fake-2   fake-4  fake-6  fake-8

Cc: kristen.c.accardi@intel.com
Cc: matthew@wil.cx
Acked-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoPCI: Hotplug core: remove 'name'
Alex Chiang [Mon, 20 Oct 2008 23:41:58 +0000 (17:41 -0600)]
PCI: Hotplug core: remove 'name'

Now that the PCI core manages the 'name' for each individual
hotplug driver, and all drivers (except rpaphp) have been converted
to use hotplug_slot_name(), there is no need for the PCI hotplug
core to drag around its own copy of name either.

Cc: kristen.c.accardi@intel.com
Cc: matthew@wil.cx
Acked-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoPCI: shcphp: remove 'name' parameter
Alex Chiang [Mon, 20 Oct 2008 23:41:53 +0000 (17:41 -0600)]
PCI: shcphp: remove 'name' parameter

We do not need to manage our own name parameter, especially since
the PCI core can change it on our behalf, in the case of duplicate
slot names.

Remove 'name' from shpchp's version of struct slot.

This change also removes the unused struct task_event from the
slot structure.

Cc: kristen.c.accardi@intel.com
Acked-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoPCI: SGI Hotplug: stop managing bss_hotplug_slot->name
Alex Chiang [Mon, 20 Oct 2008 23:41:48 +0000 (17:41 -0600)]
PCI: SGI Hotplug: stop managing bss_hotplug_slot->name

We no longer need to manage our version of hotplug_slot->name
since the PCI and hotplug core manage it on our behalf.

Update the sn_hp_slot_private_alloc() interface to fill in
the correct name for us, as that function already has all
the parameters needed to determine the name.

Cc: kristen.c.accardi@intel.com
Cc: jpk@sgi.com
Acked-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoPCI: rpaphp: kmalloc/kfree slot->name directly
Alex Chiang [Mon, 20 Oct 2008 23:41:43 +0000 (17:41 -0600)]
PCI: rpaphp: kmalloc/kfree slot->name directly

rpaphp tends to use slot->name directly everywhere, and doesn't
ever need slot->hotplug_slot->name.

struct hotplug_slot->name is going away, so convert rpaphp directly
manipulate its own slot->name everywhere, and don't bother touching
slot->hotplug_slot->name.

Acked-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoPCI: pciehp: remove 'name' parameter
Alex Chiang [Mon, 20 Oct 2008 23:41:38 +0000 (17:41 -0600)]
PCI: pciehp: remove 'name' parameter

We do not need to manage our own name parameter, especially since
the PCI core can change it on our behalf, in the case of duplicate
slot names.

Remove 'name' from pciehp's version of struct slot, and remove
unused 'task_list' as well.

Cc: kristen.c.accardi@intel.com
Acked-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoPCI: ibmphp: stop managing hotplug_slot->name
Alex Chiang [Mon, 20 Oct 2008 23:41:33 +0000 (17:41 -0600)]
PCI: ibmphp: stop managing hotplug_slot->name

We no longer need to manage our version of hotplug_slot->name
since the PCI and hotplug core manage it on our behalf.

Now, we simply advise the PCI core of the name that we would
like, and let the core take care of the rest.

Additionally, slightly rearrange the members of struct slot
so they are naturally aligned to eliminate holes.

Cc: jbarnes@virtuousgeek.org
Cc: kristen.c.accardi@intel.com
Acked-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoPCI: fakephp: remove 'name' parameter
Alex Chiang [Mon, 20 Oct 2008 23:41:28 +0000 (17:41 -0600)]
PCI: fakephp: remove 'name' parameter

Remove 'name' from fakephp's struct dummy_slot, as the PCI core
will now manage our slot name for us.

Cc: jbarnes@virtuousgeek.org
Cc: kristen.c.accardi@intel.com
Acked-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoPCI, PCI Hotplug: introduce slot_name helpers
Alex Chiang [Mon, 20 Oct 2008 23:41:07 +0000 (17:41 -0600)]
PCI, PCI Hotplug: introduce slot_name helpers

In preparation for cleaning up the various hotplug drivers
such that they don't have to manage their own 'name' parameters
anymore, we provide the following convenience functions:

pci_slot_name()
hotplug_slot_name()

These helpers will be used by individual hotplug drivers.

Cc: kristen.c.accardi@intel.com
Cc: matthew@wil.cx
Acked-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoPCI: cpqphp: stop managing hotplug_slot->name
Alex Chiang [Mon, 20 Oct 2008 23:41:22 +0000 (17:41 -0600)]
PCI: cpqphp: stop managing hotplug_slot->name

We no longer need to manage our version of hotplug_slot->name
since the PCI and hotplug core manage it on our behalf.

Now, we simply advise the PCI core of the name that we would
like, and let the core take care of the rest.

Cc: jbarnes@virtuousgeek.org
Cc: kristen.c.accardi@intel.com
Acked-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoPCI: cpci_hotplug: stop managing hotplug_slot->name
Alex Chiang [Mon, 20 Oct 2008 23:41:17 +0000 (17:41 -0600)]
PCI: cpci_hotplug: stop managing hotplug_slot->name

We no longer need to manage our version of hotplug_slot->name
since the PCI and hotplug core manage it on our behalf.

Now, we simply advise the PCI core of the name that we would
like, and let the core take care of the rest.

Cc: kristen.c.accardi@intel.com
Cc: scottm@somanetworks.com
Acked-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoPCI: acpiphp: remove 'name' parameter
Alex Chiang [Mon, 20 Oct 2008 23:41:12 +0000 (17:41 -0600)]
PCI: acpiphp: remove 'name' parameter

We do not need to manage our own name parameter, especially since
the PCI core can change it on our behalf, in the case of duplicate
slot names.

Remove 'name' from acpiphp's version of struct slot.

Cc: kristen.c.accardi@intel.com
Acked-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoPCI: prevent duplicate slot names
Alex Chiang [Mon, 20 Oct 2008 23:41:02 +0000 (17:41 -0600)]
PCI: prevent duplicate slot names

Prevent callers of pci_create_slot() from registering slots with
duplicate names. This condition occurs most often when PCI hotplug
drivers are loaded on platforms with broken firmware that assigns
identical names to multiple slots.

We now rename these duplicate slots on behalf of the user.

If firmware assigns the name N to multiple slots, then:

The first registered slot is assigned N
The second registered slot is assigned N-1
The third registered slot is assigned N-2
etc.

This is the permanent fix mentioned in earlier commits d6a9e9b4 and
167e782e (shpchp/pciehp: Rename duplicate slot name...).

We take advantage of the new 'hotplug' parameter in pci_create_slot()
to prevent a slot create/rename race between hotplug drivers and
detection drivers.

Scenario A:
hotplug driver                  detection driver
--------------                  ----------------
pci_create_slot(hotplug=set)
pci_create_slot(hotplug=NULL)

The hotplug driver creates the slot with its desired name, and then
releases the semaphore. Now, the detection driver tries to create
the same slot, but it already exists. We don't care about renaming,
so return the existing slot.

Scenario B:
hotplug driver                  detection driver
--------------                  ----------------
pci_create_slot(hotplug=NULL)
pci_create_slot(hotplug=set)

The detection driver creates the slot with name "X". Then the hotplug
driver tries to create the same slot, but wants the name "Y" instead.
We detect that we're trying to create the same slot and that we also
want a rename, so rename the slot to "Y" and return.

Scenario C:
hotplug driver                  hotplug driver
--------------                  ----------------
pci_create_slot(hotplug=set)
pci_create_slot(hotplug=set)

Two separate hotplug drivers are attempting to claim the slot and
are passing valid hotplug_slot args to pci_create_slot(). We detect
that the slot already has a ->hotplug callback, prevent a rename,
and return -EBUSY.

Cc: kristen.c.accardi@intel.com
Cc: matthew@wil.cx
Acked-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoPCI Hotplug: serialize pci_hp_register and pci_hp_deregister
Kenji Kaneshige [Mon, 20 Oct 2008 23:40:57 +0000 (17:40 -0600)]
PCI Hotplug: serialize pci_hp_register and pci_hp_deregister

Convert the pci_hotplug_slot_list_lock, which only protected the
list of hotplug slots, to a pci_hp_mutex which now protects both
interfaces.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoPCI: update pci_create_slot() to take a 'hotplug' param
Alex Chiang [Mon, 20 Oct 2008 23:40:52 +0000 (17:40 -0600)]
PCI: update pci_create_slot() to take a 'hotplug' param

Slot detection drivers can co-exist with hotplug drivers. The names
of the detected/claimed slots may be different depending on module
load order.

For legacy reasons, we need to allow hotplug drivers to override
the slot name if a detection driver is loaded first (and they find
the same slots).

Creating and overriding slot names should be an atomic operation,
otherwise you get a locking nightmare as various drivers race to
call pci_create_slot().

pci_create_slot() is already serialized by grabbing the pci_bus_sem.

We update the API and add a 'hotplug' param, which is:

set if the caller is a hotplug driver
NULL if the caller is a detection driver

pci_create_slot() does not actually use the 'hotplug' parameter in this
patch. A later patch will add the logic that uses it.

Cc: kristen.c.accardi@intel.com
Cc: matthew@wil.cx
Acked-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoPCI: rename pci_update_slot_number to pci_renumber_slot
Alex Chiang [Mon, 20 Oct 2008 23:40:47 +0000 (17:40 -0600)]
PCI: rename pci_update_slot_number to pci_renumber_slot

The GPL exported symbol pci_update_slot_number has been renamed to
pci_renumber_slot. Some of the safety checks were unnecessary and
were removed.

Cc: kristen.c.accardi@intel.com
Cc: matthew@wil.cx
Acked-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoPCI Hotplug core: add 'name' param pci_hp_register interface
Alex Chiang [Mon, 20 Oct 2008 23:40:42 +0000 (17:40 -0600)]
PCI Hotplug core: add 'name' param pci_hp_register interface

Update pci_hp_register() to take a const char *name parameter.

The motivation for this is to clean up the individual hotplug
drivers so that each one does not have to manage its own name.
The PCI core should be the place where we manage the name.

We update the interface and all callsites first, in a
"no functional change" manner, and clean up the drivers later.

Cc: kristen.c.accardi@intel.com
Acked-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Reviewed-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoRemove PCI hotplug core MAINTAINERS entry
Jesse Barnes [Tue, 21 Oct 2008 19:01:27 +0000 (12:01 -0700)]
Remove PCI hotplug core MAINTAINERS entry

Per discussion w/Kristen at the LPC PCI BoF, the core hotplug code doesn't
really need a separate maintainer, so remove the entry (but leave the driver
specific ones).

Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoPCI: include io.h in pci.h so that ioremap_nocache is defined
Jesse Barnes [Tue, 21 Oct 2008 17:09:05 +0000 (10:09 -0700)]
PCI: include io.h in pci.h so that ioremap_nocache is defined

Ingo pointed out that the m32r build was broken by pci_ioremap.  It looks like
some files include pci.h w/o including io.h.  The latter defines ioremap_* if
present, so it makes sense to include it in pci.h now that we have pci_ioremap
there.

Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoPCI: add support for function level reset
Sheng Yang [Tue, 21 Oct 2008 09:38:25 +0000 (17:38 +0800)]
PCI: add support for function level reset

Sometimes, it's necessary to enable software's ability to quiesce and
reset endpoint hardware with function-level granularity, so provide
support for it.

The patch implement Function Level Reset(FLR) feature following PCI-e
spec. And this is the first step. We would add more generic method, like
D0/D3, to allow more devices support this function.

The patch contains two functions. pcie_reset_function() is the new
driver API, and, contains some action to quiesce a device.  The other
function is a helper:  pcie_execute_reset_function() just executes the
reset for a particular device function.

Current the usage model is in KVM. Function reset is necessary for
assigning device to a guest, or moving it between partitions.

For Function Level Reset(FLR), please refer to PCI Express spec chapter
6.6.2.

Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoPCI: Fix reference counting bug
Matthew Wilcox [Tue, 21 Oct 2008 01:13:08 +0000 (19:13 -0600)]
PCI: Fix reference counting bug

pci_get_subsys() will decrement the reference count of the device that
it starts searching from.  Unfortunately, the pci_find_device() interface
will already have decremented the reference count of the device earlier,
so the device will end up losing all reference counts and be freed.

We can fix this by incrementing the reference count of the device to
start searching from before calling pci_get_subsys().

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoACPI/PCI: Set support bit for MSI in support field of _OSC
Taku Izumi [Fri, 17 Oct 2008 04:52:51 +0000 (13:52 +0900)]
ACPI/PCI: Set support bit for MSI in support field of _OSC

Currently linux doesn't have any code to set the "MSI supported" bit in
Support Fireld of _OSC. This patch adds the code for that.

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>
15 years agoACPI/PCI: Fix return value of acpi_cuery_osc()
Taku Izumi [Fri, 17 Oct 2008 04:51:53 +0000 (13:51 +0900)]
ACPI/PCI: Fix return value of acpi_cuery_osc()

If acpi_query_osc() returns other than AE_OK, __pci_osc_support_set()
stops scanning ACPI objects to evaluate _OSC. This prevents subsequent
_OSCs from being evaluated if some of root bridge doesn't have _OSC, for
example. So acpi_query_osc() should return always AE_OK to evaluate all
_OSC.

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>
15 years agoACPI/PCI: Always query _OSC control field in pci_osc_control_set()
Taku Izumi [Fri, 17 Oct 2008 04:51:00 +0000 (13:51 +0900)]
ACPI/PCI: Always query _OSC control field in pci_osc_control_set()

In current pci_osc_control_set() implementation, once the _OSC control
field is queried, it is never queried again. But the query result can
change depending on the _OSC support field. For example, if PCI Express
Native Hot Plug control depends on ASPM support on a certain platform, a
PCI Express Native Hot Plug Control query would fail before the ASPM
driver was loaded, but it would succeed if the ASPM driver was loaded
first.  Therefore, pci_osc_control_set() should query the _OSC control
field every time.

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>
15 years agoACPI/PCI: Change pci_osc_control_set() to query control bits first
Taku Izumi [Fri, 17 Oct 2008 04:49:46 +0000 (13:49 +0900)]
ACPI/PCI: Change pci_osc_control_set() to query control bits first

Current pci_osc_control_set() evaluates _OSC without query for control
bits, unless __pci_osc_support_set() is called beforehand. But as
strongly recommended in PCI firmware specification, it should query
control bits first.

This patch changes pci_osc_control_set() to query control bits first
even if __pci_osc_support_set() is not called beforehand.

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>
15 years agoACPI/PCI: Fix possible race condition on _OSC evaluation
Taku Izumi [Fri, 17 Oct 2008 04:48:36 +0000 (13:48 +0900)]
ACPI/PCI: Fix possible race condition on _OSC evaluation

Fix possible race condition on _OSC evaluation.

Current _OSC evaluation code has possible race condition because it
maniputes osc_data linked list or its contents without any lock
mechanism.

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>
15 years agoMerge branches 'cma', 'cxgb3', 'ehca', 'ipoib', 'mad', 'mlx4' and 'nes' into for...
Roland Dreier [Wed, 22 Oct 2008 22:56:41 +0000 (15:56 -0700)]
Merge branches 'cma', 'cxgb3', 'ehca', 'ipoib', 'mad', 'mlx4' and 'nes' into for-next

15 years agoIB/ehca: Reject dynamic memory add/remove when ehca adapter is present
Stefan Roscher [Wed, 22 Oct 2008 22:54:38 +0000 (15:54 -0700)]
IB/ehca: Reject dynamic memory add/remove when ehca adapter is present

Since the ehca device driver does not support dynamic memory add and
remove operations, the driver must explicitly reject such requests in
order to prevent unpredictable behaviors related to existing memory
regions that cover all of memory being used by InfiniBand protocols in
the kernel.

The solution (for now at least) is to add a memory notifier to the
ehca device driver and if a request for dynamic memory add or remove
comes in, ehca will always reject it.  The user can add or remove
memory by hot-removing the ehca adapter, performing the memory
operation, and then hot-adding the ehca adapter back.

Signed-off-by: Stefan Roscher <stefan.roscher@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
15 years agoIB/ehca: Fix reported max number of QPs and CQs in systems with >1 adapter
Stefan Roscher [Wed, 22 Oct 2008 22:52:31 +0000 (15:52 -0700)]
IB/ehca: Fix reported max number of QPs and CQs in systems with >1 adapter

Because ehca adapters can differ in the maximum number of QPs and CQs
we have to save the maximum number of these ressources per adapter and
not globally per ehca driver. This fix introduces 2 new members to the
shca structure to store the maximum value for QPs and CQs per adapter.

The module parameters are now used as initial values for those
variables.  If a user selects an invalid number of CQs or QPs we don't
print an error any longer, instead we will inform the user with a
warning and set the values to the respective maximum supported by the
HW.

Signed-off-by: Stefan Roscher <stefan.roscher@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
15 years agoIPoIB: Set netdev offload features properly for child (VLAN) interfaces
Or Gerlitz [Wed, 22 Oct 2008 22:49:49 +0000 (15:49 -0700)]
IPoIB: Set netdev offload features properly for child (VLAN) interfaces

Child devices were created without any offload features set, fix this by
moving the code that computes the features into generic function which is
now called through non-child and child device creation.

Signed-off-by: Or Gerlitz <ogerlitz@voltaire.com>
-- v1 has a bug where the 'result' flag in ipoib_vlan_add may be used uninitialized
Signed-off-by: Roland Dreier <rolandd@cisco.com>
15 years agoIPoIB: Clean up ethtool support
Or Gerlitz [Wed, 22 Oct 2008 22:49:29 +0000 (15:49 -0700)]
IPoIB: Clean up ethtool support

Add a get_rx_csum method.  Remove the driver's own get_tso method, as
the ethtool kernel code uses the default one if nothing is provided.

Signed-off-by: Or Gerlitz <ogerlitz@voltaire.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
15 years agomlx4_core: Add Ethernet PCI device IDs
Yevgeny Petrilin [Wed, 22 Oct 2008 22:48:03 +0000 (15:48 -0700)]
mlx4_core: Add Ethernet PCI device IDs

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
15 years agomlx4_en: Add driver for Mellanox ConnectX 10GbE NIC
Yevgeny Petrilin [Wed, 22 Oct 2008 22:47:49 +0000 (15:47 -0700)]
mlx4_en: Add driver for Mellanox ConnectX 10GbE NIC

The Mellanox ConnectX can operate as an InfiniBand adapter, as an
Ethernet NIC, or as a Fibre Channel (FC) HBA.  The kernel has a
low-level driver, mlx4_core, which handles multiplexing access to the
device, and there is also already an InfiniBad driver, mlx4_ib.

This patch adds a new driver, mlx4_en, which implements a standard
Ethernet NIC driver.

Signed-off-by: Liran Liss <liranl@mellanox.co.il>
Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
15 years agomlx4_core: Multiple port type support
Yevgeny Petrilin [Wed, 22 Oct 2008 22:38:42 +0000 (15:38 -0700)]
mlx4_core: Multiple port type support

Multi-protocol adapters support different port types.  Each consumer
of mlx4_core queries for supported port types; in particular mlx4_ib
can no longer assume that all physical ports belong to it.  Port type
is configured through a sysfs interface.  When the type of a port is
changed, all mlx4 interfaces are unregistered, and then registered
again with the new port types.

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
15 years agopanasonic-laptop: depends on ACPI
Randy Dunlap [Fri, 17 Oct 2008 20:46:08 +0000 (13:46 -0700)]
panasonic-laptop: depends on ACPI

panasonic-laptop uses many acpi_*() functions so it should
depend on ACPI; otherwise there are approximately 70
warnings/errors generated.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Harald Welte <laforge@gnumonks.org>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPI: thinkpad-acpi: Remove firmware backlight delays for Intel ACPI IGD OpRegion
Henrique de Moraes Holschuh [Sat, 18 Oct 2008 17:23:55 +0000 (14:23 -0300)]
ACPI: thinkpad-acpi: Remove firmware backlight delays for Intel ACPI IGD OpRegion

Based on analysis and a patch from Matthew Garrett <mjg59@srcf.ucam.org>.

Instruct the ThinkPad ACPI firmware to remove delays on the processing of
backlight brightness changes.  This method is present on ThinkPad
Vista-compatible BIOSes with standard ACPI backlight level control.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Yves-Alexis Perez <corsac@debian.org>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPI: thinkpad-acpi: Remove duplicate line
Pascal Terjan [Sat, 18 Oct 2008 17:23:54 +0000 (14:23 -0300)]
ACPI: thinkpad-acpi: Remove duplicate line

Signed-off-by: Pascal Terjan <pterjan@mandriva.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPI: thinkpad-acpi: trivial fix of error message
Mariusz Kozlowski [Sat, 18 Oct 2008 17:23:53 +0000 (14:23 -0300)]
ACPI: thinkpad-acpi: trivial fix of error message

Trivial fix makes the error message match the code before it (ibm->driver
vs ibm->acpi-driver) better.

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPI: thinkpad-acpi: attempt to preserve fan state on resume
Henrique de Moraes Holschuh [Sat, 18 Oct 2008 17:23:52 +0000 (14:23 -0300)]
ACPI: thinkpad-acpi: attempt to preserve fan state on resume

Attempt to preserve fan state across sleep and hibernation if the fan
control mode is enabled.

For safety reasons, only the PWM OFF (fan at 100%) or maximum
closed-loop level (level 7) are preserved.  If the fan state was set
to anything else, it will not be restored.

Also, should the fan be at PWM OFF mode at resume, it will be left at
that state (but this is extremely unlikely, no ThinkPad firmware was
ever reported to do this).

For reference, the known states used for fan control upon resume by
the firmware  are either "auto" or "level 7" depending on whether the
laptop wakes due to normal conditions or a thermal emergency.

Fixes: http://bugzilla.kernel.org/show_bug.cgi?id=11331
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Richard Hartmann <richih.mailinglist@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPI: Fix possible null ptr dereference
donald.d.dugger@intel.com [Fri, 17 Oct 2008 14:49:50 +0000 (07:49 -0700)]
ACPI: Fix possible null ptr dereference

Code in `pci_link.c' is calling the internal routine `acpi_ut_evaluate_object'
which is dangerous given that it is passing a NULL pointer when it should
be passing a pointer to a real object.  The patch corrects the issue by
having the code call the external routine `acpi_evaluate_object', which
correctly handles a NULL pointer.

Signed-off-by: Don Dugger <donald.d.dugger@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPI: remove unused acpi_is_child_device()
Len Brown [Sat, 11 Oct 2008 05:13:12 +0000 (01:13 -0400)]
ACPI: remove unused acpi_is_child_device()

Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPI : Load device driver according to the status of acpi device
Zhao Yakui [Mon, 11 Aug 2008 05:40:22 +0000 (13:40 +0800)]
ACPI : Load device driver according to the status of acpi device

According to ACPI spec when the status of some device is not present
but functional, the device is valid and the children of this device
should be enumerated. It means that the device should be added to
linux acpi device tree. But the device driver for this device should not
be loaded.
    The detailed info can be found in the section 6.3.7 of ACPI 3.0b spec.
    _STA may return bit 0 clear (not present) with bit 3 set (device is
functional). This case is used to indicate a valid device for which no
device driver should be loaded (for example, a bridge device.).
Children of this device may be present and valid. OS should continue
enumeration below a device whose _STA returns this bit combination

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

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Li Shaohua <shaohua.li@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPI: Add DMI check to disable power state check in power transition
Zhao Yakui [Mon, 11 Aug 2008 06:59:59 +0000 (14:59 +0800)]
ACPI: Add DMI check to disable power state check in power transition

Add the DMI check to disable power check in the course of device power
transistion.

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

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Li Shaohua <shaohua.li@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPI: Add "acpi.power_nocheck=1" to disable power state check in power transition
Zhao Yakui [Mon, 11 Aug 2008 06:57:50 +0000 (14:57 +0800)]
ACPI: Add "acpi.power_nocheck=1" to disable power state check in power transition

   Maybe the incorrect power state is returned on the bogus bios, which
is different with the real power state. For example: the bios returns D0
state and the real power state is D3. OS expects to set the device to D0
state. In  such case if OS uses the power state returned by the BIOS and
checks the device power state very strictly in power transition, the device
can't be transited to the correct power state.

   So the boot option of "acpi.power_nocheck=1" is added to avoid checking
the device power in the course of device power transition.

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

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Li Shaohua <shaohua.li@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPI: Attach the ACPI device to the ACPI handle as early as possible
Zhao Yakui [Mon, 11 Aug 2008 06:54:16 +0000 (14:54 +0800)]
ACPI: Attach the ACPI device to the ACPI handle as early as possible

Attach the ACPI device to the ACPI handle as early as possible so that OS
can get the corresponding ACPI device by the acpi handle in the course
of getting the power/wakeup/performance flags.

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

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPI: Get the device power state in the course of scanning device
Zhao Yakui [Mon, 11 Aug 2008 06:55:05 +0000 (14:55 +0800)]
ACPI: Get the device power state in the course of scanning device

Get the device power state in the course of scanning device if the device
power flag is power_managable. i.e. The device has the _PSx/_PRx object.

At the same time before the drivers/acpi/power module is loaded, there is no
relation between acpi_power_resource and acpi device. So the first parameter
of acpi_power_get_state is changed to acpi_handle.

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

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Li Shaohua <shaohua.li@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPI: replace AE_BAD_ADDRESS exception code with AE_ERROR
Lin Ming [Fri, 8 Aug 2008 03:57:11 +0000 (11:57 +0800)]
ACPI: replace AE_BAD_ADDRESS exception code with AE_ERROR

The AE_BAD_ADDRESS exception code is now unused in ACPICA.
For linux, it's only used at wmi.c and acer-wmi.c.
I checked both wmi.c and acer-wmi.c, the AE_BAD_ADDRESS exception code
has no special meaning. The parent functions just call AE_SUCCESS() or
AE_FAILURE() to check the return status.
So it's safe to replace AE_BAD_ADDRESS with AE_ERROR.

Signed-off-by Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPI: Add expand acpi.debug_layer in kernel-parameters.txt
Thomas Renninger [Mon, 11 Aug 2008 13:03:20 +0000 (15:03 +0200)]
ACPI: Add expand acpi.debug_layer in kernel-parameters.txt

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoasus-laptop: Fix the led behavior with value > 1
Corentin Chary [Wed, 24 Sep 2008 08:35:55 +0000 (10:35 +0200)]
asus-laptop: Fix the led behavior with value > 1

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

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPI suspend: Fix CONFIG_ACPI_SLEEP dependence and some compilation warnings
Rafael J. Wysocki [Wed, 22 Oct 2008 18:58:43 +0000 (14:58 -0400)]
ACPI suspend: Fix CONFIG_ACPI_SLEEP dependence and some compilation warnings

Initially CONFIG_PM_SLEEP was defined as
CONFIG_SUSPEND || CONFIG_HIBERNATION and some ACPI code, most
importantly the code in drivers/acpi/main.c, was written with this
assumption.  Currently, however, CONFIG_PM_SLEEP is also set when
CONFIG_XEN_SAVE_RESTORE is set.

This causes some compilation warnings to appear in
drivers/acpi/main.c if both CONFIG_SUSPEND and CONFIG_HIBERNATION
are unset and CONFIG_PM_SLEEP is set (this was impossible before).
To fix this problem, redefine CONFIG_ACPI_SLEEP do depend directly
on CONFIG_SUSPEND || CONFIG_HIBERNATION, as originally intended, and
use it instead of CONFIG_PM_SLEEP in drivers/acpi/main.c, wherever
appropriate.

Additionally, move the acpi_target_sleep_state definition from under
the #ifdef to prevent compilation from failing in some cases.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agomlx4_core: Ethernet MAC/VLAN management
Yevgeny Petrilin [Wed, 22 Oct 2008 18:44:46 +0000 (11:44 -0700)]
mlx4_core: Ethernet MAC/VLAN management

Add support for managing MAC and VLAN filters for each port.

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: Oren Duer <oren@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
15 years agoi2c: Add info->archdata field
Anton Vorontsov [Wed, 22 Oct 2008 18:21:33 +0000 (20:21 +0200)]
i2c: Add info->archdata field

If present the info->archdata is copied into the dev->archdata.
Some (OpenFirmware) platforms need it.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
15 years agoi2c: Inform about deprecated chips directory
Wolfram Sang [Wed, 22 Oct 2008 18:21:33 +0000 (20:21 +0200)]
i2c: Inform about deprecated chips directory

The chips directory under drivers/i2c is deprecated. Spread the word!

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
15 years agoi2c: Use pci_ioremap_bar()
Arjan van de Ven [Wed, 22 Oct 2008 18:21:32 +0000 (20:21 +0200)]
i2c: Use pci_ioremap_bar()

Use the newly introduced pci_ioremap_bar() function in drivers/i2c.
pci_ioremap_bar() just takes a pci device and a bar number, with the goal
of making it really hard to get wrong, while also having a central place
to stick sanity checks.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
15 years agoSchedule removal of the legacy i2c device driver binding model
Jean Delvare [Wed, 22 Oct 2008 18:21:32 +0000 (20:21 +0200)]
Schedule removal of the legacy i2c device driver binding model

The legacy i2c device driver binding model is superseded by the
standard model, so it's time to deprecate it and schedule it for
removal.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
15 years agoi2c: Clean up <linux/i2c.h>
Jean Delvare [Wed, 22 Oct 2008 18:21:32 +0000 (20:21 +0200)]
i2c: Clean up <linux/i2c.h>

Fix most checkpatch.pl errors and warnings. This includes replacing
spaces with tabs in many places, adding and removing spaces, and
folding long lines.

Also complete a couple prototypes to make it clearer what the
parameters represent.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
15 years agoi2c: Update and clean up writing-clients document
Jean Delvare [Wed, 22 Oct 2008 18:21:32 +0000 (20:21 +0200)]
i2c: Update and clean up writing-clients document

* Strip trailing white space.
* Remove out-of-date or irrelevant parts.
* Insist on the fact that command is deprecated.
* Fix spelling mistakes and typos.
* Reformat code examples and function prototypes to comply with the
  kernel coding style.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
15 years agoi2c: Drop 2-byte address block transfer defines
Jean Delvare [Wed, 22 Oct 2008 18:21:31 +0000 (20:21 +0200)]
i2c: Drop 2-byte address block transfer defines

We have no users and no implementers for these transfer types so it
makes little sense to define functionality bits for them.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
15 years agoi2c: Delete legacy model documentation
Jean Delvare [Wed, 22 Oct 2008 18:21:31 +0000 (20:21 +0200)]
i2c: Delete legacy model documentation

The legacy i2c binding model is deprecated and will be removed soon,
so we no longer need to document it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
15 years agoi2c: Constify i2c_get_clientdata's parameter
Jean Delvare [Wed, 22 Oct 2008 18:21:31 +0000 (20:21 +0200)]
i2c: Constify i2c_get_clientdata's parameter

i2c_get_clientdata doesn't change the i2c_client it is passed as a
parameter, so it can be constified. Same for i2c_get_adapdata.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
15 years agoi2c: Delete outdated client porting guide
Jean Delvare [Wed, 22 Oct 2008 18:21:30 +0000 (20:21 +0200)]
i2c: Delete outdated client porting guide

The document describing how to port i2c chip drivers from Linux 2.4 to
Linux 2.6 is outdated. As I suspect that most drivers that had to be
ported have already been by now, I do not want to spend time updating
it. Let's just delete it instead.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
15 years agoi2c: Make clear what the class field of i2c_adapter is good for
Wolfram Sang [Wed, 22 Oct 2008 18:21:30 +0000 (20:21 +0200)]
i2c: Make clear what the class field of i2c_adapter is good for

Make clear what the class field of i2c_adapter is good for.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
15 years agoi2c-algo-pcf: Fix typo in debugging log message
David Miller [Wed, 22 Oct 2008 18:21:30 +0000 (20:21 +0200)]
i2c-algo-pcf: Fix typo in debugging log message

Fix typo in debugging log message.

deteted --> detected

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
15 years agoi2c-algo-pcf: Add adapter hooks around xfer begin and end
David Miller [Wed, 22 Oct 2008 18:21:30 +0000 (20:21 +0200)]
i2c-algo-pcf: Add adapter hooks around xfer begin and end

Some I2C bus implementations need to synchronize with external
entities, such as system firmware, which might also be programming the
same I2C bus.

In order to facilitate this add ->xfer_begin() and ->xfer_end() hooks
which are invoked around pcf_xfer().

[JD: Make these hooks optional.]

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>