1. 29 8月, 2019 3 次提交
    • K
      PCI/ACPI: Remove unnecessary struct hotplug_program_ops · 4a2dbedd
      Krzysztof Wilczynski 提交于
      Move the ACPI-specific structs hpx_type0, hpx_type1, hpx_type2 and
      hpx_type3 to drivers/pci/pci-acpi.c as they are not used anywhere else.
      Then remove the struct hotplug_program_ops that has been shared between
      drivers/pci/probe.c and drivers/pci/pci-acpi.c from drivers/pci/pci.h as it
      is no longer needed.
      
      The struct hotplug_program_ops was added by 87fcf12e ("PCI/ACPI: Remove
      the need for 'struct hotplug_params'") and replaced previously used struct
      hotplug_params enabling the support for the _HPX Type 3 Setting Record that
      was added by f873c51a ("PCI/ACPI: Implement _HPX Type 3 Setting
      Record").
      
      The new struct allowed for the static functions such program_hpx_type0(),
      program_hpx_type1(), etc., from the drivers/pci/probe.c to be called from
      the function pci_acpi_program_hp_params() in the drivers/pci/pci-acpi.c.
      
      Previously a programming of _HPX Type 0 was as follows:
      
        drivers/pci/probe.c:
      
          program_hpx_type0()
          ...
          pci_configure_device()
            hp_ops = {
              .program_type0 = program_hpx_type0,
              ...
            }
            pci_acpi_program_hp_params(&hp_ops)
      
        drivers/pci/pci-acpi.c:
      
          pci_acpi_program_hp_params(&hp_ops)
            acpi_run_hpx(hp_ops)
              decode_type0_hpx_record()
                hp_ops->program_type0     # program_hpx_type0() called via hp_ops
      
      After the ACPI-specific functions, structs, enums, etc., have been moved to
      drivers/pci/pci-acpi.c there is no need for the hotplug_program_ops as all
      of the _HPX Type 0, 1, 2 and 3 are directly accessible.
      
      Link: https://lore.kernel.org/r/20190827094951.10613-4-kw@linux.comSigned-off-by: NKrzysztof Wilczynski <kw@linux.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      4a2dbedd
    • K
      PCI/ACPI: Move _HPP & _HPX functions to pci-acpi.c · 8c3aac6e
      Krzysztof Wilczynski 提交于
      Move program_hpx_type0(), program_hpx_type1(), etc., and enums
      hpx_type3_dev_type, hpx_type3_fn_type and hpx_type3_cfg_loc to
      drivers/pci/pci-acpi.c as these functions and enums are ACPI-specific.
      
      Move structs hpx_type0, hpx_type1, hpx_type2 and hpx_type3 to
      drivers/pci/pci.h as these are shared between drivers/pci/pci-acpi.c and
      drivers/pci/probe.c.
      
      Link: https://lore.kernel.org/r/20190827094951.10613-3-kw@linux.comSigned-off-by: NKrzysztof Wilczynski <kw@linux.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      8c3aac6e
    • K
      PCI/ACPI: Rename _HPX structs from hpp_* to hpx_* · e2797ad3
      Krzysztof Wilczynski 提交于
      The names of the hpp_type0, hpp_type1 and hpp_type2 structs suggest that
      they're related to _HPP, when in fact they're related to _HPX.
      
      The struct hpp_type0 denotes an _HPX Type 0 setting record that supersedes
      the _HPP setting record, and it has been used interchangeably for _HPP as
      per the ACPI specification (see version 6.3, section 6.2.9.1) which states
      that it should be applied to PCI, PCI-X and PCI Express devices, with
      settings being ignored if they are not applicable.
      
      Rename them to hpx_type0, hpx_type1 and hpx_type2 to reflect their relation
      to _HPX rather than _HPP.
      
      Link: https://lore.kernel.org/r/20190827094951.10613-2-kw@linux.comSigned-off-by: NKrzysztof Wilczynski <kw@linux.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      e2797ad3
  2. 28 8月, 2019 1 次提交
  3. 27 6月, 2019 3 次提交
    • R
      PCI: PM/ACPI: Refresh all stale power state data in pci_pm_complete() · b51033e0
      Rafael J. Wysocki 提交于
      In pci_pm_complete() there are checks to decide whether or not to
      resume devices that were left in runtime-suspend during the preceding
      system-wide transition into a sleep state.  They involve checking the
      current power state of the device and comparing it with the power
      state of it set before the preceding system-wide transition, but the
      platform component of the device's power state is not handled
      correctly in there.
      
      Namely, on platforms with ACPI, the device power state information
      needs to be updated with care, so that the reference counters of
      power resources used by the device (if any) are set to ensure that
      the refreshed power state of it will be maintained going forward.
      
      To that end, introduce a new ->refresh_state() platform PM callback
      for PCI devices, for asking the platform to refresh the device power
      state data and ensure that the corresponding power state will be
      maintained going forward, make it invoke acpi_device_update_power()
      (for devices with ACPI PM) on platforms with ACPI and make
      pci_pm_complete() use it, through a new pci_refresh_power_state()
      wrapper function.
      
      Fixes: a0d2a959 (PCI: Avoid unnecessary resume after direct-complete)
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      b51033e0
    • M
      PCI / ACPI: Add _PR0 dependent devices · 53b22f90
      Mika Westerberg 提交于
      If otherwise unrelated PCI devices share ACPI power resources turning
      them on causes the devices to enter D0uninitialized power state which may
      cause problems.
      
      For example in Intel Ice Lake two root ports (RP0 and RP1), Thunderbolt
      controller (NHI) and xHCI controller all share power resources as can be
      ween in the topology below where power resources are marked with []:
      
        Host bridge
          |
          +- RP0 ---\
          +- RP1 ---|--+--> [TBT]
          +- NHI --/   |
          |            |
          |            v
          +- xHCI --> [D3C]
      
      In a situation where all devices sharing the power resources are in
      D3cold (the power resources are turned off) and for example the
      Thunderbolt controller is runtime resumed resulting that the power
      resources are turned on. This means that the other devices sharing them
      (RP0, RP1 and xHCI) are transitioned into D0uninitialized state. If they
      were configured to trigger wake (PME) on a certain event that
      configuration gets lost after reset so we would need to re-initialize
      them to get the wakeup working as expected again. To do so we would need
      to runtime resume all of them to make sure their registers get restored
      properly before we can runtime suspend them again.
      
      Since we just added concept of "_PR0 dependent device" we can solve this
      by calling the relevant add/remove functions when the PCI device is bind
      to its ACPI representation. If it has power resources the PCI device
      will be added as dependent device to them and runtime resumed whenever
      they are physically turned on. This should make sure PCI core can
      reconfigure wakes after the device is transitioned into D0uninitialized.
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      53b22f90
    • M
      PCI / ACPI: Use cached ACPI device state to get PCI device power state · 83a16e3f
      Mika Westerberg 提交于
      The ACPI power state returned by acpi_device_get_power() may depend on
      the configuration of ACPI power resources in the system which may change
      any time after acpi_device_get_power() has returned, unless the
      reference counters of the ACPI power resources in question are set to
      prevent that from happening. Thus it is invalid to use acpi_device_get_power()
      in acpi_pci_get_power_state() the way it is done now and the value of
      the ->power.state field in the corresponding struct acpi_device objects
      (which reflects the ACPI power resources reference counting, among other
      things) should be used instead.
      
      As an example where this becomes an issue is Intel Ice Lake where the
      Thunderbolt controller (NHI), two PCIe root ports (RP0 and RP1) and xHCI
      all share the same power resources. The following picture with power
      resources marked with [] shows the topology:
      
        Host bridge
          |
          +- RP0 ---\
          +- RP1 ---|--+--> [TBT]
          +- NHI --/   |
          |            |
          |            v
          +- xHCI --> [D3C]
      
      Here TBT and D3C are the shared ACPI power resources. ACPI _PR3() method
      of the devices in question returns either TBT or D3C or both.
      
      Say we runtime suspend first the root ports RP0 and RP1, then NHI. Now
      since the TBT power resource is still on when the root ports are runtime
      suspended their dev->current_state is set to D3hot. When NHI is runtime
      suspended TBT is finally turned off but state of the root ports remain
      to be D3hot. Now when the xHCI is runtime suspended D3C gets also turned
      off. PCI core thus has power states of these devices cached in their
      dev->current_state as follows:
      
        RP0 -> D3hot
        RP1 -> D3hot
        NHI -> D3cold
        xHCI -> D3cold
      
      If the user now runs lspci for instance, the result is all 1's like in
      the below output (00:07.0 is the first root port, RP0):
      
      00:07.0 PCI bridge: Intel Corporation Device 8a1d (rev ff) (prog-if ff)
          !!! Unknown header type 7f
          Kernel driver in use: pcieport
      
      In short the hardware state is not in sync with the software state
      anymore. The exact same thing happens with the PME polling thread which
      ends up bringing the root ports back into D0 after they are runtime
      suspended.
      
      For this reason, modify acpi_pci_get_power_state() so that it uses the
      ACPI device power state that was cached by the ACPI core. This makes the
      PCI device power state match the ACPI device power state regardless of
      state of the shared power resources which may still be on at this point.
      
      Link: https://lore.kernel.org/r/20190618161858.77834-2-mika.westerberg@linux.intel.comSigned-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      83a16e3f
  4. 27 5月, 2019 1 次提交
  5. 09 5月, 2019 1 次提交
  6. 24 4月, 2019 3 次提交
  7. 05 12月, 2018 1 次提交
  8. 13 11月, 2018 1 次提交
  9. 05 10月, 2018 1 次提交
  10. 03 10月, 2018 2 次提交
  11. 18 9月, 2018 1 次提交
    • J
      ACPI/PCI: Pay attention to device-specific _PXM node values · bad7dcd9
      Jonathan Cameron 提交于
      The ACPI specification allows you to provide _PXM entries for devices based
      on their location on a particular bus.  Let us use that if it is provided
      rather than just assuming it makes sense to put the device into the
      proximity domain of the root.
      
      An example DSDT entry that will supply this is:
      
        Device (PCI2)
        {
          Name (_HID, "PNP0A08") // PCI Express Root Bridge
          Name (_CID, "PNP0A03") // Compatible PCI Root Bridge
          Name(_SEG, 2) // Segment of this Root complex
          Name(_BBN, 0xF8) // Base Bus Number
          Name(_CCA, 1)
          Method (_PXM, 0, NotSerialized) {
            Return(0x00)
          }
      
          ...
          Device (BRI0) {
            Name (_HID, "19E51610")
            Name (_ADR, 0)
            Name (_BBN, 0xF9)
            Device (CAR0) {
              Name (_HID, "97109912")
              Name (_ADR, 0)
              Method (_PXM, 0, NotSerialized) {
                Return(0x02)
              }
            }
          }
        }
      Signed-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      bad7dcd9
  12. 17 8月, 2018 1 次提交
    • R
      PCI / ACPI / PM: Resume all bridges on suspend-to-RAM · 9d64b539
      Rafael J. Wysocki 提交于
      Commit 26112ddc (PCI / ACPI / PM: Resume bridges w/o drivers on
      suspend-to-RAM) attempted to fix a functional regression resulting
      from commit c62ec461 (PM / core: Fix direct_complete handling
      for devices with no callbacks) by resuming PCI bridges without
      drivers (that is, "parallel PCI" ones) during system-wide suspend if
      the target system state is not ACPI S0 (working state).
      
      That turns out insufficient, however, as it is reported that, at
      least in one case, the platform firmware gets confused if a PCIe
      root port is suspended before entering the ACPI S3 sleep state.
      That issue was exposed by commit 77b3729ca03 (PCI / PM: Use
      SMART_SUSPEND and LEAVE_SUSPENDED flags for PCIe ports) that allowed
      PCIe ports to stay in runtime suspend during system-wide suspend
      (which is OK for suspend-to-idle, but turns out to be problematic
      otherwise).
      
      For this reason, drop the driver check from acpi_pci_need_resume()
      and resume all bridges (including PCIe ports with drivers) during
      system-wide suspend if the target system state is not ACPI S0.
      
      [If the target system state is ACPI S0, it means suspend-to-idle
       and the platform firmware is not going to be invoked to actually
       suspend the system, so there is no need to resume the bridges in
       that case.]
      
      Fixes: 77b3729ca03 (PCI / PM: Use SMART_SUSPEND and LEAVE_SUSPENDED flags for PCIe ports)
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=200675Reported-by: Nteika kazura <teika@gmx.com>
      Tested-by: Nteika kazura <teika@gmx.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      Cc: 4.16+ <stable@vger.kernel.org> # 4.16+: 26112ddc (PCI / ACPI / PM: Resume bridges ...)
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      9d64b539
  13. 01 7月, 2018 1 次提交
    • R
      PCI / ACPI / PM: Resume bridges w/o drivers on suspend-to-RAM · 26112ddc
      Rafael J. Wysocki 提交于
      It is reported that commit c62ec461 (PM / core: Fix direct_complete
      handling for devices with no callbacks) introduced a system suspend
      regression on Samsung 305V4A by allowing a PCI bridge (not a PCIe
      port) to stay in D3 over suspend-to-RAM, which is a side effect of
      setting power.direct_complete for the children of that bridge that
      have no PM callbacks.
      
      On the majority of systems PCI bridges are not allowed to be
      runtime-suspended (the power/control sysfs attribute is set to "on"
      for them by default), but user space can change that setting and if
      it does so and a given bridge has no children with PM callbacks, the
      direct_complete optimization will be applied to it and it will stay
      in suspend over system suspend.  Apparently, that confuses the
      platform firmware on the affected machine and that may very well
      happen elsewhere, so avoid the direct_complete optimization for
      PCI bridges with no drivers (if there is a driver, it should take
      care of the PM handling) on suspend-to-RAM altogether (that should
      not matter for suspend-to-idle as platform firmware is not involved
      in it).
      
      Fixes: c62ec461 (PM / core: Fix direct_complete handling for devices with no callbacks)
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=199941
      Reported-by: n0000b.n000b@gmail.com
      Tested-by: n0000b.n000b@gmail.com
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      Cc: 4.15+ <stable@vger.kernel.org> # 4.15+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      26112ddc
  14. 27 6月, 2018 1 次提交
    • B
      PCI: shpchp: Separate existence of SHPC and permission to use it · b03799b0
      Bjorn Helgaas 提交于
      The shpchp driver registers for all PCI bridge devices.  Its probe method
      should fail if either (1) the bridge doesn't have an SHPC or (2) the OS
      isn't allowed to use it (the platform firmware may be operating the SHPC
      itself).
      
      Separate these two tests into:
      
        - A new shpc_capable() that looks for the SHPC hardware and is applicable
          on all systems (ACPI and non-ACPI), and
      
        - A simplified acpi_get_hp_hw_control_from_firmware() that we call only
          when we already know an SHPC exists and there may be ACPI methods to
          either request permission to use it (_OSC) or transfer control to the
          OS (OSHP).
      
      acpi_get_hp_hw_control_from_firmware() is implemented when CONFIG_ACPI=y,
      but does nothing if the current platform doesn't support ACPI.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      b03799b0
  15. 05 6月, 2018 1 次提交
  16. 02 6月, 2018 1 次提交
  17. 20 3月, 2018 1 次提交
  18. 27 1月, 2018 1 次提交
  19. 19 1月, 2018 1 次提交
  20. 06 10月, 2017 1 次提交
    • V
      ACPI / PCI: Bail early in acpi_pci_add_bus() if there is no ACPI handle · a0040c01
      Vitaly Kuznetsov 提交于
      Hyper-V instances support PCI pass-through which is implemented through PV
      pci-hyperv driver. When a device is passed through, a new root PCI bus is
      created in the guest. The bus sits on top of VMBus and has no associated
      information in ACPI. acpi_pci_add_bus() in this case proceeds all the way
      to acpi_evaluate_dsm(), which reports
      
        ACPI: \: failed to evaluate _DSM (0x1001)
      
      While acpi_pci_slot_enumerate() and acpiphp_enumerate_slots() are protected
      against ACPI_HANDLE() being NULL and do nothing, acpi_evaluate_dsm() is not
      and gives us the error. It seems the correct fix is to not do anything in
      acpi_pci_add_bus() in such cases.
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      a0040c01
  21. 01 8月, 2017 1 次提交
    • R
      ACPI / PCI / PM: Rework acpi_pci_propagate_wakeup() · 1ba51a7c
      Rafael J. Wysocki 提交于
      The acpi_pci_propagate_wakeup() routine is there to handle cases in
      which PCI bridges (or PCIe ports) are expected to signal wakeup
      for devices below them, but currently it doesn't do that correctly.
      
      The problem is that acpi_pci_propagate_wakeup() uses
      acpi_pm_set_device_wakeup() for bridges and if that routine is
      called for multiple times to disable wakeup for the same device,
      it will disable it on the first invocation and the next calls
      will have no effect (it works analogously when called to enable
      wakeup, but that is not a problem).
      
      Now, say acpi_pci_propagate_wakeup() has been called for two
      different devices under the same bridge and it has called
      acpi_pm_set_device_wakeup() for that bridge each time.  The
      bridge is now enabled to generate wakeup signals.  Next,
      suppose that one of the devices below it resumes and
      acpi_pci_propagate_wakeup() is called to disable wakeup for that
      device.  It will then call acpi_pm_set_device_wakeup() for the bridge
      and that will effectively disable remote wakeup for all devices under
      it even though some of them may still be suspended and remote wakeup
      may be expected to work for them.
      
      To address this (arguably theoretical) issue, allow
      wakeup.enable_count under struct acpi_device to grow beyond 1 in
      certain situations.  In particular, allow that to happen in
      acpi_pci_propagate_wakeup() when wakeup is enabled or disabled
      for PCI bridges, so that wakeup is actually disabled for the
      bridge when all devices under it resume and not when just one
      of them does that.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      1ba51a7c
  22. 28 6月, 2017 5 次提交
    • 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
      PCI / PM: Simplify device wakeup settings code · 0847684c
      Rafael J. Wysocki 提交于
      After previous changes it is not necessary to distinguish between
      device wakeup for run time and device wakeup from system sleep states
      any more, so rework the PCI device wakeup settings code accordingly.
      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>
      0847684c
    • R
      PCI / PM: Drop pme_interrupt flag from struct pci_dev · 8370c2dc
      Rafael J. Wysocki 提交于
      The pme_interrupt flag in struct pci_dev is set when PMEs generated
      by the device are going to be signaled via root port PME interrupts.
      
      Ironically enough, that information is only used by the code setting
      up device wakeup through ACPI which returns as soon as it sees the
      pme_interrupt flag set while setting up "remote runtime wakeup".
      That is questionable, however, because in theory there may be PCIe
      devices using out-of-band PME signaling under root ports handled
      by the native PME code or devices requiring wakeup power setup to be
      carried out by AML.  For such devices, ACPI wakeup should be invoked
      regardless of whether or not native PME signaling is used in general.
      
      For this reason, drop the pme_interrupt flag and rework the code
      using it which then allows the ACPI-based device wakeup handling
      in PCI to be consolidated to use one code path for both "runtime
      remote wakeup" and system wakeup (from sleep states).
      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>
      8370c2dc
    • R
      ACPI / PM: Consolidate device wakeup settings code · 4d183d04
      Rafael J. Wysocki 提交于
      Currently, there are two separate ways of handling device wakeup
      settings in the ACPI core, depending on whether this is runtime
      wakeup or system wakeup (from sleep states).  However, after the
      previous commit eliminating the run_wake ACPI device wakeup flag,
      there is no difference between the two any more at the ACPI level,
      so they can be combined.
      
      For this reason, introduce acpi_pm_set_device_wakeup() to replace both
      acpi_pm_device_run_wake() and acpi_pm_device_sleep_wake() and make it
      check the ACPI device object's wakeup.valid flag to determine whether
      or not the device can be set up to generate wakeup signals.
      
      Also notice that zpodd_enable/disable_run_wake() only call
      device_set_run_wake() because acpi_pm_device_run_wake() called
      device_run_wake(), which is not done by acpi_pm_set_device_wakeup(),
      so drop the now redundant device_set_run_wake() calls from there.
      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>
      4d183d04
    • 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
  23. 15 6月, 2017 1 次提交
    • R
      ACPI / PM: Run wakeup notify handlers synchronously · 64fd1c70
      Rafael J. Wysocki 提交于
      The work functions provided by the users of acpi_add_pm_notifier()
      should be run synchronously before re-enabling the wakeup GPE in
      case they are used to clear the status and/or disable the wakeup
      signaling at the source.  Otherwise, which is the case currently in
      the PCI bus type code, the same wakeup event may be signaled for
      multiple times while the execution of the work function in response
      to it has already been queued up.
      
      Fortunately, acpi_add_pm_notifier() is only used by PCI and by
      ACPI device PM code internally, so the change is relatively
      straightforward to make.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      64fd1c70
  24. 07 6月, 2017 1 次提交
  25. 07 12月, 2016 1 次提交
  26. 18 11月, 2016 1 次提交
    • L
      ACPI / hotplug / PCI: Make device_is_managed_by_native_pciehp() public · 437eb7bf
      Lukas Wunner 提交于
      We're about to add runtime PM of hotplug ports, but we need to restrict it
      to ports that are handled natively by the OS:  If they're handled by the
      firmware (which is the case for Thunderbolt on non-Macs), things would
      break if the OS put the ports into D3hot behind the firmware's back.
      
      To determine if a hotplug port is handled natively, one has to walk up from
      the port to the root bridge and check the cached _OSC Control Field for the
      value of the "PCI Express Native Hot Plug control" bit.  There's already a
      function to do that, device_is_managed_by_native_pciehp(), but it's private
      to drivers/pci/hotplug/acpiphp_glue.c and only compiled in if
      CONFIG_HOTPLUG_PCI_ACPI is enabled.
      
      Make it public and move it to drivers/pci/pci-acpi.c, so that it is
      available in the more general CONFIG_ACPI case.
      
      The function contains a check if the device in question is a hotplug port
      and returns false if it's not.  The caller we're going to add doesn't need
      this as it only calls the function if it actually *is* a hotplug port.
      Move the check out of the function into the single existing caller.
      
      Rename it to pciehp_is_native() and add some kerneldoc and polish.
      
      No functional change intended.
      Tested-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NLukas Wunner <lukas@wunner.de>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      437eb7bf
  27. 29 9月, 2016 1 次提交
    • L
      PCI: Query platform firmware for device power state · cc7cc02b
      Lukas Wunner 提交于
      Usually the most accurate way to determine a PCI device's power state is to
      read its PM Control & Status Register.  There are two cases however when
      this is not an option:  If the device doesn't have the PM capability at
      all, or if it is in D3cold (in which case its config space is
      inaccessible).
      
      In both cases, we can alternatively query the platform firmware for its
      opinion on the device's power state.  To facilitate this, augment struct
      pci_platform_pm_ops with a ->get_power callback and implement it for
      acpi_pci_platform_pm (the only pci_platform_pm_ops existing so far).
      
      It is used by a forthcoming commit to let pci_update_current_state()
      recognize D3cold.
      Signed-off-by: NLukas Wunner <lukas@wunner.de>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      cc7cc02b
  28. 21 12月, 2015 1 次提交
  29. 09 12月, 2015 1 次提交