1. 15 6月, 2016 1 次提交
  2. 02 6月, 2016 1 次提交
    • L
      ACPICA / Hardware: Fix old register check in acpi_hw_get_access_bit_width() · 7f9bef9d
      Lv Zheng 提交于
      The address check in acpi_hw_get_access_bit_width() should be byte width
      based, not bit width based. This patch fixes this mistake.
      
      For those who want to review acpi_hw_access_bit_width(), here is the
      concerns and the design details of the function:
      
      It is supposed that the GAS Address field should be aligned to the byte
      width indicated by the GAS AccessSize field. Similarly, for the old non
      GAS register, it is supposed that its Address should be aligned to its
      Length.
      
      For the "AccessSize = 0 (meaning ANY)" case, we try to return the maximum
      instruction width (64 for MMIO or 32 for PIO) or the user expected access
      bit width (64 for acpi_read()/acpi_write() or 32 for acpi_hw_read()/
      acpi_hw_write()) and it is supposed that the GAS Address field should
      always be aligned to the maximum expected access bit width (otherwise it
      can't be accessed using ANY access bit width).
      
      The problem is in acpi_tb_init_generic_address(), where the non GAS
      register's Length is converted into the GAS BitWidth field, its Address is
      converted into the GAS Address field, and the GAS AccessSize field is left
      0 but most of the registers actually cannot be accessed using "ANY"
      accesses.
      
      As a conclusion, when AccessSize = 0 (ANY), the Address should either be
      aligned to the BitWidth (wrong conversion) or aligned to 32 for PIO or 64
      for MMIO (real GAS). Since currently, max_bit_width is 32, then:
      1. BitWidth for the wrong conversion is 8,16,32; and
      2. The Address of the real GAS should always be aligned to 8,16,32.
      The address alignment check to exclude false matched real GAS is not
      necessary. Thus this patch fixes the issue by removing the address
      alignment check.
      
      On the other hand, we in fact could use a simpler check of
      "reg->bit_width < max_bit_width" to exclude the "BitWidth=64 PIO" case that
      may be issued from acpi_read()/acpi_write() in the future.
      
      Fixes: b314a172 (ACPICA: Hardware: Add optimized access bit width support)
      Reported-and-tested-by: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Acked-by: NMike Marshall <hubcap@omnibond.com>
      Suggested-by: NJan Beulich <jbeulich@suse.com>
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      7f9bef9d
  3. 05 5月, 2016 12 次提交
  4. 05 4月, 2016 16 次提交
  5. 04 4月, 2016 1 次提交
  6. 26 3月, 2016 1 次提交
    • S
      ACPI / processor: Request native thermal interrupt handling via _OSC · a2121167
      Srinivas Pandruvada 提交于
      There are several reports of freeze on enabling HWP (Hardware PStates)
      feature on Skylake-based systems by the Intel P-states driver. The root
      cause is identified as the HWP interrupts causing BIOS code to freeze.
      
      HWP interrupts use the thermal LVT which can be handled by Linux
      natively, but on the affected Skylake-based systems SMM will respond
      to it by default.  This is a problem for several reasons:
       - On the affected systems the SMM thermal LVT handler is broken (it
         will crash when invoked) and a BIOS update is necessary to fix it.
       - With thermal interrupt handled in SMM we lose all of the reporting
         features of the arch/x86/kernel/cpu/mcheck/therm_throt driver.
       - Some thermal drivers like x86-package-temp depend on the thermal
         threshold interrupts signaled via the thermal LVT.
       - The HWP interrupts are useful for debugging and tuning
         performance (if the kernel can handle them).
      The native handling of thermal interrupts needs to be enabled
      because of that.
      
      This requires some way to tell SMM that the OS can handle thermal
      interrupts.  That can be done by using _OSC/_PDC in processor
      scope very early during ACPI initialization.
      
      The meaning of _OSC/_PDC bit 12 in processor scope is whether or
      not the OS supports native handling of interrupts for Collaborative
      Processor Performance Control (CPPC) notifications.  Since on
      HWP-capable systems CPPC is a firmware interface to HWP, setting
      this bit effectively tells the firmware that the OS will handle
      thermal interrupts natively going forward.
      
      For details on _OSC/_PDC refer to:
      http://www.intel.com/content/www/us/en/standards/processor-vendor-specific-acpi-specification.html
      
      To implement the _OSC/_PDC handshake as described, introduce a new
      function, acpi_early_processor_osc(), that walks the ACPI
      namespace looking for ACPI processor objects and invokes _OSC for
      them with bit 12 in the capabilities buffer set and terminates the
      namespace walk on the first success.
      
      Also modify intel_thermal_interrupt() to clear HWP status bits in
      the HWP_STATUS MSR to acknowledge HWP interrupts (which prevents
      them from firing continuously).
      Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      [ rjw: Subject & changelog, function rename ]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a2121167
  7. 23 3月, 2016 2 次提交
    • L
      ACPI / PM: Runtime resume devices when waking from hibernate · fbda4b38
      Lukas Wunner 提交于
      Commit 58a1fbbb ("PM / PCI / ACPI: Kick devices that might have been
      reset by firmware") added a runtime resume for devices that were runtime
      suspended when the system entered suspend-to-RAM.
      
      Briefly, the motivation was to ensure that devices did not remain in a
      reset-power-on state after resume, potentially preventing deep SoC-wide
      low-power states from being entered on idle.
      
      Currently we're not doing the same when leaving suspend-to-disk and this
      asymmetry is a problem if drivers rely on the automatic resume triggered
      by pm_complete_with_resume_check(). Fix it.
      
      Fixes: 58a1fbbb (PM / PCI / ACPI: Kick devices that might have been reset by firmware)
      Signed-off-by: NLukas Wunner <lukas@wunner.de>
      Cc: 4.4+ <stable@vger.kernel.org> # 4.4+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      fbda4b38
    • L
      PCI: ACPI: IA64: fix IO port generic range check · 4a2e7aab
      Lorenzo Pieralisi 提交于
      The [0 - 64k] ACPI PCI IO port resource boundary check in:
      
      acpi_dev_ioresource_flags()
      
      is currently applied blindly in the ACPI resource parsing to all
      architectures, but only x86 suffers from that IO space limitation.
      
      On arches (ie IA64 and ARM64) where IO space is memory mapped,
      the PCI root bridges IO resource windows are firstly initialized from
      the _CRS (in acpi_decode_space()) and contain the CPU physical address
      at which a root bridge decodes IO space in the CPU physical address
      space with the offset value representing the offset required to translate
      the PCI bus address into the CPU physical address.
      
      The IO resource windows are then parsed and updated in arch code
      before creating and enumerating PCI buses (eg IA64 add_io_space())
      to map in an arch specific way the obtained CPU physical address range
      to a slice of virtual address space reserved to map PCI IO space,
      ending up with PCI bridges resource windows containing IO
      resources like the following on a working IA64 configuration:
      
      PCI host bridge to bus 0000:00
      pci_bus 0000:00: root bus resource [io  0x1000000-0x100ffff window] (bus
      address [0x0000-0xffff])
      pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000fffff window]
      pci_bus 0000:00: root bus resource [mem 0x80000000-0x8fffffff window]
      pci_bus 0000:00: root bus resource [mem 0x80004000000-0x800ffffffff window]
      pci_bus 0000:00: root bus resource [bus 00]
      
      This implies that the [0 - 64K] check in acpi_dev_ioresource_flags()
      leaves platforms with memory mapped IO space (ie IA64) broken (ie kernel
      can't claim IO resources since the host bridge IO resource is disabled
      and discarded by ACPI core code, see log on IA64 with missing root bridge
      IO resource, silently filtered by current [0 - 64k] check in
      acpi_dev_ioresource_flags()):
      
      PCI host bridge to bus 0000:00
      pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000fffff window]
      pci_bus 0000:00: root bus resource [mem 0x80000000-0x8fffffff window]
      pci_bus 0000:00: root bus resource [mem 0x80004000000-0x800ffffffff window]
      pci_bus 0000:00: root bus resource [bus 00]
      
      [...]
      
      pci 0000:00:03.0: [1002:515e] type 00 class 0x030000
      pci 0000:00:03.0: reg 0x10: [mem 0x80000000-0x87ffffff pref]
      pci 0000:00:03.0: reg 0x14: [io  0x1000-0x10ff]
      pci 0000:00:03.0: reg 0x18: [mem 0x88020000-0x8802ffff]
      pci 0000:00:03.0: reg 0x30: [mem 0x88000000-0x8801ffff pref]
      pci 0000:00:03.0: supports D1 D2
      pci 0000:00:03.0: can't claim BAR 1 [io  0x1000-0x10ff]: no compatible
      bridge window
      
      For this reason, the IO port resources boundaries check in generic ACPI
      parsing code should be guarded with a CONFIG_X86 guard so that more arches
      (ie ARM64) can benefit from the generic ACPI resources parsing interface
      without incurring in unexpected resource filtering, fixing at the same
      time current breakage on IA64.
      
      This patch factors out IO ports boundary [0 - 64k] check in generic ACPI
      code and makes the IO space check X86 specific to make sure that IO
      space resources are usable on other arches too.
      
      Fixes: 3772aea7 (ia64/PCI/ACPI: Use common ACPI resource parsing interface for host bridge)
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: 4.4+ <stable@vger.kernel.org> # 4.4+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      4a2e7aab
  8. 22 3月, 2016 1 次提交
  9. 17 3月, 2016 2 次提交
  10. 16 3月, 2016 1 次提交
    • P
      tags: Fix DEFINE_PER_CPU expansions · 25528213
      Peter Zijlstra 提交于
      $ make tags
        GEN     tags
      ctags: Warning: drivers/acpi/processor_idle.c:64: null expansion of name pattern "\1"
      ctags: Warning: drivers/xen/events/events_2l.c:41: null expansion of name pattern "\1"
      ctags: Warning: kernel/locking/lockdep.c:151: null expansion of name pattern "\1"
      ctags: Warning: kernel/rcu/rcutorture.c:133: null expansion of name pattern "\1"
      ctags: Warning: kernel/rcu/rcutorture.c:135: null expansion of name pattern "\1"
      ctags: Warning: kernel/workqueue.c:323: null expansion of name pattern "\1"
      ctags: Warning: net/ipv4/syncookies.c:53: null expansion of name pattern "\1"
      ctags: Warning: net/ipv6/syncookies.c:44: null expansion of name pattern "\1"
      ctags: Warning: net/rds/page.c:45: null expansion of name pattern "\1"
      
      Which are all the result of the DEFINE_PER_CPU pattern:
      
        scripts/tags.sh:200:	'/\<DEFINE_PER_CPU([^,]*, *\([[:alnum:]_]*\)/\1/v/'
        scripts/tags.sh:201:	'/\<DEFINE_PER_CPU_SHARED_ALIGNED([^,]*, *\([[:alnum:]_]*\)/\1/v/'
      
      The below cures them. All except the workqueue one are within reasonable
      distance of the 80 char limit. TJ do you have any preference on how to
      fix the wq one, or shall we just not care its too long?
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      25528213
  11. 11 3月, 2016 2 次提交