21 Oct, 2014

2 commits

  • Eliminate an error message for batch-mode processing on unix
    systems. ACPICA BZ 1114.

    This patch is mainly for fixing the issues of acpiexec which is not in the
    Linux upstream.

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

    Bob Moore
     
  • The acpidump currently always uses ACPI 2.0 format to dump RSDP, this patch
    adds ACPI 1.0 RSDP support.

    Link: https://bugs.acpica.org/show_bug.cgi?id=1097
    Link: https://bugs.acpica.org/show_bug.cgi?id=1103
    Signed-off-by: Lv Zheng
    Reported-and-tested-by: Rudolf Marek
    Reported-and-tested-by: Rafal
    Signed-off-by: Bob Moore
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     

16 Aug, 2014

2 commits


06 Aug, 2014

1 commit

  • * pm-tools:
    cpupower: Remove redundant error check
    cpupower: bench: parse.c: Fix several minor errors
    cpupower: mperf monitor: Correct use of ! and &
    cpupower: Adjust MAINTAINERS file
    PM / tools: cpupower: drop negativity check on unsigned value

    Rafael J. Wysocki
     

30 Jul, 2014

3 commits

  • Remove double checks, and move the call to print_error to the
    first check. Replace break by return, and return 0 on success.
    The simplified version of the coccinelle semantic patch that
    fixes this issue is as follows:

    //
    @@
    expression E; identifier pr; expression list es;
    @@
    for(...;...;...){
    ...
    - if (E) break;
    + if (E){
    + pr(es);
    + break;
    + }
    ...
    }
    - if(E) pr(es);
    //

    Signed-off-by: Peter Senna Tschudin
    Signed-off-by: Thomas Renninger
    Signed-off-by: Rafael J. Wysocki

    Peter Senna Tschudin
     
  • Resolved several minor errors in prepare_config() and made some additional improvements.
    Earlier, the risk of file stream that was not closed. Misuse of strncpy, and the use of strncmp with strlen that makes it pointless.
    I also check that sscanf has been successful, otherwise continue to the next line. And minimized the use of magic numbers.

    This was found using a static code analysis program called cppcheck.

    Signed-off-by: Rickard Strandqvist
    Signed-off-by: Thomas Renninger
    Signed-off-by: Rafael J. Wysocki

    Rickard Strandqvist
     
  • In commit ae91d60ba88ef0bdb1b5e9b2363bd52fc45d2af7, a bug was fixed that
    involved converting !x & y to !(x & y). The code below shows the same
    pattern, and thus should perhaps be fixed in the same way.

    The Coccinelle semantic patch that makes this change is as follows:

    //
    @@ expression E1,E2; @@
    (
    !E1 & !E2
    |
    - !E1 & E2
    + !(E1 & E2)
    )
    //

    Signed-off-by: Himangi Saraogi
    Signed-off-by: Thomas Renninger
    Signed-off-by: Rafael J. Wysocki

    Himangi Saraogi
     

20 Jul, 2014

1 commit


08 Jul, 2014

14 commits

  • Some cleanup and comment update.

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

    Bob Moore
     
  • This patch is a result of an ACPICA commit to enables acpidump for EFI. For
    Linux kernel, this patch is a no-op. It is only required by the ACPICA
    release process to reduce the source code differences between the Linux
    kernel and the ACPICA upstream. Lv Zheng.

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

    Lv Zheng
     
  • This patch reduces the requirement of invoking freopen() in acpidump in order
    to reduce the porting effort of acpidump.

    This patch achieves this by turning all acpi_os_printf(stdout) into
    acpi_ut_file_printf(gbl_output_file). Lv Zheng.

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

    Lv Zheng
     
  • The new APIs are enabled to offer a portable layer to access files:
    1. acpi_os_XXX_file_XXX: Wrapper of fopen/fclose/fread/fwrite
    2. acpi_os_printf: Wrapper of printf
    3. acpi_log_error: Wrapper of fprintf(stderr)

    This patch deploys such mechanisms to acpidump to improve the portability
    of this tool. Lv Zheng.

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

    Lv Zheng
     
  • This patch removes exit() from generic acpidump code to improve the
    portability of this tool. Lv Zheng.

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

    Lv Zheng
     
  • This patch adds code to use generic OSL for acpidump to improve the
    portability of this tool. Lv Zheng.

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

    Lv Zheng
     
  • This patch enhances acpi_getopt() by converting the standard C library
    invocations into portable ACPI string APIs and acpi_log_error() to improve
    portability. Lv Zheng.

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

    Lv Zheng
     
  • This patch uses abstract file IO and acpi_log_error() APIs to enhance
    cm_get_file_size() so that applications that invoke this API could have
    portability improved.

    With actual references added to abstract file IO and acpi_log_error(), the
    applications need to link oslibcfs.o, utdebug.o, utexcep.o, utmath.o,
    utprint.o and utxferror.o.

    It is also required to add acpi_os_initialize() invocations if an
    application starts to use acpi_log_error().

    acpidump has already invoked acpi_os_initialize() in this way. Lv Zheng.

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

    Lv Zheng
     
  • This patch enhances ACPI_USAGE_xxx/ACPI_OPTION macros to use portable
    acpi_os_printf() so that usage functions for applications no longer rely on
    the printf() API.

    To use acpi_os_printf() exported by osunixxf.c as a replacement of
    printf(), applications need to initialize acpi_gbl_output_file to stdout
    and initialize acpi_gbl_db_output_flags to ACPI_DB_CONSOLE_OUTPUT. The
    latter is automatically done by ACPI_INIT_GLOBAL(), applications need to
    link utglobal.o to utilize this mechanism. For GCC, assigning stdout to
    acpi_gbl_output_file using ACPI_INIT_GLOBAL() is not possible as stdout is
    not a constant in GCC environment. As an alternative solution, stdout
    assignment has been put into acpi_os_initialize(). Thus
    acpi_os_initialize() need to be invoked very early by the applications to
    initialize the default output of acpi_os_printf() to keep behavior
    consistency.

    acpidump has already invoked acpi_os_initialize() in this way. Lv Zheng.

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

    Lv Zheng
     
  • This patch introduces formatted printing APIs to handle ACPICA specific
    formatted print requirements. Currently only specific OSPMs will use this
    customized printing support, Linux kernel doesn't use these APIs at this
    time. It will be enabled for Linux kernel resident ACPICA after being well
    tested. So currently this patch is a no-op.

    The specific formatted printing APIs are useful to ACPICA as:
    1. Some portable applications do not link standard C library, so they
    cannot use standard formatted print APIs directly.
    2. Platform specific printing format may differ and thus not portable, for
    example, u64 is %ull for Linux kernel and is %uI64 for some MSVC
    versions.
    3. Platform specific printing format may conflict with ACPICA's usages
    while it is not possible for ACPICA developers to test their code for
    all platforms. For example, developers may generate %pRxxx while Linux
    kernel treats %pR as structured resource printing and decodes variable
    argument as a "struct resource" pointer.
    This patch solves above issues by introducing the new APIs.

    Note that users of such APIs are not introduced in this patch. Users of
    acpi_os_file_vprintf()/acpi_ut_file_printf() need to invoke acpi_os_initialize(),
    this should be taken care by the further patches where such users are
    introduced. Lv Zheng.

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

    Lv Zheng
     
  • 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
     
  • This patch is mainly for acpidump where there are redundant
    acpi_os_printf()/acpi_os_vprintf() stubs implemented. This patch cleans up such
    specific implementation by linking acpidump to osunixxf.c/oswinxf.c.

    To make acpi_os_printf() exported by osunixxf.c/oswinxf.c to behave as the
    old acpidump specific ones, applications need to:
    1. Initialize acpi_gbl_db_output_flags to ACPI_DB_CONSOLE_OUTPUT.
    This is automatically done by ACPI_INIT_GLOBAL(), applications need to
    link utglobal.o to utilize this mechanism.
    2. Initialize acpi_gbl_output_file to stdout.
    For GCC, assigning stdout to acpi_gbl_output_file using ACPI_INIT_GLOBAL()
    is not possible as stdout is not a constant in GCC environment. As an
    alternative solution, stdout assignment is put into acpi_os_initialize().
    Thus acpi_os_initialize() need to be invoked very early by the
    applications to initialize the default output of acpi_os_printf().

    This patch also releases osunixxf.c to the Linux kernel. Lv Zheng.

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

    Lv Zheng
     
  • …rom utglobal.c to utinit.c

    The utglobal.c is used to define and initialize global variables. It makes
    sense if just adding utglobal.o to applications that are using such
    variables. But acpi_ut_init_globals() is preventing us from doing so as
    this initialization function references other components' initializations
    code, which leads to the requirement that many files should also get linked
    if one wants to link utglobal.o.

    It is possible to just move acpi_ut_init_global() to utinit.c for
    applications that require this function to link.

    By linking utglobal.o, we can stop defining DEFINE_ACPI_GLOBALS for
    applications (currently only acpidump is affected). Lv Zheng.

    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
     
  • For older EFI platforms, searches for the RSDP using ACPI 1.0 GUID if the
    2.0 GUID search fails.

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

    Lv Zheng
     

04 Jun, 2014

2 commits

  • * acpi-tools:
    ACPI / tools: Introduce ec_access.c - tool to access the EC

    * pm-tools:
    cpupower: Remove mc and smt power aware scheduler info/settings
    cpupower: cpupower info -b should return 0 on success, not the perf bias value
    cpupower: If root, try to load msr driver on x86 if /dev/cpu/0/msr is not available
    cpupower: Install recently added cpupower-idle-{set, info} manpages
    cpupower: Introduce idle state disable-by-latency and enable-all
    cpupower: Remove all manpages on make uninstall
    cpupower: Remove dead link to homepage, and update the targets built.
    cpupower: Rename cpufrequtils -> cpupower, and libcpufreq -> libcpupower.
    PM / tools: cpupower: add option to display values without round offs
    tools / power: turbostat: Drop temperature checks

    Rafael J. Wysocki
     
  • * pm-cpufreq: (28 commits)
    cpufreq: handle calls to ->target_index() in separate routine
    cpufreq: s5pv210: drop check for CONFIG_PM_VERBOSE
    cpufreq: intel_pstate: Remove unused member name of cpudata
    cpufreq: Break out early when frequency equals target_freq
    cpufreq: Tegra: drop wrapper around tegra_update_cpu_speed()
    cpufreq: imx6q: Remove unused include
    cpufreq: imx6q: Drop devm_clk/regulator_get usage
    cpufreq: powernow-k8: Suppress checkpatch warnings
    cpufreq: powernv: make local function static
    cpufreq: Enable big.LITTLE cpufreq driver on arm64
    cpufreq: nforce2: remove DEFINE_PCI_DEVICE_TABLE macro
    intel_pstate: Add CPU IDs for Broadwell processors
    cpufreq: Fix build error on some platforms that use cpufreq_for_each_*
    PM / OPP: Move cpufreq specific OPP functions out of generic OPP library
    PM / OPP: Remove cpufreq wrapper dependency on internal data organization
    cpufreq: Catch double invocations of cpufreq_freq_transition_begin/end
    intel_pstate: Remove sample parameter in intel_pstate_calc_busy
    cpufreq: Kconfig: Fix spelling errors
    cpufreq: Make linux-pm@vger.kernel.org official mailing list
    cpufreq: exynos: Use dev_err/info function instead of pr_err/info
    ...

    Rafael J. Wysocki
     

29 May, 2014

1 commit


17 May, 2014

8 commits


07 May, 2014

6 commits

  • It is reported that there are buggy BIOSes in the world: AMI uses an XSDT
    compiler for early BIOSes, this compiler will generate XSDT with a NULL
    entry. The affected BIOS versions are "AMI BIOS F2-F4".

    Original solution on Linux is to use an alternative heathy root table
    instead of the ill one. This commit is:
    Commit: 671cc68dc61f029d44b43a681356078e02d8dab8
    Subject: ACPICA: Back port and refine validation of the XSDT root table.

    This is an example of such XSDT dumped from B85-HD3 (AMI F3 BIOS):
    [000h 0000 4] Signature : "XSDT" [Extended System Description Table]
    [004h 0004 4] Table Length : 00000074
    [008h 0008 1] Revision : 01
    [009h 0009 1] Checksum : 18
    [00Ah 0010 6] Oem ID : "ALASKA"
    [010h 0016 8] Oem Table ID : "A M I"
    [018h 0024 4] Oem Revision : 01072009
    [01Ch 0028 4] Asl Compiler ID : "AMI "
    [020h 0032 4] Asl Compiler Revision : 00010013

    [024h 0036 8] ACPI Table Address 0 : 00000000BA5F8180
    [02Ch 0044 8] ACPI Table Address 1 : 00000000BA5F8290
    [034h 0052 8] ACPI Table Address 2 : 00000000BA5F8308
    [03Ch 0060 8] ACPI Table Address 3 : 00000000BA5F8848
    [044h 0068 8] ACPI Table Address 4 : 00000000BA5F9320
    [04Ch 0076 8] ACPI Table Address 5 : 00000000BA5F9360
    [054h 0084 8] ACPI Table Address 6 : 00000000BA5F9398
    [05Ch 0092 8] ACPI Table Address 7 : 00000000BA5F9708
    [064h d100 8] ACPI Table Address 8 : 00000000BA5FC9A8
    [06Ch 0108 8] ACPI Table Address 9 : 0000000000000000

    But according to the bug report, the XSDT in fact is not broken. In the
    above XSDT, ACPI Table Address 1-8 contains the same value as RSDT. The
    differences can only be seen on the following 2 entries:
    1. The first entry points to a FADT whose Revision is 5 while the first
    entry in RSDT points to a FADT whose Revision is 2.
    The FADT dumped from the address indicated by the first entry of XSDT:
    FACP @ 0x00000000BA5F8180
    0000: 46 41 43 50 0C 01 00 004B 41 4C 41 53 4B 41 FACP.....KALASKA
    ...
    The FADT dumped from the address indicated by the first entry of RSDT:
    FACP @ 0x00000000BA5ED0F0
    0000: 46 41 43 50 84 00 00 00A7 41 4C 41 53 4B 41 FACP......ALASKA
    ...
    2. The last entry is a NULL terminator.
    According to the test result, the Revision 5 FADT is accessible. Thus the
    original solution turns out to be a work around that is preventing the
    higher revision tables to be used for such platforms (they are all x86-64
    platforms, and should use XSDT and higher revision FADT).

    This patch offers a new solution, where a sanity check is performed before
    installing a table address from XSDT. If the entry is NULL, it is simply
    discarded.

    Note that, this patch doesn't remove the original solution, so for Linux
    kernel, this commit is actually a no-op, but it allows acpidump to be
    working on such platforms. By doing so, we allow another easy revertable
    commit to enable this feature so that when that commit is reverted, the
    useful sanity check will not be affected. Lv Zheng.

    References: https://bugzilla.kernel.org/show_bug.cgi?id=73911
    References: https://bugs.archlinux.org/task/39811
    Signed-off-by: Lv Zheng
    Reported-and-tested-by: Bruce Chiarelli
    Reported-and-tested-by: Spyros Stathopoulos
    Signed-off-by: Bob Moore
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     
  • This patch adds "-x" and "-x -x" options to disable XSDT for acpidump.

    The single "-x" can be used to stop using XSDT, RSDT will be forced to find
    static tables, note that XSDT will still be dumped. The double "-x" can
    stop dumping XSDT, which is useful when the XSDT address reported by RSDP
    is pointing to an invalid address.

    It is reported there are platforms having broken XSDT shipped, acpidump
    will stop working while accessing such XSDT. This patch adds new option so
    that users can force acpidump to dump tables listed in the RSDT. Lv Zheng.

    Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=73911
    Buglink: https://bugs.archlinux.org/task/39811
    Signed-off-by: Lv Zheng
    Reported-and-tested-by: Bruce Chiarelli
    Reported-and-tested-by: Spyros Stathopoulos
    Signed-off-by: Bob Moore
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     
  • This patch enforces a rule to always use ACPI_VALIDATE_RSDP_SIG for RSDP
    signatures passed from table header or ACPI_SIG_RSDP so that truncated
    string comparison can be avoided. This could help to fix the issue that
    "RSD " matches but "RSD PTR " doesn't match. Lv Zheng.

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

    Lv Zheng
     
  • This patch fixes an issue that the while loop is not needed as fread()
    should return exact the bytes of expected.

    The patch is tested by runing diff against the output of "-c" mode and
    the normal mode, and only finds the following differences:
    1. table addresses: the "-c" mode will always fill 0x0000000000000000 for
    the address.
    2. RSDP/RSDT/XSDT: there is no generation of such tables for "-c" mode.
    So the test result shows the fix is valid. Lv Zheng.

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

    Lv Zheng
     
  • Rafael J. Wysocki
     
  • The command "cpupower frequency-info" can be used when using cpupower to
    monitor and test processor behaviour to determine if the processor is
    behaving as expected. This data can be compared to the output of
    /proc/cpuinfo or the output of
    /sys/devices/system/cpu/cpuX/cpufreq/scaling_available_frequencies
    to determine if the cpu is in an expected state.

    When doing this I noticed comparison test failures due to the way the
    data is displayed in cpupower. For example,

    [root@intel-s3e37-02 cpupower]# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
    2262000 2261000 2128000 1995000 1862000 1729000 1596000 1463000 1330000
    1197000 1064000

    compared to

    [root@intel-s3e37-02 cpupower]# cpupower frequency-info
    analyzing CPU 0:
    driver: acpi-cpufreq
    CPUs which run at the same hardware frequency: 0
    CPUs which need to have their frequency coordinated by software: 0
    maximum transition latency: 10.0 us.
    hardware limits: 1.06 GHz - 2.26 GHz
    available frequency steps: 2.26 GHz, 2.26 GHz, 2.13 GHz, 2.00 GHz, 1.86 GHz, 1.73 GHz, 1.60 GHz, 1.46 GHz, 1.33 GHz, 1.20 GHz, 1.06 GHz
    available cpufreq governors: conservative, userspace, powersave, ondemand, performance
    current policy: frequency should be within 1.06 GHz and 2.26 GHz.
    The governor "performance" may decide which speed to use
    within this range.
    current CPU frequency is 2.26 GHz (asserted by call to hardware).
    boost state support:
    Supported: yes
    Active: yes

    shows very different values for the available frequency steps. The cpupower
    output rounds off values at 2 decimal points and this causes problems with
    test scripts. For example, with the data above,

    1.064 is 1.06
    1.197 is 1.20
    1.596 is 1.60
    1.995 is 2.00
    2.128 is 2.13

    and most confusingly,

    2.261 is 2.26
    2.262 is 2.26

    Truncating these values serves no real purpose other than making the output
    pretty. Since the default has been to round off these values I am adding
    a -n/--no-rounding option to the cpupower utility that will display the
    data without rounding off the still significant digits.

    After patch,

    analyzing CPU 0:
    driver: acpi-cpufreq
    CPUs which run at the same hardware frequency: 0
    CPUs which need to have their frequency coordinated by software: 0
    maximum transition latency: 10.000 us.
    hardware limits: 1.064000 GHz - 2.262000 GHz
    available frequency steps: 2.262000 GHz, 2.261000 GHz, 2.128000 GHz, 1.995000 GHz, 1.862000 GHz, 1.729000 GHz, 1.596000 GHz, 1.463000 GHz, 1.330000 GHz, 1.197000 GHz, 1.064000 GHz
    available cpufreq governors: conservative, userspace, powersave, ondemand, performance
    current policy: frequency should be within 1.064000 GHz and 2.262000 GHz.
    The governor "performance" may decide which speed to use
    within this range.
    current CPU frequency is 2.262000 GHz (asserted by call to hardware).
    boost state support:
    Supported: yes
    Active: yes

    Acked-by: Thomas Renninger
    Signed-off-by: Prarit Bhargava
    [rjw: Subject]
    Signed-off-by: Rafael J. Wysocki

    Prarit Bhargava