lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250412023303.378600-1-ende.tan@starfivetech.com>
Date: Sat, 12 Apr 2025 10:33:03 +0800
From: ende.tan@...rfivetech.com
To: linux-i2c@...r.kernel.org
Cc: jarkko.nikula@...ux.intel.com,
	andriy.shevchenko@...ux.intel.com,
	mika.westerberg@...ux.intel.com,
	jsd@...ihalf.com,
	andi.shyti@...nel.org,
	linux-kernel@...r.kernel.org,
	leyfoon.tan@...rfivetech.com,
	endeneer@...il.com,
	Tan En De <ende.tan@...rfivetech.com>
Subject: [1/1] i2c: designware: Ensure runtime suspend is invoked during rapid slave unregistration and registration

From: Tan En De <ende.tan@...rfivetech.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@...rfivetech.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ