Subject: Re: [PATCH 6/7] can: m_can: Add ECC functionality for message RAM

From: kernel test robot <[email-masked]>
Date: Fri, 21 Oct 2022 23:28:09 +0800

Hi Vivek,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on robh/for-next]
[also build test WARNING on linus/master v6.1-rc1 next-20221021]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Vivek-Yadav/dt-bindings-Document-the-SYSREG-specific-compatibles-found-on-FSD-SoC/20221021-204010
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link:    https://lore.kernel.org/r/20221021095833.62406-7-vivek.2311%40samsung.com
patch subject: [PATCH 6/7] can: m_can: Add ECC functionality for message RAM
config: m68k-allyesconfig
compiler: m68k-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/05f01ceda6f70e1942c5530e04637da412b914da
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Vivek-Yadav/dt-bindings-Document-the-SYSREG-specific-compatibles-found-on-FSD-SoC/20221021-204010
        git checkout 05f01ceda6f70e1942c5530e04637da412b914da
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=m68k SHELL=/bin/bash drivers/net/can/m_can/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email-masked]>

All warnings (new ones prefixed by >>):

>> drivers/net/can/m_can/m_can.c:1538:5: warning: no previous prototype for 'm_can_config_mram_ecc_check' [-Wmissing-prototypes]
    1538 | int m_can_config_mram_ecc_check(struct m_can_classdev *cdev, int enable,
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/m_can_config_mram_ecc_check +1538 drivers/net/can/m_can/m_can.c

  1537	
> 1538	int m_can_config_mram_ecc_check(struct m_can_classdev *cdev, int enable,
  1539					struct device_node *np)
  1540	{
  1541		int val = 0;
  1542		int offset = 0, ret = 0;
  1543		int delay_count = MRAM_INIT_TIMEOUT;
  1544		struct m_can_mraminit *mraminit = &cdev->mraminit_sys;
  1545	
  1546		mraminit->syscon = syscon_regmap_lookup_by_phandle(np,
  1547								   "mram-ecc-cfg");
  1548		if (IS_ERR(mraminit->syscon)) {
  1549			/* can fail with -EPROBE_DEFER */
  1550			ret = PTR_ERR(mraminit->syscon);
  1551			return ret;
  1552		}
  1553	
  1554		if (of_property_read_u32_index(np, "mram-ecc-cfg", 1,
  1555					       &mraminit->reg)) {
  1556			dev_err(cdev->dev, "couldn't get the mraminit reg. offset!\n");
  1557			return -ENODEV;
  1558		}
  1559	
  1560		val = ((MRAM_ECC_ENABLE_MASK | MRAM_CFG_VALID_MASK |
  1561			MRAM_INIT_ENABLE_MASK) << offset);
  1562		regmap_clear_bits(mraminit->syscon, mraminit->reg, val);
  1563	
  1564		if (enable) {
  1565			val = (MRAM_ECC_ENABLE_MASK | MRAM_INIT_ENABLE_MASK) << offset;
  1566			regmap_set_bits(mraminit->syscon, mraminit->reg, val);
  1567		}
  1568	
  1569		/* after enable or disable valid flag need to be set*/
  1570		val = (MRAM_CFG_VALID_MASK << offset);
  1571		regmap_set_bits(mraminit->syscon, mraminit->reg, val);
  1572	
  1573		if (enable) {
  1574			do {
  1575				regmap_read(mraminit->syscon, mraminit->reg, &val);
  1576	
  1577				if (val & (MRAM_INIT_DONE_MASK << offset))
  1578					return 0;
  1579	
  1580				udelay(1);
  1581			} while (delay_count--);
  1582	
  1583			return -ENODEV;
  1584		}
  1585	
  1586		return 0;
  1587	}
  1588	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp