lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 30 Oct 2019 07:19:13 +0800
From:   kbuild test robot <lkp@...el.com>
To:     Weiyi Lu <weiyi.lu@...iatek.com>
Cc:     kbuild-all@...ts.01.org, Nicolas Boichat <drinkcat@...omium.org>,
        Matthias Brugger <matthias.bgg@...il.com>,
        Rob Herring <robh@...nel.org>,
        James Liao <jamesjj.liao@...iatek.com>,
        Fan Chen <fan.chen@...iatek.com>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        linux-mediatek@...ts.infradead.org, srv_heupstream@...iatek.com,
        Weiyi Lu <weiyi.lu@...iatek.com>,
        Yong Wu <yong.wu@...iatek.com>
Subject: Re: [PATCH v8 09/14] soc: mediatek: Add multiple step bus protection
 control

Hi Weiyi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.4-rc5 next-20191029]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Weiyi-Lu/Mediatek-MT8183-scpsys-support/20191030-060526
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 23fdb198ae81f47a574296dab5167c5e136a02ba
config: mips-allmodconfig (attached as .config)
compiler: mips-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=mips 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@...el.com>

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   In file included from drivers/soc/mediatek/mtk-scpsys-ext.c:9:0:
   drivers/soc/mediatek/mtk-scpsys-ext.c: In function 'mtk_scpsys_ext_set_bus_protection':
>> include/linux/regmap.h:131:9: warning: 'map' may be used uninitialized in this function [-Wmaybe-uninitialized]
      __ret = regmap_read((map), (addr), &(val)); \
            ^
   drivers/soc/mediatek/mtk-scpsys-ext.c:51:18: note: 'map' was declared here
      struct regmap *map;
                     ^~~
   In file included from drivers/soc/mediatek/mtk-scpsys-ext.c:9:0:
   drivers/soc/mediatek/mtk-scpsys-ext.c: In function 'mtk_scpsys_ext_clear_bus_protection':
>> include/linux/regmap.h:131:9: warning: 'map' may be used uninitialized in this function [-Wmaybe-uninitialized]
      __ret = regmap_read((map), (addr), &(val)); \
            ^
   drivers/soc/mediatek/mtk-scpsys-ext.c:79:18: note: 'map' was declared here
      struct regmap *map;
                     ^~~
--
   In file included from drivers/soc//mediatek/mtk-scpsys-ext.c:9:0:
   drivers/soc//mediatek/mtk-scpsys-ext.c: In function 'mtk_scpsys_ext_set_bus_protection':
>> include/linux/regmap.h:131:9: warning: 'map' may be used uninitialized in this function [-Wmaybe-uninitialized]
      __ret = regmap_read((map), (addr), &(val)); \
            ^
   drivers/soc//mediatek/mtk-scpsys-ext.c:51:18: note: 'map' was declared here
      struct regmap *map;
                     ^~~
   In file included from drivers/soc//mediatek/mtk-scpsys-ext.c:9:0:
   drivers/soc//mediatek/mtk-scpsys-ext.c: In function 'mtk_scpsys_ext_clear_bus_protection':
>> include/linux/regmap.h:131:9: warning: 'map' may be used uninitialized in this function [-Wmaybe-uninitialized]
      __ret = regmap_read((map), (addr), &(val)); \
            ^
   drivers/soc//mediatek/mtk-scpsys-ext.c:79:18: note: 'map' was declared here
      struct regmap *map;
                     ^~~

vim +/map +131 include/linux/regmap.h

8019ff6cfc0440 Nariman Poushin         2015-07-16   73  
ca7a94464b5457 Kuninori Morimoto       2016-02-15   74  #define	regmap_update_bits(map, reg, mask, val) \
ca7a94464b5457 Kuninori Morimoto       2016-02-15   75  	regmap_update_bits_base(map, reg, mask, val, NULL, false, false)
30ed9cb7a49b49 Kuninori Morimoto       2016-02-15   76  #define	regmap_update_bits_async(map, reg, mask, val)\
30ed9cb7a49b49 Kuninori Morimoto       2016-02-15   77  	regmap_update_bits_base(map, reg, mask, val, NULL, true, false)
98c2dc48694a47 Kuninori Morimoto       2016-02-15   78  #define	regmap_update_bits_check(map, reg, mask, val, change)\
98c2dc48694a47 Kuninori Morimoto       2016-02-15   79  	regmap_update_bits_base(map, reg, mask, val, change, false, false)
89d8d4b833b0b2 Kuninori Morimoto       2016-02-15   80  #define	regmap_update_bits_check_async(map, reg, mask, val, change)\
89d8d4b833b0b2 Kuninori Morimoto       2016-02-15   81  	regmap_update_bits_base(map, reg, mask, val, change, true, false)
ca7a94464b5457 Kuninori Morimoto       2016-02-15   82  
b821957a5ae769 Kuninori Morimoto       2016-03-03   83  #define	regmap_write_bits(map, reg, mask, val) \
b821957a5ae769 Kuninori Morimoto       2016-03-03   84  	regmap_update_bits_base(map, reg, mask, val, NULL, false, true)
b821957a5ae769 Kuninori Morimoto       2016-03-03   85  
3674124b358946 Kuninori Morimoto       2016-02-15   86  #define	regmap_field_write(field, val) \
3674124b358946 Kuninori Morimoto       2016-02-15   87  	regmap_field_update_bits_base(field, ~0, val, NULL, false, false)
489061bba6c655 Kuninori Morimoto       2016-02-15   88  #define	regmap_field_force_write(field, val) \
489061bba6c655 Kuninori Morimoto       2016-02-15   89  	regmap_field_update_bits_base(field, ~0, val, NULL, false, true)
721ed64dda3774 Kuninori Morimoto       2016-02-15   90  #define	regmap_field_update_bits(field, mask, val)\
721ed64dda3774 Kuninori Morimoto       2016-02-15   91  	regmap_field_update_bits_base(field, mask, val, NULL, false, false)
489061bba6c655 Kuninori Morimoto       2016-02-15   92  #define	regmap_field_force_update_bits(field, mask, val) \
489061bba6c655 Kuninori Morimoto       2016-02-15   93  	regmap_field_update_bits_base(field, mask, val, NULL, false, true)
3674124b358946 Kuninori Morimoto       2016-02-15   94  
bbf2c46f46e23a Kuninori Morimoto       2016-02-15   95  #define	regmap_fields_write(field, id, val) \
bbf2c46f46e23a Kuninori Morimoto       2016-02-15   96  	regmap_fields_update_bits_base(field, id, ~0, val, NULL, false, false)
e6ef243fa4660f Kuninori Morimoto       2016-02-15   97  #define	regmap_fields_force_write(field, id, val) \
e6ef243fa4660f Kuninori Morimoto       2016-02-15   98  	regmap_fields_update_bits_base(field, id, ~0, val, NULL, false, true)
48138609135fc9 Kuninori Morimoto       2016-02-15   99  #define	regmap_fields_update_bits(field, id, mask, val)\
48138609135fc9 Kuninori Morimoto       2016-02-15  100  	regmap_fields_update_bits_base(field, id, mask, val, NULL, false, false)
e6ef243fa4660f Kuninori Morimoto       2016-02-15  101  #define	regmap_fields_force_update_bits(field, id, mask, val) \
e6ef243fa4660f Kuninori Morimoto       2016-02-15  102  	regmap_fields_update_bits_base(field, id, mask, val, NULL, false, true)
bbf2c46f46e23a Kuninori Morimoto       2016-02-15  103  
08188ba8822163 Philipp Zabel           2016-07-06  104  /**
08188ba8822163 Philipp Zabel           2016-07-06  105   * regmap_read_poll_timeout - Poll until a condition is met or a timeout occurs
2cf8e2dfdf8836 Charles Keepax          2017-01-12  106   *
08188ba8822163 Philipp Zabel           2016-07-06  107   * @map: Regmap to read from
08188ba8822163 Philipp Zabel           2016-07-06  108   * @addr: Address to poll
08188ba8822163 Philipp Zabel           2016-07-06  109   * @val: Unsigned integer variable to read the value into
08188ba8822163 Philipp Zabel           2016-07-06  110   * @cond: Break condition (usually involving @val)
08188ba8822163 Philipp Zabel           2016-07-06  111   * @sleep_us: Maximum time to sleep between reads in us (0
08188ba8822163 Philipp Zabel           2016-07-06  112   *            tight-loops).  Should be less than ~20ms since usleep_range
458f69ef36656d Mauro Carvalho Chehab   2019-06-12  113   *            is used (see Documentation/timers/timers-howto.rst).
08188ba8822163 Philipp Zabel           2016-07-06  114   * @timeout_us: Timeout in us, 0 means never timeout
08188ba8822163 Philipp Zabel           2016-07-06  115   *
08188ba8822163 Philipp Zabel           2016-07-06  116   * Returns 0 on success and -ETIMEDOUT upon a timeout or the regmap_read
08188ba8822163 Philipp Zabel           2016-07-06  117   * error return value in case of a error read. In the two former cases,
08188ba8822163 Philipp Zabel           2016-07-06  118   * the last read value at @addr is stored in @val. Must not be called
08188ba8822163 Philipp Zabel           2016-07-06  119   * from atomic context if sleep_us or timeout_us are used.
08188ba8822163 Philipp Zabel           2016-07-06  120   *
08188ba8822163 Philipp Zabel           2016-07-06  121   * This is modelled after the readx_poll_timeout macros in linux/iopoll.h.
08188ba8822163 Philipp Zabel           2016-07-06  122   */
08188ba8822163 Philipp Zabel           2016-07-06  123  #define regmap_read_poll_timeout(map, addr, val, cond, sleep_us, timeout_us) \
08188ba8822163 Philipp Zabel           2016-07-06  124  ({ \
1b0c22e45508ff Arnd Bergmann           2017-10-13  125  	u64 __timeout_us = (timeout_us); \
1b0c22e45508ff Arnd Bergmann           2017-10-13  126  	unsigned long __sleep_us = (sleep_us); \
1b0c22e45508ff Arnd Bergmann           2017-10-13  127  	ktime_t __timeout = ktime_add_us(ktime_get(), __timeout_us); \
780b1350d316fd Ramesh Shanmugasundaram 2017-07-03  128  	int __ret; \
1b0c22e45508ff Arnd Bergmann           2017-10-13  129  	might_sleep_if(__sleep_us); \
08188ba8822163 Philipp Zabel           2016-07-06  130  	for (;;) { \
780b1350d316fd Ramesh Shanmugasundaram 2017-07-03 @131  		__ret = regmap_read((map), (addr), &(val)); \
780b1350d316fd Ramesh Shanmugasundaram 2017-07-03  132  		if (__ret) \
08188ba8822163 Philipp Zabel           2016-07-06  133  			break; \
08188ba8822163 Philipp Zabel           2016-07-06  134  		if (cond) \
08188ba8822163 Philipp Zabel           2016-07-06  135  			break; \
1b0c22e45508ff Arnd Bergmann           2017-10-13  136  		if ((__timeout_us) && \
780b1350d316fd Ramesh Shanmugasundaram 2017-07-03  137  		    ktime_compare(ktime_get(), __timeout) > 0) { \
780b1350d316fd Ramesh Shanmugasundaram 2017-07-03  138  			__ret = regmap_read((map), (addr), &(val)); \
08188ba8822163 Philipp Zabel           2016-07-06  139  			break; \
08188ba8822163 Philipp Zabel           2016-07-06  140  		} \
1b0c22e45508ff Arnd Bergmann           2017-10-13  141  		if (__sleep_us) \
1b0c22e45508ff Arnd Bergmann           2017-10-13  142  			usleep_range((__sleep_us >> 2) + 1, __sleep_us); \
08188ba8822163 Philipp Zabel           2016-07-06  143  	} \
780b1350d316fd Ramesh Shanmugasundaram 2017-07-03  144  	__ret ?: ((cond) ? 0 : -ETIMEDOUT); \
08188ba8822163 Philipp Zabel           2016-07-06  145  })
08188ba8822163 Philipp Zabel           2016-07-06  146  

:::::: The code at line 131 was first introduced by commit
:::::: 780b1350d316fda28d85fcae17854c778d89cbbe regmap: Avoid namespace collision within macro & tidy up

:::::: TO: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@...renesas.com>
:::::: CC: Mark Brown <broonie@...nel.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Download attachment ".config.gz" of type "application/gzip" (62069 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ