]> git.baikalelectronics.ru Git - kernel.git/commit
PM / wakeirq: fix wakeirq setting after wakup re-configuration from sysfs
authorStrashko, Grygorii <grygorii.strashko@ti.com>
Wed, 6 Apr 2016 11:45:53 +0000 (14:45 +0300)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 7 Apr 2016 20:23:47 +0000 (22:23 +0200)
commit5555ce6e932622f8247f1eb02274ed5323b012b3
tree7d9f0c18fa51fde7d475ea6594aa9f86965ef122
parent817544f9b6f1a0723f73bb6bd7154e6a6a58b002
PM / wakeirq: fix wakeirq setting after wakup re-configuration from sysfs

Now wakeirq stops working for device if wakeup option for
this device will be reconfigured through sysfs, like:

echo disabled > /sys/devices/platform/extcon_usb1/power/wakeup
echo enabled > /sys/devices/platform/extcon_usb1/power/wakeup

Once above set of commands is executed the device's wakeup_source
opject will be recreated and dev->power.wakeup->wakeirq field will
contain NULL. As result, device_wakeup_arm_wake_irqs() will not arm
wakeirq for the affected device.

Hece, lets try to fix it in the following way:
  check for dev->wakeirq field when device_wakeup_attach() is called
  and if !NULL re-attach wakeirq to the device

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/wakeup.c