1. 02 6月, 2018 1 次提交
  2. 24 5月, 2018 1 次提交
  3. 04 4月, 2018 1 次提交
  4. 31 3月, 2018 1 次提交
    • B
      PCI/portdrv: Simplify PCIe feature permission checking · 02bfeb48
      Bjorn Helgaas 提交于
      Some PCIe features (AER, DPC, hotplug, PME) can be managed by either the
      platform firmware or the OS, so the host bridge driver may have to request
      permission from the platform before using them.  On ACPI systems, this is
      done by negotiate_os_control() in acpi_pci_root_add().
      
      The PCIe port driver later uses pcie_port_platform_notify() and
      pcie_port_acpi_setup() to figure out whether it can use these features.
      But all we need is a single bit for each service, so these interfaces are
      needlessly complicated.
      
      Simplify this by adding bits in the struct pci_host_bridge to show when the
      OS has permission to use each feature:
      
        + unsigned int native_aer:1;       /* OS may use PCIe AER */
        + unsigned int native_hotplug:1;   /* OS may use PCIe hotplug */
        + unsigned int native_pme:1;       /* OS may use PCIe PME */
      
      These are set when we create a host bridge, and the host bridge driver can
      clear the bits corresponding to any feature the platform doesn't want us to
      use.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      02bfeb48
  5. 04 8月, 2017 1 次提交
    • L
      treewide: Consolidate Apple DMI checks · 630b3aff
      Lukas Wunner 提交于
      We're about to amend ACPI bus scan with DMI checks whether we're running
      on a Mac to support Apple device properties in AML.  The DMI checks are
      performed for every single device, adding overhead for everything x86
      that isn't Apple, which is the majority.  Rafael and Andy therefore
      request to perform the DMI match only once and cache the result.
      
      Outside of ACPI various other Apple DMI checks exist and it seems
      reasonable to use the cached value there as well.  Rafael, Andy and
      Darren suggest performing the DMI check in arch code and making it
      available with a header in include/linux/platform_data/x86/.
      
      To this end, add early_platform_quirks() to arch/x86/kernel/quirks.c
      to perform the DMI check and invoke it from setup_arch().  Switch over
      all existing Apple DMI checks, thereby fixing two deficiencies:
      
      * They are now #defined to false on non-x86 arches and can thus be
        optimized away if they're located in cross-arch code.
      
      * Some of them only match "Apple Inc." but not "Apple Computer, Inc.",
        which is used by BIOSes released between January 2006 (when the first
        x86 Macs started shipping) and January 2007 (when the company name
        changed upon introduction of the iPhone).
      Suggested-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Suggested-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Suggested-by: NDarren Hart <dvhart@infradead.org>
      Signed-off-by: NLukas Wunner <lukas@wunner.de>
      Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      630b3aff
  6. 28 6月, 2017 2 次提交
    • R
      PM / core: Drop run_wake flag from struct dev_pm_info · de3ef1eb
      Rafael J. Wysocki 提交于
      The run_wake flag in struct dev_pm_info is used to indicate whether
      or not the device is capable of generating remote wakeup signals at
      run time (or in the system working state), but the distinction
      between runtime remote wakeup and system wakeup signaling has always
      been rather artificial.  The only practical reason for it to exist
      at the core level was that ACPI and PCI treated those two cases
      differently, but that's not the case any more after recent changes.
      
      For this reason, get rid of the run_wake flag and, when applicable,
      use device_set_wakeup_capable() and device_can_wakeup() instead of
      device_set_run_wake() and device_run_wake(), respectively.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      de3ef1eb
    • R
      ACPI / PM: Drop run_wake from struct acpi_device_wakeup_flags · a1a66393
      Rafael J. Wysocki 提交于
      The run_wake flag in struct acpi_device_wakeup_flags stores the
      information on whether or not the device can generate wakeup
      signals at run time, but in ACPI that really is equivalent to
      being able to generate wakeup signals at all.
      
      In fact, run_wake will always be set after successful executeion of
      acpi_setup_gpe_for_wake(), but if that fails, the device will not be
      able to use a wakeup GPE at all, so it won't be able to wake up the
      systems from sleep states too.  Hence, run_wake actually means that
      the device is capable of triggering wakeup and so it is equivalent
      to the valid flag.
      
      For this reason, drop run_wake from struct acpi_device_wakeup_flags
      and make sure that the valid flag is only set if
      acpi_setup_gpe_for_wake() has been successful.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      a1a66393
  7. 23 5月, 2017 1 次提交
  8. 01 3月, 2017 1 次提交
    • R
      x86/ioapic: Split IOAPIC hot-removal into two steps · f2ae5da7
      Rui Wang 提交于
      The hot removal of IOAPIC is handling PCI and ACPI removal in one go. That
      only works when the PCI drivers released the interrupt resources, but
      breaks when a IOAPIC interrupt is still associated to a PCI device.
      
      The new pcibios_release_device() callback allows to solve that problem by
      splitting the removal into two steps:
      
      1) PCI removal:
      
         Release all PCI resources including eventually not yet released IOAPIC
         interrupts via the new pcibios_release_device() callback.
      
      2) ACPI removal:
      
         After release of all PCI resources the ACPI resources can be released
         without issue.
      
      [ tglx: Rewrote changelog ]
      Signed-off-by: NRui Wang <rui.y.wang@intel.com>
      Cc: tony.luck@intel.com
      Cc: linux-pci@vger.kernel.org
      Cc: rjw@rjwysocki.net
      Cc: linux-acpi@vger.kernel.org
      Cc: fengguang.wu@intel.com
      Cc: helgaas@kernel.org
      Cc: kbuild-all@01.org
      Cc: bhelgaas@google.com
      Link: http://lkml.kernel.org/r/1488288869-31290-3-git-send-email-rui.y.wang@intel.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      f2ae5da7
  9. 18 8月, 2016 2 次提交
  10. 11 6月, 2016 1 次提交
  11. 02 12月, 2015 1 次提交
  12. 17 10月, 2015 1 次提交
  13. 08 7月, 2015 1 次提交
  14. 10 4月, 2015 1 次提交
  15. 05 2月, 2015 1 次提交
  16. 26 1月, 2015 1 次提交
    • L
      ACPICA: Resources: Provide common part for struct acpi_resource_address structures. · a45de93e
      Lv Zheng 提交于
      struct acpi_resource_address and struct acpi_resource_extended_address64 share substracts
      just at different offsets. To unify the parsing functions, OSPMs like Linux
      need a new ACPI_ADDRESS64_ATTRIBUTE as their substructs, so they can
      extract the shared data.
      
      This patch also synchronizes the structure changes to the Linux kernel.
      The usages are searched by matching the following keywords:
      1. acpi_resource_address
      2. acpi_resource_extended_address
      3. ACPI_RESOURCE_TYPE_ADDRESS
      4. ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS
      And we found and fixed the usages in the following files:
       arch/ia64/kernel/acpi-ext.c
       arch/ia64/pci/pci.c
       arch/x86/pci/acpi.c
       arch/x86/pci/mmconfig-shared.c
       drivers/xen/xen-acpi-memhotplug.c
       drivers/acpi/acpi_memhotplug.c
       drivers/acpi/pci_root.c
       drivers/acpi/resource.c
       drivers/char/hpet.c
       drivers/pnp/pnpacpi/rsparser.c
       drivers/hv/vmbus_drv.c
      
      Build tests are passed with defconfig/allnoconfig/allyesconfig and
      defconfig+CONFIG_ACPI=n.
      Original-by: NThomas Gleixner <tglx@linutronix.de>
      Original-by: NJiang Liu <jiang.liu@linux.intel.com>
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a45de93e
  17. 18 11月, 2014 1 次提交
  18. 25 9月, 2014 1 次提交
    • M
      ACPI: Support _OSI("Darwin") correctly · 7bc5a2ba
      Matthew Garrett 提交于
      Apple hardware queries _OSI("Darwin") in order to determine whether the
      system is running OS X, and changes firmware behaviour based on the
      answer.  The most obvious difference in behaviour is that Thunderbolt
      hardware is forcibly powered down unless the system is running OS X. The
      obvious solution would be to simply add Darwin to the list of supported
      _OSI strings, but this causes problems.
      
      Recent Apple hardware includes two separate methods for checking _OSI
      strings. The first will check whether Darwin is supported, and if so
      will exit. The second will check whether Darwin is supported, but will
      then continue to check for further operating systems. If a further
      operating system is found then later firmware code will assume that the
      OS is not OS X.  This results in the unfortunate situation where the
      Thunderbolt controller is available at boot time but remains powered
      down after suspend.
      
      The easiest way to handle this is to special-case it in the
      Linux-specific OSI handling code. If we see Darwin, we should answer
      true and then disable all other _OSI vendor strings.
      
      The next problem is that the Apple PCI _OSC method has the following
      code:
      
      if (LEqual (0x01, OSDW ()))
        if (LAnd (LEqual (Arg0, GUID), NEXP)
          (do stuff)
        else
          (fail)
      NEXP is a value in high memory and is presumably under the control of
      the firmware. No methods sets it. The methods that are called in the "do
      stuff" path are dummies. Unless there's some additional firmware call in
      early boot, there's no way for this call to succeed - and even if it
      does, it doesn't do anything.
      
      The easiest way to handle this is simply to ignore it. We know which
      flags would be set, so just set them by hand if the platform is running
      in Darwin mode.
      Signed-off-by: NMatthew Garrett <matthew.garrett@nebula.com>
      [andreas.noever@gmail.com: merged two patches, do not touch ACPICA]
      Signed-off-by: NAndreas Noever <andreas.noever@gmail.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      7bc5a2ba
  19. 23 7月, 2014 1 次提交
    • R
      ACPI / PM: Revork the handling of ACPI device wakeup notifications · c072530f
      Rafael J. Wysocki 提交于
      Since ACPI wakeup GPEs are going to be enabled during system suspend
      as well as for runtime wakeup by a subsequent patch and the same
      notify handlers will be used in both cases, rework the ACPI device
      wakeup notification framework so that the part specific to physical
      devices is always run asynchronously from the PM workqueue.  This
      prevents runtime resume callbacks for those devices from being
      run during system suspend and resume which may not be appropriate,
      among other things.
      
      Also make ACPI device wakeup notification handling a bit more robust
      agaist subsequent removal of ACPI device objects, whould that ever
      happen, and create a wakeup source object for each ACPI device
      configured for wakeup so that wakeup notifications for those
      devices can wake up the system from the "freeze" sleep state.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      c072530f
  20. 19 3月, 2014 1 次提交
  21. 07 2月, 2014 1 次提交
  22. 15 1月, 2014 1 次提交
  23. 07 12月, 2013 1 次提交
    • L
      ACPI: Clean up inclusions of ACPI header files · 8b48463f
      Lv Zheng 提交于
      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: NLv 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: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8b48463f
  24. 23 11月, 2013 3 次提交
    • R
      ACPI / hotplug: Make ACPI PCI root hotplug use common hotplug code · 3338db00
      Rafael J. Wysocki 提交于
      Rework the common ACPI device hotplug code so that it is suitable
      for PCI host bridge hotplug and switch the PCI host bridge scan
      handler to using the common hotplug code.
      
      This allows quite a few lines of code that are not necessary any more
      to be dropped from the PCI host bridge scan handler and removes
      arbitrary differences in behavior between PCI host bridge hotplug
      and ACPI-based hotplug of other components, like CPUs and memory.
      
      Also acpi_device_hotplug() can be static now.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      3338db00
    • R
      ACPI / hotplug: Introduce common hotplug function acpi_device_hotplug() · c27b2c33
      Rafael J. Wysocki 提交于
      Modify the common ACPI device hotplug code to always queue up the
      same function, acpi_device_hotplug(), using acpi_hotplug_execute()
      and make the PCI host bridge hotplug code use that function too for
      device hot removal.
      
      This allows some code duplication to be reduced and a race condition
      where the relevant ACPI handle may become invalid between the
      notification handler and the function queued up by it via
      acpi_hotplug_execute() to be avoided.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      c27b2c33
    • R
      ACPI / scan: Add acpi_device objects for all device nodes in the namespace · 202317a5
      Rafael J. Wysocki 提交于
      Modify the ACPI namespace scanning code to register a struct
      acpi_device object for every namespace node representing a device,
      processor and so on, even if the device represented by that namespace
      node is reported to be not present and not functional by _STA.
      
      There are multiple reasons to do that.  First of all, it avoids
      quite a lot of overhead when struct acpi_device objects are
      deleted every time acpi_bus_trim() is run and then added again
      by a subsequent acpi_bus_scan() for the same scope, although the
      namespace objects they correspond to stay in memory all the time
      (which always is the case on a vast majority of systems).
      
      Second, it will allow user space to see that there are namespace
      nodes representing devices that are not present at the moment and may
      be added to the system.  It will also allow user space to evaluate
      _SUN for those nodes to check what physical slots the "missing"
      devices may be put into and it will make sense to add a sysfs
      attribute for _STA evaluation after this change (that will be
      useful for thermal management on some systems).
      
      Next, it will help to consolidate the ACPI hotplug handling among
      subsystems by making it possible to store hotplug-related information
      in struct acpi_device objects in a standard common way.
      
      Finally, it will help to avoid a race condition related to the
      deletion of ACPI namespace nodes.  Namely, namespace nodes may be
      deleted as a result of a table unload triggered by _EJ0 or _DCK.
      If a hotplug notification for one of those nodes is triggered
      right before the deletion and it executes a hotplug callback
      via acpi_hotplug_execute(), the ACPI handle passed to that
      callback may be stale when the callback actually runs.  One way
      to work around that is to always pass struct acpi_device pointers
      to hotplug callbacks after doing a get_device() on the objects in
      question which eliminates the use-after-free possibility (the ACPI
      handles in those objects are invalidated by acpi_scan_drop_device(),
      so they will trigger ACPICA errors on attempts to use them).
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      202317a5
  25. 20 11月, 2013 1 次提交
    • T
      ACPI / hotplug: Fix conflicted PCI bridge notify handlers · ca499fc8
      Toshi Kani 提交于
      The PCI host bridge scan handler installs its own notify handler,
      handle_hotplug_event_root(), by itself.  Nevertheless, the ACPI
      hotplug framework also installs the common notify handler,
      acpi_hotplug_notify_cb(), for PCI root bridges.  This causes
      acpi_hotplug_notify_cb() to call _OST method with unsupported
      error as hotplug.enabled is not set.
      
      To address this issue, introduce hotplug.ignore flag, which
      indicates that the scan handler installs its own notify handler by
      itself.  The ACPI hotplug framework does not install the common
      notify handler when this flag is set.
      Signed-off-by: NToshi Kani <toshi.kani@hp.com>
      [rjw: Changed the name of the new flag]
      Cc: 3.9+ <stable@vger.kernel.org> # 3.9+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      ca499fc8
  26. 19 11月, 2013 1 次提交
  27. 08 11月, 2013 1 次提交
    • R
      ACPI / hotplug: Consolidate deferred execution of ACPI hotplug routines · 7b98118a
      Rafael J. Wysocki 提交于
      There are two different interfaces for queuing up work items on the
      ACPI hotplug workqueue, alloc_acpi_hp_work() used by PCI and PCI host
      bridge hotplug code and acpi_os_hotplug_execute() used by the common
      ACPI hotplug code and docking stations.  They both are somewhat
      cumbersome to use and work slightly differently.
      
      The users of alloc_acpi_hp_work() have to submit a work function that
      will extract the necessary data items from a struct acpi_hp_work
      object allocated by alloc_acpi_hp_work() and then will free that
      object, while it would be more straightforward to simply use a work
      function with one more argument and let the interface take care of
      the execution details.
      
      The users of acpi_os_hotplug_execute() also have to deal with the
      fact that it takes only one argument in addition to the work function
      pointer, although acpi_os_execute_deferred() actually takes care of
      the allocation and freeing of memory, so it would have been able to
      pass more arguments to the work function if it hadn't been
      constrained by the connection with acpi_os_execute().
      
      Moreover, while alloc_acpi_hp_work() makes GFP_KERNEL memory
      allocations, which is correct, because hotplug work items are
      always queued up from process context, acpi_os_hotplug_execute()
      uses GFP_ATOMIC, as that is needed by acpi_os_execute().  Also,
      acpi_os_execute_deferred() queued up by it waits for the ACPI event
      workqueues to flush before executing the work function, whereas
      alloc_acpi_hp_work() can't do anything similar.  That leads to
      somewhat arbitrary differences in behavior between various ACPI
      hotplug code paths and has to be straightened up.
      
      For this reason, replace both alloc_acpi_hp_work() and
      acpi_os_hotplug_execute() with a single interface,
      acpi_hotplug_execute(), combining their behavior and being more
      friendly to its users than any of the two.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      7b98118a
  28. 07 11月, 2013 4 次提交
  29. 24 9月, 2013 5 次提交