13 Aug, 2016

1 commit

  • …)/errno/perror() instead

    ACPICA commit 189429fb7d06cdb89043ae32d615faf553467f1d

    This patch follows new ACPICA design, eliminates old portable OSLs, and
    implements fopen/fread/fwrite/fclose/fseek/ftell for GNU EFI
    environment. This patch also eliminates acpi_log_error(), convering them
    into fprintf(stderr)/perror(). Lv Zheng.

    Link: https://github.com/acpica/acpica/commit/189429fb
    Link: https://bugs.acpica.org/show_bug.cgi?id=1302
    Signed-off-by: Lv Zheng <lv.zheng@intel.com>
    Signed-off-by: Bob Moore <robert.moore@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

    Lv Zheng
     

05 May, 2016

1 commit

  • ACPICA commit b2294cae776f5a66a7697414b21949d307e6856f

    This patch removes unwanted spaces for typedef. This solution doesn't cover
    function types.

    Note that the linuxize result of this commit is very giant and should have
    many conflicts against the current Linux upstream. Thus it is required to
    modify the linuxize result of this commit and the commits around it
    manually in order to have them merged to the Linux upstream. Since this is
    very costy, we should do this only once, and if we can't ensure to do this
    only once, we need to revert the Linux code to the wrong indentation result
    before merging the linuxize result of this commit. Lv Zheng.

    Link: https://github.com/acpica/acpica/commit/b2294cae
    Signed-off-by: Lv Zheng
    Signed-off-by: Bob Moore
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     

04 Apr, 2016

1 commit


16 Jan, 2016

1 commit


15 Dec, 2015

1 commit

  • The following mechanisms are OSPM specific:
    1. Redirect output destination to console: no file redirection will be
    needed by an in-kernel debugger, there is even no file can be accessed
    when the debugger is running in the kernel mode.
    2. Output command prompts: programs other than acpiexec can have different
    prompt characters and the prompt characters may be implemented as a
    special character sequence to form a char device IO protocol.
    3. Command ready/complete handshake: OSPM debugger may wait more conditions
    to implement OSPM specific semantics (for example, FIFO full/empty
    conditions for O_NONBLOCK or IO open/close conditions).
    Leaving such OSPM specific stuffs in the ACPICA debugger core blocks
    Linux debugger IO driver implementation.

    Several new OSL APIs are provided by this patch:
    1. acpi_os_initialize_command_signals: initialize command handshake mechanism
    or any other OSPM specific stuffs.
    2. acpi_os_terminate_command_signals: reversal of
    acpi_os_initialize_command_signals.
    3. acpi_os_wait_command_ready: putting debugger task into wait state when a
    command is not ready. OSPMs can terminate command loop by returning
    AE_CTRL_TERMINATE from this API. Normally, wait_event() or
    wait_for_multiple_object() may be used to implement this API.
    4. acpi_os_notify_command_complete: putting user task into running state when a
    command has been completed. OSPMs can terminate command loop by
    returning AE_CTRL_TERMINATE from this API. Normally, wake_up() or
    set_event() may be used to implement this API.
    This patch also converts current command signaling implementation into a
    generic debugger layer (osgendbg.c) to be used by the existing OSPMs or
    acpiexec, in return, Linux can have chance to implement its own command
    handshake mechanism. This patch also implements acpiexec batch mode in a
    multi-threading mode comaptible style as a demo (this can be confirmed by
    configuring acpiexec into DEBUGGER_MULTI_THREADED mode where the batch mode
    is still working). Lv Zheng.

    Note that the OSPM specific command handshake mechanism is required by
    Linux kernel because:
    1. Linux kernel trends to use wait queue to synchronize two threads, using
    mutexes to achieve that will cause false "dead lock" warnings.
    2. The command handshake mechanism implemented by ACPICA is implemented in
    this way because of a design issue in debugger IO streaming. Debugger IO
    outputs are simply cached using a giant buffer, this should be tuned by
    Linux in the future.

    Signed-off-by: Lv Zheng
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     

22 Oct, 2015

1 commit

  • …to the debugger thread

    When the debugger is running in the kernel mode, acpi_db_single_step() may
    also be invoked by the kernel runtime code path but the single stepping
    command prompt may be erronously logged as the kernel logs and runtime code
    path cannot proceed.

    This patch fixes this issue by adding acpi_gbl_db_thread_id for the debugger
    thread and preventing acpi_db_single_step() to be invoked from other threads.

    It is not suitable to add acpi_thread_id parameter for acpi_os_execute() as
    the function may be implemented as work queue on some hosts. So it is
    better to let the hosts invoke acpi_set_debugger_thread_id(). Currently
    acpiexec is not configured as DEBUGGER_MULTI_THREADED, but we can do this.
    When we do this, it is better to invoke acpi_set_debugger_thread_id() in
    acpi_os_execute() when the execution type is OSL_DEBUGGER_MAIN_THREAD. The
    support should look like:
    create_thread(&tid);
    if (type == OSL_DEBUGGER_MAIN_THREAD)
    acpi_set_debugger_thread_id(tid);
    resume_thread(tid);
    Similarly, semop() may be used for pthread implementation. But this patch
    simply skips debugger thread ID check for application instead of
    introducing such complications as there is no need to skip
    acpi_db_single_step() for an application debugger - acpiexec.

    Note that the debugger thread ID can also be used by acpi_os_printf() to
    filter out debugger output. Lv Zheng.

    Signed-off-by: Lv Zheng <lv.zheng@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

    Lv Zheng
     

24 Jul, 2015

1 commit

  • ACPICA commit e8e4a9b19d0b72a7b165398bdc961fc2f6f502ec

    This patch adds OSL trace hook support.

    OSPMs are encouraged to use acpi_os_trace_point() with
    ACPI_USE_SYSTEM_TRACER defined to implement platform specific trace
    facility. Lv Zheng.

    Link: https://github.com/acpica/acpica/commit/e8e4a9b1
    Signed-off-by: Lv Zheng
    Signed-off-by: Bob Moore
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     

15 May, 2015

1 commit


05 Feb, 2015

1 commit


08 Jul, 2014

1 commit

  • This patch adds portable file IO to generic OSL to improve the portability
    of the applications.

    A portable application may use different file IO interfaces than the
    standard C library ones. This patch thus introduces an abstract file IO
    layer into the generic OSL.

    Note that this patch does not introduce users of such interfaces, further
    patches should introduce users one by one carefully with build tests
    performed. Lv Zheng.

    Signed-off-by: Lv Zheng
    Signed-off-by: Bob Moore
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     

18 Mar, 2014

1 commit


27 Feb, 2014

1 commit

  • Use push and pop to both guarantee that the correct alignment is used,
    and to restore the alignment to whatever it was before the header
    was included.

    It is reported that the #pragma pack(push/pop) directives are not supported
    by the specific GCCs, but this patch still doesn't affect kernel build
    as there are already #pragma pack([1]) directives used in the old ACPICA
    headers, which means there shouldn't be GCCs that are currently used to
    compile the ACPI kernels do not support #pragma pack() directives.

    References: https://bugs.acpica.org/show_bug.cgi?id=1058
    Signed-off-by: Bob Moore
    Signed-off-by: Lv Zheng
    Signed-off-by: Rafael J. Wysocki

    Bob Moore
     

11 Feb, 2014

1 commit


31 Oct, 2013

2 commits

  • The new ACPICA OSL override mechanism is used to solve these issues
    for the Linux OSL:
    1. Linux can implement OSL using a macro.
    2. Linux can implement OSL using an inlined function.
    3. Linux can leave OSL not implemented for __KERNEL__ undefined code
    fragments.
    4. Linux can add sparse declarators (__iomem) to OSL.
    5. Linux can add memory tuning declarators (__init/__exit) to OSL.
    This patch also moves Linux specific OSL to aclinux.h which has not been
    maintained in the ACPICA code base. Lv Zheng.

    Known issue:

    From ACPICA's perspective, actypes.h should be included after inclusion
    of acenv.h. But currently in Linux, aclinux.h included by acenv.h has
    included actypes.h to find ACPICA types for inline functions. This is a
    known and existing issue and currently there is no real problem caused
    by this issue for Linux kernel build. Thus this issue is not covered by
    this cleanup commit.

    Signed-off-by: Lv Zheng
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     
  • This change enables the host OS to redefine OSL prototypes found in the
    acpiosxf.h file. This allows the host OS to implement OSL interfaces with
    a macro or inlined function. Further, it allows the host OS to add any
    additional required modifiers such as __iomem, __init, __exit, etc.,
    as necessary on a per-interface basis. Enables maximum flexibility
    for the OSL interfaces. Lv Zheng.

    Signed-off-by: Lv Zheng
    Signed-off-by: Bob Moore
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     

30 Oct, 2013

1 commit

  • In the common case, the ACPI_ALLOCATE and related macros now resolve
    directly to their respective acpi_os* OSL interfaces. Two options:
    1) The ACPI_ALLOCATE_ZEROED macro defaults to a simple local implementation
    by default, unless overridden by the USE_NATIVE_ALLOCATE_ZEROED define.
    2) For ACPI execution simulation environment (AcpiExec) which is not
    shipped with the Linux kernel, the macros can optionally be resolved to
    the local interfaces that track each allocation (used to immediately
    detect memory leaks).

    Signed-off-by: Lv Zheng
    Signed-off-by: Bob Moore
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     

12 May, 2013

1 commit


26 Feb, 2013

1 commit

  • Pull PCI changes from Bjorn Helgaas:
    "Host bridge hotplug
    - Major overhaul of ACPI host bridge add/start (Rafael Wysocki, Yinghai Lu)
    - Major overhaul of PCI/ACPI binding (Rafael Wysocki, Yinghai Lu)
    - Split out ACPI host bridge and ACPI PCI device hotplug (Yinghai Lu)
    - Stop caching _PRT and make independent of bus numbers (Yinghai Lu)

    PCI device hotplug
    - Clean up cpqphp dead code (Sasha Levin)
    - Disable ARI unless device and upstream bridge support it (Yijing Wang)
    - Initialize all hot-added devices (not functions 0-7) (Yijing Wang)

    Power management
    - Don't touch ASPM if disabled (Joe Lawrence)
    - Fix ASPM link state management (Myron Stowe)

    Miscellaneous
    - Fix PCI_EXP_FLAGS accessor (Alex Williamson)
    - Disable Bus Master in pci_device_shutdown (Konstantin Khlebnikov)
    - Document hotplug resource and MPS parameters (Yijing Wang)
    - Add accessor for PCIe capabilities (Myron Stowe)
    - Drop pciehp suspend/resume messages (Paul Bolle)
    - Make pci_slot built-in only (not a module) (Jiang Liu)
    - Remove unused PCI/ACPI bind ops (Jiang Liu)
    - Removed used pci_root_bus (Bjorn Helgaas)"

    * tag 'pci-v3.9-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (51 commits)
    PCI/ACPI: Don't cache _PRT, and don't associate them with bus numbers
    PCI: Fix PCI Express Capability accessors for PCI_EXP_FLAGS
    ACPI / PCI: Make pci_slot built-in only, not a module
    PCI/PM: Clear state_saved during suspend
    PCI: Use atomic_inc_return() rather than atomic_add_return()
    PCI: Catch attempts to disable already-disabled devices
    PCI: Disable Bus Master unconditionally in pci_device_shutdown()
    PCI: acpiphp: Remove dead code for PCI host bridge hotplug
    PCI: acpiphp: Create companion ACPI devices before creating PCI devices
    PCI: Remove unused "rc" in virtfn_add_bus()
    PCI: pciehp: Drop suspend/resume ENTRY messages
    PCI/ASPM: Don't touch ASPM if forcibly disabled
    PCI/ASPM: Deallocate upstream link state even if device is not PCIe
    PCI: Document MPS parameters pci=pcie_bus_safe, pci=pcie_bus_perf, etc
    PCI: Document hpiosize= and hpmemsize= resource reservation parameters
    PCI: Use PCI Express Capability accessor
    PCI: Introduce accessor to retrieve PCIe Capabilities Register
    PCI: Put pci_dev in device tree as early as possible
    PCI: Skip attaching driver in device_add()
    PCI: acpiphp: Keep driver loaded even if no slots found
    ...

    Linus Torvalds
     

26 Jan, 2013

1 commit


25 Jan, 2013

1 commit


10 Jan, 2013

2 commits

  • This is a cosmetic patch only. Comparison of the resulting binary showed
    only line number differences.

    This patch does not affect the generation of the Linux binary.
    This patch decreases 210 lines of 20121018 divergence.diff.

    The ACPICA source codes uses a totally different indentation style from the
    Linux to be compatible with other users (operating systems or BIOS).

    Indentation differences are critical to the release automation. There are
    two causes related to the "indentation" that are affecting the release
    automation:
    1. The ACPICA -> Linux release process is:
    ACPICA source -- acpisrc - hierarchy - indent ->
    linuxized ACPICA source -- diff ->
    linuxized ACPICA patch (x) -- human intervention ->
    linuxized ACPICA patch (o)
    Where
    'x' means "cannot be directly applied to the Linux"
    'o' means "can be directly applied to the Linux"
    Different "indent" version or "indent" options used in the "indent"
    step will lead to different divergences.
    The version of "indent" used for the current release process is:
    GNU indent 2.2.11
    The options of "indent" used for the current release process is:
    -npro -kr -i8 -ts8 -sob -l80 -ss -ncs
    2. Manual indentation prettifying work in the Linux side will also harm the
    automatically generated linuxized ACPICA patches, making them impossible
    to apply directly.

    This patch fixes source code differences caused by the two causes so that
    the "human intervention" can be reduced in the future.

    Signed-off-by: Lv Zheng
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     
  • This is a cosmetic patch only. Comparison of the resulting binary showed
    only line number differences.

    This patch does not affect the generation of the Linux binary.
    This patch decreases 389 lines of 20121018 divergence.diff.

    This patch reduces source code diff caused by the simple code maintenance
    work:
    1. Deletion of the unused include files.
    2. Deletion of the deprecated codes blocks.
    3. Repositioning of the code blocks.
    4. Replacing the values with the well defined macros.
    5. Replacing the types with the equivalent types.

    Signed-off-by: Lv Zheng
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     

15 Nov, 2012

2 commits


03 Oct, 2012

1 commit


17 Jul, 2012

1 commit


01 Jun, 2012

1 commit


22 Mar, 2012

2 commits

  • This interface allows the host to override a table via a
    physical address, instead of the logical address required by
    acpi_os_table_override. This simplifies the host implementation.
    Initial implementation by Thomas Renninger. ACPICA implementation
    creates a single function for table overrides that attempts both
    a logical and a physical override.

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

    Bob Moore
     
  • This change expands acpi_os_read_memory and acpi_os_write_memory to a
    full 64 bits. This allows 64 bit transfers via the acpi_read and
    acpi_write interfaces. Note: The internal acpi_hw_read and acpi_hw_write
    interfaces remain at 32 bits, because 64 bits is not needed to
    access the standard ACPI registers.

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

    Bob Moore
     

21 Jan, 2012

1 commit

  • Base ACPI (CA) currently does not support atomic 64-bit reads and writes
    (acpi_read() and acpi_write() split 64-bit loads/stores into two
    32-bit transfers) yet APEI expects 64-bit transfer capability, even
    when running on 32-bit systems.

    This patch implements 64-bit read and write routines for APEI usage.

    This patch re-factors similar functionality introduced in commit
    04c25997c97, bringing it into the ACPI subsystem in preparation for
    removing ./drivers/acpi/atomicio.[ch]. In the implementation I have
    replicated acpi_os_read_memory() and acpi_os_write_memory(), creating
    64-bit versions for APEI to utilize, as opposed to something more
    elegant. My thinking is that we should attempt to see if we can get
    ACPI's CA/OSL changed so that the existing acpi_read() and acpi_write()
    interfaces are natively 64-bit capable and then subsequently remove the
    replication.

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

    Myron Stowe
     

17 Jan, 2012

1 commit

  • Allows drivers to determine if any memory or I/O addresses
    will conflict with addresses used by ACPI operation regions.
    Introduces a new interface, acpi_check_address_range.

    http://marc.info/?t=132251388700002&r=1&w=2

    Reported-and-tested-by: Luca Tettamanti
    Signed-off-by: Lin Ming
    Signed-off-by: Bob Moore
    Signed-off-by: Len Brown

    Lin Ming
     

15 Oct, 2011

1 commit

  • I originally submitted a patch to workaround this by pushing all Ejection
    Requests and Device Checks onto the kacpi_hotplug queue.

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

    The patch is still insufficient in that Bus Checks also need to be added.

    Rather than add all events, including non-PCI-hotplug events, to the
    hotplug queue, mjg suggested that a better approach would be to modify
    the acpiphp driver so only acpiphp events would be added to the
    kacpi_hotplug queue.

    It's a longer patch, but at least we maintain the benefit of having separate
    queues in ACPI. This, of course, is still only a workaround the problem.
    As Bjorn and mjg pointed out, we have to refactor a lot of this code to do
    the right thing but at this point it is a better to have this code working.

    The acpi core places all events on the kacpi_notify queue. When the acpiphp
    driver is loaded and a PCI card with a PCI-to-PCI bridge is removed the
    following call sequence occurs:

    cleanup_p2p_bridge()
    -> cleanup_bridge()
    -> acpi_remove_notify_handler()
    -> acpi_os_wait_events_complete()
    -> flush_workqueue(kacpi_notify_wq)

    which is the queue we are currently executing on and the process will hang.

    Move all hotplug acpiphp events onto the kacpi_hotplug workqueue. In
    handle_hotplug_event_bridge() and handle_hotplug_event_func() we can simply
    push the rest of the work onto the kacpi_hotplug queue and then avoid the
    deadlock.

    Signed-off-by: Prarit Bhargava
    Cc: mjg@redhat.com
    Cc: bhelgaas@google.com
    Cc: linux-acpi@vger.kernel.org
    Signed-off-by: Jesse Barnes

    Prarit Bhargava
     

14 Jul, 2011

1 commit

  • All ACPICA locks are allocated by the same function,
    acpi_os_create_lock(), with the help of a local variable called
    "lock". Thus, when lockdep is enabled, it uses "lock" as the
    name of all those locks and regards them as instances of the same
    lock, which causes it to report possible locking problems with them
    when there aren't any.

    To work around this problem, define acpi_os_create_lock() as a macro
    and make it pass its argument to spin_lock_init(), so that lockdep
    uses it as the name of the new lock. Define this macron in a
    Linux-specific file, to minimize the resulting modifications of
    the OS-independent ACPICA parts.

    This change is based on an earlier patch from Andrea Righi and it
    addresses a regression from 2.6.39 tracked as
    https://bugzilla.kernel.org/show_bug.cgi?id=38152

    Signed-off-by: Rafael J. Wysocki
    Reported-and-tested-by: Borislav Petkov
    Tested-by: Andrea Righi
    Reviewed-by: Florian Mickler
    Signed-off-by: Len Brown

    Rafael J. Wysocki
     

25 Mar, 2011

1 commit


19 Jan, 2011

1 commit


27 Oct, 2010

1 commit


20 Oct, 2010

1 commit


01 Oct, 2010

3 commits

  • This function is not OS-dependent and has been replaced by
    acpi_hw_derive_pci_id, which is now in the ACPICA core code. Local
    implementations of acpi_os_derive_pci_id are no longer necessary and
    are removed. ACPICA BZ 857.

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

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

    Bob Moore
     
  • Adds install/remove interfaces so that the host can dynamically
    alter the global _OSI table. Also adds support for _OSI handlers.
    Additional support: new debugger command (osi), and test support in
    the acpiexec utility. Adds new file, utilities/utosi.c.
    ACPICA bugzilla 836.

    The Linux OSL _OSI code is also changed.
    acpi_osi_setup can't call acpi_install/remove_interface because ACPICA
    is not initialized yet at this early time.
    So we just save the osi string in acpi_osi_setup and will handle it
    later in a new function acpi_osi_setup_late.

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

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

    Lin Ming
     
  • Prototype in acpiosxf.h had the output value pointer as a (u32 *).
    Should be a (u64 *).

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

    Bob Moore