1. 18 Mar, 2018 2 commits
  2. 21 Feb, 2018 1 commit
  3. 06 Feb, 2018 1 commit
  4. 04 Feb, 2018 1 commit
  5. 03 Aug, 2017 1 commit
  6. 20 Jul, 2017 1 commit
  7. 27 Jun, 2017 1 commit
  8. 12 Jun, 2017 1 commit
  9. 09 Feb, 2017 2 commits
  10. 02 Jan, 2017 4 commits
  11. 21 Dec, 2016 1 commit
    • Lv Zheng's avatar
      ACPICA: Tables: Back port acpi_get_table_with_size() and... · 174cc718
      Lv Zheng authored
      ACPICA: Tables: Back port acpi_get_table_with_size() and early_acpi_os_unmap_memory() from Linux kernel
      
      ACPICA commit cac6790954d4d752a083e6122220b8a22febcd07
      
      This patch back ports Linux acpi_get_table_with_size() and
      early_acpi_os_unmap_memory() into ACPICA upstream to reduce divergences.
      
      The 2 APIs are used by Linux as table management APIs for long time, it
      contains a hidden logic that during the early stage, the mapped tables
      should be unmapped before the early stage ends.
      
      During the early stage, tables are handled by the following sequence:
       acpi_get_table_with_size();
       parse the table
       early_acpi_os_unmap_memory();
      During the late stage, tables are handled by the following sequence:
       acpi_get_table();
       parse the table
      Linux uses acpi_gbl_permanent_mmap to distinguish the early stage and the
      late stage.
      
      The reasoning of introducing acpi_get_table_with_size() is: ACPICA will
      remember the early mapped pointer in acpi_get_table() and Linux isn't able to
      prevent ACPICA from using the wrong early mapped pointer during the late
      stage as there is no API provided from ACPICA to be an inverse of
      acpi_get_table() to forget the early mapped pointer.
      
      But how ACPICA can work with the early/late stage requirement? Inside of
      ACPICA, tables are ensured to be remained in "INSTALLED" state during the
      early stage, and they are carefully not transitioned to "VALIDATED" state
      until the late stage. So the same logic is in fact implemented inside of
      ACPICA in a different way. The gap is only that the feature is not provided
      to the OSPMs in an accessible external API style.
      
      It then is possible to fix the gap by providing an inverse of
      acpi_get_table() from ACPICA, so that the two Linux sequences can be
      combined:
       acpi_get_table();
       parse the table
       acpi_put_table();
      In order to work easier with the current Linux code, acpi_get_table() and
      acpi_put_table() is implemented in a usage counting based style:
       1. When the usage count of the table is increased from 0 to 1, table is
          mapped and .Pointer is set with the mapping address (VALIDATED);
       2. When the usage count of the table is decreased from 1 to 0, .Pointer
          is unset and the mapping address is unmapped (INVALIDATED).
      So that we can deploy the new APIs to Linux with minimal effort by just
      invoking acpi_get_table() in acpi_get_table_with_size() and invoking
      acpi_put_table() in early_acpi_os_unmap_memory(). Lv Zheng.
      
      Link: https://github.com/acpica/acpica/commit/cac67909Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      174cc718
  12. 16 Nov, 2016 1 commit
  13. 13 Aug, 2016 10 commits
  14. 15 Jul, 2016 1 commit
  15. 05 Apr, 2016 3 commits
  16. 15 Jan, 2016 1 commit
  17. 01 Jan, 2016 1 commit
  18. 14 Dec, 2015 2 commits
    • Lv Zheng's avatar
      ACPI / debugger: Add IO interface to access debugger functionalities · 8cfb0cdf
      Lv Zheng authored
      This patch adds /sys/kernel/debug/acpi/acpidbg, which can be used by
      userspace programs to access ACPICA debugger functionalities.
      
      Known issue:
      1. IO flush support
         acpi_os_notify_command_complete() and acpi_os_wait_command_ready() can
         be used by acpi_dbg module to implement .flush() filesystem operation.
         While this patch doesn't go that far. It then becomes userspace tool's
         duty now to flush old commands before executing new batch mode commands.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8cfb0cdf
    • Lv Zheng's avatar
      ACPICA: Debugger: Convert some mechanisms to OSPM specific · f8d31489
      Lv Zheng authored
      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: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f8d31489
  19. 22 Oct, 2015 3 commits
    • Lv Zheng's avatar
      ACPI: Enable build of AML interpreter debugger · 4d946f79
      Lv Zheng authored
      This patch enables ACPICA debugger files using a configurable
      CONFIG_ACPI_DEBUGGER configuration item. Those debugger related code that
      was originally masked as ACPI_FUTURE_USAGE now gets unmasked.
      
      Necessary OSL stubs are also added in this patch:
      1. acpi_os_readable(): This should be arch specific in Linux, while this
          patch doesn't introduce real implementation and a complex mechanism to
          allow architecture specific acpi_os_readable() to be implemented to
          validate the address. It may be done by future commits.
      2. acpi_os_get_line(): This is used to obtain debugger command input. This
          patch only introduces a simple KDB concept example in it and the
          example should be co-working with the code implemented in
          acpi_os_printf(). Since this KDB example won't be compiled unless
          ENABLE_DEBUGGER is defined and it seems Linux has already stopped to
          use ENABLE_DEBUGGER, thus do not expect it can work properly.
      
      This patch also cleans up all other ACPI_FUTURE_USAGE surroundings
      accordingly.
      1. Since linkage error can be automatically detected, declaration in the
         headers needn't be surrounded by ACPI_FUTURE_USAGE.
         So only the following separate exported fuction bodies are masked by
         this macro (other exported fucntions may have already been masked at
         entire module level via drivers/acpi/acpica/Makefile):
           acpi_install_exception_handler()
           acpi_subsystem_status()
           acpi_get_system_info()
           acpi_get_statistics()
           acpi_install_initialization_handler()
      2. Since strip can automatically zap the no-user functions, functions that
         are not marked with ACPI_EXPORT_SYMBOL() needn't get surrounded by
         ACPI_FUTURE_USAGE.
         So the following function which is not used by Linux kernel now won't
         get surrounded by this macro:
           acpi_ps_get_name()
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      4d946f79
    • Bob Moore's avatar
      ACPICA: Debugger: Update mutexes used for multithreaded debugger · cd64bbf8
      Bob Moore authored
      ACPICA commit 6b2701f619040e803313363f516b200e362a9100
      
      Make these mutex objects independent of the deadlock detection mechanism.
      This mechanism caused failures with the multithread debugger.
      
      This patch doesn't affect Linux kernel as debugger is currently not fully
      functioning in the Linux kernel. And the further debugger cleanups will
      take care of handling debugger command signalling correctly instead of
      using such kind of mutexes. So it is safe to leave this patch as it is.
      
      Link: https://github.com/acpica/acpica/commit/6b2701f6Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      cd64bbf8
    • Bob Moore's avatar
      ACPICA: Remove unnecessary conditional compilation · 93556118
      Bob Moore authored
      ACPICA commit eea1f0e561893b6d6417913b2d224082fe3a0a5e
      
      Remove use of ACPI_DEBUGGER and ACPI_DISASSEMBLER where these
      defines are used around entire modules.
      
      Note: This type of code also causes problems with IDEs.
      
      Link: https://github.com/acpica/acpica/commit/eea1f0e5Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      93556118
  20. 25 Aug, 2015 2 commits