Bug 212291 - as3722: disable_irq is called after enable_irq_wake on suspend (as3722_i2c_suspend)
Summary: as3722: disable_irq is called after enable_irq_wake on suspend (as3722_i2c_su...
Status: NEW
Alias: None
Product: Other
Classification: Unclassified
Component: Modules (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: other_modules
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-15 11:23 UTC by Michal Koziel
Modified: 2021-03-15 11:24 UTC (History)
0 users

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments

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).

Note You need to log in before you can comment on or make changes to this bug.