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

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

Hi Balakrishnan,

kernel test robot noticed the following build errors:

[auto build test ERROR on be5c93fa674f0fc3c8f359c2143abce6bbb422e6]

url:    https://github.com/intel-lab-lkp/linux/commits/Balakrishnan-Sambath/staging-nvec-disable-i2c-slave-on-remove/20260702-185025
base:   be5c93fa674f0fc3c8f359c2143abce6bbb422e6
patch link:    https://lore.kernel.org/r/20260702-contrib-nvec-clk-leak-v1-1-659bcbe74e56%40microchip.com
patch subject: [PATCH] staging: nvec: disable i2c slave on remove
config: arm64-randconfig-002-20260702 (https://download.01.org/0day-ci/archive/20260703/202607030502.TdzG5XDE-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260703/202607030502.TdzG5XDE-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202607030502.TdzG5XDE-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/staging/nvec/nvec.c: In function 'tegra_nvec_remove':
>> drivers/staging/nvec/nvec.c:911:2: error: implicit declaration of function 'nvec_disable_i2c_slave'; did you mean 'disable_irq_wake'? [-Werror=implicit-function-declaration]
     nvec_disable_i2c_slave(nvec);
     ^~~~~~~~~~~~~~~~~~~~~~
     disable_irq_wake
   cc1: some warnings being treated as errors


vim +911 drivers/staging/nvec/nvec.c

   899	
   900	static void tegra_nvec_remove(struct platform_device *pdev)
   901	{
   902		struct nvec_chip *nvec = platform_get_drvdata(pdev);
   903	
   904		nvec_toggle_global_events(nvec, false);
   905		mfd_remove_devices(nvec->dev);
   906		nvec_unregister_notifier(nvec, &nvec->nvec_status_notifier);
   907		cancel_work_sync(&nvec->rx_work);
   908		cancel_work_sync(&nvec->tx_work);
   909		if (pm_power_off == nvec_power_off)
   910			pm_power_off = NULL;
 > 911		nvec_disable_i2c_slave(nvec);
   912	}
   913	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[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