1. 28 Apr, 2014 1 commit
  2. 21 Apr, 2014 1 commit
  3. 20 Apr, 2014 33 commits
    • Bob Moore's avatar
      ACPICA: Update version to 20140325. · 35476c75
      Bob Moore authored
      Version 20140325.
      Signed-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>
      35476c75
    • Lv Zheng's avatar
      ACPICA: acpidump: Update man page. · 6c870213
      Lv Zheng authored
      This patch updates man file of acpidump.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      [rjw: Subject]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      6c870213
    • Lv Zheng's avatar
      ACPICA: acpidump: Remove old acpidump source. · bf5afef9
      Lv Zheng authored
      This patch removes old acpidump source.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      bf5afef9
    • Lv Zheng's avatar
      ACPICA: acpidump: Update Makefile to build acpidump from ACPICA. · edbe47c1
      Lv Zheng authored
      This patch updates tools Makefile to use new acpidump.
      
      ACPICA's acpidump relies on various ACPICA components/common/os_specific
      source code.  They are located in various kernel folders, being searched
      and compiled using vpath technique in Makefile.  These files include:
      1. drivers/acpi/acpica/acapps.h
      2. tools/power/acpi/common/getopt.c
      3. tools/power/acpi/common/cmfsize.c
      4. tools/power/acpi/os_specific/service_layers/oslinuxtbl.c
      5. tools/power/acpi/os_specific/service_layers/osunixdir.c
      6. tools/power/acpi/os_specific/service_layers/osunixmap.c
      
      This patch has been tested on DELL Inspiron Mini, acpidump output can be
      successfully generated by typing the following commands:
      # cd tools/power/acpi
      # make DEBUG=false
      # sudo make install DESTDIR=/opt
      # sudo make uninstall DESTDIR=/opt
      # make clean
      Or
      # cd tools
      # make acpi
      # sudo make acpi_install
      # sudo make acpi_uninstall
      # make acpi_clean
      A kernel build test is also performed on DELL Inspiron Mini to verify that
      the changes done to actypes.h and aclinux.h won't affect the kernel
      build process.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      [rjw: Subject]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      edbe47c1
    • Lv Zheng's avatar
      ACPICA: acpidump: Update new structures and add missing file. · e2b9035f
      Lv Zheng authored
      This patch is the generation of a commit that updates release automation
      with newly added structures and files that are referenced by the acpidump.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      e2b9035f
    • Lv Zheng's avatar
      ACPICA: acpidump: Add support to generate acpidump release. · 506f57dd
      Lv Zheng authored
      The acpidump is initiated by Bob Moore and Chao Guan, fixed and completed
      by Lv Zheng.
      
      This patch is a generation of the commit that adds acpidump release
      automation into ACPICA release process. Lv Zheng.
      
      Note that this patch doesn't replace the kernel shipped acpidump with the
      new acpidump.  The replacement is done by further patches.
      Original-by: default avatarChao Guan <guanchao@mail.ustc.edu.cn>
      Signed-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>
      506f57dd
    • Bob Moore's avatar
      ACPICA: Table Manager: Split tbinstal.c into two files. · c418ce19
      Bob Moore authored
      New file is tbdata.c -- management functions for ACPICA table
      manager data structures.
      Signed-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>
      c418ce19
    • Bob Moore's avatar
      ACPICA: Table Manager: Misc cleanup and renames, no functional change. · ed6f1d44
      Bob Moore authored
      Some various cleanups and renames.
      Signed-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>
      ed6f1d44
    • Lv Zheng's avatar
      ACPICA: Tables: Add acpi_install_table() API for early table installation. · caf4a15c
      Lv Zheng authored
      This patch adds a new API - acpi_install_table(). OSPMs can use this API
      to install tables during early boot stage.  Lv Zheng.
      
      References: https://lkml.org/lkml/2014/2/28/372
      Cc: Thomas Renninger <trenn@suse.de>
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      [rjw: Subject]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      caf4a15c
    • Lv Zheng's avatar
      ACPICA: Tables: Avoid SSDT installation with acpi_gbl_disable_ssdt_table_load. · a94e88cd
      Lv Zheng authored
      It is reported that when acpi_gbl_disable_ssdt_table_load is specified, user
      still can see it installed into /sys/firmware/acpi/tables on Linux boxes.
      This is because the option only stops table "loading", but doesn't stop
      table "installing", thus it is still in the acpi_gbl_root_table_list. With
      previous cleanups, it is possible to prevent SSDT installations to make
      it not such confusing.  The global variable is also renamed.  Lv Zheng.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      [rjw: Subject]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a94e88cd
    • Lv Zheng's avatar
      ACPICA: Tables: Cleanup ACPI_TABLE_ORIGIN_xxx flags. · 8a216d7f
      Lv Zheng authored
      This patch refines ACPI_TABLE_ORIGIN_xxx flags.  No functional changes.
      
      The previous commits have introduced the following internal APIs:
      1. acpi_tb_acquire_table: Acquire struct acpi_table_header according to
                             ACPI_TABLE_ORIGIN_xxx flags.
      2. acpi_tb_release_table: Release struct acpi_table_header according to
                             ACPI_TABLE_ORIGIN_xxx flags.
      3. acpi_tb_install_table: Make struct acpi_table_desc.Address not NULL according to
                             ACPI_TABLE_ORIGIN_xxx flags.
      4. acpi_tb_uninstall_table: Make struct acpi_table_desc.Address NULL according to
                               ACPI_TABLE_ORIGIN_xxx flags.
      5. acpi_tb_validate_table: Make struct acpi_table_desc.Pointer not NULL according to
                              ACPI_TABLE_ORIGIN_xxx flags.
      6. acpi_tb_invalidate_table: Make struct acpi_table_desc.Pointer NULL according to
                                ACPI_TABLE_ORIGIN_xxx flags.
      It thus detects that the ACPI_TABLE_ORIGIN_UNKNOWN is redundant to
      ACPI_TABLE_ORIGIN_OVERRIDE.
      
      The ACPI_TABLE_ORIGIN_xxTERN_VIRTUAL flags are named as VIRTUAL in order
      not to confuse with x86 logical address, this patch also renames all
      "logical override" into "virtual override".
      Signed-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>
      8a216d7f
    • Lv Zheng's avatar
      ACPICA: Tables: Fix table checksums verification before installation. · 86dfc6f3
      Lv Zheng authored
      The original table handling code does not always verify checksums before
      installing a table, this is because code to achieve this must be
      implemented here and there in the redundant code blocks.
      
      There are two stages during table initialization:
      1. "INSTALLED" after acpi_tb_install_table() and acpi_tb_override_table(),
         struct acpi_table_desc.Pointer is ensured to be NULL.  This can be safely used
         during OSPM's early boot stage.
      2. "VALIDATED" after acpi_tb_validate_table(), struct acpi_table_desc.Pointer is
         ensured to be not NULL.  This must not be used during OSPM's early boot
         stage.
      
      This patch changes acpi_tb_add_table() into an early boot safe API to reduce
      code redundancies by changing the table state that is returned by this
      function from "VALIDATED" to "INSTALLED".  Then the table verification
      code can be done in a single place.  Originally, the acpi_tb_add_table() can
      only be used by dynamic table loadings that are executed after early boot
      stage, it cannot be used by static table loadings that are executed in
      early boot stage as:
      1.  The address of the table is a virtual address either maintained by
          OSPMs who call acpi_load_table() or by ACPICA whenever "Load" or
          "LoadTable" opcodes are executed, while during early boot stage,
          physical address of the table should be used for table loading.
      2.  The API will ensure the state of the loaded table to be "VALIDATED"
          while during early boot stage, tables maintained by root table list
          should be kept as "INSTALLED".
      
      To achieve this:
      1. Rename acpi_tb_install_table() to acpi_tb_install_fixed_table() as it only
         applies to DSDT/FACS installation.  Rename acpi_tb_add_table() to
         acpi_tb_install_non_fixed_table() as it will be applied to the installation
         of the rest kinds of tables.
      2. Introduce acpi_tb_install_table(), acpi_tb_install_and_override_table to collect
         redudant code where their invocations actually have slight differences.
         1. acpi_tb_install_table() is used to fill an struct acpi_table_desc where the
            table length is known to the caller.
         2. acpi_tb_install_and_override_table() is used to perform necessary
            overriding before installation.
      3. Change a parameter of acpi_tb_install_non_fixed_table() from struct acpi_table_desc
         to acpi_physical_address to allow it to be invoked by static table
         loadings.  Also cleanup acpi_ex_load_op() and acpi_load_table() to accomodate
         to the parameter change.
      4. Invoke acpi_tb_install_non_fixed_table() for all table loadings other than
         DSDT/FACS in acpi_tb_parse_root_table() to improve code maintainability
         (logics are collected in the single function).  Also delete useless code
         from acpi_tb_parse_root_table().
      5. Remove all acpi_tb_validate_table() from acpi_tb_install_non_fixed_table() and
         acpi_tb_install_fixed_table() so that the table descriptor is kept in the
         state of "INSTALLED" but not "VALIDATED" after returning from these
         functions.
      6. Introduce temporary struct acpi_table_desc (new_table_desc/old_table_desc) into
         the functions to indicate a table descriptor that is not maintained by
         acpi_gbl_root_table_list. Introduce acpi_tb_acquire_temporal_table() and
         acpi_tb_release_temporal_table() to handle the use cases of such temporal
         tables.  They are only used for verified installation.
      7. Introduce acpi_tb_verify_table() to validate table and verify table
         checksum, also remove table checksum verification from
         acpi_tb_validate_table(). Invoke acpi_tb_validate_table() in the functions
         that will convert a table into "LOADED" state or invoke it from
         acpi_get_table_XXX() APIs. Invoke acpi_tb_verify_table() on temporary
         struct acpi_table_desc(s) that are going to be "INSTALLED".
      8. Change acpi_tb_override_table() logic so that a temporary struct acpi_table_desc
         will be overridden before installtion, this makes code simpler.
      
      After applying the patch, tables are always installed after being
      overridden and the table checksums are always verified before installation.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      [rjw: Subject]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      86dfc6f3
    • Lv Zheng's avatar
      ACPICA: Tables: Fix unbalanced table validations. · eb0c65bd
      Lv Zheng authored
      As acpi_tb_validate_table() returns failure on checksum verification without
      doing invalidatation, all its invocations that are not done to a descriptor
      stored in acpi_gbl_root_table_list are checked and balanced.
      
      But this is not a real issue as the descritors that have been passed to
      acpi_tb_add_table() are all virtual address tables and the validations are in
      fact no-op.  The cleanup can ensure that any future extensions made on
      acpi_tb_add_table() to allow it to be invoked with physical address tables
      will not trigger memory leakage regressions.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      [rjw: Subject]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      eb0c65bd
    • Lv Zheng's avatar
      ACPICA: Tables: Clean up split INSTALLED/VALIDATED table state logics. · 7f9fc99c
      Lv Zheng authored
      This patch is mainly a naming cleanup to clarify hidden logics, no
      functional changes.
      
      acpi_initialize_tables() is used by Linux to install table addresses for
      early boot steps.  During this stage, table addresses are mapped by
      early_ioremap() mechanism which is different from the runtime IO mappings.
      Thus it is not safe for ACPICA to keep mapped pointers in struct acpi_table_desc
      structure during this stage.
      
      In order to support this in ACPICA, table states are divided into
      1. "INSTALLED" (where struct acpi_table_desc.Pointer is always NULL) and
      2. "VALIDATED" (where struct acpi_table_desc.Pointer is always not NULL).
      During acpi_initialize_tables(), table state are ensured to be "INSTALLED"
      but not "VALIDATED".  This logic is ensured by the original code in very
      ambigious way.  For example, currently acpi_tb_delete_table() is invoked in
      some place to perform an uninstallation while it is invoked in other place
      to perform an invalidation.  They happen to work just because no one enters
      the penalty where the 2 behaviours are not equivalent.
      
      The naming cleanups are made in this patch:
      A. For installation and validation:
         There is code setting struct acpi_table_desc.Pointer first and delete it
         immediately to keep the descriptor's state as "INSTALLED" during the
         installation.  This patch implements this in more direct way.  After
         applying it, struct acpi_table_desc.Pointer will never be set in
         acpi_tb_install_table() and acpi_tb_override_table() as they are the only
         functions invoked during acpi_initialize_tables(). This is achieved by:
      1. Rename acpi_tb_verify_table() to acpi_tb_validate_table() to clarify this
         change.
      2. Rename acpi_tb_table_override() to acpi_tb_override_table() to keep nameing
         consistencies as other APIs (verb. Table).
      3. Stops setting struct acpi_table_desc.Pointer in acpi_tb_install_table() and
         acpi_tb_table_override().
      4. Introduce acpi_tb_acquire_table() to acquire the table pointer that is not
         maintained in the struct acpi_table_desc of the global root table list and
         rewrite acpi_tb_validate_table() using this new function to reduce
         redundancies.
      5. Replace the table pointer using the overridden table pointer in
         acpi_tb_add_table(). As acpi_tb_add_table() is not invoked during early boot
         stage, tables returned from this functions should be "VALIDATED".  As
         acpi_tb_override_table() is modified by this patch to return a "INSTALLED"
         but not "VALIDATED" descriptor, to keep acpi_tb_add_table() unchanged,
         struct acpi_table_desc.Pointer is filled in acpi_tb_add_table().
      B. For invalidation and uninstallation:
         The original code invalidate table by invoking acpi_tb_delete_table() here
         and there, but actually this function should only be used to uninstall
         tables.  This can work just because its invocations are equivalent to
         invalidation in some cases.
         This patch splits acpi_tb_delete_table() into acpi_tb_invalidate_table() and
         acpi_tb_uninstall_table() and cleans up the hidden logic using the new
         APIs.  This is achieved by:
      1. Rename acpi_tb_delete_table() to acpi_tb_uninstall_table() as it is mainly
         called before resetting struct acpi_table_desc.Address.  Thus the table
         descriptor is in "not INSTALLED" state.  This patch enforces this by
         setting struct acpi_table_desc.Address to NULL in this function.
      2. Introduce acpi_tb_invalidate_table() to be the reversal of
         acpi_tb_validate_table() and invoke it in acpi_tb_uninstall_table().
      3. Introduce acpi_tb_release_table() to release the table pointer that is not
         maintained in acpi_gbl_root_table_list and rewrite acpi_tb_invalidate_table()
         using this new function to reduce redundancies.
      
      After cleaning up, the maintainability of the internal APIs are also
      improved:
      1. acpi_tb_acquire_table: Acquire struct acpi_table_header according to
                             ACPI_TABLE_ORIGIN_xxx flags.
      2. acpi_tb_release_table: Release struct acpi_table_header according to
                             ACPI_TABLE_ORIGIN_xxx flags.
      3. acpi_tb_install_table: Make struct acpi_table_desc.Address not NULL according to
                             ACPI_TABLE_ORIGIN_xxx flags.
      4. acpi_tb_uninstall_table: Make struct acpi_table_desc.Address NULL according to
                               ACPI_TABLE_ORIGIN_xxx flags.
      5. acpi_tb_validate_table: Make struct acpi_table_desc.Pointer not NULL according to
                              ACPI_TABLE_ORIGIN_xxx flags.
      6. acpi_tb_invalidate_table: Make struct acpi_table_desc.Pointer NULL according to
                                ACPI_TABLE_ORIGIN_xxx flags.
      7. acpi_tb_override_table: Replace struct acpi_table_desc.Address and
                              struct acpi_table_desc.Flags.  It only happens in
                              "INSTALLED" state.
      
      The patch has been unit tested in acpi_exec by:
      1. Initializing;
      2. Executing exc_tbl ASLTS tests;
      3. Executing "Load" command.
      So that all original acpi_tb_install_table() and acpi_tb_override_table()
      invocations are covered.
      
      Known Issues:
      1. Cleanup acpi_tb_add_table() to Kill Code Redundancies
         Current implementation in acpi_tb_add_table() is not very clean, further
         patch can rewrite acpi_tb_add_table() with ordered acpi_tb_install_table(),
         acpi_tb_override_table() and acpi_tb_validate_table(). It is not done in this
         patch so that it is easy for the reviewers to understand the changes in
         this patch.
      Signed-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>
      7f9fc99c
    • Lv Zheng's avatar
      ACPICA: Tables: Fix multiple ACPI_FREE()s around acpi_tb_add_table(). · 55df23f0
      Lv Zheng authored
      Currently there are following issues in acpi_tb_add_table():
      Following logic is currently correct:
      1. When a table is allocated in acpi_ex_load_op(), if a reloading happens,
         the allocated memory is freed by acpi_tb_add_table() and AE_OK is
         returned to the caller to avoid the caller to free it again.
      Following logic is currently incorrect:
      1. When a table is allocated in acpi_ex_load_op() or by the
         acpi_load_table() caller, if the table is already loaded, there will be
         twice ACPI_FREE() called for the same pointer when acpi_tb_add_table()
         returns AE_ALREADY_EXISTS.
      
      This patch only fixes the above incorrect logic in acpi_tb_add_table():
      1. Only invoke acpi_tb_delete_table() if AE_OK is going to be returned.
      2. After doing so, we do not invoke ACPI_FREE() when returning AE_OK;
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      [rjw: Subject]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      55df23f0
    • Lv Zheng's avatar
      ACPICA: Tables: Fix the issues in handling virtual addressed tables. · dc156adf
      Lv Zheng authored
      When table is overridden or reloaded, acpi_tb_delete_table() is called where
      struct acpi_table_desc.Pointer will be NULL.  It thus is impossible for virtual
      addressed tables to obtain the .Pointer again in acpi_tb_verify_table().
      
      This patch stores virtual table addresses  (ACPI_TABLE_ORIGIN_ALLOCATED,
      ACPI_TABLE_ORIGIN_UNKNOWN, ACPI_TABLE_ORIGIN_OVERRIDE) in the
      struct acpi_table_desc.Address field and refills the struct acpi_table_desc.Pointer
      using these addresses in acpi_tb_verify_table(). Note that if a table with
      ACPI_TABLE_ORIGIN_ALLOCATED set is actually freed, the .Address field
      should be invalidated and thus must be replaced with NULL to avoid wrong
      future validations occuring in acpi_tb_verify_table().
      Signed-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>
      dc156adf
    • Lv Zheng's avatar
      ACPICA: Remove indent divergences to reduce maintenance overhead. · 5582982d
      Lv Zheng authored
      The divergences in the ACPICA files makes it difficult to maintain linuxize
      ACPICA table commits.  This patch reduces such divergences before applying
      table manager commits so that human interventions of patch rebasing can be
      reduced.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      [rjw: Subject]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      5582982d
    • Bob Moore's avatar
      ACPICA: Add a missing field for debug dump of mutex objects. · 0745fb41
      Bob Moore authored
      Adds "OriginalSyncLevel" field to the output.
      Signed-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>
      0745fb41
    • Colin Ian King's avatar
      ACPICA: Linux-specific header: Add support for PPC64 compilation. · 72bdad96
      Colin Ian King authored
      Adds PPC64 as a 64-bit architecture. Colin Ian King.
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-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>
      72bdad96
    • Lv Zheng's avatar
      ACPICA: Clean up comment divergences in aclinux.h · a3a80da3
      Lv Zheng authored
      When the following commmit is back ported to ACPICA, comments have been
      updated:
        Subject: ACPICA: Linux-specific header: Update support for Linux/acpi
                 applications.
      
      This patch back ports the differences between the ACPICA upstream and
      Linux.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      [rjw: Subject]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a3a80da3
    • Lv Zheng's avatar
      ACPICA: Update use of acpi_os_wait_events_complete interface. · 69c841b6
      Lv Zheng authored
      This patch cleans up all of the acpi_os_wait_events_complete() invocations to
      make it to be invoked inside of ACPICA in the way to accommodate Linux's
      work queue implementation.
      
      According to the report, current Linux kernel code is facing a boot time
      race issue in the acpi_remove_notify_handler(). This is because:
      Linux is using work queues to implement a deferred handler call environment
      while ACPICA expects OSPM to implement acpi_os_wait_events_complete() using
      wait queues.  The position to invoke a "waiter" is not suitable for a
      "flusher" as new invocations can be scheduled after this position and
      before the deletion of the handler from its management container.
      
      Since the following commit has deleted acpi_os_wait_events_complete()
      parameters, it thus might not be possible for OSPM to achieve a safe
      removal using wait queues.  This requires ACPICA to be changed accordingly
      to "flush" handlers rather than "wait" them to be drain up:
      
        Commit: 5ff986a2a9db11858247b71fe242fe17617229aa
        Date: Wed, 16 May 2012 13:36:07 -0700
        Subject: Introduce acpi_os_wait_events_complete interface.
      
        This interface will block until asynchronous events like notifies
        and GPEs are complete. Within ACPICA, it is called before a notify or GPE
        handler is removed. ACPICA BZ 868.
      
      This patch fixes this issue by invoking acpi_os_wait_events_complete() in the
      way to "flush" things - it thus should be put to the position after handler
      is removed from its management container but before it is destructed.
      
      The technical concerns are:
      1. MTX_NAMESPACE is used to protect things that acpi_os_wait_events_complete()
         might be waiting for, thus MTX_NAMESPACE must be unlocked before
         invoking acpi_os_wait_events_complete().
      2. MTX_NAMESPACE is also used to implement the serialization of
         acpi_install_notify_handler() and acpi_remove_notify_handler(). This patch
         changes this logic, thus if there are many
         acpi_install/remove_notify_handler() invoked in parallel, the
         acpi_os_wait_events_complete() might face the races which could cause it
         never running to an end.  Normally this will require additional code to
         implement a separate locking facility which is not implemented due to 3.
      3. Given ACPICA users will always invoke acpi_install_notify_handler() once
         during Linux module/device initialization and invoke
         acpi_remove_notify_handler() once during module/device finalization,
         problem stated in 2 will not happen in Linux environment due to the
         mutual exclusive module/device existence, this fix thus is sufficient.
      Same concerns can apply to acpi_install/remove_gpe_handler(). Reported and
      tested: Ronald Vink.  Fixed: Lv Zheng.
      
      References: https://bugzilla.kernel.org/show_bug.cgi?id=60583Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Reported-and-Tested-by: default avatarRonald Vink <ronald.vink@boskalis.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      69c841b6
    • Bob Moore's avatar
      ACPICA: Disassembler: Add decoding of Notify() values. · 06a63e33
      Bob Moore authored
      For Notify operators, displays a comment that describe the meaning
      of the notify value.
      
      This patch updates the debugging information that is enabled for
      CONFIG_ACPI_DEBUG builds.
      Signed-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>
      06a63e33
    • Bob Moore's avatar
      ACPICA: Disassembler: Add support to decode _HID and _CID values. · b944b29c
      Bob Moore authored
      For _HID and _CID, the disassembler will emit a string that describes
      the device if the _HID/_CID value is recognized. acpihelp updated also.
      acpihelp will now search for a specific ID as well as displaying
      the list of "known" (to ACPICA) IDs.
      
      This patch does not affect Linux kernel behavior as the disassembler
      and the acpihelp are not shipped with it.
      Signed-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>
      b944b29c
    • Bob Moore's avatar
      ACPICA: Unload operator: Emit a warning if and when it is ever used. · 43d1a62d
      Bob Moore authored
      We would like to see the ASL for any machine that uses this operator,
      so emit at least a warning to hopefully draw some attention.
      Signed-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>
      43d1a62d
    • Bob Moore's avatar
      ACPICA: gcc-specific: Fix possible issue with the strchr function. · 7ed82326
      Bob Moore authored
      Some versions of gcc implement strchr via a macro, which either
      contains bugs or can provoke a bug in the compiler. This change
      fixes a possible compile-time error when using this function.
      The problem is usually seen when compiling the getopt.c module.
      Signed-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>
      7ed82326
    • Bob Moore's avatar
      ACPICA: Update comments for ACPICA name - no functional change. · 6085bb18
      Bob Moore authored
      Change all comments that contain the string "ACPI CA" to "ACPICA"
      so that the name is standard across the entire source base.
      Signed-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>
      6085bb18
    • David Binderman's avatar
      ACPICA: utstring: Check array index bound before use. · 5d42b0fa
      David Binderman authored
      ACPICA BZ 1077. David Binderman.
      
      References: https://bugs.acpica.org/show_bug.cgi?id=1077Signed-off-by: default avatarDavid Binderman <dcb314@hotmail.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Cc: 3.9+ <stable@vger.kernel.org> # 3.9.x: 42f8fb75: ACPICA: Source restructuring
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      5d42b0fa
    • Bob Moore's avatar
      ACPICA: Add EXPORT_SYMBOL macros for install/remove SCI handler interfaces. · 1d44efab
      Bob Moore authored
      These recently added interfaces did not have these macros, used
      by some hosts.
      Signed-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>
      1d44efab
    • Linus Torvalds's avatar
      Linux 3.15-rc2 · a798c10f
      Linus Torvalds authored
      a798c10f
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma · 372feacb
      Linus Torvalds authored
      Pull slave-dmaengine fixes from Vinod Koul:
       "Back from long weekend here in India and now the time to send fixes
        for slave dmaengine.
         - Dan's fix of sirf xlate code
         - Jean's fix for timberland
         - edma fixes by Sekhar for SG handling and Yuan for changing init
           call"
      
      * 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
        dma: fix eDMA driver as a subsys_initcall
        dmaengine: sirf: off by one in of_dma_sirfsoc_xlate()
        platform: Fix timberdale dependencies
        dma: edma: fix incorrect SG list handling
      372feacb
    • Linus Torvalds's avatar
      Merge tag 'iommu-fixes-v3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu · 5269519f
      Linus Torvalds authored
      Pull iommu fixes from Joerg Roedel:
       "Fixes for regressions:
      
         - fix wrong IOMMU enumeration causing some SCSI device drivers
           initialization failures
         - ARM-SMMU fixes for a panic condition and a wrong return value"
      
      * tag 'iommu-fixes-v3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
        iommu/arm-smmu: fix panic in arm_smmu_alloc_init_pte
        iommu/arm-smmu: Return 0 on unmap failure
        iommu/vt-d: fix bug in matching PCI devices with DRHD/RMRR descriptors
        iommu/vt-d: Fix get_domain_for_dev() handling of upstream PCIe bridges
        iommu/vt-d: fix memory leakage caused by commit ea8ea460
      5269519f
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 200bde27
      Linus Torvalds authored
      Pull perf tooling fixes from Ingo Molnar:
       "Three small tooling fixes"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf tools: Improve error reporting
        perf tools: Adjust symbols in VDSO
        perf kvm: Fix 'Min time' counting in report command
      200bde27
    • Ingo Molnar's avatar
      Merge tag 'perf-urgent-for-mingo' of... · fd741edc
      Ingo Molnar authored
      Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf into perf/urgent
      
      Pull perf/urgent fixes from Jiri Olsa:
      
      User visible changes:
      
        * Adjust symbols in VDSO to properly resolve its function names (Vladimir Nikulichev)
      
        * Improve error reporting for record session failure (Adrien BAK)
      
        * Fix 'Min time' counting in report command (Alexander Yarygin)
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      fd741edc
  4. 19 Apr, 2014 5 commits
    • Adrien BAK's avatar
      perf tools: Improve error reporting · ffa91880
      Adrien BAK authored
      In the current version, when using perf record, if something goes
      wrong in tools/perf/builtin-record.c:375
        session = perf_session__new(file, false, NULL);
      
      The error message:
      "Not enough memory for reading per file header"
      
      is issued. This error message seems to be outdated and is not very
      helpful. This patch proposes to replace this error message by
      "Perf session creation failed"
      
      I believe this issue has been brought to lkml:
      https://lkml.org/lkml/2014/2/24/458
      although this patch only tackles a (small) part of the issue.
      
      Additionnaly, this patch improves error reporting in
      tools/perf/util/data.c open_file_write.
      
      Currently, if the call to open fails, the user is unaware of it.
      This patch logs the error, before returning the error code to
      the caller.
      Reported-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarAdrien BAK <adrien.bak@metascale.org>
      Link: http://lkml.kernel.org/r/1397786443.3093.4.camel@beast
      [ Reorganize the changelog into paragraphs ]
      [ Added empty line after fd declaration in open_file_write ]
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      ffa91880
    • Vladimir Nikulichev's avatar
      perf tools: Adjust symbols in VDSO · 922d0e4d
      Vladimir Nikulichev authored
      pert-report doesn't resolve function names in VDSO:
      
      $ perf report --stdio -g flat,0.0,15,callee --sort pid
      ...
                  8.76%
                     0x7fff6b1fe861
                     __gettimeofday
                     ACE_OS::gettimeofday()
      ...
      
      In this case symbol values should be adjusted the same way as for executables,
      relocatable objects and prelinked libraries.
      
      After fix:
      
      $ perf report --stdio -g flat,0.0,15,callee --sort pid
      ...
                  8.76%
                     __vdso_gettimeofday
                     __gettimeofday
                     ACE_OS::gettimeofday()
      Signed-off-by: default avatarVladimir Nikulichev <nvs@tbricks.com>
      Tested-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Link: http://lkml.kernel.org/r/969812.163009436-sendEmail@nvsSigned-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      922d0e4d
    • Alexander Yarygin's avatar
      perf kvm: Fix 'Min time' counting in report command · acb61fc8
      Alexander Yarygin authored
      Every event in the perf-kvm has a 'stats' structure, which contains
      max/min/average/etc times of handling this event.
      The problem is that the 'perf-kvm stat report' command always shows
      that 'min time' is 0us for every event. Example:
      
       # perf kvm stat report
      
       Analyze events for all VCPUs:
      
          VM-EXIT    Samples  Samples%     Time%   Min Time   Max Time Avg time
        [..]
        0xB2 MSCH         12     0.07%     0.00%        0us        8us 7.31us ( +-   2.11% )
        0xB2 CHSC         12     0.07%     0.00%        0us       18us 9.39us ( +-   9.49% )
        0xB2 STPX          8     0.05%     0.00%        0us        2us 1.88us ( +-   7.18% )
        0xB2 STSI          7     0.04%     0.00%        0us       44us 16.49us ( +-  38.20% )
        [..]
      
      This happens because the 'stats' structure is not initialized and
      stats->min equals to 0. Lets initialize the structure for every
      event after its allocation using init_stats() function. This initializes
      stats->min to -1 and makes 'Min time' statistics counting work:
      
       # perf kvm stat report
      
       Analyze events for all VCPUs:
      
          VM-EXIT    Samples  Samples%     Time%   Min Time   Max Time Avg time
        [..]
        0xB2 MSCH         12     0.07%     0.00%        6us        8us 7.31us ( +-   2.11% )
        0xB2 CHSC         12     0.07%     0.00%        7us       18us 9.39us ( +-   9.49% )
        0xB2 STPX          8     0.05%     0.00%        1us        2us 1.88us ( +-   7.18% )
        0xB2 STSI          7     0.04%     0.00%        1us       44us 16.49us ( +-  38.20% )
        [..]
      Signed-off-by: default avatarAlexander Yarygin <yarygin@linux.vnet.ibm.com>
      Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@gmail.com>
      Link: http://lkml.kernel.org/r/1397053319-2130-3-git-send-email-borntraeger@de.ibm.com
      [ Fixing the perf examples changelog output ]
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      acb61fc8
    • Eric Dumazet's avatar
      coredump: fix va_list corruption · 404ca80e
      Eric Dumazet authored
      A va_list needs to be copied in case it needs to be used twice.
      
      Thanks to Hugh for debugging this issue, leading to various panics.
      
      Tested:
      
        lpq84:~# echo "|/foobar12345 %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h" >/proc/sys/kernel/core_pattern
      
      'produce_core' is simply : main() { *(int *)0 = 1;}
      
        lpq84:~# ./produce_core
        Segmentation fault (core dumped)
        lpq84:~# dmesg | tail -1
        [  614.352947] Core dump to |/foobar12345 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 (null) pipe failed
      
      Notice the last argument was replaced by a NULL (we were lucky enough to
      not crash, but do not try this on your production machine !)
      
      After fix :
      
        lpq83:~# echo "|/foobar12345 %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h" >/proc/sys/kernel/core_pattern
        lpq83:~# ./produce_core
        Segmentation fault
        lpq83:~# dmesg | tail -1
        [  740.800441] Core dump to |/foobar12345 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 pipe failed
      
      Fixes: 5fe9d8ca ("coredump: cn_vprintf() has no reason to call vsnprintf() twice")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Diagnosed-by: default avatarHugh Dickins <hughd@google.com>
      Acked-by: default avatarOleg Nesterov <oleg@redhat.com>
      Cc: Neil Horman <nhorman@tuxdriver.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: stable@vger.kernel.org # 3.11+
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      404ca80e
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 6d459690
      Linus Torvalds authored
      Pull x86 fix from Ingo Molnar:
       "This fixes the preemption-count imbalance crash reported by Owen
        Kibel"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/mce: Fix CMCI preemption bugs
      6d459690