Bug 200861

Summary: baytrail axp288 axp20x-pek : power button irq firing continuously after freeze
Product: Drivers Reporter: Rafael Gandolfi (kaillasse91)
Component: I2CAssignee: Hans de Goede (jwrdegoede)
Status: RESOLVED CODE_FIX    
Severity: normal CC: jwrdegoede
Priority: P1    
Hardware: Intel   
OS: Linux   
Kernel Version: 4.18 mainline Tree: Mainline
Regression: No
Attachments: clear_i2c_poknirq
config-4.18.0-custom
dmesg
lsmod
powerstat.RcD.001.before_sleep
powerstat.RcD.002.after_sleep_and_pwr_btn_press_release
proc_int.001.at_boot
proc_int.002.after_pwr_btn_press
proc_int.003.after_pwr_btn_release
proc_int.004.after_sleep_and_wake_up_by_pwr_btn_press_release
proc_int.005.after_another_pwr_btn_press
proc_int.006.after_another_pwr_btn_release
proc_int.007.doing_nothing
proc_int.008.doing_nothing_longer
sys_kernel_debug_pmc_atom_sleep_state.001.before_sleep
sys_kernel_debug_pmc_atom_sleep_state.002.after_sleep
uname.a
[PATCH] i2c: designware: Re-init controllers with pm_disabled set on resume

Description Rafael Gandolfi 2018-08-19 13:37:58 UTC
Created attachment 277943 [details]
clear_i2c_poknirq

Since v4.18, SOiX is working for my Meegopad T02 but when waking up, the irq for the power button is behaving stangely.

1/normal behaviour :
power button press		: 1 irq at axp20x-pek-dbf
power button release	: 1 irq at axp20x-pek-dbr

2/after wakeup by pressing power button:
axp20x-pek-dbr increases by 1
axp20x-pek-dbf doesn't change

3/after freeze :
power button press		: 5000 irq/s at axp20x-pek-dbr, 0 irq at axp20x-pek-dbf
power button release	: nothing

After 3, if I try to freeze, it wakes up immediatly.

To stop the irq firing continuously I can unload/reload axp20x_pek module or clear the axp20x-pek-dbr interupt with i2cset.

Then I can freeze and when it wakes up it is in the 2/ state.

Note, that a long press (16s) to the power button halts the Meegopad T02, this behavior is not affected by the freeze.
Comment 1 Rafael Gandolfi 2018-08-19 13:38:42 UTC
Created attachment 277945 [details]
config-4.18.0-custom
Comment 2 Rafael Gandolfi 2018-08-19 13:39:01 UTC
Created attachment 277947 [details]
dmesg
Comment 3 Rafael Gandolfi 2018-08-19 13:39:20 UTC
Created attachment 277949 [details]
lsmod
Comment 4 Rafael Gandolfi 2018-08-19 13:39:36 UTC
Created attachment 277951 [details]
powerstat.RcD.001.before_sleep
Comment 5 Rafael Gandolfi 2018-08-19 13:39:48 UTC
Created attachment 277953 [details]
powerstat.RcD.002.after_sleep_and_pwr_btn_press_release
Comment 6 Rafael Gandolfi 2018-08-19 13:40:07 UTC
Created attachment 277955 [details]
proc_int.001.at_boot
Comment 7 Rafael Gandolfi 2018-08-19 13:40:19 UTC
Created attachment 277957 [details]
proc_int.002.after_pwr_btn_press
Comment 8 Rafael Gandolfi 2018-08-19 13:40:32 UTC
Created attachment 277959 [details]
proc_int.003.after_pwr_btn_release
Comment 9 Rafael Gandolfi 2018-08-19 13:40:44 UTC
Created attachment 277961 [details]
proc_int.004.after_sleep_and_wake_up_by_pwr_btn_press_release
Comment 10 Rafael Gandolfi 2018-08-19 13:40:56 UTC
Created attachment 277963 [details]
proc_int.005.after_another_pwr_btn_press
Comment 11 Rafael Gandolfi 2018-08-19 13:41:10 UTC
Created attachment 277965 [details]
proc_int.006.after_another_pwr_btn_release
Comment 12 Rafael Gandolfi 2018-08-19 13:41:22 UTC
Created attachment 277967 [details]
proc_int.007.doing_nothing
Comment 13 Rafael Gandolfi 2018-08-19 13:41:44 UTC
Created attachment 277969 [details]
proc_int.008.doing_nothing_longer
Comment 14 Rafael Gandolfi 2018-08-19 13:42:05 UTC
Created attachment 277971 [details]
sys_kernel_debug_pmc_atom_sleep_state.001.before_sleep
Comment 15 Rafael Gandolfi 2018-08-19 13:42:19 UTC
Created attachment 277973 [details]
sys_kernel_debug_pmc_atom_sleep_state.002.after_sleep
Comment 16 Rafael Gandolfi 2018-08-19 13:42:35 UTC
Created attachment 277975 [details]
uname.a
Comment 17 Hans de Goede 2018-08-29 13:10:38 UTC
Created attachment 278197 [details]
[PATCH] i2c: designware: Re-init controllers with pm_disabled set on resume

Thank you for bringing this to our attention, I believe that this patch fixes this.
Comment 18 Rafael Gandolfi 2018-08-29 14:14:06 UTC
Thank you for the patch, I've just tested it on top of v4.18 in cold boot and reboot conditions doing several 'freeze'/wake up in a row and it fixes the problem.