Skip to content

Commit 62aec8a

Browse files
charleskeepaxlag-linaro
authored andcommitted
mfd: cs42l43: Move IRQ enable/disable to encompass force suspend
As pm_runtime_force_suspend() will force the device state to suspend, the driver needs to ensure no IRQ handlers are currently running. If not those handlers may find they are now running on suspended hardware despite holding a PM runtime reference. disable_irq() will sync any currently running handlers, so move the IRQ disabling to cover the whole of the forced suspend state to avoid such race conditions. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20250903094549.271068-6-ckeepax@opensource.cirrus.com Signed-off-by: Lee Jones <lee@kernel.org>
1 parent d952bba commit 62aec8a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/mfd/cs42l43.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,6 +1151,8 @@ static int cs42l43_suspend(struct device *dev)
11511151
return ret;
11521152
}
11531153

1154+
disable_irq(cs42l43->irq);
1155+
11541156
ret = pm_runtime_force_suspend(dev);
11551157
if (ret) {
11561158
dev_err(cs42l43->dev, "Failed to force suspend: %d\n", ret);
@@ -1164,8 +1166,6 @@ static int cs42l43_suspend(struct device *dev)
11641166
if (ret)
11651167
return ret;
11661168

1167-
disable_irq(cs42l43->irq);
1168-
11691169
return 0;
11701170
}
11711171

@@ -1196,14 +1196,14 @@ static int cs42l43_resume(struct device *dev)
11961196
if (ret)
11971197
return ret;
11981198

1199-
enable_irq(cs42l43->irq);
1200-
12011199
ret = pm_runtime_force_resume(dev);
12021200
if (ret) {
12031201
dev_err(cs42l43->dev, "Failed to force resume: %d\n", ret);
12041202
return ret;
12051203
}
12061204

1205+
enable_irq(cs42l43->irq);
1206+
12071207
return 0;
12081208
}
12091209

0 commit comments

Comments
 (0)