14 Jul, 2011

1 commit

  • Commit 28c2103 added new state ACPI_STATE_D3_COLD, so the device power
    states array must be expanded by one also.

    v2: Use ACPI_D_STATE_COUNT instead of number 5 for the array size.

    Reported-by: Dan Carpenter
    Suggested-by: Oldřich Jedlička
    Signed-off-by: Lin Ming
    Signed-off-by: Len Brown

    Lin Ming
     

23 Mar, 2011

1 commit


15 Mar, 2011

1 commit


25 Feb, 2011

1 commit

  • The wakeup.run_wake_count ACPI device field is only used by the PCI
    runtime PM code to "protect" devices from being prepared for
    generating wakeup signals more than once in a row. However, it
    really doesn't provide any protection, because (1) all of the
    functions it is supposed to protect use their own reference counters
    effectively ensuring that the device will be set up for generating
    wakeup signals just once and (2) the PCI runtime PM code uses
    wakeup.run_wake_count in a racy way, since nothing prevents
    acpi_dev_run_wake() from being called concurrently from two different
    threads for the same device.

    Remove the wakeup.run_wake_count ACPI device field which is
    unnecessary, confusing and used in a wrong way.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

12 Jan, 2011

5 commits

  • The wake_capable ACPI device flag is not necessary, because it is
    only used in scan.c for recording the information that _PRW is
    present for the given device. That information is only used by
    acpi_add_single_object() to decide whether or not to call
    acpi_bus_get_wakeup_device_flags(), so the flag may be dropped
    if the _PRW check is moved to acpi_bus_get_wakeup_device_flags().
    Moreover, acpi_bus_get_wakeup_device_flags() always returns 0,
    so it really should be void.

    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Len Brown

    Rafael J. Wysocki
     
  • Len Brown
     
  • There are no more users of acpi_bus_get_power(), so it can be
    dropped. Moreover, it should be dropped, because it modifies
    the device->power.state field of an ACPI device without updating
    the reference counters of the device's power resources, which is
    wrong.

    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Len Brown

    Rafael J. Wysocki
     
  • Use the new function acpi_bus_update_power() for manipulating power
    resources used by ACPI fan devices, which allows them to be put into
    the right state during initialization and resume. Consequently,
    remove the flags.force_power_state field from struct acpi_device,
    which is not necessary any more.

    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Len Brown

    Rafael J. Wysocki
     
  • Add function acpi_bus_update_power() for reading the actual power
    state of an ACPI device and updating its device->power.state field
    in such a way that its power resources' reference counters will
    remain consistent with that field.

    For this purpose introduce __acpi_bus_set_power() setting the
    power state of an ACPI device without updating its
    device->power.state field and make acpi_bus_set_power() and
    acpi_bus_update_power() use it (acpi_bus_set_power() retains the
    current behavior for now).

    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Len Brown

    Rafael J. Wysocki
     

07 Jan, 2011

1 commit


25 Oct, 2010

1 commit


16 Oct, 2010

1 commit

  • There is a number of problems with acpi_pm_device_sleep_state() now.
    First, if _S0W is not defined, it prevents devices from being put
    into D3 by PCI runtime PM, which shouldn't happen. Second, it
    shouldn't use adev->wakeup.state.enabled, because if it's set, it
    only means that either the device is permanently enabled to wake up
    the system, or that it has been enabled to do that through
    /proc/acpi/wakeup. Finally, it should be compiled if CONFIG_PM_SLEEP
    is not set, so that PCI runtime PM works correctly in that case.
    Fix these problems.

    Reported-by: Matthew Garrett
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Len Brown

    Rafael J. Wysocki
     

02 Oct, 2010

1 commit


25 Aug, 2010

1 commit

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

    Rafael J. Wysocki
     

04 Apr, 2010

1 commit

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

    Bjorn Helgaas
     

02 Mar, 2010

1 commit

  • * 'acpica' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
    ACPI: replace acpi_integer by u64
    ACPICA: Update version to 20100121.
    ACPICA: Remove unused uint32_struct type
    ACPICA: Disassembler: Remove obsolete "Integer64" field in parse object
    ACPICA: Remove obsolete ACPI_INTEGER (acpi_integer) type
    ACPICA: Predefined name repair: fix NULL package elements
    ACPICA: AcpiGetDevices: Eliminate unnecessary _STA calls
    ACPICA: Update all ACPICA copyrights and signons to 2010
    ACPICA: Update for new gcc-4 warning options

    Linus Torvalds
     

23 Feb, 2010

2 commits

  • 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 .

    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Jesse Barnes

    Rafael J. Wysocki
     
  • Use the run_wake flag to mark all devices for which run-time wake-up
    events may be generated by the platform. Introduce a new wake-up
    flag, always_enabled, for marking devices that should be permanently
    enabled to generate run-time events. Also, introduce a reference
    counter for run-wake devices and a function that will initialize all
    of the run-time wake-up fields for given device.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Len Brown
    Signed-off-by: Jesse Barnes

    Rafael J. Wysocki
     

28 Jan, 2010

1 commit


26 Sep, 2009

7 commits

  • Nobody uses acpi_device_uid(), so this patch removes it.

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

    Bjorn Helgaas
     
  • Every acpi_device has at least one ID (if there's no _HID or _CID, we
    give it a synthetic or default ID). So there's no longer a need to
    check whether an ID exists; we can just use it.

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

    Bjorn Helgaas
     
  • We now keep a single list of IDs that includes both the _HID and any
    _CIDs. We no longer need to keep track of whether the device has a _CID.

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

    Bjorn Helgaas
     
  • There's no need to treat _HID and _CID differently. Keeping them in
    a single list makes code that uses the IDs a little simpler because it
    can just traverse the list rather than checking "do we have a HID?",
    "do we have any CIDs?"

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

    Bjorn Helgaas
     
  • Add acpi_bus_get_status_handle() so we can get the status of a namespace
    object before building a struct acpi_device.

    This removes a use of "device->flags.dynamic_status", a cached indicator of
    whether _STA exists. It seems simpler and more reliable to just evaluate
    _STA and catch AE_NOT_FOUND errors.

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

    Bjorn Helgaas
     
  • We can identify the root of the ACPI device tree by the fact that it
    has no parent. This is simpler than passing around ACPI_BUS_TYPE_SYSTEM
    and will help remove special treatment of the device tree root.

    Currently, we add the root by hand with ACPI_BUS_TYPE_SYSTEM. If we
    traverse the tree treating the root as just another device and use
    acpi_get_type(), the root shows up as ACPI_TYPE_DEVICE.

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

    Bjorn Helgaas
     
  • Most uses of the ACPI bus device_type (ACPI_BUS_TYPE_DEVICE,
    ACPI_BUS_TYPE_POWER, etc) are during device initialization, but
    we do need it later for notify handler installation, since that
    is different for fixed hardware devices vs. namespace devices.

    This patch saves the device_type in the acpi_device structure,
    so we can check that rather than comparing against the _HID string.

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

    Bjorn Helgaas
     

24 Sep, 2009

1 commit

  • * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (119 commits)
    ACPI: don't pass handle for fixed hardware notifications
    ACPI: remove null pointer checks in deferred execution path
    ACPI: simplify deferred execution path
    acerhdf: additional BIOS versions
    acerhdf: convert to dev_pm_ops
    acerhdf: fix fan control for AOA150 model
    thermal: add missing Kconfig dependency
    acpi: switch /proc/acpi/{debug_layer,debug_level} to seq_file
    hp-wmi: fix rfkill memory leak on unload
    ACPI: remove unnecessary #ifdef CONFIG_DMI
    ACPI: linux/acpi.h should not include linux/dmi.h
    hwmon driver for ACPI 4.0 power meters
    topstar-laptop: add new driver for hotkeys support on Topstar N01
    thinkpad_acpi: fix rfkill memory leak on unload
    thinkpad-acpi: report brightness events when required
    thinkpad-acpi: don't poll by default any of the reserved hotkeys
    thinkpad-acpi: Fix procfs hotkey reset command
    thinkpad-acpi: deprecate hotkey_bios_mask
    thinkpad-acpi: hotkey poll fixes
    thinkpad-acpi: be more strict when detecting a ThinkPad
    ...

    Linus Torvalds
     

20 Sep, 2009

1 commit


19 Sep, 2009

3 commits


10 Sep, 2009

2 commits

  • The wakeup.prepared flag is used for marking devices that have the
    wake-up power already enabled, so that the wake-up power is not
    enabled twice in a row for the same device. This assumes, however,
    that device wake-up power will only be enabled once, while the device
    is being prepared for a system-wide sleep transition, and the second
    attempt is made by acpi_enable_wakeup_device_prep().

    With the upcoming PCI wake-up rework this assumption will not hold
    any more for PCI bridges and the root bridge whose wake-up power
    may be enabled as a result of wake-up enable propagation from other
    devices (eg. add-on devices that are not associated with any GPEs).
    Thus, there may be many attempts to enable wake-up power on a PCI
    bridge or the root bridge during a system power state transition
    and it's better to replace wakeup.prepared with a reference counter.

    Reviewed-by: Matthew Garrett
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Jesse Barnes

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

    Reviewed-by: Bjorn Helgaas
    Signed-off-by: Alex Chiang
    Signed-off-by: Jesse Barnes

    Alex Chiang
     

29 Aug, 2009

1 commit

  • 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
     

27 Aug, 2009

2 commits

  • Handler was never invoked. Now invoked if/when host node is deleted.
    Data object was not automatically deleted when host node was deleted.
    Interface to handler had an unused parameter, removed it.
    ACPICA BZ 778.

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

    Signed-off-by: Bob Moore
    Signed-off-by: Lin Ming
    Signed-off-by: Len Brown

    Bob Moore
     
  • Completed a major update for the acpi_get_object_info external interface.
    Changes include:
    - Support for variable, unlimited length HID, UID, and CID strings
    - Support Processor objects the same as Devices (HID,UID,CID,ADR,STA, etc.)
    - Call the _SxW power methods on behalf of a device object
    - Determine if a device is a PCI root bridge
    - Change the ACPI_BUFFER parameter to ACPI_DEVICE_INFO.
    These changes will require an update to all callers of this interface.
    See the ACPICA Programmer Reference for details.

    Also, update all invocations of acpi_get_object_info interface

    Signed-off-by: Bob Moore
    Signed-off-by: Lin Ming
    Signed-off-by: Len Brown

    Bob Moore
     

26 Jun, 2009

1 commit


24 Jun, 2009

2 commits


18 Jun, 2009

1 commit

  • System notify events (0x00-0x7f) are common across all device types
    and should be handled in Linux/ACPI, not in drivers. However, some
    BIOSes use system notify events in device-specific ways that require
    the driver to be involved.

    This patch adds a ACPI_DRIVER_ALL_NOTIFY_EVENTS driver flag. When a
    driver sets this flag and supplies a .notify method, Linux/ACPI calls
    the .notify method for ALL notify events on the device, not just the
    device-specific (0x80-0xff) events.

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

    Bjorn Helgaas