summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.cirrus.com>2023-06-01 12:10:35 +0200
committerMark Brown <broonie@kernel.org>2023-06-01 13:32:52 +0200
commit02534c8e967b51940ae7c0cd99befe216f1c2c8d (patch)
tree35e776f30c6aeaca77c8b9caf7ba617672813597
parentregmap: Load register defaults in blocks rather than register by register (diff)
downloadlinux-02534c8e967b51940ae7c0cd99befe216f1c2c8d.tar.xz
linux-02534c8e967b51940ae7c0cd99befe216f1c2c8d.zip
regmap: regmap-irq: Move handle_post_irq to before pm_runtime_put
Typically handle_post_irq is going to be used to manage some additional chip specific hardware operations required on each IRQ, these are very likely to want the chip to be resumed. For example the current in tree user max77620 uses this to toggle a global mask bit, which would obviously want the device resumed. It is worth noting this device does not specify the runtime_pm flag in regmap_irq_chip, so there is no actual issue. Move the callback to before the pm_runtime_put, so it will be called whilst the device is still resumed. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230601101036.1499612-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/base/regmap/regmap-irq.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c
index 330da5d6c8c3..ced0dcf86e0b 100644
--- a/drivers/base/regmap/regmap-irq.c
+++ b/drivers/base/regmap/regmap-irq.c
@@ -502,12 +502,12 @@ static irqreturn_t regmap_irq_thread(int irq, void *d)
}
exit:
- if (chip->runtime_pm)
- pm_runtime_put(map->dev);
-
if (chip->handle_post_irq)
chip->handle_post_irq(chip->irq_drv_data);
+ if (chip->runtime_pm)
+ pm_runtime_put(map->dev);
+
if (handled)
return IRQ_HANDLED;
else