Bug 212291

Summary: as3722: disable_irq is called after enable_irq_wake on suspend (as3722_i2c_suspend)
Product: Other Reporter: Michal Koziel (mrkozmic)
Component: ModulesAssignee: other_modules
Status: NEW ---    
Severity: normal    
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: Subsystem:
Regression: No Bisected commit-id:

Description Michal Koziel 2021-03-15 11:23:05 UTC
Problem: Wakeup is disabled by the call to disable_irq. 
Fix: remove disable_irq. Fix also as3722_i2c_resume. 


from /drivers/mfd/as3722.c:

static int __maybe_unused as3722_i2c_suspend(struct device *dev)
{
	struct as3722 *as3722 = dev_get_drvdata(dev);

	if (device_may_wakeup(dev))
		enable_irq_wake(as3722->chip_irq);
	disable_irq(as3722->chip_irq);

	return 0;
}


From https://www.kernel.org/doc/Documentation/power/suspend-and-interrupts.rst:

Calling enable_irq_wake() causes suspend_device_irqs() to treat the given IRQ
in a special way.  Namely, the IRQ remains enabled, by on the first interrupt
it will be disabled, marked as pending and "suspended" so that it will be
re-enabled by resume_device_irqs() during the subsequent system resume.  Also
the PM core is notified about the event which causes the system suspend in
progress to be aborted (that doesn't have to happen immediately, but at one
of the points where the suspend thread looks for pending wakeup events).