1. 21 Mar, 2018 1 commit
    • Joao Martins's avatar
      xen/acpi: upload _PSD info for non Dom0 CPUs too · 4d0f1ce6
      Joao Martins authored
      All uploaded PM data from non-dom0 CPUs takes the info from vCPU 0 and
      changing only the acpi_id. For processors which P-state coordination type
      is HW_ALL (0xFD) it is OK to upload bogus P-state dependency information
      (_PSD), because Xen will ignore any cpufreq domains created for past CPUs.
      Albeit for platforms which expose coordination types as SW_ANY or SW_ALL,
      this will have some unintended side effects. Effectively, it will look at
      the P-state domain existence and *if it already exists* it will skip the
      acpi-cpufreq initialization and thus inherit the policy from the first CPU
      in the cpufreq domain. This will finally lead to the original cpu not
      changing target freq to P0 other than the first in the domain. Which will
      make turbo boost not getting enabled (e.g. for 'performance' governor) for
      all cpus.
      This patch fixes that, by also evaluating _PSD when we enumerate all ACPI
      processors and thus always uploading the correct info to Xen. We export
      acpi_processor_get_psd() for that this purpose, but change signature
      to not assume an existent of acpi_processor given that ACPI isn't creating
      an acpi_processor for non-dom0 CPUs.
      Signed-off-by: default avatarJoao Martins <joao.m.martins@oracle.com>
      Reviewed-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
  2. 02 Nov, 2017 1 commit
    • Greg Kroah-Hartman's avatar
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman authored
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      How this work was done:
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
      All documentation files were explicitly excluded.
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
         For non */uapi/* files that summary was:
         SPDX license identifier                            # files
         GPL-2.0                                              11139
         and resulted in the first patch in this series.
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
         SPDX license identifier                            # files
         GPL-2.0 WITH Linux-syscall-note                        930
         and resulted in the second patch in this series.
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
         SPDX license identifier                            # files
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
         and that resulted in the third patch in this series.
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: default avatarKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: default avatarPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
  3. 21 Nov, 2016 1 commit
  4. 17 Nov, 2016 1 commit
    • Rafael J. Wysocki's avatar
      cpufreq: intel_pstate: Request P-states control from SMM if needed · d0ea59e1
      Rafael J. Wysocki authored
      Currently, intel_pstate is unable to control P-states on my
      IvyBridge-based Acer Aspire S5, because they are controlled by SMM
      on that machine by default and it is necessary to request OS control
      of P-states from it via the SMI Command register exposed in the ACPI
      FADT.  intel_pstate doesn't do that now, but acpi-cpufreq and other
      cpufreq drivers for x86 platforms do.
      Address this problem by making intel_pstate use the ACPI-defined
      mechanism as well.  However, intel_pstate is not modular and it
      doesn't need the module refcount tricks played by
      acpi_processor_notify_smm(), so export the core of this function
      to it as acpi_processor_pstate_control() and make it call that.
      [The changes in processor_perflib.c related to this should not
      make any functional difference for the acpi_processor_notify_smm()
      To be safe, only call acpi_processor_notify_smm() from intel_pstate
      if ACPI _PPC support is enabled in it.
      Suggested-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
  5. 19 Sep, 2016 1 commit
  6. 21 Jul, 2016 2 commits
    • Sudeep Holla's avatar
      ACPI / processor_idle: Add support for Low Power Idle(LPI) states · a36a7fec
      Sudeep Holla authored
      ACPI 6.0 introduced an optional object _LPI that provides an alternate
      method to describe Low Power Idle states. It defines the local power
      states for each node in a hierarchical processor topology. The OSPM can
      use _LPI object to select a local power state for each level of processor
      hierarchy in the system. They used to produce a composite power state
      request that is presented to the platform by the OSPM.
      Since multiple processors affect the idle state for any non-leaf hierarchy
      node, coordination of idle state requests between the processors is
      required. ACPI supports two different coordination schemes: Platform
      coordinated and  OS initiated.
      This patch adds initial support for Platform coordination scheme of LPI.
      Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    • Sudeep Holla's avatar
      ACPI / processor_idle: introduce ACPI_PROCESSOR_CSTATE · 35ae7133
      Sudeep Holla authored
      ACPI 6.0 adds a new method to specify the CPU idle states(C-states)
      called Low Power Idle(LPI) states. Since new architectures like ARM64
      use only LPIs, introduce ACPI_PROCESSOR_CSTATE to encapsulate all the
      code supporting the old style C-states(_CST).
      This patch will help to extend the processor_idle module to support
      Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
  7. 30 May, 2016 1 commit
  8. 21 Feb, 2016 2 commits
    • Sudeep Holla's avatar
      ACPI / sleep: move acpi_processor_sleep to sleep.c · 504997cf
      Sudeep Holla authored
      acpi_processor_sleep is neither related nor used by CPUIdle framework.
      It's used in system suspend/resume path as a syscore operation. It makes
      more sense to move it to acpi/sleep.c where all the S-state transition
      (a.k.a. Linux system suspend/hiberate) related code are present.
      Also make it depend on CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT so that
      it's not compiled on architecture like ARM64 where S-states are not
      yet defined in ACPI.
      Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    • Sudeep Holla's avatar
      ACPI / processor : add support for ACPI0010 processor container · db62fda3
      Sudeep Holla authored
      ACPI 6.0 adds support for optional processor container device which may
      contain child objects that are either processor devices or other processor
      containers. This allows representing hierarchical processor topologies.
      It is declared using the _HID of ACPI0010. It is an abstract container
      used to represent CPU topology and should not be used to hotplug
      If no matching handler is found for a device in acpi_scan_attach_handler,
      acpi_bus_attach does a default enumeration for those devices with valid
      HID in the acpi namespace. This patch adds a scan handler for these ACPI
      processor containers to avoid default that enumeration and ensures the
      platform devices are not created for them.
      Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
  9. 12 Oct, 2015 1 commit
  10. 25 Aug, 2015 2 commits
    • Ashwin Chaugule's avatar
      ACPI: Decouple ACPI idle and ACPI processor drivers · 5f05586c
      Ashwin Chaugule authored
      This patch introduces a new Kconfig symbol, ACPI_PROCESSOR_IDLE,
      which is auto selected by architectures which support the ACPI
      based C states for CPU Idle management.
      The processor_idle driver in its present form contains declarations
      specific to X86 and IA64. Since there are no reasonable defaults
      for other architectures e.g. ARM64, the driver is selected only for
      X86 or IA64.
      This helps in decoupling the ACPI processor_driver from the ACPI
      processor_idle driver which is useful for the upcoming alternative
      patchwork for controlling CPU Performance (CPPC) and CPU Idle (LPI).
      Signed-off-by: default avatarAshwin Chaugule <ashwin.chaugule@linaro.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    • Ashwin Chaugule's avatar
      ACPI: Split out ACPI PSS from ACPI Processor driver · 239708a3
      Ashwin Chaugule authored
      The ACPI processor driver is currently tied too closely
      to the ACPI P-states (PSS) and other related constructs
      for controlling CPU performance.
      The newer ACPI specification (v5.1 onwards) introduces
      alternative methods to PSS. These new mechanisms are
      described within each ACPI Processor object and so they
      need to be scanned whenever a new Processor object is detected.
      This patch introduces a new Kconfig symbol to allow for
      finer configurability among the two options for controlling
      performance states. There is no change in functionality and
      the option is auto-selected by the architectures which support it.
      A future commit will introduce support for CPPC: A newer method of
      controlling CPU performance. The OS is not expected to support
      CPPC and PSS at the same time, so the Kconfig option lets us make
      the two mutually exclusive at compile time.
      Signed-off-by: default avatarAshwin Chaugule <ashwin.chaugule@linaro.org>
      [ rjw: Changelog ]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
  11. 22 Jul, 2015 1 commit
  12. 26 Mar, 2015 1 commit
  13. 05 Jan, 2015 1 commit
    • Hanjun Guo's avatar
      ACPI / processor: Convert apic_id to phys_id to make it arch agnostic · af8f3f51
      Hanjun Guo authored
      apic_id in MADT table is the CPU hardware id which identify
      it self in the system for x86 and ia64, OSPM will use it for
      SMP init to map APIC ID to logical cpu number in the early
      boot, when the DSDT/SSDT (ACPI namespace) is scanned later, the
      ACPI processor driver is probed and the driver will use acpi_id
      in DSDT to get the apic_id, then map to the logical cpu number
      which is needed by the processor driver.
      Before ACPI 5.0, only x86 and ia64 were supported in ACPI spec,
      so apic_id is used both in arch code and ACPI core which is
      pretty fine. Since ACPI 5.0, ARM is supported by ACPI and
      APIC is not available on ARM, this will confuse people when
      apic_id is both used by x86 and ARM in one function.
      So convert apic_id to phys_id (which is the original meaning)
      in ACPI processor dirver to make it arch agnostic, but leave the
      arch dependent code unchanged, no functional change.
      Signed-off-by: default avatarHanjun Guo <hanjun.guo@linaro.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
  14. 25 Nov, 2014 1 commit
  15. 11 Nov, 2014 1 commit
  16. 17 Jun, 2014 1 commit
  17. 29 Oct, 2013 1 commit
    • Rafael J. Wysocki's avatar
      ACPI / processor: Do not request ACPI cpufreq module directly · 34411a69
      Rafael J. Wysocki authored
      Function acpi_processor_load_module() used by the ACPI processor
      driver can only really work if the acpi-cpufreq module is available
      when acpi_processor_start() is executed which usually is not the case
      for systems loading the processor driver module from an initramfs.
      Moreover, that used to be a hackish workaround for module autoloading
      issues, but udev loads acpi-cpufreq just fine nowadays, so that
      function isn't really necessary any more.  For this reason, drop
      acpi_processor_load_module() entirely.
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
  18. 23 Sep, 2013 1 commit
  19. 12 May, 2013 2 commits
    • Rafael J. Wysocki's avatar
      ACPI / processor: Use common hotplug infrastructure · ac212b69
      Rafael J. Wysocki authored
      Split the ACPI processor driver into two parts, one that is
      non-modular, resides in the ACPI core and handles the enumeration
      and hotplug of processors and one that implements the rest of the
      existing processor driver functionality.
      The non-modular part uses an ACPI scan handler object to enumerate
      processors on the basis of information provided by the ACPI namespace
      and to hook up with the common ACPI hotplug infrastructure.  It also
      populates the ACPI handle of each processor device having a
      corresponding object in the ACPI namespace, which allows the driver
      proper to bind to those devices, and makes the driver bind to them
      if it is readily available (i.e. loaded) when the scan handler's
      .attach() routine is running.
      There are a few reasons to make this change.
      First, switching the ACPI processor driver to using the common ACPI
      hotplug infrastructure reduces code duplication and size considerably,
      even though a new file is created along with a header comment etc.
      Second, since the common hotplug code attempts to offline devices
      before starting the (non-reversible) removal procedure, it will abort
      (and possibly roll back) hot-remove operations involving processors
      if cpu_down() returns an error code for one of them instead of
      continuing them blindly (if /sys/firmware/acpi/hotplug/force_remove
      is unset).  That is a more desirable behavior than what the current
      code does.
      Finally, the separation of the scan/hotplug part from the driver
      proper makes it possible to simplify the driver's .remove() routine,
      because it doesn't need to worry about the possible cleanup related
      to processor removal any more (the scan/hotplug part is responsible
      for that now) and can handle device removal and driver removal
      symmetricaly (i.e. as appropriate).
      Some user-visible changes in sysfs are made (for example, the
      'sysdev' link from the ACPI device node to the processor device's
      directory is gone and a 'physical_node' link is present instead
      and a corresponding 'firmware_node' is present in the processor
      device's directory, the processor driver is now visible under
      /sys/bus/cpu/drivers/ and bound to the processor device), but
      that shouldn't affect the functionality that users care about
      (frequency scaling, C-states and thermal management).
      Tested on my venerable Toshiba Portege R500.
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Reviewed-by: default avatarToshi Kani <toshi.kani@hp.com>
    • Rafael J. Wysocki's avatar
      ACPI / PM: Move processor suspend/resume to syscore_ops · 0a3b15ac
      Rafael J. Wysocki authored
      The system suspend routine of the ACPI processor driver saves
      the BUS_MASTER_RLD register and its resume routine restores it.
      However, there can be only one such register in the system and it
      really should be saved after non-boot CPUs have been offlined and
      restored before they are put back online during resume.
      For this reason, move the saving and restoration of BUS_MASTER_RLD
      to syscore suspend and syscore resume, respectively, and drop the no
      longer necessary suspend/resume callbacks from the ACPI processor
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
  20. 06 Mar, 2013 1 commit
    • Konrad Rzeszutek Wilk's avatar
      acpi: Export the acpi_processor_get_performance_info · c705c78c
      Konrad Rzeszutek Wilk authored
      The git commit d5aaffa9
      (cpufreq: handle cpufreq being disabled for all exported function)
      tightens the cpufreq API by returning errors when disable_cpufreq()
      had been called.
      The problem we are hitting is that the module xen-acpi-processor which
      uses the ACPI's functions: acpi_processor_register_performance,
      acpi_processor_preregister_performance, and acpi_processor_notify_smm
      fails at acpi_processor_register_performance with -22.
      Note that earlier during bootup in arch/x86/xen/setup.c there is also
      an call to cpufreq's API: disable_cpufreq().
      This is b/c we want the Linux kernel to parse the ACPI data, but leave
      the cpufreq decisions to the hypervisor.
      In v3.9 all the checks that d5aaffa9
      added are now hit and the calls to cpufreq_register_notifier will now
      fail. This means that acpi_processor_ppc_init ends up printing:
      "Warning: Processor Platform Limit not supported"
      and the acpi_processor_ppc_status is not set.
      The repercussions of that is that the call to
      acpi_processor_register_performance fails right away at:
      	if (!(acpi_processor_ppc_status & PPC_REGISTERED))
      and we don't progress any further on parsing and extracting the _P*
      The only reason the Xen code called that function was b/c it was
      exported and the only way to gather the P-states. But we can also
      just make acpi_processor_get_performance_info be exported and not
      use acpi_processor_register_performance. This patch does so.
      Acked-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  21. 17 Sep, 2012 1 commit
    • Daniel Lezcano's avatar
      cpuidle / ACPI : move cpuidle_device field out of the acpi_processor_power structure · 3d339dcb
      Daniel Lezcano authored
      Currently we have the cpuidle_device field in the acpi_processor_power structure.
      This adds a dependency between processor.h and cpuidle.h
      Although it is not a real problem, removing this dependency has the benefit of
      separating a bit more the cpuidle code from the rest of the acpi code.
      Also, the compilation should be a bit improved because we do no longer
      include cpuidle.h in processor.h. The preprocessor was generating 30418 loc
      and with this patch it generates 30256 loc for processor_thermal.c, a file
      which is not concerned at all by cpuidle, like processor_perflib.c and
      That may sound ridiculous, but "small streams make big rivers" :P
      This patch moves this field into a static global per cpu variable like what is
      done in the intel_idle driver.
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
  22. 15 Sep, 2012 1 commit
  23. 05 Sep, 2012 1 commit
  24. 17 Jul, 2012 3 commits
  25. 01 Jul, 2012 2 commits
  26. 27 Jan, 2012 1 commit
  27. 20 Jan, 2012 1 commit
  28. 07 Nov, 2011 1 commit
  29. 16 Jul, 2011 1 commit
  30. 29 May, 2011 1 commit
  31. 10 Jan, 2011 1 commit
  32. 15 Aug, 2010 1 commit
  33. 22 Jul, 2010 1 commit