All of lore.kernel.org
 help / color / mirror / Atom feed
* [broonie-regulator:for-7.5 6/6] drivers/regulator/qcom-labibb-regulator.c:444 qcom_labibb_setup_ocp_irq() warn: 'vreg->ocp_irq' from request_threaded_irq() not released on lines: 444.
@ 2026-11-26  5:56 ` Dan Carpenter
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2026-11-25 17:55 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

Unfiltered warning: this smatch report is sent as-is and has not been
reviewed for false positives, so please treat it with due skepticism.

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Yaohan Li <shunsheng1218@gmail.com>
CC: Mark Brown <broonie@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-7.5
head:   d23ba232a8fefe909aeb9366e3905a95a429ebfc
commit: d23ba232a8fefe909aeb9366e3905a95a429ebfc [6/6] regulator: qcom-labibb: stop the recovery workers on teardown
:::::: branch date: 22 hours ago
:::::: commit date: 22 hours ago
config: openrisc-randconfig-2200-20261125 (https://download.01.org/0day-ci/archive/20261125/20261125184601.R647t8Sj-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 10.5.0
smatch: v0.5.0-9187-g5189e3fb

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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/20261125184601.R647t8Sj-lkp@intel.com/

smatch warnings:
drivers/regulator/qcom-labibb-regulator.c:444 qcom_labibb_setup_ocp_irq() warn: 'vreg->ocp_irq' from request_threaded_irq() not released on lines: 444.

vim +444 drivers/regulator/qcom-labibb-regulator.c

d23ba232a8fefe9 Yaohan Li 2026-11-18  384  
d23ba232a8fefe9 Yaohan Li 2026-11-18  385  /*
d23ba232a8fefe9 Yaohan Li 2026-11-18  386   * Request the over-current interrupt once the regulator is registered.
d23ba232a8fefe9 Yaohan Li 2026-11-18  387   * Requesting it from ->set_over_current_protection() is not possible: the
d23ba232a8fefe9 Yaohan Li 2026-11-18  388   * regulator core calls that op from set_machine_constraints(), inside
d23ba232a8fefe9 Yaohan Li 2026-11-18  389   * regulator_register(), and a devres node created there is released after
d23ba232a8fefe9 Yaohan Li 2026-11-18  390   * the regulator itself.  The recovery worker would then still be runnable
d23ba232a8fefe9 Yaohan Li 2026-11-18  391   * while vreg->rdev is already gone.
d23ba232a8fefe9 Yaohan Li 2026-11-18  392   */
d23ba232a8fefe9 Yaohan Li 2026-11-18  393  static int qcom_labibb_setup_ocp_irq(struct labibb_regulator *vreg)
d23ba232a8fefe9 Yaohan Li 2026-11-18  394  {
d23ba232a8fefe9 Yaohan Li 2026-11-18  395  	u32 irq_flags = IRQF_ONESHOT;
d23ba232a8fefe9 Yaohan Li 2026-11-18  396  	int ret;
d23ba232a8fefe9 Yaohan Li 2026-11-18  397  
d23ba232a8fefe9 Yaohan Li 2026-11-18  398  	lockdep_assert_held(&vreg->ocp_lock);
d23ba232a8fefe9 Yaohan Li 2026-11-18  399  
d23ba232a8fefe9 Yaohan Li 2026-11-18  400  	if (vreg->shutting_down)
d23ba232a8fefe9 Yaohan Li 2026-11-18  401  		return -ESHUTDOWN;
d23ba232a8fefe9 Yaohan Li 2026-11-18  402  
d23ba232a8fefe9 Yaohan Li 2026-11-18  403  	if (!vreg->ocp_requested)
d23ba232a8fefe9 Yaohan Li 2026-11-18  404  		return 0;
d23ba232a8fefe9 Yaohan Li 2026-11-18  405  
d23ba232a8fefe9 Yaohan Li 2026-11-18  406  	if (!vreg->ocp_irq_done) {
d23ba232a8fefe9 Yaohan Li 2026-11-18  407  		/* IRQ polarities - LAB: trigger-low, IBB: trigger-high */
d23ba232a8fefe9 Yaohan Li 2026-11-18  408  		switch (vreg->type) {
d23ba232a8fefe9 Yaohan Li 2026-11-18  409  		case QCOM_LAB_TYPE:
d23ba232a8fefe9 Yaohan Li 2026-11-18  410  			irq_flags |= IRQF_TRIGGER_LOW;
d23ba232a8fefe9 Yaohan Li 2026-11-18  411  			break;
d23ba232a8fefe9 Yaohan Li 2026-11-18  412  		case QCOM_IBB_TYPE:
d23ba232a8fefe9 Yaohan Li 2026-11-18  413  			irq_flags |= IRQF_TRIGGER_HIGH;
d23ba232a8fefe9 Yaohan Li 2026-11-18  414  			break;
d23ba232a8fefe9 Yaohan Li 2026-11-18  415  		default:
d23ba232a8fefe9 Yaohan Li 2026-11-18  416  			return -EINVAL;
d23ba232a8fefe9 Yaohan Li 2026-11-18  417  		}
d23ba232a8fefe9 Yaohan Li 2026-11-18  418  
d23ba232a8fefe9 Yaohan Li 2026-11-18  419  		/*
d23ba232a8fefe9 Yaohan Li 2026-11-18  420  		 * The interrupt is owned and released by the cleanup
d23ba232a8fefe9 Yaohan Li 2026-11-18  421  		 * action, so its name has to outlive the interrupt:
d23ba232a8fefe9 Yaohan Li 2026-11-18  422  		 * devres would release a name allocated here before the
d23ba232a8fefe9 Yaohan Li 2026-11-18  423  		 * action runs, while vreg->desc.name is owned by the
d23ba232a8fefe9 Yaohan Li 2026-11-18  424  		 * driver data.
d23ba232a8fefe9 Yaohan Li 2026-11-18  425  		 */
d23ba232a8fefe9 Yaohan Li 2026-11-18  426  		ret = request_threaded_irq(vreg->ocp_irq, NULL,
d23ba232a8fefe9 Yaohan Li 2026-11-18  427  					   qcom_labibb_ocp_isr, irq_flags,
d23ba232a8fefe9 Yaohan Li 2026-11-18  428  					   vreg->desc.name, vreg);
d23ba232a8fefe9 Yaohan Li 2026-11-18  429  		if (ret)
d23ba232a8fefe9 Yaohan Li 2026-11-18  430  			return ret;
d23ba232a8fefe9 Yaohan Li 2026-11-18  431  
d23ba232a8fefe9 Yaohan Li 2026-11-18  432  		vreg->ocp_irq_done = true;
d23ba232a8fefe9 Yaohan Li 2026-11-18  433  	}
d23ba232a8fefe9 Yaohan Li 2026-11-18  434  
d23ba232a8fefe9 Yaohan Li 2026-11-18  435  	/*
d23ba232a8fefe9 Yaohan Li 2026-11-18  436  	 * Enable the hardware source only once a handler exists, and turn
d23ba232a8fefe9 Yaohan Li 2026-11-18  437  	 * it back off if that failed, so that a later attempt can retry
d23ba232a8fefe9 Yaohan Li 2026-11-18  438  	 * without leaving the source enabled on its own.
d23ba232a8fefe9 Yaohan Li 2026-11-18  439  	 */
d23ba232a8fefe9 Yaohan Li 2026-11-18  440  	ret = qcom_labibb_ocp_hw_enable(vreg->rdev);
d23ba232a8fefe9 Yaohan Li 2026-11-18  441  	if (ret)
d23ba232a8fefe9 Yaohan Li 2026-11-18  442  		qcom_labibb_ocp_hw_disable(vreg->rdev);
d23ba232a8fefe9 Yaohan Li 2026-11-18  443  
d23ba232a8fefe9 Yaohan Li 2026-11-18 @444  	return ret;
d23ba232a8fefe9 Yaohan Li 2026-11-18  445  }
d23ba232a8fefe9 Yaohan Li 2026-11-18  446  

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

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

end of thread, other threads:[~2026-11-27  7:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 17:55 [broonie-regulator:for-7.5 6/6] drivers/regulator/qcom-labibb-regulator.c:444 qcom_labibb_setup_ocp_irq() warn: 'vreg->ocp_irq' from request_threaded_irq() not released on lines: 444 kernel test robot
2026-11-26  5:56 ` Dan Carpenter
2026-11-26  7:16 ` Yaohan Li
2026-11-27  6:14   ` Dan Carpenter
2026-11-27  6:30     ` Dan Carpenter
2026-11-27  7:56     ` Yaohan Li

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.