History log of /drivers/acpi/pci_root.c
Revision Date Author Comments
10f6dc7eede9a8895626e9c1b4f2c3b75fbf2850 10-Nov-2011 Matthew Garrett <mjg@redhat.com> PCI: Rework ASPM disable code

Right now we forcibly clear ASPM state on all devices if the BIOS indicates
that the feature isn't supported. Based on the Microsoft presentation
"PCI Express In Depth for Windows Vista and Beyond", I'm starting to think
that this may be an error. The implication is that unless the platform
grants full control via _OSC, Windows will not touch any PCIe features -
including ASPM. In that case clearing ASPM state would be an error unless
the platform has granted us that control.

This patch reworks the ASPM disabling code such that the actual clearing
of state is triggered by a successful handoff of PCIe control to the OS.
The general ASPM code undergoes some changes in order to ensure that the
ability to clear the bits isn't overridden by ASPM having already been
disabled. Further, this theoretically now allows for situations where
only a subset of PCIe roots hand over control, leaving the others in the
BIOS state.

It's difficult to know for sure that this is the right thing to do -
there's zero public documentation on the interaction between all of these
components. But enough vendors enable ASPM on platforms and then set this
bit that it seems likely that they're expecting the OS to leave them alone.

Measured to save around 5W on an idle Thinkpad X220.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
3c076351c4027a56d5005a39a0b518a4ba393ce2 10-Nov-2011 Matthew Garrett <mjg@redhat.com> PCI: Rework ASPM disable code

Right now we forcibly clear ASPM state on all devices if the BIOS indicates
that the feature isn't supported. Based on the Microsoft presentation
"PCI Express In Depth for Windows Vista and Beyond", I'm starting to think
that this may be an error. The implication is that unless the platform
grants full control via _OSC, Windows will not touch any PCIe features -
including ASPM. In that case clearing ASPM state would be an error unless
the platform has granted us that control.

This patch reworks the ASPM disabling code such that the actual clearing
of state is triggered by a successful handoff of PCIe control to the OS.
The general ASPM code undergoes some changes in order to ensure that the
ability to clear the bits isn't overridden by ASPM having already been
disabled. Further, this theoretically now allows for situations where
only a subset of PCIe roots hand over control, leaving the others in the
BIOS state.

It's difficult to know for sure that this is the right thing to do -
there's zero public documentation on the interaction between all of these
components. But enough vendors enable ASPM on platforms and then set this
bit that it seems likely that they're expecting the OS to leave them alone.

Measured to save around 5W on an idle Thinkpad X220.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
e545b55a1e980cbb6a158886286106bbf39722b1 20-Jun-2011 Jon Mason <jdmason@kudzu.us> ACPI: fix 80 char overflow

Trivial fix for 80 char line overflow in drivers/acpi/pci_root.c

Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Len Brown <len.brown@intel.com>
a246670ddee3132fa71f8993d3989ad8ac04d965 30-Apr-2011 Rafael J. Wysocki <rjw@sisk.pl> PCI/ACPI: Report _OSC control mask returned on failure to get control

If an attempt to get _OSC control of the PCIe native features from the
BIOS fails, report the resulting mask of control flags the BIOS was
willing to grant in the error message. Moreover, if the _OSC support
mask is insufficient for requesting control of the PCIe native features
or pcie_ports_disabled is set, print a diagnostic message containing the
_OSC support mask. This helps to diagnose obscure _OSC-related problems
on a number machines.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
eca67315e0e0d5fd91264d79c88694006dbc7d31 21-Mar-2011 Naga Chumbalkar <nagananda.chumbalkar@hp.com> PCI: Disable ASPM when _OSC control is not granted for PCIe services

v3 -> v2: Added text to describe the problem
v2 -> v1: Split this patch from v1
v1 : Part of: http://marc.info/?l=linux-pci&m=130042212003242&w=2

Disable ASPM when no _OSC control for PCIe services is granted
by the BIOS. This is to protect systems with a buggy BIOS that
did not set the ACPI FADT "ASPM Controls" bit even though the
underlying HW can't do ASPM.

To turn "on" ASPM the minimum the BIOS needs to do:
1. Clear the ACPI FADT "ASPM Controls" bit.
2. Support _OSC appropriately

There is no _OSC Control bit for ASPM. However, we expect the BIOS to
support _OSC for a Root Bridge that originates a PCIe hierarchy. If this
is not the case - we are better off not enabling ASPM on that server.

Commit 852972acff8f10f3a15679be2059bb94916cba5d (ACPI: Disable ASPM if the
Platform won't provide _OSC control for PCIe) describes the above scenario.
To quote verbatim from there:
[The PCI SIG documentation for the _OSC OS/firmware handshaking interface
states:

"If the _OSC control method is absent from the scope of a host bridge
device, then the operating system must not enable or attempt to use any
features defined in this section for the hierarchy originated by the host
bridge."

The obvious interpretation of this is that the OS should not attempt to use
PCIe hotplug, PME or AER - however, the specification also notes that an
_OSC method is *required* for PCIe hierarchies, and experimental validation
with An Alternative OS indicates that it doesn't use any PCIe functionality
if the _OSC method is missing. That arguably means we shouldn't be using
MSI or extended config space, but right now our problems seem to be limited
to vendors being surprised when ASPM gets enabled on machines when other
OSs refuse to do so. So, for now, let's just disable ASPM if the _OSC
method doesn't exist or refuses to hand over PCIe capability control.]

Signed-off-by: Naga Chumbalkar <nagananda.chumbalkar@hp.com>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
8b8bae901ce23addbdcdb54fa1696fb2d049feb5 05-Mar-2011 Rafael J. Wysocki <rjw@sisk.pl> PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

We need to distinguish the situation in which ASPM support is
disabled from the command line or through .config from the situation
in which it is disabled, because the hardware or BIOS can't handle
it. In the former case we should not report ASPM support to the BIOS
through ACPI _OSC, but in the latter case we should do that.

Introduce pcie_aspm_support_enabled() that can be used by
acpi_pci_root_add() to determine whether or not it should report ASPM
support to the BIOS through _OSC.

Cc: stable@kernel.org
References: https://bugzilla.kernel.org/show_bug.cgi?id=29722
References: https://bugzilla.kernel.org/show_bug.cgi?id=20232
Reported-and-tested-by: Ortwin Glück <odi@odi.ch>
Reviewed-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Tested-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
d3072e6a7e9bf7aca200370317f8e297be360b17 16-Jan-2011 Rafael J. Wysocki <rjw@sisk.pl> ACPI: Fix boot problem related to APEI with acpi_disabled set

Commit 415e12b23792 ("PCI/ACPI: Request _OSC control once for each root
bridge (v3)") put the acpi_hest_init() call in acpi_pci_root_init() into
a wrong place, presumably because the author confused acpi_pci_disabled
with acpi_disabled. Bring the code ordering in acpi_pci_root_init()
back to sanity.

Additionally, make sure that hest_disable is set when acpi_disabled is
set, which is going to prevent acpi_hest_parse(), that still may be
executed for acpi_disabled=1 through aer_acpi_firmware_first(), from
crashing because of uninitialized hest_tab.

Reported-and-tested-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
415e12b2379239973feab91850b0dce985c6058a 07-Jan-2011 Rafael J. Wysocki <rjw@sisk.pl> PCI/ACPI: Request _OSC control once for each root bridge (v3)

Move the evaluation of acpi_pci_osc_control_set() (to request control of
PCI Express native features) into acpi_pci_root_add() to avoid calling
it many times for the same root complex with the same arguments.
Additionally, check if all of the requisite _OSC support bits are set
before calling acpi_pci_osc_control_set() for a given root complex.

References: https://bugzilla.kernel.org/show_bug.cgi?id=20232
Reported-by: Ozan Caglayan <ozan@pardus.org.tr>
Tested-by: Ozan Caglayan <ozan@pardus.org.tr>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
03e7c3432d40d067476eaf49ede29128b637998f 08-Oct-2010 Zhang Rui <rui.zhang@intel.com> ACPI: remove unused declaration of proc_fs.h

Remove unused declaration of proc_fs.h.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
28eb5f274a305bf3a13b2c80c4804d4515d05c64 21-Aug-2010 Rafael J. Wysocki <rjw@sisk.pl> PCI: PCIe: Ask BIOS for control of all native services at once

After commit 852972acff8f10f3a15679be2059bb94916cba5d (ACPI: Disable
ASPM if the platform won't provide _OSC control for PCIe) control of
the PCIe Capability Structure is unconditionally requested by
acpi_pci_root_add(), which in principle may cause problems to
happen in two ways. First, the BIOS may refuse to give control of
the PCIe Capability Structure if it is not asked for any of the
_OSC features depending on it at the same time. Second, the BIOS may
assume that control of the _OSC features depending on the PCIe
Capability Structure will be requested in the future and may behave
incorrectly if that doesn't happen. For this reason, control of
the PCIe Capability Structure should always be requested along with
control of any other _OSC features that may depend on it (ie. PCIe
native PME, PCIe native hot-plug, PCIe AER).

Rework the PCIe port driver so that (1) it checks which native PCIe
port services can be enabled, according to the BIOS, and (2) it
requests control of all these services simultaneously. In
particular, this causes pcie_portdrv_probe() to fail if the BIOS
refuses to grant control of the PCIe Capability Structure, which
means that no native PCIe port services can be enabled for the PCIe
Root Complex the given port belongs to. If that happens, ASPM is
disabled to avoid problems with mishandling it by the part of the
PCIe hierarchy for which control of the PCIe Capability Structure
has not been received.

Make it possible to override this behavior using 'pcie_ports=native'
(use the PCIe native services regardless of the BIOS response to the
control request), or 'pcie_ports=compat' (do not use the PCIe native
services at all).

Accordingly, rework the existing PCIe port service drivers so that
they don't request control of the services directly.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
75fb60f26befb59dbfa05cb122972642b7bdd219 23-Aug-2010 Rafael J. Wysocki <rjw@sisk.pl> ACPI/PCI: Negotiate _OSC control bits before requesting them

It is possible that the BIOS will not grant control of all _OSC
features requested via acpi_pci_osc_control_set(), so it is
recommended to negotiate the final set of _OSC features with the
query flag set before calling _OSC to request control of these
features.

To implement it, rework acpi_pci_osc_control_set() so that the caller
can specify the mask of _OSC control bits to negotiate and the mask
of _OSC control bits that are absolutely necessary to it. Then,
acpi_pci_osc_control_set() will run _OSC queries in a loop until
the mask of _OSC control bits returned by the BIOS is equal to the
mask passed to it. Also, before running the _OSC request
acpi_pci_osc_control_set() will check if the caller's required
control bits are present in the final mask.

Using this mechanism we will be able to avoid situations in which the
BIOS doesn't grant control of certain _OSC features, because they
depend on some other _OSC features that have not been requested.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2b8fd9186d9275b07aef43e5bb4e98cd571f9a7d 23-Aug-2010 Rafael J. Wysocki <rjw@sisk.pl> ACPI/PCI: Do not preserve _OSC control bits returned by a query

There is the assumption in acpi_pci_osc_control_set() that it is
always sufficient to compare the mask of _OSC control bits to be
requested with the result of an _OSC query where all of the known
control bits have been checked. However, in general, that need not
be the case. For example, if an _OSC feature A depends on an _OSC
feature B and control of A, B plus another _OSC feature C is
requested simultaneously, the BIOS may return A, B, C, while it would
only return C if A and C were requested without B.

That may result in passing a wrong mask of _OSC control bits to an
_OSC control request, in which case the BIOS may only grant control
of a subset of the requested features. Moreover, acpi_pci_run_osc()
will return error code if that happens and the caller of
acpi_pci_osc_control_set() will not know that it's been granted
control of some _OSC features. Consequently, the system will
generally not work as expected.

Apart from this acpi_pci_osc_control_set() always uses the mask
of _OSC control bits returned by the very first invocation of
acpi_pci_query_osc(), but that is done with the second argument
equal to OSC_PCI_SEGMENT_GROUPS_SUPPORT which generally happens
to affect the returned _OSC control bits.

For these reasons, make acpi_pci_osc_control_set() always check if
control of the requested _OSC features will be granted before making
the final control request. As a result, the osc_control_qry and
osc_queried members of struct acpi_pci_root are not necessary any
more, so drop them and remove the remaining code referring to them.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
ab8e8957a2ae21c0f036476c6db13e949be730ac 21-Aug-2010 Rafael J. Wysocki <rjw@sisk.pl> ACPI/PCI: Make acpi_pci_query_osc() return control bits

Make acpi_pci_query_osc() use an additional pointer argument to
return the mask of control bits obtained from the BIOS to the
caller.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
b879dc4b3e81069e3f715b7569bb0f43eed76c76 21-Aug-2010 Rafael J. Wysocki <rjw@sisk.pl> ACPI/PCI: Reorder checks in acpi_pci_osc_control_set()

Make acpi_pci_osc_control_set() attempt to find the handle of the
_OSC object under the given PCI root bridge object after verifying
that its second argument is correct and that there is a struct
acpi_pci_root object for the given root bridge handle, which is
more logical than the old code.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Reviewed-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
852972acff8f10f3a15679be2059bb94916cba5d 22-Jun-2010 Matthew Garrett <mjg@redhat.com> ACPI: Disable ASPM if the platform won't provide _OSC control for PCIe

The PCI SIG documentation for the _OSC OS/firmware handshaking interface
states:

"If the _OSC control method is absent from the scope of a host bridge
device, then the operating system must not enable or attempt to use any
features defined in this section for the hierarchy originated by the host
bridge."

The obvious interpretation of this is that the OS should not attempt to use
PCIe hotplug, PME or AER - however, the specification also notes that an
_OSC method is *required* for PCIe hierarchies, and experimental validation
with An Alternative OS indicates that it doesn't use any PCIe functionality
if the _OSC method is missing. That arguably means we shouldn't be using
MSI or extended config space, but right now our problems seem to be limited
to vendors being surprised when ASPM gets enabled on machines when other
OSs refuse to do so. So, for now, let's just disable ASPM if the _OSC
method doesn't exist or refuses to hand over PCIe capability control.

Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
57283776b2b821ba4d592f61cad04d0293412740 11-Mar-2010 Bjorn Helgaas <bjorn.helgaas@hp.com> ACPI: pci_root: pass acpi_pci_root to arch-specific scan

The acpi_pci_root structure contains all the individual items (acpi_device,
domain, bus number) we pass to pci_acpi_scan_root(), so just pass the
single acpi_pci_root pointer directly.

This will make it easier to add _CBA support later. For _CBA, we need the
entire downstream bus range, not just the base bus number. We have that in
the acpi_pci_root structure, so passing the pointer makes it available to
the arch-specific code.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Reviewed-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Len Brown <len.brown@intel.com>
6ad95513d60096b569e4e4bd721420f03b57e4d4 11-Mar-2010 Bjorn Helgaas <bjorn.helgaas@hp.com> ACPI: pci_root: save downstream bus range

Previously, we only saved the root bus number, i.e., the beginning of the
downstream bus range. We now support IORESOURCE_BUS resources, so this
patch uses that to keep track of both the beginning and the end of the
downstream bus range.

It's important to know both the beginning and the end for supporting _CBA
(see PCI Firmware spec, rev 3.0, sec 4.1.3) and so we know the limits for
any possible PCI bus renumbering (we can't renumber downstream buses to be
outside the bus number range claimed by the host bridge).

It's clear from the spec that the bus range is supposed to be in _CRS, but
if we don't find it there, we'll assume [_BBN - 0xFF] or [0 - 0xFF].

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Reviewed-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Len Brown <len.brown@intel.com>
5a0e3ad6af8660be21ca98a971cd00f331318c05 24-Mar-2010 Tejun Heo <tj@kernel.org> include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
7bc5e3f2be32ae6fb0c74cd0f707f986b3a01a26 23-Feb-2010 Bjorn Helgaas <bjorn.helgaas@hp.com> x86/PCI: use host bridge _CRS info by default on 2008 and newer machines

The main benefit of using ACPI host bridge window information is that
we can do better resource allocation in systems with multiple host bridges,
e.g., http://bugzilla.kernel.org/show_bug.cgi?id=14183

Sometimes we need _CRS information even if we only have one host bridge,
e.g., https://bugs.launchpad.net/ubuntu/+source/linux/+bug/341681

Most of these systems are relatively new, so this patch turns on
"pci=use_crs" only on machines with a BIOS date of 2008 or newer.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
b67ea76172d4b1922c4b3c46c8ea8e9fec1ff38c 17-Feb-2010 Rafael J. Wysocki <rjw@sisk.pl> PCI / ACPI / PM: Platform support for PCI PME wake-up

Although the majority of PCI devices can generate PMEs that in
principle may be used to wake up devices suspended at run time,
platform support is generally necessary to convert PMEs into wake-up
events that can be delivered to the kernel. If ACPI is used for this
purpose, PME signals generated by a PCI device will trigger the ACPI
GPE associated with the device to generate an ACPI wake-up event that
we can set up a handler for, provided that everything is configured
correctly.

Unfortunately, the subset of PCI devices that have GPEs associated
with them is quite limited. The devices without dedicated GPEs have
to rely on the GPEs associated with other devices (in the majority of
cases their upstream bridges and, possibly, the root bridge) to
generate ACPI wake-up events in response to PME signals from them.

Add ACPI platform support for PCI PME wake-up:
o Add a framework making is possible to use ACPI system notify
handlers for run-time PM.
o Add new PCI platform callback ->run_wake() to struct
pci_platform_pm_ops allowing us to enable/disable the platform to
generate wake-up events for given device. Implemet this callback
for the ACPI platform.
o Define ACPI wake-up handlers for PCI devices and PCI root buses and
make the PCI-ACPI binding code register wake-up notifiers for all
PCI devices present in the ACPI tables.
o Add function pci_dev_run_wake() which can be used by PCI drivers to
check if given device is capable of generating wake-up events at
run time.

Developed in cooperation with Matthew Garrett <mjg@redhat.com>.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
c97adf9e7bebf17a86b95e2131bf9ba76c4857c7 10-Jan-2010 Márton Németh <nm127@freemail.hu> acpi: make ACPI device id constant

The ids field of the struct acpi_driver is constant in <linux/acpi/acpi_bus.h>
so it is worth to make the initialization data also constant.

The semantic match that finds this kind of pattern is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
disable decl_init,const_decl_init;
identifier I1, I2, x;
@@
struct I1 {
...
const struct I2 *x;
...
};
@s@
identifier r.I1, y;
identifier r.x, E;
@@
struct I1 y = {
.x = E,
};
@c@
identifier r.I2;
identifier s.E;
@@
const struct I2 E[] = ... ;
@depends on !c@
identifier r.I2;
identifier s.E;
@@
+ const
struct I2 E[] = ...;
// </smpl>

Signed-off-by: Márton Németh <nm127@freemail.hu>
Cc: Julia Lawall <julia@diku.dk>
Cc: cocci@diku.dk
Signed-off-by: Len Brown <len.brown@intel.com>
3a9622dc4659af44a8098a233f65c51e495ff0a5 29-Oct-2009 Shaohua Li <shaohua.li@intel.com> ACPI: cleanup pci_root _OSC code.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
497fb54f578efd2b479727bc88d5ef942c0a1e2d 13-Oct-2009 Rafael J. Wysocki <rjw@sisk.pl> ACPI / PCI: Fix NULL pointer dereference in acpi_get_pci_dev() (rev. 2)

acpi_get_pci_dev() may be called for a non-PCI device, in which case
it should return NULL. However, it assumes that every handle it
finds in the ACPI CA name space, between given device handle and the
PCI root bridge handle, corresponds to a PCI-to-PCI bridge with an
existing secondary bus. For this reason, when it finds a struct
pci_dev object corresponding to one of them, it doesn't check if
its 'subordinate' field is a valid pointer. This obviously leads to
a NULL pointer dereference if acpi_get_pci_dev() is called for a
non-PCI device with a PCI parent which is not a bridge.

To fix this issue make acpi_get_pci_dev() check if pdev->subordinate
is not NULL for every device it finds on the path between the root
bridge and the device it's supposed to get to and return NULL if the
"target" device cannot be found.

http://bugzilla.kernel.org/show_bug.cgi?id=14129
(worked in 2.6.30, regression in 2.6.31)

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Reported-by: Danny Feng <dfeng@redhat.com>
Reviewed-by: Alex Chiang <achiang@hp.com>
Tested-by: chepioq <chepioq@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
76d56de57ae60c6be383e48e7068fd973d5fb08a 24-Jul-2009 Alex Chiang <achiang@hp.com> ACPI: export acpi_pci_root and friends

We can simplify ACPI drivers if we can tell whether a handle is an
ACPI PCI root or not.

Reviewed-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
a192a9580bcc41692be1f36b77c3b681827f566a 28-Jul-2009 Len Brown <len.brown@intel.com> ACPI: Move definition of PREFIX from acpi_bus.h to internal..h

Linux/ACPI core files using internal.h all PREFIX "ACPI: ",
however, not all ACPI drivers use/want it -- and they
should not have to #undef PREFIX to define their own.

Add GPL commment to internal.h while we are there.

This does not change any actual console output,
asside from a whitespace fix.

Signed-off-by: Len Brown <len.brown@intel.com>
412af97838828bc6d035a1902c8974f944663da6 26-Jun-2009 Troy Moure <twmoure@szypr.net> ACPI: video: prevent NULL deref in acpi_get_pci_dev()

ref: http://thread.gmane.org/gmane.linux.kernel/857228/focus=857468

When the ACPI video driver initializes, it does a namespace walk
looking for for supported devices. When we find an appropriate
handle, we walk up the ACPI tree looking for a PCI root bus, and
then walk back down the PCI bus, assuming that every device
inbetween is a P2P bridge.

This assumption is not correct, and is reported broken on at
least:

Dell Latitude E6400
ThinkPad X61
Dell XPS M1330

Add a NULL deref check to prevent boot panics.

Reported-by: Alessandro Suardi <alessandro.suardi@gmail.com>
Signed-off-by: Troy Moure <twmoure@szypr.net>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
0705495d9010048e293013d9d129cf723363a0a8 18-Jun-2009 Bjorn Helgaas <bjorn.helgaas@hp.com> ACPI: pci_root: remove unused dev/fn information

We never use the PCI device & function number, so remove it to make
it clear that it's not needed. Many PCI host bridges don't even
appear in config space, so it's meaningless to look at stuff from
_ADR, which doesn't exist in that case.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Reviewed-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
c1aec8341627dad5d63cc24aa6746dc077f5b706 18-Jun-2009 Bjorn Helgaas <bjorn.helgaas@hp.com> ACPI: pci_root: simplify list traversals

Using list_for_each_entry() makes traversing the root list easier.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Reviewed-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
caf420c68afe01acd7c458ce40b85b3db5330ff5 18-Jun-2009 Bjorn Helgaas <bjorn.helgaas@hp.com> ACPI: pci_root: use driver data rather than list lookup

There's no need to search the list to find the acpi_pci_root
structure. We saved it as device->driver_data when we added
the device.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
f5eebbe119a861b5e4f5c67c886eab0937c686ed 18-Jun-2009 Bjorn Helgaas <bjorn.helgaas@hp.com> ACPI: pci_root: simplify acpi_pci_root_add() control flow

By looking up the segment & bus number earlier, we don't have to
worry about cleaning up if it fails.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
fbe2b31b4b6dfa790cbc88e00631f3112c4fc54e 18-Jun-2009 Bjorn Helgaas <bjorn.helgaas@hp.com> ACPI: pci_root: check _CRS, then _BBN for downstream bus number

To find a host bridge's downstream bus number, we currently look at _BBN
first. If _BBN returns a bus number we've already seen, we conclude that
_BBN was wrong and look for a bus number in _CRS.

However, the spec[1] (figure 5-5 and the example in sec 9.12.1) and an ACPI
FAQ[2] suggest that the OS should use _CRS to discover the bus number
range, and that _BBN is really intended to bootstrap _CRS methods that
reference PCI opregions.

This patch makes us always look at _CRS first. If _CRS doesn't supply a
bus number, we look at _BBN. If _BBN doesn't exist, we default to zero.
This makes the behavior consistent regardless of device discovery order.
Previously, if A and B had duplicate _BBNs and we found A first, we'd only
look at B's _CRS, whereas if we found B first, we'd only look at A's _CRS.

I'm told that Windows discovers host bridge bus numbers using _CRS, so
it should be fairly safe to rely on this BIOS functionality.

This patch also removes two misleading messages: we printed the "Wrong _BBN
value, reboot and use option 'pci=noacpi'" message before looking at _CRS,
so we would likely find the bus number in _CRS, the system would work fine,
and the user would be confused. The "PCI _CRS %d overrides _BBN 0" message
incorrectly assumes _BBN was zero, and it's useless anyway because we
print the segment/bus number a few lines later.

References:
[1] http://www.acpi.info/DOWNLOADS/ACPIspec30b.pdf
[2] http://www.acpi.info/acpi_faq.htm _BBN/_CRS discussion
http://download.microsoft.com/download/9/8/f/98f3fe47-dfc3-4e74-92a3-088782200fe7/TWAR05005_WinHEC05.ppt (slide 17)
http://bugzilla.kernel.org/show_bug.cgi?id=1662 ASUS PR-DLS
http://bugzilla.kernel.org/show_bug.cgi?id=1127 ASUS PR-DLSW
http://bugzilla.kernel.org/show_bug.cgi?id=1741 ASUS PR-DLS533

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Reviewed-by: Alex Chiang <achiang@hp.com>
CC: Shaohua Li <shaohua.li@intel.com>
CC: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Len Brown <len.brown@intel.com>
859a3f86ca83346f4097e956d0b27d96aa7a1cff 10-Jun-2009 Alexander Chiang <achiang@hp.com> ACPI: simplify acpi_pci_irq_add_prt() API

A PCI domain cannot change as you descend down subordinate buses, which
makes the 'segment' argument to acpi_pci_irq_add_prt() useless.

Change the interface to take a struct pci_bus *, from whence we can derive
the bus number and segment. Reducing the number of arguments makes life
simpler for callers.

Signed-off-by: Alex Chiang <achiang@hp.com>
Acked-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
499650de6906722184b639989b47227a362b62f8 10-Jun-2009 Alexander Chiang <achiang@hp.com> ACPI: eviscerate pci_bind.c

Now that we can dynamically convert an ACPI CA handle to a
struct pci_dev at runtime, there's no need to statically bind
them during boot.

acpi_pci_bind/unbind are vastly simplified, and are only used
to evaluate _PRT methods on P2P bridges and non-bridge children.

This patch also changes the time-space tradeoff ever so slightly.

Looking up the ACPI-PCI binding is never in the performance path, and by
eliminating this caching, we save 24 bytes for each _ADR device in the
ACPI namespace.

This patch lays further groundwork to eventually eliminate
the acpi_driver_ops.bind callback.

Signed-off-by: Alex Chiang <achiang@hp.com>
Acked-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2f7bbceb5b6aa938024bb4dad93c410fa59ed3b9 10-Jun-2009 Alexander Chiang <achiang@hp.com> ACPI: Introduce acpi_get_pci_dev()

Convert an ACPI CA handle to a struct pci_dev.

Performing this lookup dynamically allows us to get rid of the
ACPI-PCI binding code, which:

- eliminates struct acpi_device vs struct pci_dev lifetime issues
- lays more groundwork for eliminating .start from acpi_device_ops
and thus simplifying ACPI drivers
- whacks out a lot of code

This change lays the groundwork for eliminating much of pci_bind.c.

Although pci_root.c may not be the most logical place for this
change, putting it here saves us from having to export acpi_pci_find_root.

Signed-off-by: Alex Chiang <achiang@hp.com>
Acked-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
275582031f9b3597a1b973f3ff617adfe639faa2 10-Jun-2009 Alexander Chiang <achiang@hp.com> ACPI: Introduce acpi_is_root_bridge()

Returns whether an ACPI CA node is a PCI root bridge or not.

This API is generically useful, and shouldn't just be a hotplug function.

The implementation becomes much simpler as well.

Signed-off-by: Alex Chiang <achiang@hp.com>
Acked-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
ce597bb42aa84bc73db80509b7c37e7fbc0b75c4 10-Jun-2009 Alexander Chiang <achiang@hp.com> ACPI: make acpi_pci_bind() static

acpi_pci_root_add() explicitly assigns device->ops.bind, and later
calls acpi_pci_bind_root(), which also does the same thing.

We don't need to repeat ourselves; removing the explicit assignment
allows us to make acpi_pci_bind() static.

Signed-off-by: Alex Chiang <achiang@hp.com>
Acked-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
9f5404d8ea90bfa4d58a3936e5a3d0d28cecf60f 09-Feb-2009 Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> PCI/ACPI: rename pci_osc_control_set()

- Rename pci_osc_control_set() to acpi_pci_osc_control_set() according
to the other API names in drivers/acpi/pci_root.c.

- Move _OSC related definitions to include/linux/acpi.h because _OSC
related API is implemented in drivers/acpi/pci_root.c now.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Reviewed-by: Andrew Patterson <andrew.patterson@hp.com>
Tested-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
63f10f0f6df4e4e860b790d64bebfde85b540b0a 09-Feb-2009 Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> PCI/ACPI: move _OSC code to pci_root.c

Move PCI _OSC management code from drivers/pci/pci-acpi.c to
drivers/acpi/pci_root.c. The benefits are

- We no longer need struct osc_data and its management code (contents
are moved to struct acpi_pci_root). This simplify the code, and we
no longer care about kmalloc() failure.

- We can make pci_acpi_osc_support() be a static function, which is
called only from drivers/acpi/pci_root.c.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Reviewed-by: Andrew Patterson <andrew.patterson@hp.com>
Tested-by: Andrew Patterson <andrew.patterson@hp.com>
Acked-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
07ae95f988a34465bdcb384bfa73c03424fe2312 10-Nov-2008 Andrew Patterson <andrew.patterson@hp.com> 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>
3e1b16002af29758b6bc9c38939d43838d9335bc 10-Nov-2008 Andrew Patterson <andrew.patterson@hp.com> 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>
0ef5f8f6159e44b4faa997be08d1a3bcbf44ad08 10-Nov-2008 Andrew Patterson <andrew.patterson@hp.com> 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>
990a7ac5645883a833a11b900bb6f25b65dea65b 10-Nov-2008 Andrew Patterson <andrew.patterson@hp.com> 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>
5704d626e7c770ef4a984a697bac7eff07420a39 06-Nov-2008 Bjorn Helgaas <bjorn.helgaas@hp.com> ACPI: remove comments about debug layer/level to use

I don't think there's any point in cluttering the code with these.
Better to improve the documentation so *anybody* can figure out
what layer & level to use.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
27663c5855b10af9ec67bc7dfba001426ba21222 10-Oct-2008 Matthew Wilcox <willy@linux.intel.com> ACPI: Change acpi_evaluate_integer to support 64-bit on 32-bit kernels

As of version 2.0, ACPI can return 64-bit integers. The current
acpi_evaluate_integer only supports 64-bit integers on 64-bit platforms.
Change the argument to take a pointer to an acpi_integer so we support
64-bit integers on all platforms.

lenb: replaced use of "acpi_integer" with "unsigned long long"
lenb: fixed bug in acpi_thermal_trips_update()

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
db89b4f0dbab837d0f3de2c3e9427a8d5393afa3 22-Sep-2008 Pavel Machek <pavel@suse.cz> ACPI: catch calls of acpi_driver_data on pointer of wrong type

Catch attempts to use of acpi_driver_data on pointers of wrong type.

akpm: rewritten to use proper C typechecking and remove the
"function"-used-as-lvalue thing.

Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
b5678a34762edf2c8de1c60c125fea42a8c17e63 17-Feb-2008 Sam Ravnborg <sam@ravnborg.org> ACPI: fix section mismatch in acpi_pci_root_add

Fix following warning:
WARNING: vmlinux.o(.text+0x550e85): Section mismatch in reference from the function acpi_pci_root_add() to the function .devinit.text:pci_acpi_scan_root()

acpi_pci_root_add uses a __devinit annotated function and
it looks like annotating it __devinit too is the correct fix.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Len Brown <len.brown@intel.com>
1ba90e3a87c46500623afdc3898573e4a5ebb21b 23-Jul-2007 Thomas Renninger <trenn@suse.de> ACPI: autoload modules - Create __mod_acpi_device_table symbol for all ACPI drivers

modpost is going to use these to create e.g. acpi:ACPI0001
in modules.alias.

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
7cda93e008e1a477970adbf82dba81a5d4f0ae40 13-Feb-2007 Len Brown <len.brown@intel.com> ACPI: delete extra #defines in /drivers/acpi/ drivers

Cosmetic only.

Except in a single case, #define ACPI_*_DRIVER_NAME
were invoked 0 or 1 times.

Signed-off-by: Len Brown <len.brown@intel.com>
c2b6705b75d9c7aff98a4602a32230639e10891c 13-Feb-2007 Len Brown <len.brown@intel.com> ACPI: fix acpi_driver.name usage

It was erroneously used as a description rather than a name.

ie. turn this:

lenb@se7525gp2:/sys> ls bus/acpi/drivers
ACPI AC Adapter Driver ACPI Embedded Controller Driver ACPI Power Resource Driver
ACPI Battery Driver ACPI Fan Driver ACPI Processor Driver
ACPI Button Driver ACPI PCI Interrupt Link Driver ACPI Thermal Zone Driver
ACPI container driver ACPI PCI Root Bridge Driver hpet

into this:

lenb@se7525gp2:~> ls /sys/bus/acpi/drivers
ac battery button container ec fan hpet pci_link pci_root power processor thermal

Signed-off-by: Len Brown <len.brown@intel.com>
f52fd66d2ea794010c2d7536cf8e6abed0ac4947 13-Feb-2007 Len Brown <len.brown@intel.com> ACPI: clean up ACPI_MODULE_NAME() use

cosmetic only

Make "module name" actually match the file name.
Invoke with ';' as leaving it off confuses Lindent and gcc doesn't care.
Fix indentation where Lindent did get confused.

Signed-off-by: Len Brown <len.brown@intel.com>
d91a0078476ca536d76419f3b53196873b2931bc 06-Dec-2006 Justin Chen <justin.chen@hp.com> ACPI: Optimize acpi_get_pci_rootbridge_handle() to boot faster

Move acpi_get_pci_rootbridge_handle() from glue.c to pci_root.c and get the
root bridge ACPI handles by searching the &acpi_pci_roots list instead of
walking through the ACPI name space. This significantly reduces boot time
on large I/O systems.

Signed-off-by: Justin Chen <justin.chen@hp.com>
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2786f6e388e9dfe9e7b1c3c6bd7fcfba9cfb9831 21-Dec-2006 Rui Zhang <rui.zhang@intel.com> ACPI: fix Supermicro X7DB8+ Boot regression

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

Originally we converted bind/unbind to use a new pci bridge driver.
The driver will add/remove _PRT, so we can eventually remove
.bind/.unbind methods.

But we found that some of the _ADR-Based devices don't have _PRT,
i.e. they are not managed by the new ACPI PCI bridge driver.
So that .bind method is not called for some _ADR-Based devices,
which leads to a failure.

Now we make ACPI PCI Root Bridge Driver scan and binds all _ADR-Based devices
once the driver is loaded, in the .add method of ACPI PCI Root Bridge driver.

Extra code path for calling .bind/.unbind when _ADR-Based devices
are hot added/removed is also added.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
36bcbec7ce21e2e8b3143b11a05747330abeca70 19-Dec-2006 Burman Yan <yan_952@hotmail.com> ACPI: replace kmalloc+memset with kzalloc

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
f10bb2544bab75b3e8df15a7b51a833c78cbd77f 19-Dec-2006 Akinobu Mita <akinobu.mita@gmail.com> ACPI: fix single linked list manipulation

Fix single linked list manipulation for sub_driver. If the remving entry
is not on the head of the sub_driver list, it goes into infinate loop.

Though that infinite loop doesn't happen. Because the only user of
acpi_pci_register_dirver() is acpiphp.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
db3e1cc3257758d8a694d0a6ab29f109fb019853 07-Dec-2006 Li Shaohua <shaohua.li@intel.com> ACPI: Convert ACPI PCI .bind/.unbind to use PCI bridge driver

acpi_device had a .bind/.unbind methods, but Linux driver model does not.
Cut ACPI PCI code over to use the Linux driver model methods.

Convert bind/unbind to use a new pci bridge driver.
The driver will add/remove _PRT, so we can eventually
remove .bind/.unbind methods.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
50dd096973f1d95aa03c6a6d9e148d706b62b68e 01-Oct-2006 Jan Engelhardt <jengelh@linux01.gwdg.de> ACPI: Remove unnecessary from/to-void* and to-void casts in drivers/acpi

Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Signed-off-by: Len Brown <len.brown@intel.com>
432bfaba7d4e70483fc5af164e020066f4921bff 19-May-2006 Patrick Mochel <mochel@linux.intel.com> ACPI: pci_root: Remove unneeded acpi_handle from driver.

Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2d1e0a02f16f84c2358843d91d6ca0131a0587ce 19-May-2006 Patrick Mochel <mochel@linux.intel.com> ACPI: pci_root: Use acpi_device's handle instead of driver's

Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
32917e5b589d813c9dc0f2d140d8c52898ddb6fb 19-May-2006 Patrick Mochel <mochel@linux.intel.com> ACPI: pci root: add struct acpi_device to struct acpi_pci_root.

Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
d550d98d3317378d93a4869db204725d270ec812 27-Jun-2006 Patrick Mochel <mochel@linux.intel.com> ACPI: delete tracing macros from drivers/acpi/*.c

Signed-off-by: Len Brown <len.brown@intel.com>
6468463abd7051fcc29f3ee7c931f9bbbb26f5a4 27-Jun-2006 Len Brown <len.brown@intel.com> ACPI: un-export ACPI_ERROR() -- use printk(KERN_ERR...)

Signed-off-by: Len Brown <len.brown@intel.com>
a6fc67202e0224e6c9d1d285cc0b444bce887ed5 27-Jun-2006 Thomas Renninger <trenn@suse.de> ACPI: Enable ACPI error messages w/o CONFIG_ACPI_DEBUG

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
50eca3eb89d73d9f0aa070b126c7ee6a616016ab 01-Oct-2005 Bob Moore <robert.moore@intel.com> [ACPI] ACPICA 20050930

Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)

All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".

The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)

Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.

acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
eca008c8134df15262a0362623edb59902628c95 22-Sep-2005 Len Brown <len.brown@intel.com> [ACPI] handle ACPICA 20050916's acpi_resource.type rename

Signed-off-by: Len Brown <len.brown@intel.com>
4be44fcd3bf648b782f4460fd06dfae6c42ded4b 05-Aug-2005 Len Brown <len.brown@intel.com> [ACPI] Lindent all ACPI files

Signed-off-by: Len Brown <len.brown@intel.com>
c431ada45d65b305a6aab4557067e564b23ce5a5 28-Apr-2005 Rajesh Shah <rajesh.shah@intel.com> [PATCH] acpi bridge hotadd: ACPI based root bridge hot-add

When you hot-plug a (root) bridge hierarchy, it may have p2p bridges and
devices attached to it that have not been configured by firmware. In this
case, we need to configure the devices before starting them. This patch
separates device start from device scan so that we can introduce the
configuration step in the middle.

I kept the existing semantics for pci_scan_bus() since there are a huge number
of callers to that function.

Also, I have no way of testing the changes I made to the parisc files, so this
needs review by those folks. Sorry for the massive cross-post, this touches
files in many different places.

Signed-off-by: Rajesh Shah <rajesh.shah@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 17-Apr-2005 Linus Torvalds <torvalds@ppc970.osdl.org> Linux-2.6.12-rc2

Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!