1. 01 8月, 2017 3 次提交
    • J
      ACPI / sleep: Make acpi_sleep_syscore_init() static · a042e0c6
      Jean Delvare 提交于
      Function acpi_sleep_syscore_init has no external user so it should be
      static.
      Signed-off-by: NJean Delvare <jdelvare@suse.de>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a042e0c6
    • 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
    • R
      ACPI / PM: Split acpi_device_wakeup() · 99d8845e
      Rafael J. Wysocki 提交于
      To prepare for a subsequent change and make the code somewhat easier
      to follow, do the following in the ACPI device wakeup handling code:
      
       * Replace wakeup.flags.enabled under struct acpi_device with
         wakeup.enable_count as that will be necessary going forward.
      
         For now, wakeup.enable_count is not allowed to grow beyond 1,
         so the current behavior is retained.
      
       * Split acpi_device_wakeup() into acpi_device_wakeup_enable()
         and acpi_device_wakeup_disable() and modify the callers of
         it accordingly.
      
       * Introduce a new acpi_wakeup_lock mutex to protect the wakeup
         enabling/disabling code from races in case it is executed
         more than once in parallel for the same device (which may
         happen for bridges theoretically).
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      99d8845e
  2. 25 7月, 2017 1 次提交
  3. 20 7月, 2017 1 次提交
    • R
      ACPI / PM / EC: Flush all EC work in acpi_freeze_sync() · 880a6627
      Rafael J. Wysocki 提交于
      Commit eed4d47e (ACPI / sleep: Ignore spurious SCI wakeups from
      suspend-to-idle) introduced acpi_freeze_sync() whose purpose is to
      flush all of the processing of possible wakeup events signaled via
      the ACPI SCI.  However, it doesn't flush the query workqueue used
      by the EC driver, so the events generated by the EC may not be
      processed timely which leads to issues (increased overhead at least,
      lost events possibly).
      
      To fix that introduce acpi_ec_flush_work() that will flush all of
      the outstanding EC work and call it from acpi_freeze_sync().
      
      Fixes: eed4d47e (ACPI / sleep: Ignore spurious SCI wakeups from suspend-to-idle)
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      880a6627
  4. 19 7月, 2017 1 次提交
    • R
      ACPI / EC: Add parameter to force disable the GPE on suspend · 76380636
      Rafael J. Wysocki 提交于
      After commit 8110dd28 (ACPI / sleep: EC-based wakeup from
      suspend-to-idle on recent systems) the configuration of GPEs,
      including the EC one, is not changed during suspend-to-idle on
      recent systems.  That's in order to make system wakeup events
      generated by the EC work, in particular.
      
      However, on some of the systems in question (for example on Dell
      XPS13 9365), in addition to generating system wakeup events the
      EC generates a heartbeat sequence of interrupts that have nothing
      to do with wakeup while suspended, and the Low Power Idle S0 _DSM
      interface doesn't change that behavior.
      
      The users of those systems may prefer to disable the EC GPE during
      system suspend, for the cost of non-functional power button wakeup
      or similar, but currently there is no way to do that.
      
      For this reason, add a new module parameter, ec_no_wakeup, for the
      EC driver module that, if set, will cause the EC GPE to be disabled
      during system suspend and re-enabled during the subsequent system
      resume.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=192591#c106
      Amends: 8110dd28 (ACPI / sleep: EC-based wakeup from suspend-to-idle on recent systems)
      Reported-and-tested-by: NPatrik Kullman <patrik.kullman@gmail.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      76380636
  5. 18 7月, 2017 1 次提交
  6. 12 7月, 2017 6 次提交
  7. 05 7月, 2017 9 次提交
  8. 03 7月, 2017 1 次提交
  9. 01 7月, 2017 3 次提交
  10. 30 6月, 2017 1 次提交
  11. 29 6月, 2017 5 次提交
  12. 28 6月, 2017 8 次提交
    • L
      ACPI: EC: Fix EC command visibility for dynamic debug · 4625d752
      Lv Zheng 提交于
      acpi_ec_cmd_string() currently is only enabled for "DEBUG" macro, but users
      trend to use CONFIG_DYNAMIC_DEBUG and enable ec.c pr_debug() print-outs by
      "dyndbg='file ec.c +p'". In this use case, all command names are turned
      into UNDEF and the log is confusing. This affects bugzilla triage work.
      
      This patch fixes this issue by enabling acpi_ec_cmd_string() for
      CONFIG_DYNAMIC_DEBUG.
      Tested-by: NWang Wendy <wendy.wang@intel.com>
      Tested-by: NFeng Chenzhou <chenzhoux.feng@intel.com>
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      4625d752
    • L
      ACPI: EC: Fix an EC event IRQ storming issue · 1ab69f27
      Lv Zheng 提交于
      The EC event IRQ (SCI_EVT) can only be handled by submitting QR_EC. As the
      EC driver handles SCI_EVT in a workqueue, after SCI_EVT is flagged and
      before QR_EC is submitted, there is a period risking IRQ storming. EC IRQ
      must be masked for this period but linux EC driver never does so.
      
      No end user notices the IRQ storming and no developer fixes this known
      issue because:
      
       1. The EC IRQ is always edge triggered GPE, and
       2. The kernel can execute no-op EC IRQ handler very fast.
      
      For edge-triggered EC GPE platforms, it is only reported of post-resume EC
      event lost issues, there won't be an IRQ storming. For level triggered EC
      GPE platforms, fortunately the kernel is always fast enough to execute such
      a no-op EC IRQ handler so that the IRQ handler won't be accumulated to
      starve the task contexts, causing a real IRQ storming.
      
      But the IRQ storming actually can still happen when:
      
       1. The EC IRQ performs like level triggered GPE, and
       2. The kernel EC debugging log is turned on but the console is slow enough.
      
      There are more and more platforms using EC GPE as wake GPE where the EC GPE
      is likely designed as level triggered. Then when EC debugging log is
      enabled, the EC IRQ handler is no longer a no-op but dumps IRQ status to
      the consoles. If the consoles are slow enough, the EC IRQs can arrive much
      faster than executing the handler. Finally the accumulated EC event IRQ
      handlers starve the task contexts, causing the IRQ storming to occur, and
      the kernel hangs can be observed during boot/resume.
      
      This patch fixes this issue by masking EC IRQ for this period:
      
       1. Begins when there is an SCI_EVT IRQ pending, and
       2. Ends when there is a QR_EC completed (SCI_EVT acknowledged).
      Tested-by: NWang Wendy <wendy.wang@intel.com>
      Tested-by: NFeng Chenzhou <chenzhoux.feng@intel.com>
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      1ab69f27
    • 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: 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
    • D
      libnvdimm, nfit: enable support for volatile ranges · c9e582aa
      Dan Williams 提交于
      Allow volatile nfit ranges to participate in all the same infrastructure
      provided for persistent memory regions. A resulting resulting namespace
      device will still be called "pmem", but the parent region type will be
      "nd_volatile". This is in preparation for disabling the dax ->flush()
      operation in the pmem driver when it is hosted on a volatile range.
      
      Cc: Jan Kara <jack@suse.cz>
      Cc: Jeff Moyer <jmoyer@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Matthew Wilcox <mawilcox@microsoft.com>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      c9e582aa
    • D
      x86, libnvdimm, pmem: remove global pmem api · ca6a4657
      Dan Williams 提交于
      Now that all callers of the pmem api have been converted to dax helpers that
      call back to the pmem driver, we can remove include/linux/pmem.h and
      asm/pmem.h.
      
      Cc: <x86@kernel.org>
      Cc: Jeff Moyer <jmoyer@redhat.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Toshi Kani <toshi.kani@hpe.com>
      Cc: Oliver O'Halloran <oohall@gmail.com>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Reviewed-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      ca6a4657