Linux kernel staging patches
 help / color / mirror / Atom feed
* [PATCH] staging: nvec: disable i2c slave on remove
@ 2026-07-02 10:36 Balakrishnan Sambath
  2026-07-02 21:13 ` kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: Balakrishnan Sambath @ 2026-07-02 10:36 UTC (permalink / raw)
  To: Marc Dietrich, Greg Kroah-Hartman, Stephen Warren,
	Prashant Gaikwad
  Cc: ac100, linux-tegra, linux-staging, linux-kernel,
	Balakrishnan Sambath

tegra_init_i2c_slave() runs from probe and enables the i2c controller
clock with clk_prepare_enable(), and enables the interrupt.
tegra_nvec_remove() removes the mfd devices, notifier and work queues
but never calls the matching nvec_disable_i2c_slave(), so the clock's
prepare/enable count is leaked on unbind and the controller clock is
left running with no user.

The leak is only reached on driver unbind, which is why it has gone
unnoticed in normal use.

Call nvec_disable_i2c_slave() on remove, the same teardown the suspend
path already does.

Fixes: 61c3b1971ad4 ("staging: nvec: add clk_prepare/clk_unprepare")
Signed-off-by: Balakrishnan Sambath <balakrishnan.s@microchip.com>
---
 drivers/staging/nvec/nvec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
index 88c416ee0381..3869c16ad3c8 100644
--- a/drivers/staging/nvec/nvec.c
+++ b/drivers/staging/nvec/nvec.c
@@ -908,6 +908,7 @@ static void tegra_nvec_remove(struct platform_device *pdev)
 	cancel_work_sync(&nvec->tx_work);
 	if (pm_power_off == nvec_power_off)
 		pm_power_off = NULL;
+	nvec_disable_i2c_slave(nvec);
 }
 
 #ifdef CONFIG_PM_SLEEP

---
base-commit: be5c93fa674f0fc3c8f359c2143abce6bbb422e6
change-id: 20260702-contrib-nvec-clk-leak-77d573a746a6

Best regards,
-- 
Balakrishnan Sambath <balakrishnan.s@microchip.com>


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

end of thread, other threads:[~2026-07-02 21:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-02 10:36 [PATCH] staging: nvec: disable i2c slave on remove Balakrishnan Sambath
2026-07-02 21:13 ` kernel test robot

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