08 Jul, 2015

1 commit


07 May, 2014

1 commit


22 Feb, 2014

1 commit


21 Feb, 2014

1 commit


07 Dec, 2013

1 commit

  • Replace direct inclusions of , and
    , which are incorrect, with
    inclusions and remove some inclusions of those files that aren't
    necessary.

    First of all, , and
    should not be included directly from any files that are built for
    CONFIG_ACPI unset, because that generally leads to build warnings about
    undefined symbols in !CONFIG_ACPI builds. For CONFIG_ACPI set,
    includes those files and for CONFIG_ACPI unset it
    provides stub ACPI symbols to be used in that case.

    Second, there are ordering dependencies between those files that always
    have to be met. Namely, it is required that be included
    prior to so that the acpi_pci_root declarations the
    latter depends on are always there. And which provides
    basic ACPICA type declarations should always be included prior to any other
    ACPI headers in CONFIG_ACPI builds. That also is taken care of including
    as appropriate.

    Signed-off-by: Lv Zheng
    Cc: Greg Kroah-Hartman
    Cc: Matthew Garrett
    Cc: Tony Luck
    Cc: "H. Peter Anvin"
    Acked-by: Bjorn Helgaas (drivers/pci stuff)
    Acked-by: Konrad Rzeszutek Wilk (Xen stuff)
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     

15 Jul, 2013

2 commits

  • The only user of the ACPI dock notifier chain is the ACPI-based PCI
    hotplug (acpiphp) driver that uses it to carry out post-dock fixups
    needed by some systems with broken _DCK. However, it is not
    necessary to use a separate notifier chain for that, as it can be
    simply replaced with a new callback in struct acpi_dock_ops.

    For this reason, add a new .fixup() callback to struct acpi_dock_ops
    and make hotplug_dock_devices() execute it for all dock devices with
    hotplug operations registered. Accordingly, make acpiphp point that
    callback to the function carrying out the post-dock fixups and
    do not register a separate dock notifier for each device
    registering dock operations. Finally, drop the ACPI dock notifier
    chain that has no more users.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Since commit 94add0f (ACPI / dock: Initialize ACPI dock subsystem
    upfront) the ACPI dock driver cannot be a module, so
    CONFIG_ACPI_DOCK_MODULE is never set. For this reason, simplify
    the preprocessor conditional in include/acpi/acpi_drivers.h
    referring to that sybbol unnecessarily.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

24 Jun, 2013

1 commit

  • The interactions between the ACPI dock driver and the ACPI-based PCI
    hotplug (acpiphp) are currently problematic because of ordering
    issues during hot-remove operations.

    First of all, the current ACPI glue code expects that physical
    devices will always be deleted before deleting the companion ACPI
    device objects. Otherwise, acpi_unbind_one() will fail with a
    warning message printed to the kernel log, for example:

    [ 185.026073] usb usb5: Oops, 'acpi_handle' corrupt
    [ 185.035150] pci 0000:1b:00.0: Oops, 'acpi_handle' corrupt
    [ 185.035515] pci 0000:18:02.0: Oops, 'acpi_handle' corrupt
    [ 180.013656] port1: Oops, 'acpi_handle' corrupt

    This means, in particular, that struct pci_dev objects have to
    be deleted before the struct acpi_device objects they are "glued"
    with.

    Now, the following happens the during the undocking of an ACPI-based
    dock station:
    1) hotplug_dock_devices() invokes registered hotplug callbacks to
    destroy physical devices associated with the ACPI device objects
    depending on the dock station. It calls dd->ops->handler() for
    each of those device objects.
    2) For PCI devices dd->ops->handler() points to
    handle_hotplug_event_func() that queues up a separate work item
    to execute _handle_hotplug_event_func() for the given device and
    returns immediately. That work item will be executed later.
    3) hotplug_dock_devices() calls dock_remove_acpi_device() for each
    device depending on the dock station. This runs acpi_bus_trim()
    for each of them, which causes the underlying ACPI device object
    to be destroyed, but the work items queued up by
    handle_hotplug_event_func() haven't been started yet.
    4) _handle_hotplug_event_func() queued up in step 2) are executed
    and cause the above failure to happen, because the PCI devices
    they handle do not have the companion ACPI device objects any
    more (those objects have been deleted in step 3).

    The possible breakage doesn't end here, though, because
    hotplug_dock_devices() may return before at least some of the
    _handle_hotplug_event_func() work items spawned by it have a
    chance to complete and then undock() will cause _DCK to be
    evaluated and that will cause the devices handled by the
    _handle_hotplug_event_func() to go away possibly while they are
    being accessed.

    This means that dd->ops->handler() for PCI devices should not point
    to handle_hotplug_event_func(). Instead, it should point to a
    function that will do the work of _handle_hotplug_event_func()
    synchronously. For this reason, introduce such a function,
    hotplug_event_func(), and modity acpiphp_dock_ops to point to
    it as the handler.

    Unfortunately, however, this is not sufficient, because if the dock
    code were not changed further, hotplug_event_func() would now
    deadlock with hotplug_dock_devices() that called it, since it would
    run unregister_hotplug_dock_device() which in turn would attempt to
    acquire the dock station's hp_lock mutex already acquired by
    hotplug_dock_devices().

    To resolve that deadlock use the observation that
    unregister_hotplug_dock_device() won't need to acquire hp_lock
    if PCI bridges the devices on the dock station depend on are
    prevented from being removed prematurely while the first loop in
    hotplug_dock_devices() is in progress.

    To make that possible, introduce a mechanism by which the callers of
    register_hotplug_dock_device() can provide "init" and "release"
    routines that will be executed, respectively, during the addition
    and removal of the physical device object associated with the
    given ACPI device handle. Make acpiphp use two new functions,
    acpiphp_dock_init() and acpiphp_dock_release(), that call
    get_bridge() and put_bridge(), respectively, on the acpiphp bridge
    holding the given device, for this purpose.

    In addition to that, remove the dock station's list of
    "hotplug devices" and make the dock code always walk the whole list
    of "dependent devices" instead in such a way that the loops in
    hotplug_dock_devices() and dock_event() (replacing the loops over
    "hotplug devices") will take references to the list entries that
    register_hotplug_dock_device() has been called for. That prevents
    the "release" routines associated with those entries from being
    called while the given entry is being processed and for PCI
    devices this means that their bridges won't be removed (by a
    concurrent thread) while hotplug_event_func() handling them is
    being executed.

    This change is based on two earlier patches from Jiang Liu.

    References: https://bugzilla.kernel.org/show_bug.cgi?id=59501
    Reported-and-tested-by: Alexander E. Patrakov
    Tracked-down-by: Jiang Liu
    Tested-by: Illya Klymov
    Signed-off-by: Rafael J. Wysocki
    Acked-by: Yinghai Lu
    Cc: 3.9+

    Rafael J. Wysocki
     

25 Mar, 2013

1 commit


17 Feb, 2013

1 commit

  • Previously, we cached _PRT (PCI routing table, ACPI 5.0 sec 6.2.12)
    contents and associated each _PRT entry with a PCI bus number. The bus
    number association means dependencies on PCI device enumeration and bus
    number assignment, as well as on the PCI/ACPI binding process.

    After 4f535093cf ("PCI: Put pci_dev in device tree as early as possible"),
    these dependencies caused the IRQ issues reported by Peter:

    pci 0000:00:1e.0: PCI bridge to [bus 09] (subtractive decode)
    pci 0000:00:1e.0: can't derive routing for PCI INT A
    snd_ctxfi 0000:09:02.0: PCI INT A: no GSI - using ISA IRQ 5
    irq 18: nobody cared (try booting with the "irqpoll" option)

    This patch removes _PRT caching. Instead, we evaluate _PRT as needed
    in the pci_enable_device() path. This also removes the dependency on
    PCI bus numbers: we can simply look at the _PRT associated with each
    bridge as we walk upstream toward the root.

    [bhelgaas: changelog]
    Reference: https://bugzilla.kernel.org/show_bug.cgi?id=53561
    Reported-and-tested-by: Peter Hurley
    Suggested-by: Bjorn Helgaas
    Signed-off-by: Yinghai Lu
    Signed-off-by: Bjorn Helgaas

    Yinghai Lu
     

06 Nov, 2012

1 commit

  • This effectively reverts 859a3f86ca8 ("ACPI: simplify
    acpi_pci_irq_add_prt() API") and d9efae3688a ("ACPI: simplify
    acpi_pci_irq_del_prt() API").

    The reason is to disentangle these routines from the struct pci_bus.
    We want to be able to add the _PRT before the struct pci_bus
    exists, and delete the _PRT after we've removed the pci_bus.

    Signed-off-by: Bjorn Helgaas
    Signed-off-by: Taku Izumi

    Bjorn Helgaas
     

07 Nov, 2011

1 commit

  • Recently the ACPI ops structs were constified but the inline version
    of register_hotplug_dock_device() was overlooked (see also commit
    9c8b04b, June 25 2011). Update the inline function
    register_hotplug_dock_device() that is enabled with
    CONFIG_ACPI_DOCK=n too. This patch fixes at least the following
    compiler warnings:

    drivers/ata/libata-acpi.c: In function .ata_acpi_associate.:
    drivers/ata/libata-acpi.c:266:11: warning: passing argument 2 of .register_hotplug_dock_device. discards qualifiers from pointer target type
    include/acpi/acpi_drivers.h:146:19: note: expected .struct acpi_dock_ops *. but argument is of type .const struct acpi_dock_ops *.
    drivers/ata/libata-acpi.c:275:11: warning: passing argument 2 of .register_hotplug_dock_device. discards qualifiers from pointer target type
    include/acpi/acpi_drivers.h:146:19: note: expected .struct acpi_dock_ops *. but argument is of type .const struct acpi_dock_ops *.

    Cc: stable@vger.kernel.org
    Signed-off-by: Len Brown

    Bart Van Assche
     

17 Jul, 2011

1 commit

  • Structs battery_file, acpi_dock_ops, file_operations,
    thermal_cooling_device_ops, thermal_zone_device_ops, kernel_param_ops
    are not changed in runtime. It is safe to make them const.
    register_hotplug_dock_device() was altered to take const "ops" argument
    to respect acpi_dock_ops' const notion.

    Signed-off-by: Vasiliy Kulikov
    Acked-by: Jeff Garzik
    Signed-off-by: Len Brown

    Vasiliy Kulikov
     

20 Oct, 2010

1 commit


04 Apr, 2010

1 commit

  • 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
    Reviewed-by: Kenji Kaneshige
    Signed-off-by: Len Brown

    Bjorn Helgaas
     

24 Mar, 2010

1 commit

  • On some old IBM workstations and desktop computers, the BIOS presents in the
    DSDT an SMBus object that is missing the HID identifier that the i2c-scmi
    driver looks for. Modify the ACPI device scan code to insert the missing HID
    if it finds an IBM system with such an object.

    Affected machines: IntelliStation Z20/Z30. Note that the i2c-i801 driver no
    longer works on these machines because of ACPI resource conflicts.

    Signed-off-by: Darrick J. Wong
    Signed-off-by: Jean Delvare

    Darrick J. Wong
     

24 Feb, 2010

1 commit

  • 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
    Signed-off-by: Jesse Barnes

    Bjorn Helgaas
     

24 Jun, 2009

1 commit


18 Jun, 2009

6 commits

  • acpi_get_pci_dev() is better, and all callers have been converted, so
    eliminate acpi_get_pci_id().

    Signed-off-by: Alex Chiang
    Acked-by: Bjorn Helgaas
    Signed-off-by: Len Brown

    Alexander Chiang
     
  • There is no need to pass a segment/bus tuple to this API, as the callsite
    always has a struct pci_bus. We can derive segment/bus from the
    struct pci_bus, so let's take this opportunit to simplify the API and
    make life easier for the callers.

    Signed-off-by: Alex Chiang
    Acked-by: Bjorn Helgaas
    Signed-off-by: Len Brown

    Alexander Chiang
     
  • 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
    Acked-by: Bjorn Helgaas
    Signed-off-by: Len Brown

    Alexander Chiang
     
  • 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
    Acked-by: Bjorn Helgaas
    Signed-off-by: Len Brown

    Alexander Chiang
     
  • 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
    Acked-by: Bjorn Helgaas
    Signed-off-by: Len Brown

    Alexander Chiang
     
  • 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
    Acked-by: Bjorn Helgaas
    Signed-off-by: Len Brown

    Alexander Chiang
     

28 May, 2009

2 commits

  • The ACPI0007 _HID used for processor "Device" objects in the namespace
    is not needed outside the processor driver, so move it there. Also, the
    #define is only used once, so just remove it and hard-code "ACPI0007".

    Signed-off-by: Bjorn Helgaas
    Signed-off-by: Len Brown

    Bjorn Helgaas
     
  • ACPI_PROCESSOR_OBJECT_HID is a synthetic _HID that Linux generates
    for "Processor" definitions. Unlike "Device" definitions, "Processor"
    definitions do not have a _HID in the namespace, so we generate a
    fake _HID. By convention, all these fake _HIDs begin with "LNX".

    This does change the user-visible _HID for "Processor" objects --
    previously, we used "ACPI_CPU" and this changes that to "LNXCPU",
    which starts with "LNX" as do all the other made-up _HIDs. This
    change is visible in processor filenames and "hid" files under
    /sys/devices/LNXSYSTM:00/.

    Signed-off-by: Bjorn Helgaas
    Signed-off-by: Len Brown

    Bjorn Helgaas
     

05 Apr, 2009

1 commit

  • This patch adds support for ACPI device driver .notify() methods. If
    such a method is present, Linux/ACPI installs a handler for device
    notifications (but not for system notifications such as Bus Check,
    Device Check, etc). When a device notification occurs, Linux/ACPI
    passes it on to the driver's .notify() method.

    In most cases, this removes the need for drivers to install their own
    handlers for device-specific notifications.

    For fixed hardware devices like some power and sleep buttons, there's
    no notification value because there's no control method to execute a
    Notify opcode. When a fixed hardware device generates an event, we
    handle it the same as a regular device notification, except we send
    a ACPI_FIXED_HARDWARE_EVENT value. This is outside the normal 0x0-0xff
    range used by Notify opcodes.

    Several drivers install their own handlers for system Bus Check and
    Device Check notifications so they can support hot-plug. This patch
    doesn't affect that usage.

    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Alex Chiang
    Signed-off-by: Len Brown

    Bjorn Helgaas
     

17 Mar, 2009

1 commit

  • A number of things that shouldn't be exposed outside the ACPI core
    were declared in include/acpi/acpi_drivers.h, where anybody can
    see them. This patch moves those declarations to a new "internal.h"
    inside drivers/acpi.

    Signed-off-by: Bjorn Helgaas
    Signed-off-by: Len Brown

    Bjorn Helgaas
     

12 Nov, 2008

1 commit


08 Nov, 2008

3 commits


07 Nov, 2008

3 commits

  • Declaring processors in ACPI namespace can be done using either a
    "Processor" definition or a "Device" definition (see section 8.4 -
    Declaring Processors; "Advanced Configuration and Power Interface
    Specification", Revision 3.0b). Currently the two processor
    declaration types are conflated.

    This patch disambiguates the processor declaration's definition type
    enabling subsequent code to behave uniquely based explicitly on the
    declaration's type.

    Signed-off-by: Myron Stowe
    Signed-off-by: Len Brown

    Myron Stowe
     
  • Remove CONFIG_ACPI_EC. It was always set the same as CONFIG_ACPI,
    and it had no menu label, so there was no way to set it to anything
    other than "y".

    Per section 6.5.4 of the ACPI 3.0b specification,

    OSPM must make Embedded Controller operation regions, accessed
    via the Embedded Controllers described in ECDT, available before
    executing any control method.

    The ECDT table is optional, but if it is present, the above text
    means that the EC it describes is a required part of the ACPI
    subsystem, so CONFIG_ACPI_EC=n wouldn't make sense.

    Signed-off-by: Bjorn Helgaas
    Acked-by: Alexey Starikovskiy
    Signed-off-by: Len Brown

    Bjorn Helgaas
     
  • Remove CONFIG_ACPI_POWER. It was always set the same as CONFIG_ACPI,
    and it had no menu label, so there was no way to set it to anything
    other than "y".

    The interfaces under CONFIG_ACPI_POWER (acpi_device_sleep_wake(),
    acpi_power_transition(), etc) are called unconditionally from the
    ACPI core, so we already depend on it always being present.

    Signed-off-by: Bjorn Helgaas
    Signed-off-by: Len Brown

    Bjorn Helgaas
     

23 Oct, 2008

3 commits

  • Len Brown
     
  • Conflicts:
    drivers/acpi/osl.c

    Signed-off-by: Len Brown

    Len Brown
     
  • 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
    Signed-off-by: Zhang Rui
    Signed-off-by: Li Shaohua
    Signed-off-by: Andi Kleen
    Signed-off-by: Len Brown

    Zhao Yakui
     

11 Oct, 2008

1 commit

  • when there is no ECDT table and no _INI object for EC device, it will be
    enabled before scanning ACPI device. But it is too late after the following
    the commit is merged.
    >commit 7752d5cfe3d11ca0bb9c673ec38bd78ba6578f8e
    > Author: Robert Hancock
    > Date: Fri Feb 15 01:27:20 2008 -0800
    >x86: validate against acpi motherboard resources

    After the above commit is merged, OS will check whether MCFG area is
    reserved in ACPI motherboard resources by calling the function of
    acpi_get_devices when there exists MCFG table. In the acpi_get_devices the _STA
    object will be evaluated to check the status of the ACPI device. On some broken
    BIOS the MYEC object of EC device is initialized as one, which indicates that
    EC operation region is already accessible before enabling EC device.So on these
    broken BIOS the EC operation region will be accessed in course of evaluating
    the _STA object before enabling EC device, which causes that OS will print the
    following warning messages:
    >ACPI Error (evregion-0315): No handler for Region [EC__] (ffff88007f8145e8)
    [EmbeddedControl] [20080609]
    >ACPI Error (exfldio-0290): Region EmbeddedControl(3) has no handler [20080321]
    >ACPI Error (psparse-0530): Method parse/execution failed [\_SB_.PCI0.SBRG.
    EC__.BAT1._STA] (Node ffff81013fc17a00), AE_NOT_EXIST
    >ACPI Error (uteval-0233): Method execution failed [\_SB_.PCI0.SBRG.EC__.BAT1.
    _STA] (Node ffff81013fc17a00), AE_NOT_EXIST

    Although the above warning message is harmless, it looks confusing.
    So it is necessary to enable EC device as early as possible.Maybe it is
    appropriate to enable it immediately after ACPI full initialization.

    http://bugzilla.kernel.org/show_bug.cgi?id=11255
    http://bugzilla.kernel.org/show_bug.cgi?id=11374
    http://bugzilla.kernel.org/show_bug.cgi?id=11660

    Signed-off-by: Zhao Yakui
    Acked-by: Alexey Starikovskiy
    Signed-off-by: Len Brown

    Zhao Yakui
     

24 Sep, 2008

1 commit

  • dock's uevent reported itself, not ata. It might be difficult to find an
    ata device just according to a dock. This patch introduces docking ops
    for each device in a dock. when docking, dock driver can send device
    specific uevent. This should help dock station too (not just bay)

    Signed-off-by: Shaohua Li
    Acked-by: Tejun Heo
    Signed-off-by: Len Brown

    Shaohua Li