public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [1/1] i2c: designware: Ensure runtime suspend is invoked during rapid slave unregistration and registration
@ 2025-04-12  2:33 ende.tan
  2025-04-15 13:57 ` Jarkko Nikula
  0 siblings, 1 reply; 8+ messages in thread
From: ende.tan @ 2025-04-12  2:33 UTC (permalink / raw)
  To: linux-i2c
  Cc: jarkko.nikula, andriy.shevchenko, mika.westerberg, jsd,
	andi.shyti, linux-kernel, leyfoon.tan, endeneer, Tan En De

From: Tan En De <ende.tan@starfivetech.com>

Replaced pm_runtime_put() with pm_runtime_put_sync_suspend() to ensure
the runtime suspend is invoked immediately when unregistering a slave.
This prevents a race condition where suspend was skipped when
unregistering and registering slave in quick succession.

Signed-off-by: Tan En De <ende.tan@starfivetech.com>
---
 drivers/i2c/busses/i2c-designware-slave.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-designware-slave.c b/drivers/i2c/busses/i2c-designware-slave.c
index 5cd4a5f7a472..b936a240db0a 100644
--- a/drivers/i2c/busses/i2c-designware-slave.c
+++ b/drivers/i2c/busses/i2c-designware-slave.c
@@ -96,7 +96,7 @@ static int i2c_dw_unreg_slave(struct i2c_client *slave)
 	i2c_dw_disable(dev);
 	synchronize_irq(dev->irq);
 	dev->slave = NULL;
-	pm_runtime_put(dev->dev);
+	pm_runtime_put_sync_suspend(dev->dev);
 
 	return 0;
 }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-05-12 23:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-12  2:33 [1/1] i2c: designware: Ensure runtime suspend is invoked during rapid slave unregistration and registration ende.tan
2025-04-15 13:57 ` Jarkko Nikula
2025-04-20  3:31   ` EnDe Tan
2025-05-02 11:03     ` Jarkko Nikula
2025-05-05 21:48       ` Andi Shyti
2025-05-08  8:30         ` EnDe Tan
2025-05-08 11:55           ` Jarkko Nikula
2025-05-12 23:29           ` Andi Shyti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox