All of lore.kernel.org
 help / color / mirror / Atom feed
* [kkdwivedi:coroutine 1/19] arch/arm/mach-mxs/mach-mxs.c:149 mxs_get_ocotp() warn: 'ocotp_base' from of_iomap() not released on lines: 149.
@ 2026-10-13  4:09 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-10-13  4:09 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: Kumar Kartikeya Dwivedi <memxor@gmail.com>

tree:   https://github.com/kkdwivedi/linux coroutine
head:   0813a9d05d658bcd6b8f960368b4c046e24ae1c9
commit: 87bfa22937000db29a9a09ec826ab7227eaf9e8c [1/19] bpf: Reject BTF ids with the same address in tracing_multi link
:::::: branch date: 9 hours ago
:::::: commit date: 19 hours ago
config: arm-randconfig-r2202-20261012 (https://download.01.org/0day-ci/archive/20261013/202610130510.dfDBWM0r-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 16.1.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/202610130510.dfDBWM0r-lkp@intel.com/

smatch warnings:
arch/arm/mach-mxs/mach-mxs.c:149 mxs_get_ocotp() warn: 'ocotp_base' from of_iomap() not released on lines: 149.

vim +/ocotp_base +149 arch/arm/mach-mxs/mach-mxs.c

1bff2d76ac88d5 Shawn Guo 2013-03-29   85  
1bff2d76ac88d5 Shawn Guo 2013-03-29   86  static const u32 *mxs_get_ocotp(void)
1bff2d76ac88d5 Shawn Guo 2013-03-29   87  {
1bff2d76ac88d5 Shawn Guo 2013-03-29   88  	struct device_node *np;
1bff2d76ac88d5 Shawn Guo 2013-03-29   89  	void __iomem *ocotp_base;
1bff2d76ac88d5 Shawn Guo 2013-03-29   90  	int timeout = 0x400;
1bff2d76ac88d5 Shawn Guo 2013-03-29   91  	size_t i;
1bff2d76ac88d5 Shawn Guo 2013-03-29   92  	static int once;
1bff2d76ac88d5 Shawn Guo 2013-03-29   93  
1bff2d76ac88d5 Shawn Guo 2013-03-29   94  	if (once)
1bff2d76ac88d5 Shawn Guo 2013-03-29   95  		return ocotp_words;
1bff2d76ac88d5 Shawn Guo 2013-03-29   96  
1bff2d76ac88d5 Shawn Guo 2013-03-29   97  	np = of_find_compatible_node(NULL, NULL, "fsl,ocotp");
1bff2d76ac88d5 Shawn Guo 2013-03-29   98  	ocotp_base = of_iomap(np, 0);
1bff2d76ac88d5 Shawn Guo 2013-03-29   99  	WARN_ON(!ocotp_base);
1bff2d76ac88d5 Shawn Guo 2013-03-29  100  
1bff2d76ac88d5 Shawn Guo 2013-03-29  101  	mutex_lock(&ocotp_mutex);
1bff2d76ac88d5 Shawn Guo 2013-03-29  102  
1bff2d76ac88d5 Shawn Guo 2013-03-29  103  	/*
1bff2d76ac88d5 Shawn Guo 2013-03-29  104  	 * clk_enable(hbus_clk) for ocotp can be skipped
1bff2d76ac88d5 Shawn Guo 2013-03-29  105  	 * as it must be on when system is running.
1bff2d76ac88d5 Shawn Guo 2013-03-29  106  	 */
1bff2d76ac88d5 Shawn Guo 2013-03-29  107  
1bff2d76ac88d5 Shawn Guo 2013-03-29  108  	/* try to clear ERROR bit */
1bff2d76ac88d5 Shawn Guo 2013-03-29  109  	__mxs_clrl(BM_OCOTP_CTRL_ERROR, ocotp_base);
1bff2d76ac88d5 Shawn Guo 2013-03-29  110  
1bff2d76ac88d5 Shawn Guo 2013-03-29  111  	/* check both BUSY and ERROR cleared */
1bff2d76ac88d5 Shawn Guo 2013-03-29  112  	while ((__raw_readl(ocotp_base) &
1bff2d76ac88d5 Shawn Guo 2013-03-29  113  		(BM_OCOTP_CTRL_BUSY | BM_OCOTP_CTRL_ERROR)) && --timeout)
1bff2d76ac88d5 Shawn Guo 2013-03-29  114  		cpu_relax();
1bff2d76ac88d5 Shawn Guo 2013-03-29  115  
1bff2d76ac88d5 Shawn Guo 2013-03-29  116  	if (unlikely(!timeout))
1bff2d76ac88d5 Shawn Guo 2013-03-29  117  		goto error_unlock;
1bff2d76ac88d5 Shawn Guo 2013-03-29  118  
1bff2d76ac88d5 Shawn Guo 2013-03-29  119  	/* open OCOTP banks for read */
1bff2d76ac88d5 Shawn Guo 2013-03-29  120  	__mxs_setl(BM_OCOTP_CTRL_RD_BANK_OPEN, ocotp_base);
1bff2d76ac88d5 Shawn Guo 2013-03-29  121  
1bff2d76ac88d5 Shawn Guo 2013-03-29  122  	/* approximately wait 32 hclk cycles */
1bff2d76ac88d5 Shawn Guo 2013-03-29  123  	udelay(1);
1bff2d76ac88d5 Shawn Guo 2013-03-29  124  
1bff2d76ac88d5 Shawn Guo 2013-03-29  125  	/* poll BUSY bit becoming cleared */
1bff2d76ac88d5 Shawn Guo 2013-03-29  126  	timeout = 0x400;
1bff2d76ac88d5 Shawn Guo 2013-03-29  127  	while ((__raw_readl(ocotp_base) & BM_OCOTP_CTRL_BUSY) && --timeout)
1bff2d76ac88d5 Shawn Guo 2013-03-29  128  		cpu_relax();
1bff2d76ac88d5 Shawn Guo 2013-03-29  129  
1bff2d76ac88d5 Shawn Guo 2013-03-29  130  	if (unlikely(!timeout))
1bff2d76ac88d5 Shawn Guo 2013-03-29  131  		goto error_unlock;
1bff2d76ac88d5 Shawn Guo 2013-03-29  132  
1bff2d76ac88d5 Shawn Guo 2013-03-29  133  	for (i = 0; i < OCOTP_WORD_COUNT; i++)
1bff2d76ac88d5 Shawn Guo 2013-03-29  134  		ocotp_words[i] = __raw_readl(ocotp_base + OCOTP_WORD_OFFSET +
1bff2d76ac88d5 Shawn Guo 2013-03-29  135  						i * 0x10);
1bff2d76ac88d5 Shawn Guo 2013-03-29  136  
1bff2d76ac88d5 Shawn Guo 2013-03-29  137  	/* close banks for power saving */
1bff2d76ac88d5 Shawn Guo 2013-03-29  138  	__mxs_clrl(BM_OCOTP_CTRL_RD_BANK_OPEN, ocotp_base);
1bff2d76ac88d5 Shawn Guo 2013-03-29  139  
1bff2d76ac88d5 Shawn Guo 2013-03-29  140  	once = 1;
1bff2d76ac88d5 Shawn Guo 2013-03-29  141  
1bff2d76ac88d5 Shawn Guo 2013-03-29  142  	mutex_unlock(&ocotp_mutex);
1bff2d76ac88d5 Shawn Guo 2013-03-29  143  
1bff2d76ac88d5 Shawn Guo 2013-03-29  144  	return ocotp_words;
1bff2d76ac88d5 Shawn Guo 2013-03-29  145  
1bff2d76ac88d5 Shawn Guo 2013-03-29  146  error_unlock:
1bff2d76ac88d5 Shawn Guo 2013-03-29  147  	mutex_unlock(&ocotp_mutex);
1bff2d76ac88d5 Shawn Guo 2013-03-29  148  	pr_err("%s: timeout in reading OCOTP\n", __func__);
1bff2d76ac88d5 Shawn Guo 2013-03-29 @149  	return NULL;
1bff2d76ac88d5 Shawn Guo 2013-03-29  150  }
1bff2d76ac88d5 Shawn Guo 2013-03-29  151  

:::::: The code at line 149 was first introduced by commit
:::::: 1bff2d76ac88d59e45d2ba0d1103be210a9eca11 ARM: mxs: move mxs_get_ocotp() into mach-mxs.c

:::::: TO: Shawn Guo <shawn.guo@linaro.org>
:::::: CC: Shawn Guo <shawn.guo@linaro.org>

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-13  4:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-13  4:09 [kkdwivedi:coroutine 1/19] arch/arm/mach-mxs/mach-mxs.c:149 mxs_get_ocotp() warn: 'ocotp_base' from of_iomap() not released on lines: 149 kernel test robot

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.