1. 03 6月, 2017 11 次提交
  2. 26 5月, 2017 1 次提交
    • P
      kobject: support passing in variables for synthetic uevents · f36776fa
      Peter Rajnoha 提交于
      This patch makes it possible to pass additional arguments in addition
      to uevent action name when writing /sys/.../uevent attribute. These
      additional arguments are then inserted into generated synthetic uevent
      as additional environment variables.
      
      Before, we were not able to pass any additional uevent environment
      variables for synthetic uevents. This made it hard to identify such uevents
      properly in userspace to make proper distinction between genuine uevents
      originating from kernel and synthetic uevents triggered from userspace.
      Also, it was not possible to pass any additional information which would
      make it possible to optimize and change the way the synthetic uevents are
      processed back in userspace based on the originating environment of the
      triggering action in userspace. With the extra additional variables, we are
      able to pass through this extra information needed and also it makes it
      possible to synchronize with such synthetic uevents as they can be clearly
      identified back in userspace.
      
      The format for writing the uevent attribute is following:
      
          ACTION [UUID [KEY=VALUE ...]
      
      There's no change in how "ACTION" is recognized - it stays the same
      ("add", "change", "remove"). The "ACTION" is the only argument required
      to generate synthetic uevent, the rest of arguments, that this patch
      adds support for, are optional.
      
      The "UUID" is considered as transaction identifier so it's possible to
      use the same UUID value for one or more synthetic uevents in which case
      we logically group these uevents together for any userspace listeners.
      The "UUID" is expected to be in "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
      format where "x" is a hex digit. The value appears in uevent as
      "SYNTH_UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" environment variable.
      
      The "KEY=VALUE" pairs can contain alphanumeric characters only. It's
      possible to define zero or more more pairs - each pair is then delimited
      by a space character " ". Each pair appears in synthetic uevents as
      "SYNTH_ARG_KEY=VALUE" environment variable. That means the KEY name gains
      "SYNTH_ARG_" prefix to avoid possible collisions with existing variables.
      To pass the "KEY=VALUE" pairs, it's also required to pass in the "UUID"
      part for the synthetic uevent first.
      
      If "UUID" is not passed in, the generated synthetic uevent gains
      "SYNTH_UUID=0" environment variable automatically so it's possible to
      identify this situation in userspace when reading generated uevent and so
      we can still make a difference between genuine and synthetic uevents.
      Signed-off-by: NPeter Rajnoha <prajnoha@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f36776fa
  3. 25 5月, 2017 1 次提交
  4. 06 5月, 2017 2 次提交
    • R
      ACPI / sleep: Ignore spurious SCI wakeups from suspend-to-idle · eed4d47e
      Rafael J. Wysocki 提交于
      The ACPI SCI (System Control Interrupt) is set up as a wakeup IRQ
      during suspend-to-idle transitions and, consequently, any events
      signaled through it wake up the system from that state.  However,
      on some systems some of the events signaled via the ACPI SCI while
      suspended to idle should not cause the system to wake up.  In fact,
      quite often they should just be discarded.
      
      Arguably, systems should not resume entirely on such events, but in
      order to decide which events really should cause the system to resume
      and which are spurious, it is necessary to resume up to the point
      when ACPI SCIs are actually handled and processed, which is after
      executing dpm_resume_noirq() in the system resume path.
      
      For this reasons, add a loop around freeze_enter() in which the
      platforms can process events signaled via multiplexed IRQ lines
      like the ACPI SCI and add suspend-to-idle hooks that can be
      used for this purpose to struct platform_freeze_ops.
      
      In the ACPI case, the ->wake hook is used for checking if the SCI
      has triggered while suspended and deferring the interrupt-induced
      system wakeup until the events signaled through it are actually
      processed sufficiently to decide whether or not the system should
      resume.  In turn, the ->sync hook allows all of the relevant event
      queues to be flushed so as to prevent events from being missed due
      to race conditions.
      
      In addition to that, some ACPI code processing wakeup events needs
      to be modified to use the "hard" version of wakeup triggers, so that
      it will cause a system resume to happen on device-induced wakeup
      events even if the "soft" mechanism to prevent the system from
      suspending is not enabled (that also helps to catch device-induced
      wakeup events occurring during suspend transitions in progress).
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      eed4d47e
    • R
      PM / wakeup: Integrate mechanism to abort transitions in progress · 8a537ece
      Rafael J. Wysocki 提交于
      The system wakeup framework is not very consistent with respect to
      the way it handles suspend-to-idle and generally wakeup events
      occurring during transitions to system low-power states.
      
      First off, system transitions in progress are aborted by the event
      reporting helpers like pm_wakeup_event() only if the wakeup_count
      sysfs attribute is in use (as documented), but there are cases in
      which system-wide transitions should be aborted even if that is
      not the case.  For example, a wakeup signal from a designated
      wakeup device during system-wide PM transition, it should cause
      the transition to be aborted right away.
      
      Moreover, there is a freeze_wake() call in wakeup_source_activate(),
      but that really is only effective after suspend_freeze_state has
      been set to FREEZE_STATE_ENTER by freeze_enter().  However, it
      is very unlikely that wakeup_source_activate() will ever be called
      at that time, as it could only be triggered by a IRQF_NO_SUSPEND
      interrupt handler, so wakeups from suspend-to-idle don't really
      occur in wakeup_source_activate().
      
      At the same time there is a way to abort a system suspend in
      progress (or wake up the system from suspend-to-idle), which is by
      calling pm_system_wakeup(), but in turn that doesn't cause any
      wakeup source objects to be activated, so it will not be covered
      by wakeup source statistics and will not prevent the system from
      suspending again immediately (in case autosleep is used, for
      example).  Consequently, if anyone wants to abort system transitions
      in progress and allow the wakeup_count mechanism to work, they need
      to use both pm_system_wakeup() and pm_wakeup_event(), say, at the
      same time which is awkward.
      
      For the above reasons, make it possible to trigger
      pm_system_wakeup() from within wakeup_source_activate() and
      provide a new pm_wakeup_hard_event() helper to do so within the
      wakeup framework.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8a537ece
  5. 20 4月, 2017 3 次提交
  6. 19 4月, 2017 1 次提交
  7. 09 4月, 2017 2 次提交
  8. 07 4月, 2017 1 次提交
    • H
      platform-msi: Make platform_msi_create_device_domain() ACPI aware · 6943acf6
      Hanjun Guo 提交于
      The irqdomain creation that is carried out in:
      
      platform_msi_create_device_domain()
      
      relies on the fwnode_handle interrupt controller token to associate the
      interrupt controller with a specific irqdomain. Current code relies on
      the OF layer to retrieve a fwnode_handle for the device representing the
      interrupt controller from its device->of_node pointer.  This makes
      platform_msi_create_device_domain() DT specific whilst it really is not
      because after the merge of commit f94277af ("of/platform: Initialise
      dev->fwnode appropriately") the fwnode_handle can easily be retrieved
      from the dev->fwnode pointer in a firmware agnostic way.
      
      Update platform_msi_create_device_domain() to retrieve the interrupt
      controller fwnode_handle from the dev->fwnode pointer so that it can
      be used seamlessly in ACPI and DT systems.
      Signed-off-by: NHanjun Guo <hanjun.guo@linaro.org>
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Tested-by: NMing Lei <ming.lei@canonical.com>
      Tested-by: NWei Xu <xuwei5@hisilicon.com>
      Cc: Greg KH <gregkh@linuxfoundation.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      6943acf6
  9. 04 4月, 2017 1 次提交
  10. 30 3月, 2017 4 次提交
  11. 29 3月, 2017 13 次提交