1. 11 Mar, 2017 2 commits
  2. 21 Dec, 2016 1 commit
    • Lv Zheng's avatar
      ACPI / osl: Remove acpi_get_table_with_size()/early_acpi_os_unmap_memory() users · 6b11d1d6
      Lv Zheng authored
      This patch removes the users of the deprectated APIs:
       acpi_get_table_with_size()
       early_acpi_os_unmap_memory()
      The following APIs should be used instead of:
       acpi_get_table()
       acpi_put_table()
      
      The deprecated APIs are invented to be a replacement of acpi_get_table()
      during the early stage so that the early mapped pointer will not be stored
      in ACPICA core and thus the late stage acpi_get_table() won't return a
      wrong pointer. The mapping size is returned just because it is required by
      early_acpi_os_unmap_memory() to unmap the pointer during early stage.
      
      But as the mapping size equals to the acpi_table_header.length
      (see acpi_tb_init_table_descriptor() and acpi_tb_validate_table()), when
      such a convenient result is returned, driver code will start to use it
      instead of accessing acpi_table_header to obtain the length.
      
      Thus this patch cleans up the drivers by replacing returned table size with
      acpi_table_header.length, and should be a no-op.
      Reported-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      6b11d1d6
  3. 23 Sep, 2016 1 commit
    • Thomas Gleixner's avatar
      acpi: Fix broken error check in map_processor() · c183a603
      Thomas Gleixner authored
      map_processor() checks the cpuid value returned by acpi_map_cpuid() for -1
      but acpi_map_cpuid() returns -EINVAL in case of error.
      
      As a consequence the error is ignored and the following access into percpu
      data with that negative cpuid results in a boot crash.
      
      This happens always when NR_CPUS/nr_cpu_ids is smaller than the number of
      processors listed in the ACPI tables.
      
      Use a proper error check for id < 0 so the function returns instead of
      trying to map CPU#(-EINVAL).
      Reported-by: default avatarIngo Molnar <mingo@kernel.org>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Dou Liyang <douly.fnst@cn.fujitsu.com>
      Cc: Gu Zheng <guz.fnst@cn.fujitsu.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Tang Chen <tangchen@cn.fujitsu.com>
      Cc: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
      Cc: akpm@linux-foundation.org
      Cc: chen.tang@easystack.cn
      Cc: cl@linux.com
      Cc: gongzhaogang@inspur.com
      Cc: isimatu.yasuaki@jp.fujitsu.com
      Cc: izumi.taku@jp.fujitsu.com
      Cc: kamezawa.hiroyu@jp.fujitsu.com
      Cc: len.brown@intel.com
      Cc: lenb@kernel.org
      Cc: linux-acpi@vger.kernel.org
      Cc: linux-mm@kvack.org
      Cc: mika.j.penttila@gmail.com
      Cc: rafael@kernel.org
      Cc: rjw@rjwysocki.net
      Cc: tj@kernel.org
      Cc: yasu.isimatu@gmail.com
      Fixes: dc6db24d ("x86/acpi: Set persistent cpuid <-> nodeid mapping when booting")
      Link: http://lkml.kernel.org/r/alpine.DEB.2.20.1609231705570.5640@nanosSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      c183a603
  4. 21 Sep, 2016 3 commits
    • Dou Liyang's avatar
      acpi: Validate processor id when mapping the processor · fd74da21
      Dou Liyang authored
      When we want to identify whether the proc_id is unreasonable or not, we
      can call the "acpi_processor_validate_proc_id" function. It will search
      in the duplicate IDs. If we find the proc_id in the IDs, we return true
      to the call function. Conversely, the false represents available.
      
      When we establish all possible cpuid <-> nodeid mapping to handle the
      cpu hotplugs, we will use the proc_id from ACPI table.
      
      We do validation when we get the proc_id. If the result is true, we
      will stop the mapping.
      
      [ tglx: Mark the new function __init ]
      Signed-off-by: default avatarDou Liyang <douly.fnst@cn.fujitsu.com>
      Acked-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: mika.j.penttila@gmail.com
      Cc: len.brown@intel.com
      Cc: rafael@kernel.org
      Cc: rjw@rjwysocki.net
      Cc: yasu.isimatu@gmail.com
      Cc: linux-mm@kvack.org
      Cc: linux-acpi@vger.kernel.org
      Cc: isimatu.yasuaki@jp.fujitsu.com
      Cc: gongzhaogang@inspur.com
      Cc: tj@kernel.org
      Cc: izumi.taku@jp.fujitsu.com
      Cc: cl@linux.com
      Cc: chen.tang@easystack.cn
      Cc: akpm@linux-foundation.org
      Cc: kamezawa.hiroyu@jp.fujitsu.com
      Cc: lenb@kernel.org
      Link: http://lkml.kernel.org/r/1472114120-3281-8-git-send-email-douly.fnst@cn.fujitsu.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      fd74da21
    • Gu Zheng's avatar
      x86/acpi: Set persistent cpuid <-> nodeid mapping when booting · dc6db24d
      Gu Zheng authored
      The whole patch-set aims at making cpuid <-> nodeid mapping persistent. So that,
      when node online/offline happens, cache based on cpuid <-> nodeid mapping such as
      wq_numa_possible_cpumask will not cause any problem.
      It contains 4 steps:
      1. Enable apic registeration flow to handle both enabled and disabled cpus.
      2. Introduce a new array storing all possible cpuid <-> apicid mapping.
      3. Enable _MAT and MADT relative apis to return non-present or disabled cpus' apicid.
      4. Establish all possible cpuid <-> nodeid mapping.
      
      This patch finishes step 4.
      
      This patch set the persistent cpuid <-> nodeid mapping for all enabled/disabled
      processors at boot time via an additional acpi namespace walk for processors.
      
      [ tglx: Remove the unneeded exports ]
      Signed-off-by: default avatarGu Zheng <guz.fnst@cn.fujitsu.com>
      Signed-off-by: default avatarTang Chen <tangchen@cn.fujitsu.com>
      Signed-off-by: default avatarZhu Guihua <zhugh.fnst@cn.fujitsu.com>
      Signed-off-by: default avatarDou Liyang <douly.fnst@cn.fujitsu.com>
      Acked-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: mika.j.penttila@gmail.com
      Cc: len.brown@intel.com
      Cc: rafael@kernel.org
      Cc: rjw@rjwysocki.net
      Cc: yasu.isimatu@gmail.com
      Cc: linux-mm@kvack.org
      Cc: linux-acpi@vger.kernel.org
      Cc: isimatu.yasuaki@jp.fujitsu.com
      Cc: gongzhaogang@inspur.com
      Cc: tj@kernel.org
      Cc: izumi.taku@jp.fujitsu.com
      Cc: cl@linux.com
      Cc: chen.tang@easystack.cn
      Cc: akpm@linux-foundation.org
      Cc: kamezawa.hiroyu@jp.fujitsu.com
      Cc: lenb@kernel.org
      Link: http://lkml.kernel.org/r/1472114120-3281-6-git-send-email-douly.fnst@cn.fujitsu.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      dc6db24d
    • Gu Zheng's avatar
      x86/acpi: Enable MADT APIs to return disabled apicids · 8ad893fa
      Gu Zheng authored
      The whole patch-set aims at making cpuid <-> nodeid mapping persistent. So that,
      when node online/offline happens, cache based on cpuid <-> nodeid mapping such as
      wq_numa_possible_cpumask will not cause any problem.
      It contains 4 steps:
      1. Enable apic registeration flow to handle both enabled and disabled cpus.
      2. Introduce a new array storing all possible cpuid <-> apicid mapping.
      3. Enable _MAT and MADT relative apis to return non-present or disabled cpus' apicid.
      4. Establish all possible cpuid <-> nodeid mapping.
      
      This patch finishes step 3.
      
      There are four mappings in the kernel:
      1. nodeid (logical node id)   <->   pxm        (persistent)
      2. apicid (physical cpu id)   <->   nodeid     (persistent)
      3. cpuid (logical cpu id)     <->   apicid     (not persistent, now persistent by step 2)
      4. cpuid (logical cpu id)     <->   nodeid     (not persistent)
      
      So, in order to setup persistent cpuid <-> nodeid mapping for all possible CPUs,
      we should:
      1. Setup cpuid <-> apicid mapping for all possible CPUs, which has been done in step 1, 2.
      2. Setup cpuid <-> nodeid mapping for all possible CPUs. But before that, we should
         obtain all apicids from MADT.
      
      All processors' apicids can be obtained by _MAT method or from MADT in ACPI.
      The current code ignores disabled processors and returns -ENODEV.
      
      After this patch, a new parameter will be added to MADT APIs so that caller
      is able to control if disabled processors are ignored.
      Signed-off-by: default avatarGu Zheng <guz.fnst@cn.fujitsu.com>
      Signed-off-by: default avatarTang Chen <tangchen@cn.fujitsu.com>
      Signed-off-by: default avatarZhu Guihua <zhugh.fnst@cn.fujitsu.com>
      Signed-off-by: default avatarDou Liyang <douly.fnst@cn.fujitsu.com>
      Acked-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: mika.j.penttila@gmail.com
      Cc: len.brown@intel.com
      Cc: rafael@kernel.org
      Cc: rjw@rjwysocki.net
      Cc: yasu.isimatu@gmail.com
      Cc: linux-mm@kvack.org
      Cc: linux-acpi@vger.kernel.org
      Cc: isimatu.yasuaki@jp.fujitsu.com
      Cc: gongzhaogang@inspur.com
      Cc: tj@kernel.org
      Cc: izumi.taku@jp.fujitsu.com
      Cc: cl@linux.com
      Cc: chen.tang@easystack.cn
      Cc: akpm@linux-foundation.org
      Cc: kamezawa.hiroyu@jp.fujitsu.com
      Cc: lenb@kernel.org
      Link: http://lkml.kernel.org/r/1472114120-3281-5-git-send-email-douly.fnst@cn.fujitsu.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      8ad893fa
  5. 30 May, 2016 1 commit
  6. 13 May, 2015 2 commits
  7. 26 Mar, 2015 2 commits
  8. 05 Feb, 2015 1 commit
  9. 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>
      af8f3f51
  10. 16 Dec, 2014 1 commit
  11. 24 Sep, 2014 1 commit
  12. 30 Jul, 2014 1 commit
  13. 21 Jul, 2014 1 commit
  14. 26 Mar, 2014 1 commit
  15. 19 Mar, 2014 1 commit
  16. 18 Feb, 2014 4 commits
  17. 27 Jan, 2014 1 commit
  18. 07 Dec, 2013 1 commit
    • Lv Zheng's avatar
      ACPI: Clean up inclusions of ACPI header files · 8b48463f
      Lv Zheng authored
      Replace direct inclusions of <acpi/acpi.h>, <acpi/acpi_bus.h> and
      <acpi/acpi_drivers.h>, which are incorrect, with <linux/acpi.h>
      inclusions and remove some inclusions of those files that aren't
      necessary.
      
      First of all, <acpi/acpi.h>, <acpi/acpi_bus.h> and <acpi/acpi_drivers.h>
      should not be included directly from any files that are built for
      CONFIG_ACPI unset, because that generally leads to build warnings about
      undefined symbols in !CONFIG_ACPI builds.  For CONFIG_ACPI set,
      <linux/acpi.h> includes those files and for CONFIG_ACPI unset it
      provides stub ACPI symbols to be used in that case.
      
      Second, there are ordering dependencies between those files that always
      have to be met.  Namely, it is required that <acpi/acpi_bus.h> be included
      prior to <acpi/acpi_drivers.h> so that the acpi_pci_root declarations the
      latter depends on are always there.  And <acpi/acpi.h> which provides
      basic ACPICA type declarations should always be included prior to any other
      ACPI headers in CONFIG_ACPI builds.  That also is taken care of including
      <linux/acpi.h> as appropriate.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Acked-by: Bjorn Helgaas <bhelgaas@google.com> (drivers/pci stuff)
      Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> (Xen stuff)
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8b48463f
  19. 23 Sep, 2013 1 commit
  20. 07 Aug, 2013 1 commit
  21. 14 Jul, 2013 1 commit
    • Paul Gortmaker's avatar
      acpi: delete __cpuinit usage from all acpi files · fe7bf106
      Paul Gortmaker authored
      The __cpuinit type of throwaway sections might have made sense
      some time ago when RAM was more constrained, but now the savings
      do not offset the cost and complications.  For example, the fix in
      commit 5e427ec2 ("x86: Fix bit corruption at CPU resume time")
      is a good example of the nasty type of bugs that can be created
      with improper use of the various __init prefixes.
      
      After a discussion on LKML[1] it was decided that cpuinit should go
      the way of devinit and be phased out.  Once all the users are gone,
      we can then finally remove the macros themselves from linux/init.h.
      
      This removes all the drivers/acpi uses of the __cpuinit macros
      from all C files.
      
      [1] https://lkml.org/lkml/2013/5/20/589
      
      Cc: Len Brown <lenb@kernel.org>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: linux-acpi@vger.kernel.org
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      fe7bf106
  22. 04 Mar, 2013 1 commit
  23. 12 Jul, 2012 1 commit
    • Thomas Renninger's avatar
      cpufreq / ACPI: Fix not loading acpi-cpufreq driver regression · c4686c71
      Thomas Renninger authored
      Commit d640113f introduced a regression on SMP
      systems where the processor core with ACPI id zero is disabled
      (typically should be the case because of hyperthreading).
      The regression got spread through stable kernels.
      On 3.0.X it got introduced via 3.0.18.
      
      Such platforms may be rare, but do exist.
      Look out for a disabled processor with acpi_id 0 in dmesg:
      ACPI: LAPIC (acpi_id[0x00] lapic_id[0x10] disabled)
      
      This problem has been observed on a:
      HP Proliant BL280c G6 blade
      
      This patch restricts the introduced workaround to platforms
      with nr_cpu_ids <= 1.
      Signed-off-by: default avatarThomas Renninger <trenn@suse.de>
      CC: stable@vger.kernel.org
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      c4686c71
  24. 17 Jan, 2012 1 commit
    • Lin Ming's avatar
      ACPI: processor: fix acpi_get_cpuid for UP processor · d640113f
      Lin Ming authored
      For UP processor, it is likely that no _MAT method or MADT table defined.
      So currently acpi_get_cpuid(...) always return -1 for UP processor.
      This is wrong. It should return valid value for CPU0.
      
      In the other hand, BIOS may define multiple CPU handles even for UP
      processor, for example
      
              Scope (_PR)
              {
                  Processor (CPU0, 0x00, 0x00000410, 0x06) {}
                  Processor (CPU1, 0x01, 0x00000410, 0x06) {}
                  Processor (CPU2, 0x02, 0x00000410, 0x06) {}
                  Processor (CPU3, 0x03, 0x00000410, 0x06) {}
              }
      
      We should only return valid value for CPU0's acpi handle.
      And return invalid value for others.
      
      http://marc.info/?t=132329819900003&r=1&w=2
      
      Cc: stable@vger.kernel.org
      Reported-and-tested-by: wallak@free.fr
      Signed-off-by: default avatarLin Ming <ming.m.lin@intel.com>
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      d640113f
  25. 31 Oct, 2011 1 commit
  26. 29 May, 2011 1 commit
  27. 03 Mar, 2011 2 commits
  28. 12 Jan, 2011 1 commit
    • Thomas Renninger's avatar
      ACPI, intel_idle: Cleanup idle= internal variables · d1896049
      Thomas Renninger authored
      Having four variables for the same thing:
        idle_halt, idle_nomwait, force_mwait and boot_option_idle_overrides
      is rather confusing and unnecessary complex.
      
      if idle= boot param is passed, only set up one variable:
      boot_option_idle_overrides
      
      Introduces following functional changes/fixes:
        - intel_idle driver does not register if any idle=xy
          boot param is passed.
        - processor_idle.c will also not register a cpuidle driver
          and get active if idle=halt is passed.
          Before a cpuidle driver with one (C1, halt) state got registered
          Now the default_idle function will be used which finally uses
          the same idle call to enter sleep state (safe_halt()), but
          without registering a whole cpuidle driver.
      
      That means idle= param will always avoid cpuidle drivers to register
      with one exception (same behavior as before):
      idle=nomwait
      may still register acpi_idle cpuidle driver, but C1 will not use
      mwait, but hlt. This can be a workaround for IO based deeper sleep
      states where C1 mwait causes problems.
      Signed-off-by: default avatarThomas Renninger <trenn@suse.de>
      cc: x86@kernel.org
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      d1896049
  29. 01 Oct, 2010 1 commit
    • Yinghai Lu's avatar
      ACPI: Handle ACPI0007 Device in acpi_early_set_pdc · c1e0ddbf
      Yinghai Lu authored
      After
      | commit d8191fa4
      | Author: Alex Chiang <achiang@hp.com>
      | Date:   Mon Feb 22 12:11:39 2010 -0700
      |
      |    ACPI: processor: driver doesn't need to evaluate _PDC
      |
      |    Now that the early _PDC evaluation path knows how to correctly
      |    evaluate _PDC on only physically present processors, there's no
      |    need for the processor driver to evaluate it later when it loads.
      |
      |    To cover the hotplug case, push _PDC evaluation down into the
      |    hotplug paths.
      
      only cpu with Processor Statement get processed with _PDC
      
      If bios is using Device object instead of Processor statement.
      SSDTs for Pstate/Cstate/Tstate can not be loaded dynamically.
      
      Need to try to scan ACPI0007 in addition to Processor.
      
      That commit is between 2.6.34-rc1 and 2.6.34-rc2, so stable tree for 2.6.34+
      need this patch.
      Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
      Reviewed-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      c1e0ddbf
  30. 28 Sep, 2010 1 commit
  31. 12 Jul, 2010 1 commit