public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: ende.tan@starfivetech.com
To: linux-i2c@vger.kernel.org
Cc: jarkko.nikula@linux.intel.com, andriy.shevchenko@linux.intel.com,
	mika.westerberg@linux.intel.com, jsd@semihalf.com,
	andi.shyti@kernel.org, linux-kernel@vger.kernel.org,
	leyfoon.tan@starfivetech.com, endeneer@gmail.com,
	Tan En De <ende.tan@starfivetech.com>
Subject: [1/1] i2c: designware: Ensure runtime suspend is invoked during rapid slave unregistration and registration
Date: Sat, 12 Apr 2025 10:33:03 +0800	[thread overview]
Message-ID: <20250412023303.378600-1-ende.tan@starfivetech.com> (raw)

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


             reply	other threads:[~2025-04-12  4:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-12  2:33 ende.tan [this message]
2025-04-15 13:57 ` [1/1] i2c: designware: Ensure runtime suspend is invoked during rapid slave unregistration and registration 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250412023303.378600-1-ende.tan@starfivetech.com \
    --to=ende.tan@starfivetech.com \
    --cc=andi.shyti@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=endeneer@gmail.com \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=jsd@semihalf.com \
    --cc=leyfoon.tan@starfivetech.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox