Skip to content
  • Ravi Chandra Sadineni's avatar
    PM / wakeup: Export wakeup_count instead of event_count via sysfs · 2d5ed61c
    Ravi Chandra Sadineni authored
    Currently we export event_count instead of wakeup_count via the
    per-device wakeup_count sysfs attribute. Change it to wakeup_count
    to make it more meaningful.
    wakeup_count increments only when events_check_enabled is set,
    that is whenever writes the current wakeup count to
    /sys/power/wakeup_count.  Also events_check_enabled is cleared on
    every resume. User space is expected to write to this just before
    suspend.  This way pm_wakeup_event(), when called from IRQs handles,
    will increment wakeup_count only if we are in system-wide
    suspend-resume cycle and should give a fair approximation of how many
    times a device may have triggered a wakeup from system suspend.
    event_count on the other hand will increment every time
    pm_wakeup_event() is called irrespective of whether we are in a
    suspend-resume cycle and some drivers call it on every interrupt
    which makes it less useful for system wakeup tracking.
    Signed-off-by: default avatarRavi Chandra Sadineni <>
    Acked-by: default avatarPavel Machek <>
    [ rjw: Subject & changelog ]
    Signed-off-by: default avatarRafael J. Wysocki <>