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] [day] [month] [year] [list]
Message-ID: <202212072253.UeKPqhxU-lkp@intel.com>
Date:   Wed, 7 Dec 2022 22:30:16 +0800
From:   kernel test robot <lkp@...el.com>
To:     David Collins <quic_collinsd@...cinc.com>,
        Amit Kucheria <amitk@...nel.org>,
        Thara Gopinath <thara.gopinath@...il.com>,
        Andy Gross <agross@...nel.org>,
        Bjorn Andersson <bjorn.andersson@...aro.org>
Cc:     llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
        David Collins <quic_collinsd@...cinc.com>,
        Konrad Dybcio <konrad.dybcio@...ainline.org>,
        "Rafael J . Wysocki" <rafael@...nel.org>,
        Daniel Lezcano <daniel.lezcano@...aro.org>,
        Zhang Rui <rui.zhang@...el.com>, linux-arm-msm@...r.kernel.org,
        linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 3/3] thermal: qcom-spmi-temp-alarm: add support for
 LITE PMIC peripherals

Hi David,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on rafael-pm/thermal]
[also build test ERROR on linus/master v6.1-rc8 next-20221207]
[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/David-Collins/thermal-qcom-spmi-temp-alarm-add-support-for-new-TEMP_ALARM-subtypes/20221207-100725
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git thermal
patch link:    https://lore.kernel.org/r/fa5b6b7a88b23f3efb15f4da4a2fdfa6e6d57cb2.1670375556.git.quic_collinsd%40quicinc.com
patch subject: [PATCH v2 3/3] thermal: qcom-spmi-temp-alarm: add support for LITE PMIC peripherals
config: hexagon-randconfig-r036-20221207
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 6e4cea55f0d1104408b26ac574566a0e4de48036)
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/e0a2cf4754a17500d98226eb7fa3e10822bd497b
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review David-Collins/thermal-qcom-spmi-temp-alarm-add-support-for-new-TEMP_ALARM-subtypes/20221207-100725
        git checkout e0a2cf4754a17500d98226eb7fa3e10822bd497b
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/thermal/qcom/

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

All errors (new ones prefixed by >>):

   In file included from drivers/thermal/qcom/qcom-spmi-temp-alarm.c:11:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/hexagon/include/asm/io.h:334:
   include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __raw_readb(PCI_IOBASE + addr);
                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
   #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
                                                     ^
   In file included from drivers/thermal/qcom/qcom-spmi-temp-alarm.c:11:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/hexagon/include/asm/io.h:334:
   include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                                                     ^
   In file included from drivers/thermal/qcom/qcom-spmi-temp-alarm.c:11:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/hexagon/include/asm/io.h:334:
   include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writeb(value, PCI_IOBASE + addr);
                               ~~~~~~~~~~ ^
   include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
>> drivers/thermal/qcom/qcom-spmi-temp-alarm.c:374:9: error: call to undeclared function 'FIELD_PREP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
           reg |= FIELD_PREP(LITE_TEMP_CFG_THRESHOLD_MASK, thresh);
                  ^
>> drivers/thermal/qcom/qcom-spmi-temp-alarm.c:648:11: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
           thresh = FIELD_GET(LITE_TEMP_CFG_THRESHOLD_MASK, reg);
                    ^
   6 warnings and 2 errors generated.


vim +/FIELD_PREP +374 drivers/thermal/qcom/qcom-spmi-temp-alarm.c

   314	
   315	static int qpnp_tm_set_temp_lite_thresh(struct qpnp_tm_chip *chip, int trip,
   316					       int temp)
   317	{
   318		int ret, temp_cfg, i;
   319		const long *temp_map;
   320		u16 addr;
   321		u8 reg, thresh;
   322	
   323		if (trip < 0 || trip >= STAGE_COUNT) {
   324			dev_err(chip->dev, "invalid TEMP_LITE trip = %d\n", trip);
   325			return -EINVAL;
   326		}
   327	
   328		switch (trip) {
   329		case 0:
   330			temp_map = temp_map_lite_warning;
   331			addr = QPNP_TM_REG_LITE_TEMP_CFG1;
   332			break;
   333		case 1:
   334			/*
   335			 * The second trip point is purely in software to facilitate
   336			 * a controlled shutdown after the warning threshold is crossed
   337			 * but before the automatic hardware shutdown threshold is
   338			 * crossed.
   339			 */
   340			return 0;
   341		case 2:
   342			temp_map = temp_map_lite_shutdown;
   343			addr = QPNP_TM_REG_LITE_TEMP_CFG2;
   344			break;
   345		default:
   346			return 0;
   347		}
   348	
   349		if (temp < temp_map[THRESH_MIN] || temp > temp_map[THRESH_MAX]) {
   350			dev_err(chip->dev, "invalid TEMP_LITE temp = %d\n", temp);
   351			return -EINVAL;
   352		}
   353	
   354		thresh = 0;
   355		temp_cfg = temp_map[thresh];
   356		for (i = THRESH_MAX; i >= THRESH_MIN; i--) {
   357			if (temp >= temp_map[i]) {
   358				thresh = i;
   359				temp_cfg = temp_map[i];
   360				break;
   361			}
   362		}
   363	
   364		if (temp_cfg == chip->temp_dac_map[trip])
   365			return 0;
   366	
   367		ret = qpnp_tm_read(chip, addr, &reg);
   368		if (ret < 0) {
   369			dev_err(chip->dev, "LITE_TEMP_CFG read failed, ret=%d\n", ret);
   370			return ret;
   371		}
   372	
   373		reg &= ~LITE_TEMP_CFG_THRESHOLD_MASK;
 > 374		reg |= FIELD_PREP(LITE_TEMP_CFG_THRESHOLD_MASK, thresh);
   375	
   376		ret = qpnp_tm_write(chip, addr, reg);
   377		if (ret < 0) {
   378			dev_err(chip->dev, "LITE_TEMP_CFG write failed, ret=%d\n", ret);
   379			return ret;
   380		}
   381	
   382		chip->temp_dac_map[trip] = temp_cfg;
   383	
   384		return 0;
   385	}
   386	

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

View attachment "config" of type "text/plain" (134679 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ