23 Oct, 2020

1 commit


09 May, 2020

1 commit

  • With a recent fix to the pinctrl-cherryview driver we now have
    2 drivers open-coding the parameter building / passing for calling
    _REG on an ACPI handle.

    Add a helper for this, so that these 2 drivers can be converted to this
    helper.

    Suggested-by: Andy Shevchenko
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Hans de Goede
    Signed-off-by: Rafael J. Wysocki

    Hans de Goede
     

15 Oct, 2019

2 commits

  • There are users outside of ACPI realm which reimplementing the comparator
    function to check if the given device matches to given HID and UID.

    For better utilization, introduce a helper for everyone to use.

    Signed-off-by: Andy Shevchenko
    Reviewed-by: Mika Westerberg
    Signed-off-by: Rafael J. Wysocki

    Andy Shevchenko
     
  • Kernel documentation script complains that some of the function parameters
    are not described:

    drivers/acpi/utils.c:462: warning: Function parameter or member 'handle' not described in 'acpi_handle_path'
    drivers/acpi/utils.c:484: warning: Function parameter or member 'level' not described in 'acpi_handle_printk'
    drivers/acpi/utils.c:484: warning: Function parameter or member 'handle' not described in 'acpi_handle_printk'
    drivers/acpi/utils.c:484: warning: Function parameter or member 'fmt' not described in 'acpi_handle_printk'
    drivers/acpi/utils.c:513: warning: Function parameter or member 'descriptor' not described in '__acpi_handle_debug'
    drivers/acpi/utils.c:513: warning: Function parameter or member 'handle' not described in '__acpi_handle_debug'
    drivers/acpi/utils.c:513: warning: Function parameter or member 'fmt' not described in '__acpi_handle_debug'

    Describe function parameters where it's appropriate.

    Signed-off-by: Andy Shevchenko
    Reviewed-by: Mika Westerberg
    Signed-off-by: Rafael J. Wysocki

    Andy Shevchenko
     

24 Jun, 2019

2 commits

  • There is an arbitrary difference between the prototypes of
    bus_find_device() and class_find_device() preventing their callers
    from passing the same pair of data and match() arguments to both of
    them, which is the const qualifier used in the prototype of
    class_find_device(). If that qualifier is also used in the
    bus_find_device() prototype, it will be possible to pass the same
    match() callback function to both bus_find_device() and
    class_find_device(), which will allow some optimizations to be made in
    order to avoid code duplication going forward. Also with that, constify
    the "data" parameter as it is passed as a const to the match function.

    For this reason, change the prototype of bus_find_device() to match
    the prototype of class_find_device() and adjust its callers to use the
    const qualifier in accordance with the new prototype of it.

    Cc: Alexander Shishkin
    Cc: Andrew Lunn
    Cc: Andreas Noever
    Cc: Arnd Bergmann
    Cc: Bjorn Helgaas
    Cc: Corey Minyard
    Cc: Christian Borntraeger
    Cc: David Kershner
    Cc: "David S. Miller"
    Cc: David Airlie
    Cc: Felipe Balbi
    Cc: Frank Rowand
    Cc: Grygorii Strashko
    Cc: Harald Freudenberger
    Cc: Hartmut Knaack
    Cc: Heiko Stuebner
    Cc: Jason Gunthorpe
    Cc: Jonathan Cameron
    Cc: "James E.J. Bottomley"
    Cc: Len Brown
    Cc: Mark Brown
    Cc: Michael Ellerman
    Cc: Michael Jamet
    Cc: "Martin K. Petersen"
    Cc: Peter Oberparleiter
    Cc: Sebastian Ott
    Cc: Srinivas Kandagatla
    Cc: Yehezkel Bernat
    Cc: rafael@kernel.org
    Acked-by: Corey Minyard
    Acked-by: David Kershner
    Acked-by: Mark Brown
    Acked-by: Rafael J. Wysocki
    Acked-by: Srinivas Kandagatla
    Acked-by: Wolfram Sang # for the I2C parts
    Acked-by: Rob Herring
    Signed-off-by: Suzuki K Poulose
    Signed-off-by: Greg Kroah-Hartman

    Suzuki K Poulose
     
  • The prototype of bus_find_device() will be unified with that of
    class_find_device() subsequently, but for this purpose the callback
    functions passed to it need to take (const void *) as the second
    argument. Consequently, they cannot modify the memory pointed to by
    that argument which currently is not the case for acpi_dev_match_cb().
    However, acpi_dev_match_cb() really need not modify the "match" object
    passed to it, because acpi_dev_get_first_match_dev() which uses it via
    bus_find_device() can easily convert the result of bus_find_device()
    into the pointer to return.

    For this reason, update acpi_dev_match_cb() to avoid the redundant
    memory updates.

    Cc: Len Brown
    Cc: linux-acpi@vger.kernel.org
    Signed-off-by: Suzuki K Poulose
    Reviewed-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Suzuki K Poulose
     

31 May, 2019

1 commit

  • Based on 3 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version this program is distributed in the
    hope that it will be useful but without any warranty without even
    the implied warranty of merchantability or fitness for a particular
    purpose see the gnu general public license for more details

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version [author] [kishon] [vijay] [abraham]
    [i] [kishon]@[ti] [com] this program is distributed in the hope that
    it will be useful but without any warranty without even the implied
    warranty of merchantability or fitness for a particular purpose see
    the gnu general public license for more details

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version [author] [graeme] [gregory]
    [gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i]
    [kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema]
    [hk] [hemahk]@[ti] [com] this program is distributed in the hope
    that it will be useful but without any warranty without even the
    implied warranty of merchantability or fitness for a particular
    purpose see the gnu general public license for more details

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 1105 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Richard Fontana
    Reviewed-by: Kate Stewart
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070033.202006027@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

01 Apr, 2019

2 commits


20 Mar, 2019

1 commit

  • When commit 8661423eea1a ("ACPI / utils: Add new acpi_dev_present
    helper") introduced acpi_dev_present(), it missed the fact that
    bus_find_device() took a reference on the device found by it and
    the callers of acpi_dev_present() don't drop that reference.

    Drop the reference on the device in acpi_dev_present().

    Fixes: 8661423eea1a ("ACPI / utils: Add new acpi_dev_present helper")
    Signed-off-by: Andy Shevchenko
    Reviewed-by: Hans de Goede
    Signed-off-by: Rafael J. Wysocki

    Andy Shevchenko
     

10 Jan, 2018

1 commit

  • Sometimes the user wants to have device name of the match rather than
    just checking if device present or not. To make life easier for such
    users introduce acpi_dev_get_first_match_name() helper based on code
    for acpi_dev_present().

    For example, GPIO driver for Intel Merrifield needs to know the device
    name of pin control to be able to apply GPIO mapping table to the proper
    device.

    To be more consistent with the purpose rename

    struct acpi_dev_present_info -> struct acpi_dev_match_info
    acpi_dev_present_cb() -> acpi_dev_match_cb()

    in the utils.c file.

    Tested-by: Pierre-Louis Bossart
    Signed-off-by: Andy Shevchenko
    Signed-off-by: Rafael J. Wysocki

    Andy Shevchenko
     

14 Nov, 2017

1 commit


29 Aug, 2017

1 commit

  • ACPI OEM ID / OEM Table ID / Revision can be used to identify
    a platform based on ACPI firmware info. acpi_blacklisted(),
    intel_pstate_platform_pwr_mgmt_exists(), and some other funcs,
    have been using similar check to detect a list of platforms
    that require special handlings.

    Move the platform check in acpi_blacklisted() to a new common
    utility function, acpi_match_platform_list(), so that other
    drivers do not have to implement their own version.

    There is no change in functionality.

    Signed-off-by: Toshi Kani
    Reviewed-by: Borislav Petkov
    Signed-off-by: Rafael J. Wysocki

    Toshi Kani
     

07 Jun, 2017

1 commit

  • acpi_evaluate_dsm() and friends take a pointer to a raw buffer of 16
    bytes. Instead we convert them to use guid_t type. At the same time we
    convert current users.

    acpi_str_to_uuid() becomes useless after the conversion and it's safe to
    get rid of it.

    Acked-by: Rafael J. Wysocki
    Cc: Borislav Petkov
    Acked-by: Dan Williams
    Cc: Amir Goldstein
    Reviewed-by: Jarkko Sakkinen
    Reviewed-by: Jani Nikula
    Acked-by: Jani Nikula
    Cc: Ben Skeggs
    Acked-by: Benjamin Tissoires
    Acked-by: Joerg Roedel
    Acked-by: Adrian Hunter
    Cc: Yisen Zhuang
    Acked-by: Bjorn Helgaas
    Acked-by: Felipe Balbi
    Acked-by: Mathias Nyman
    Reviewed-by: Heikki Krogerus
    Acked-by: Mark Brown
    Signed-off-by: Andy Shevchenko
    Signed-off-by: Christoph Hellwig

    Andy Shevchenko
     

20 Apr, 2017

1 commit

  • acpi_dev_found just iterates over all ACPI-ids and sees if one matches.
    This means that it will return true for devices which are in the DSDT
    but disabled (their _STA method returns 0).

    For some drivers it is useful to be able to check if a certain HID
    is not only present in the namespace, but also actually present as in
    acpi_device_is_present() will return true for the device. For example
    because if a certain device is present then the driver will want to use
    an extcon or IIO ADC channel provided by that device.

    This commit adds a new acpi_dev_present helper which drivers can use
    to this end.

    Like acpi_dev_found, acpi_dev_present take a HID as argument, but
    it also has 2 extra optional arguments to only check for an ACPI
    device with a specific UID and/or HRV value. This makes it more
    generic and allows it to replace custom code doing similar checks
    in several places.

    Arguably acpi_dev_present is what acpi_dev_found should have been, but
    there are too many users to just change acpi_dev_found without the risk
    of breaking something.

    Signed-off-by: Hans de Goede
    Reviewed-by: Lukas Wunner
    Reviewed-by: Mika Westerberg
    Signed-off-by: Rafael J. Wysocki

    Hans de Goede
     

20 Jul, 2016

1 commit

  • Commit 4995734e973a "acpi, nfit: fix acpi_check_dsm() vs zero functions
    implemented" attempted to fix a QEMU regression by supporting its usage
    of a zero-mask as a valid response to a DSM-family probe request.
    However, this behavior breaks HP platforms that return a zero-mask by
    default causing the probe to misidentify the DSM-family.

    Instead, the QEMU regression can be fixed by simply not requiring the DSM
    family to be identified.

    This effectively reverts commit 4995734e973a, and removes the DSM
    requirement from the init path.

    Cc: "Rafael J. Wysocki"
    Cc: Xiao Guangrong
    Cc: Linda Knippers
    Fixes: 4995734e973a ("acpi, nfit: fix acpi_check_dsm() vs zero functions implemented")
    Reported-by: Jerry Hoemann
    Tested-by: Jerry Hoemann
    Signed-off-by: Dan Williams

    Dan Williams
     

25 Jun, 2016

1 commit

  • QEMU 2.6 implements nascent support for nvdimm DSMs. Depending on
    configuration it may only implement the function0 dsm to indicate that
    no other DSMs are available. Commit 31eca76ba2fc "nfit, libnvdimm:
    limited/whitelisted dimm command marshaling mechanism" breaks QEMU, but
    QEMU is spec compliant. Per the spec the way to indicate that no
    functions are supported is:

    If Function Index is zero, the return is a buffer containing one bit
    for each function index, starting with zero. Bit 0 indicates whether
    there is support for any functions other than function 0 for the
    specified UUID and Revision ID. If set to zero, no functions are
    supported (other than function zero) for the specified UUID and
    Revision ID.

    Update the nfit driver to determine the family (interface UUID) without
    requiring the implementation to define any other functions, i.e.
    short-circuit acpi_check_dsm() to succeed per the spec. The nfit driver
    appears to be the only user passing funcs==0 to acpi_check_dsm(), so
    this behavior change of the common routine should be limited to the
    probing done by the nfit driver.

    Cc: Len Brown
    Cc: Jerry Hoemann
    Acked-by: "Rafael J. Wysocki"
    Fixes: 31eca76ba2fc ("nfit, libnvdimm: limited/whitelisted dimm command marshaling mechanism")
    Reported-by: Xiao Guangrong
    Tested-by: Xiao Guangrong
    Signed-off-by: Dan Williams

    Dan Williams
     

24 May, 2016

1 commit

  • Pull libnvdimm updates from Dan Williams:
    "The bulk of this update was stabilized before the merge window and
    appeared in -next. The "device dax" implementation was revised this
    week in response to review feedback, and to address failures detected
    by the recently expanded ndctl unit test suite.

    Not included in this pull request are two dax topic branches (dax
    error handling, and dax radix-tree locking). These topics were
    deferred to get a few more days of -next integration testing, and to
    coordinate a branch baseline with Ted and the ext4 tree. Vishal and
    Ross will send the error handling and locking topics respectively in
    the next few days.

    This branch has received a positive build result from the kbuild robot
    across 226 configs.

    Summary:

    - Device DAX for persistent memory: Device DAX is the device-centric
    analogue of Filesystem DAX (CONFIG_FS_DAX). It allows memory
    ranges to be allocated and mapped without need of an intervening
    file system. Device DAX is strict, precise and predictable.
    Specifically this interface:

    a) Guarantees fault granularity with respect to a given page size
    (pte, pmd, or pud) set at configuration time.

    b) Enforces deterministic behavior by being strict about what
    fault scenarios are supported.

    Persistent memory is the first target, but the mechanism is also
    targeted for exclusive allocations of performance/feature
    differentiated memory ranges.

    - Support for the HPE DSM (device specific method) command formats.
    This enables management of these first generation devices until a
    unified DSM specification materializes.

    - Further ACPI 6.1 compliance with support for the common dimm
    identifier format.

    - Various fixes and cleanups across the subsystem"

    * tag 'libnvdimm-for-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: (40 commits)
    libnvdimm, dax: fix deletion
    libnvdimm, dax: fix alignment validation
    libnvdimm, dax: autodetect support
    libnvdimm: release ida resources
    Revert "block: enable dax for raw block devices"
    /dev/dax, core: file operations and dax-mmap
    /dev/dax, pmem: direct access to persistent memory
    libnvdimm: stop requiring a driver ->remove() method
    libnvdimm, dax: record the specified alignment of a dax-device instance
    libnvdimm, dax: reserve space to store labels for device-dax
    libnvdimm, dax: introduce device-dax infrastructure
    nfit: add sysfs dimm 'family' and 'dsm_mask' attributes
    tools/testing/nvdimm: ND_CMD_CALL support
    nfit: disable vendor specific commands
    nfit: export subsystem ids as attributes
    nfit: fix format interface code byte order per ACPI6.1
    nfit, libnvdimm: limited/whitelisted dimm command marshaling mechanism
    nfit, libnvdimm: clarify "commands" vs "_DSMs"
    libnvdimm: increase max envelope size for ioctl
    acpi/nfit: Add sysfs "id" for NVDIMM ID
    ...

    Linus Torvalds
     

12 Apr, 2016

1 commit

  • The ACPI specification states that arguments "Revision ID" and "Function
    Index" to a _DSM are type "Integer." Type Integers are 64 bit
    quantities.

    The function evaluate_dsm specifies these types as simple "int" which
    are 32 bits. Widen type passed to acpi_evaluate_dsm and its callers and
    derived callers to pass correct type.

    acpi_check_dsm and acpi_evaluate_dsm_typed had similar issue and were
    corrected as well.

    This is in preparation for libnvdimm implementing a generic _DSM
    passthrough facility to have the capacity to pass 64-bit values as the
    ACPI specification allows.

    [djbw: clarify the changelog, add rationale]
    Signed-off-by: Jerry Hoemann
    Acked-by: Rafael J. Wysocki
    Signed-off-by: Dan Williams

    Jerry Hoemann
     

09 Apr, 2016

1 commit

  • acpi_dev_present() was originally named after pci_dev_present()
    to signify the similarity of the two functions.

    However Rafael J. Wysocki pointed out that the exported function
    acpi_dev_present() is easily confused with the non-exported
    acpi_device_is_present(). Additionally in ACPI parlance the term
    "present" usually refers to the "device is present" bit returned
    by the _STA control method, yet acpi_dev_present() merely checks
    presence in the namespace. It does not invoke _STA at all, let
    alone check the "device is present" bit.

    As suggested by Rafael, rename the function to acpi_dev_found()
    and adjust all existing call sites.

    Signed-off-by: Lukas Wunner
    Signed-off-by: Rafael J. Wysocki

    Lukas Wunner
     

22 Mar, 2016

1 commit


10 Mar, 2016

1 commit


09 Dec, 2015

1 commit

  • There's an idiom in use by 7 Linux drivers to detect the presence of a
    particular ACPI HID by walking the namespace with acpi_get_devices().
    The callback passed to acpi_get_devices() is mostly identical across
    the drivers, leading to lots of duplicate code.

    Add acpi_dev_present(), the ACPI equivalent to pci_dev_present(),
    allowing us to deduplicate all that boilerplate in the drivers.

    Signed-off-by: Lukas Wunner
    Reviewed-by: Hanjun Guo
    Signed-off-by: Rafael J. Wysocki

    Lukas Wunner
     

08 Jul, 2015

1 commit


19 Jun, 2015

1 commit

  • This is a preparation patch for the backlight interface selection logic
    cleanup, there are 2 reasons to not always build the video_detect code
    into the kernel:

    1) In order for the video_detect.c to also deal with / select native
    backlight interfaces on win8 systems, instead of doing this in video.c
    where it does not belong, video_detect.c needs to call into the backlight
    class code. Which cannot be done if it is builtin and the blacklight class
    is not.

    2) Currently all the platform/x86 drivers which have quirks to prefer
    the vendor driver over acpi-video call acpi_video_unregister_backlight()
    to remove the acpi-video backlight interface, this logic really belongs
    in video_detect.c, which will cause video_detect.c to depend on symbols of
    video.c and video.c already depends on video_detect.c symbols, so they
    really need to be a single module.

    Note that this commits make 2 changes so as to maintain 100% kernel
    commandline compatibility:

    1) The __setup call for the acpi_backlight= handling is moved to
    acpi/util.c as __setup may only be used by code which is alwasy builtin
    2) video.c is renamed to acpi_video.c so that it can be combined with
    video_detect.c into video.ko

    This commit also makes changes to drivers/platform/x86/Kconfig to ensure
    that drivers which use acpi_video_backlight_support() from video_detect.c,
    will not be built-in when acpi_video is not built in. This also changes
    some "select" uses to "depends on" to avoid dependency loops.

    Signed-off-by: Hans de Goede
    Acked-by: Darren Hart
    Signed-off-by: Rafael J. Wysocki

    Hans de Goede
     

19 Dec, 2014

1 commit


13 Dec, 2014

1 commit

  • Some of the error messages printed by acpi_evaluate_reference()
    with the KERN_ERR priority should really be debug messages, but then
    they would be redundant, because acpi_util_eval_error() is called
    too at the same spots (except for one).

    Drop the kernel messages from there entirely and leave the
    acpi_util_eval_error() to handle the debug printing. In one case,
    replace the kernel message with a call to acpi_util_eval_error().

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

18 Nov, 2014

1 commit


25 Oct, 2014

1 commit

  • Pull thermal management updates from Zhang Rui:
    "Sorry that I missed the merge window as there is a bug found in the
    last minute, and I have to fix it and wait for the code to be tested
    in linux-next tree for a few days. Now the buggy patch has been
    dropped entirely from my next branch. Thus I hope those changes can
    still be merged in 3.18-rc2 as most of them are platform thermal
    driver changes.

    Specifics:

    - introduce ACPI INT340X thermal drivers.

    Newer laptops and tablets may have thermal sensors and other
    devices with thermal control capabilities that are exposed for the
    OS to use via the ACPI INT340x device objects. Several drivers are
    introduced to expose the temperature information and cooling
    ability from these objects to user-space via the normal thermal
    framework.

    From: Lu Aaron, Lan Tianyu, Jacob Pan and Zhang Rui.

    - introduce a new thermal governor, which just uses a hysteresis to
    switch abruptly on/off a cooling device. This governor can be used
    to control certain fan devices that can not be throttled but just
    switched on or off. From: Peter Feuerer.

    - introduce support for some new thermal interrupt functions on
    i.MX6SX, in IMX thermal driver. From: Anson, Huang.

    - introduce tracing support on thermal framework. From: Punit
    Agrawal.

    - small fixes in OF thermal and thermal step_wise governor"

    * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (25 commits)
    Thermal: int340x thermal: select ACPI fan driver
    Thermal: int3400_thermal: use acpi_thermal_rel parsing APIs
    Thermal: int340x_thermal: expose acpi thermal relationship tables
    Thermal: introduce int3403 thermal driver
    Thermal: introduce INT3402 thermal driver
    Thermal: move the KELVIN_TO_MILLICELSIUS macro to thermal.h
    ACPI / Fan: support INT3404 thermal device
    ACPI / Fan: add ACPI 4.0 style fan support
    ACPI / fan: convert to platform driver
    ACPI / fan: use acpi_device_xxx_power instead of acpi_bus equivelant
    ACPI / fan: remove no need check for device pointer
    ACPI / fan: remove unused macro
    Thermal: int3400 thermal: register to thermal framework
    Thermal: int3400 thermal: add capability to detect supporting UUIDs
    Thermal: introduce int3400 thermal driver
    ACPI: add ACPI_TYPE_LOCAL_REFERENCE support to acpi_extract_package()
    ACPI: make acpi_create_platform_device() an external API
    thermal: step_wise: fix: Prevent from binary overflow when trend is dropping
    ACPI: introduce ACPI int340x thermal scan handler
    thermal: Added Bang-bang thermal governor
    ...

    Linus Torvalds
     

10 Oct, 2014

1 commit


25 Sep, 2014

1 commit


26 May, 2014

1 commit

  • Commit 1a699476e258 ("ACPI / hotplug / PCI: Hotplug notifications
    from acpi_bus_notify()") added debug messages for a few common
    events. These debug messages are unconditionally enabled if
    CONFIG_DYNAMIC_DEBUG is defined, contrary to the documented
    meaning, making the ACPI system spew lots of unwanted noise on
    any kernel with dynamic debugging.

    The bug was introduced by commit fbfddae69657 ("ACPI: Add
    acpi_handle_() interfaces"), which added the
    CONFIG_DYNAMIC_DEBUG dependency without respecting its meaning.

    Fix by adding real support for dynamic_debug.

    Fixes: fbfddae69657 ("ACPI: Add acpi_handle_() interfaces")
    Signed-off-by: Bjørn Mork
    Signed-off-by: Rafael J. Wysocki

    Bjørn Mork
     

04 Apr, 2014

1 commit


22 Feb, 2014

1 commit


21 Feb, 2014

1 commit


05 Feb, 2014

1 commit


13 Jan, 2014

1 commit

  • * acpi-dsm:
    ACPI / extlog: replace open-coded _DSM code with helper functions
    ACPI / nouveau: replace open-coded _DSM code with helper functions
    nouveau / ACPI: fix memory leak in ACPI _DSM related code
    ACPI / i915: replace open-coded _DSM code with helper functions
    ACPI / i2c-hid: replace open-coded _DSM code with helper functions
    ACPI / TPM: detect PPI features by checking availability of _DSM functions
    ACPI / TPM: replace open-coded _DSM code with helper functions
    ACPI / TPM: match node name instead of full path when searching for TPM device
    PCI / pci-label: treat PCI label with index 0 as valid label
    ACPI / PCI: replace open-coded _DSM code with helper functions
    PCI / pci-label: release allocated ACPI object on error recovery path
    ACPI: introduce helper interfaces for _DSM method

    Rafael J. Wysocki
     

05 Jan, 2014

1 commit

  • There are several drivers making use of ACPI _DSM method to detect
    and invoke device specific methods. Currently every driver has
    implemented its private version to support ACPI _DSM method.
    So this patch introduces three helper functions to support ACPI _DSM
    method, which will be used to replace open-coded versions.

    It helps to simplify code and improve code readability.

    Signed-off-by: Jiang Liu
    Signed-off-by: Rafael J. Wysocki

    Jiang Liu
     

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
     

30 Oct, 2013

1 commit