1. 27 4月, 2016 1 次提交
  2. 09 4月, 2016 1 次提交
    • L
      ACPI / utils: Rename acpi_dev_present() · c68ae33e
      Lukas Wunner 提交于
      acpi_dev_present() was originally named after pci_dev_present()
      to signify the similarity of the two functions.
      
      However Rafael J. Wysocki pointed out that the exported function
      acpi_dev_present() is easily confused with the non-exported
      acpi_device_is_present(). Additionally in ACPI parlance the term
      "present" usually refers to the "device is present" bit returned
      by the _STA control method, yet acpi_dev_present() merely checks
      presence in the namespace. It does not invoke _STA at all, let
      alone check the "device is present" bit.
      
      As suggested by Rafael, rename the function to acpi_dev_found()
      and adjust all existing call sites.
      Signed-off-by: NLukas Wunner <lukas@wunner.de>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      c68ae33e
  3. 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
  4. 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
  5. 22 3月, 2016 1 次提交
  6. 17 3月, 2016 2 次提交
  7. 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
  8. 11 3月, 2016 4 次提交
  9. 10 3月, 2016 15 次提交
  10. 09 3月, 2016 3 次提交
    • C
      x86/ACPI/PCI: Recognize that Interrupt Line 255 means "not connected" · e237a551
      Chen Fan 提交于
      Per the x86-specific footnote to PCI spec r3.0, sec 6.2.4, the value 255 in
      the Interrupt Line register means "unknown" or "no connection."
      Previously, when we couldn't derive an IRQ from the _PRT, we fell back to
      using the value from Interrupt Line as an IRQ.  It's questionable whether
      we should do that at all, but the spec clearly suggests we shouldn't do it
      for the value 255 on x86.
      
      Calling request_irq() with IRQ 255 may succeed, but the driver won't
      receive any interrupts.  Or, if IRQ 255 is shared with another device, it
      may succeed, and the driver's ISR will be called at random times when the
      *other* device interrupts.  Or it may fail if another device is using IRQ
      255 with incompatible flags.  What we *want* is for request_irq() to fail
      predictably so the driver can fall back to polling.
      
      On x86, assume 255 in the Interrupt Line means the INTx line is not
      connected.  In that case, set dev->irq to IRQ_NOTCONNECTED so request_irq()
      will fail gracefully with -ENOTCONN.
      
      We found this problem on a system where Secure Boot firmware assigned
      Interrupt Line 255 to an i801_smbus device and another device was already
      using MSI-X IRQ 255.  This was in v3.10, where i801_probe() fails if
      request_irq() fails:
      
        i801_smbus 0000:00:1f.3: enabling device (0140 -> 0143)
        i801_smbus 0000:00:1f.3: can't derive routing for PCI INT C
        i801_smbus 0000:00:1f.3: PCI INT C: no GSI
        genirq: Flags mismatch irq 255. 00000080 (i801_smbus) vs. 00000000 (megasa)
        CPU: 0 PID: 2487 Comm: kworker/0:1 Not tainted 3.10.0-229.el7.x86_64 #1
        Hardware name: FUJITSU PRIMEQUEST 2800E2/D3736, BIOS PRIMEQUEST 2000 Serie5
        Call Trace:
          dump_stack+0x19/0x1b
          __setup_irq+0x54a/0x570
          request_threaded_irq+0xcc/0x170
          i801_probe+0x32f/0x508 [i2c_i801]
          local_pci_probe+0x45/0xa0
        i801_smbus 0000:00:1f.3: Failed to allocate irq 255: -16
        i801_smbus: probe of 0000:00:1f.3 failed with error -16
      
      After aeb8a3d1 ("i2c: i801: Check if interrupts are disabled"),
      i801_probe() will fall back to polling if request_irq() fails.  But we
      still need this patch because request_irq() may succeed or fail depending
      on other devices in the system.  If request_irq() fails, i801_smbus will
      work by falling back to polling, but if it succeeds, i801_smbus won't work
      because it expects interrupts that it may not receive.
      Signed-off-by: NChen Fan <chen.fan.fnst@cn.fujitsu.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      e237a551
    • B
      ACPICA: Revert "Parser: Fix for SuperName method invocation" · 0dda8851
      Bob Moore 提交于
      ACPICA commit eade8f78f2aa21e8eabc3380a5728db47273bcf1
      
      Revert commit ae90fbf5 (ACPICA: Parser: Fix for SuperName method
      invocation).
      
      Support for method invocations as part of super_name will be
      removed from the ACPI specification, since no AML interpreter
      supports it.
      
      Fixes: ae90fbf5 (ACPICA: Parser: Fix for SuperName method invocation)
      Link: https://github.com/acpica/acpica/commit/eade8f78Signed-off-by: NBob Moore <robert.moore@intel.com>
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      0dda8851
    • B
      ACPICA: Utilities: Update trace mechinism for acquire_object · 1e059e20
      Bob Moore 提交于
      ACPICA commit 0824ab90e03c2e4239e890615f447e7962b1daa2
      
      Was not using the correct macro. Updated a comment in
      acoutput.h
      
      Link: https://github.com/acpica/acpica/commit/0824ab90Signed-off-by: NBob Moore <robert.moore@intel.com>
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      1e059e20
  11. 06 3月, 2016 7 次提交
  12. 05 3月, 2016 1 次提交
  13. 27 2月, 2016 1 次提交