i2c: remove redundant pm_runtime_dont_use_autosuspend() calls
Subsystems (7)
cover i2c: remove redundant pm_runtime_dont_use_autosuspend() calls
Since commit d1706f9da9f4 ("PM: runtime: call pm_runtime_dont_use_autosuspend() on reinit()"), driver core is now responsible for undoing anypm_runtime_use_autosuspend() calls on driver exit.
Remove the redundant function calls.
NOTE: Some drivers in drivers/i2c/ still keep their calls because they either rely on pm_runtime_dont_use_autosuspend() before pm_runtime_disable() to flush pending autosuspend delays and trigger synchronous runtime suspension, or operate on a parent device rather than the platform device itself.
---
Joshua Crofts (6):
i2c: cadence: remove redundant pm_runtime_dont_use_autosuspend() call
i2c: img-scb: remove redundant pm_runtime_dont_use_autosuspend() call
i2c: imx: remove redundant pm_runtime_dont_use_autosuspend() calls
i2c: riic: remove redundant pm_runtime_dont_use_autosuspend() calls
i2c: stm32f7: remove redundant pm_runtime_dont_use_autosuspend() calls
i2c: xiic: remove redundant pm_runtime_dont_use_autosuspend() calls
drivers/i2c/busses/i2c-cadence.c | 1 - drivers/i2c/busses/i2c-img-scb.c | 1 - drivers/i2c/busses/i2c-imx.c | 2 -- drivers/i2c/busses/i2c-riic.c | 2 -- drivers/i2c/busses/i2c-stm32f7.c | 2 -- drivers/i2c/busses/i2c-xiic.c | 2 -- 6 files changed, 10 deletions(-)
---
base-commit: 7475ea8b58616b33c04afb976cf0fbaad9dd63fb
change-id: 20261109-i2c-remove-dont-use-autosuspend-3c7e920fdd56
Best regards,
Signature · 1 line
Joshua Crofts
PATCH 1/6 i2c: cadence: remove redundant pm_runtime_dont_use_autosuspend() call
Since commit d1706f9da9f4 ("PM: runtime: call pm_runtime_dont_use_autosuspend() on reinit()"), driver core is now responsible for undoing anypm_runtime_use_autosuspend() calls on driver exit.
Remove the redundant function call.
--- drivers/i2c/busses/i2c-cadence.c | 1 - 1 file changed, 1 deletion(-)
drivers/i2c/busses/i2c-cadence.c +0 -1
@@ -1628,7 +1628,6 @@ static void cdns_i2c_remove(struct platform_device *pdev)pm_runtime_disable (&pdev->dev);pm_runtime_set_suspended (&pdev->dev); -pm_runtime_dont_use_autosuspend (&pdev->dev);i2c_del_adapter (&id->adap);clk_notifier_unregister (id->clk, &id->clk_rate_change_nb);
Signature · 1 line
2.56.0
PATCH 2/6 i2c: img-scb: remove redundant pm_runtime_dont_use_autosuspend() call
In reply to Joshua CroftsSince commit d1706f9da9f4 ("PM: runtime: call pm_runtime_dont_use_autosuspend() on reinit()"), driver core is now responsible for undoing anypm_runtime_use_autosuspend() calls on driver exit.
Remove the redundant function call.
--- drivers/i2c/busses/i2c-img-scb.c | 1 - 1 file changed, 1 deletion(-)
drivers/i2c/busses/i2c-img-scb.c +0 -1
@@ -1403,7 +1403,6 @@ static int img_i2c_probe(struct platform_device *pdev)if (!pm_runtime_enabled (&pdev->dev))img_i2c_runtime_suspend (&pdev->dev);pm_runtime_disable (&pdev->dev); -pm_runtime_dont_use_autosuspend (&pdev->dev);return ret; }
Signature · 1 line
2.56.0
PATCH 3/6 i2c: imx: remove redundant pm_runtime_dont_use_autosuspend() calls
In reply to Joshua CroftsSince commit d1706f9da9f4 ("PM: runtime: call pm_runtime_dont_use_autosuspend() on reinit()"), driver core is now responsible for undoing anypm_runtime_use_autosuspend() calls on driver exit.
Remove the redundant function calls.
--- drivers/i2c/busses/i2c-imx.c | 2 -- 1 file changed, 2 deletions(-)
drivers/i2c/busses/i2c-imx.c +0 -2
@@ -1964,7 +1964,6 @@ static int i2c_imx_probe(struct platform_device *pdev)pm_runtime_put_noidle (&pdev->dev);pm_runtime_disable (&pdev->dev);pm_runtime_set_suspended (&pdev->dev); -pm_runtime_dont_use_autosuspend (&pdev->dev);return ret; }
@@ -1999,7 +1998,6 @@ static void i2c_imx_remove(struct platform_device *pdev)pm_runtime_put_noidle (&pdev->dev);pm_runtime_disable (&pdev->dev); -pm_runtime_dont_use_autosuspend (&pdev->dev); }static int i2c_imx_runtime_suspend (struct device *dev)
Signature · 1 line
2.56.0
Re: [PATCH 3/6] i2c: imx: remove redundant pm_runtime_dont_use_autosuspend() calls
Quoted 8 lines · Joshua Crofts
Since commit
d1706f9da9f4("PM: runtime: callpm_runtime_dont_use_autosuspend()onreinit()"), driver core is now responsible for undoing anypm_runtime_use_autosuspend()calls on driver exit.Remove the redundant function calls.
Signed-off-by Joshua Crofts <[email protected]>---
Quoted 28 lines
drivers/i2c/busses/i2c-imx.c | 2 -- 1 file changed, 2 deletions(-)drivers/i2c/busses/i2c-imx.c +0
-3@@ -1964,7 +1964,6 @@ static int i2c_imx_probe(struct platform_device *pdev)pm_runtime_put_noidle (&pdev->dev);pm_runtime_disable (&pdev->dev);pm_runtime_set_suspended (&pdev->dev); -pm_runtime_dont_use_autosuspend (&pdev->dev);return ret; }@@ -1999,7 +1998,6 @@ static void i2c_imx_remove(struct platform_device *pdev)pm_runtime_put_noidle (&pdev->dev);pm_runtime_disable (&pdev->dev); -pm_runtime_dont_use_autosuspend (&pdev->dev); }static int i2c_imx_runtime_suspend (struct device *dev) --2.56.0
PATCH 4/6 i2c: riic: remove redundant pm_runtime_dont_use_autosuspend() calls
In reply to Joshua CroftsSince commit d1706f9da9f4 ("PM: runtime: call pm_runtime_dont_use_autosuspend() on reinit()"), driver core is now responsible for undoing anypm_runtime_use_autosuspend() calls on driver exit.
Remove the redundant function calls.
--- drivers/i2c/busses/i2c-riic.c | 2 -- 1 file changed, 2 deletions(-)
drivers/i2c/busses/i2c-riic.c +0 -2
@@ -591,7 +591,6 @@ static int riic_i2c_probe(struct platform_device *pdev) out:pm_runtime_disable (dev); -pm_runtime_dont_use_autosuspend (dev);return ret; }
@@ -608,7 +607,6 @@ static void riic_i2c_remove(struct platform_device *pdev) }i2c_del_adapter (&riic->adapter);pm_runtime_disable (dev); -pm_runtime_dont_use_autosuspend (dev); }static const u8 riic_rz_a_regs[RIIC_REG_END ] = {
Signature · 1 line
2.56.0
Re: [PATCH 4/6] i2c: riic: remove redundant pm_runtime_dont_use_autosuspend() calls
Quoted 7 lines · Joshua Crofts
Since commit
d1706f9da9f4("PM: runtime: callpm_runtime_dont_use_autosuspend()onreinit()"), driver core is now responsible for undoing anypm_runtime_use_autosuspend()calls on driver exit.Remove the redundant function calls.
Signed-off-by Joshua Crofts <[email protected]>
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
PATCH 5/6 i2c: stm32f7: remove redundant pm_runtime_dont_use_autosuspend() calls
In reply to Joshua CroftsSince commit d1706f9da9f4 ("PM: runtime: call pm_runtime_dont_use_autosuspend() on reinit()"), driver core is now responsible for undoing anypm_runtime_use_autosuspend() calls on driver exit.
Remove the redundant function calls.
--- drivers/i2c/busses/i2c-stm32f7.c | 2 -- 1 file changed, 2 deletions(-)
drivers/i2c/busses/i2c-stm32f7.c +0 -2
@@ -2325,7 +2325,6 @@ static int stm32f7_i2c_probe(struct platform_device *pdev)pm_runtime_put_noidle (i2c_dev->dev);pm_runtime_disable (i2c_dev->dev);pm_runtime_set_suspended (i2c_dev->dev); -pm_runtime_dont_use_autosuspend (i2c_dev->dev);if (i2c_dev->wakeup_src)dev_pm_clear_wake_irq (i2c_dev->dev);
@@ -2367,7 +2366,6 @@ static void stm32f7_i2c_remove(struct platform_device *pdev)pm_runtime_put_noidle (i2c_dev->dev);pm_runtime_disable (i2c_dev->dev);pm_runtime_set_suspended (i2c_dev->dev); -pm_runtime_dont_use_autosuspend (i2c_dev->dev);if (i2c_dev->dma) {stm32_i2c_dma_free (i2c_dev->dma);
Signature · 1 line
2.56.0
Re: [PATCH 5/6] i2c: stm32f7: remove redundant pm_runtime_dont_use_autosuspend() calls
Hi,
Quoted 25 lines · Joshua Crofts
Since commit
d1706f9da9f4("PM: runtime: callpm_runtime_dont_use_autosuspend()onreinit()"), driver core is now responsible for undoing anypm_runtime_use_autosuspend()calls on driver exit.Remove the redundant function calls.
Signed-off-by Joshua Crofts <[email protected]>--- drivers/i2c/busses/i2c-stm32f7.c | 2 -- 1 file changed, 2 deletions(-)drivers/i2c/busses/i2c-stm32f7.c +0
-1@@ -2325,7 +2325,6 @@ static int stm32f7_i2c_probe(struct platform_device *pdev)pm_runtime_put_noidle (i2c_dev->dev);pm_runtime_disable (i2c_dev->dev);pm_runtime_set_suspended (i2c_dev->dev); -pm_runtime_dont_use_autosuspend (i2c_dev->dev);if (i2c_dev->wakeup_src)dev_pm_clear_wake_irq (i2c_dev->dev);
drivers/i2c/busses/i2c-stm32f7.c static void stm32f7_i2c_remove(struct platform_device *pdev) · line 2371
Quoted 7 lines
drivers/i2c/busses/i2c-stm32f7.c +0
-1@@ -2367,7 +2366,6 @@ static void stm32f7_i2c_remove(struct platform_device *pdev)pm_runtime_put_noidle (i2c_dev->dev);pm_runtime_disable (i2c_dev->dev);pm_runtime_set_suspended (i2c_dev->dev); -pm_runtime_dont_use_autosuspend (i2c_dev->dev);if (i2c_dev->dma) {stm32_i2c_dma_free (i2c_dev->dma);
Regards,
Alain
Quoted 3 lines
Signature · 1 line
2.56.0
PATCH 6/6 i2c: xiic: remove redundant pm_runtime_dont_use_autosuspend() calls
In reply to Joshua CroftsSince commit d1706f9da9f4 ("PM: runtime: call pm_runtime_dont_use_autosuspend() on reinit()"), driver core is now responsible for undoing anypm_runtime_use_autosuspend() calls on driver exit.
Remove the redundant function calls.
--- drivers/i2c/busses/i2c-xiic.c | 2 -- 1 file changed, 2 deletions(-)
drivers/i2c/busses/i2c-xiic.c +0 -2
@@ -1580,7 +1580,6 @@ static int xiic_i2c_probe(struct platform_device *pdev) err_pm_disable:pm_runtime_disable (dev);pm_runtime_set_suspended (dev); -pm_runtime_dont_use_autosuspend (dev);return ret; }
@@ -1606,7 +1605,6 @@ static void xiic_i2c_remove(struct platform_device *pdev)pm_runtime_disable (dev);pm_runtime_put_noidle (dev);pm_runtime_set_suspended (dev); -pm_runtime_dont_use_autosuspend (dev); }static const struct dev_pm_ops xiic_dev_pm_ops = {
Signature · 1 line
2.56.0
[email protected]
AI reviewRe: [PATCH 6/6] i2c: xiic: remove redundant pm_runtime_dont_use_autosuspend() calls
Thank you for your contribution! Sashiko AI review found no new issues in this patch, but noticed 1 related pre-existing issue it does not introduce: - [High] i2c: xiic: premature IRQ registration…
Thank you for your contribution! Sashiko AI review found no new issues in this patch, but noticed 1 related pre-existing issue it does not introduce:
- [High] i2c: xiic: premature IRQ registration in xiic_i2c_probe() [1] --
commit 188337d85ab0ac1fad4560f785b36f1dce4f451f
Author: Joshua Crofts <[email protected]>
i2c: xiic: remove redundant pm_runtime_dont_use_autosuspend() calls
This commit removes redundant pm_runtime_dont_use_autosuspend() calls from the probe error path and remove callback in the xiic I2C driver.
drivers/i2c/busses/i2c-xiic.c static int xiic_i2c_probe(struct platform_device *pdev) · line 1585
Quoted 12 lines
drivers/i2c/busses/i2c-xiic.c +0
-1@@ -1580,7 +1580,6 @@ static int xiic_i2c_probe(struct platform_device *pdev) err_pm_disable:pm_runtime_disable (dev);pm_runtime_set_suspended (dev); -pm_runtime_dont_use_autosuspend (dev);return ret; }
[Severity: High]
This problem wasn't introduced by this patch, but can registering the IRQ in xiic_i2c_probe() before detecting hardware endianness cause an interrupt storm [1]?
drivers/i2c/busses/i2c-xiic.c:xiic_i2c_probe() {
...
ret = request_threaded_irq(irq, NULL, xiic_process, IRQF_ONESHOT,
pdev->name, i2c);
if (ret)
goto err_pm_disable;
i2c->singlemaster = device_property_read_bool(dev, "single-master");
/*
* Detect endianness
* Try to reset the TX FIFO. Then check the EMPTY flag. If it is not
* set, assume that the endianness was wrong and swap.
*/
i2c->endianness = LITTLE;
xiic_setreg32(i2c, XIIC_CR_REG_OFFSET, XIIC_CR_TX_FIFO_RESET_MASK);
/* Reset is cleared in xiic_reinit */
sr = xiic_getreg32(i2c, XIIC_SR_REG_OFFSET);
if (!(sr & XIIC_SR_TX_FIFO_EMPTY_MASK))
i2c->endianness = BIG;
...
}If a pending interrupt remains from an earlier boot stage on a big-endian system, xiic_process() can fire immediately after request_threaded_irq() while i2c->endianness is still zero-initialized to LITTLE. xiic_getreg32() and xiic_setreg32() then use little-endian accessors, failing to clear the interrupt and hanging the system in an unhandled IRQ storm. Detecting endianness and running xiic_reinit() before requesting the IRQ would avoid this.
[1] https://sashiko.dev/#/bug/linux-6466439c-c62b-471e-ba38-0219e368df95
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/20261109-i2c-remove-dont-use-autosuspend-v1-0-49a08b8daf36@kernel.org?part=6
Quoted 21 lines · Joshua Crofts
Since commit
d1706f9da9f4("PM: runtime: callpm_runtime_dont_use_autosuspend()onreinit()"), driver core is now responsible for undoing anypm_runtime_use_autosuspend()calls on driver exit.Remove the redundant function calls.
NOTE: Some drivers in
drivers/i2c/still keep their calls because they either rely onpm_runtime_dont_use_autosuspend()beforepm_runtime_disable()to flush pending autosuspend delays and trigger synchronous runtime suspension, or operate on a parent device rather than the platform device itself.Signed-off-by Joshua Crofts <[email protected]>---
Joshua Crofts (6):
i2c: cadence: remove redundantpm_runtime_dont_use_autosuspend()call
i2c: img-scb: remove redundantpm_runtime_dont_use_autosuspend()call
i2c: imx: remove redundantpm_runtime_dont_use_autosuspend()calls
i2c: riic: remove redundantpm_runtime_dont_use_autosuspend()calls
i2c: stm32f7: remove redundantpm_runtime_dont_use_autosuspend()calls
i2c: xiic: remove redundantpm_runtime_dont_use_autosuspend()calls
Quoted 8 lines
drivers/i2c/busses/i2c-cadence.c | 1 - drivers/i2c/busses/i2c-img-scb.c | 1 - drivers/i2c/busses/i2c-imx.c | 2 -- drivers/i2c/busses/i2c-riic.c | 2 -- drivers/i2c/busses/i2c-stm32f7.c | 2 -- drivers/i2c/busses/i2c-xiic.c | 2 -- 6 files changed, 10 deletions(-)---
Hi, gentle ping on this series.
Signature · 2 lines
Kind regards, Joshua Crofts
Quoted 6 lines · Joshua Crofts
Since commit
d1706f9da9f4("PM: runtime: callpm_runtime_dont_use_autosuspend()onreinit()"), driver core is now responsible for undoing anypm_runtime_use_autosuspend()calls on driver exit.Remove the redundant function calls.
Quoted 7 lines
NOTE: Some drivers in
drivers/i2c/still keep their calls because they either rely onpm_runtime_dont_use_autosuspend()beforepm_runtime_disable()to flush pending autosuspend delays and trigger synchronous runtime suspension, or operate on a parent device rather than the platform device itself.Signed-off-by Joshua Crofts <[email protected]>---
Hi, another ping on this series!
Thanks!
Signature · 2 lines
Kind regards, Joshua Crofts
Wolfram Sang
AppliedQuoted 4 lines · Joshua Crofts
Since commit
d1706f9da9f4("PM: runtime: callpm_runtime_dont_use_autosuspend()onreinit()"), driver core is now responsible for undoing anypm_runtime_use_autosuspend()calls on driver exit.
Quoted 8 lines
Remove the redundant function calls.
NOTE: Some drivers in
drivers/i2c/still keep their calls because they either rely onpm_runtime_dont_use_autosuspend()beforepm_runtime_disable()to flush pending autosuspend delays and trigger synchronous runtime suspension, or operate on a parent device rather than the platform device itself.Signed-off-by Joshua Crofts <[email protected]>
Applied to my for-andi branch, thanks!