public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Szuying Chen <chensiying21@gmail.com>,
	gregkh@linuxfoundation.org, mario.limonciello@amd.com,
	mika.westerberg@linux.intel.com, andreas.noever@gmail.com,
	michael.jamet@intel.com, YehezkelShB@gmail.com,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: kbuild-all@lists.01.org, Yd_Tseng@asmedia.com.tw,
	Chloe_Chen@asmedia.com.tw, Richard_Hsu@asmedia.com.tw
Subject: Re: [PATCH v5] thunderbolt: thunderbolt: add vendor's NVM formats
Date: Mon, 22 Aug 2022 20:33:49 +0800	[thread overview]
Message-ID: <202208222014.gb1mZ0S1-lkp@intel.com> (raw)
In-Reply-To: <20220822073105.10509-1-chensiying21@gmail.com>

Hi Szuying,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v6.0-rc2 next-20220822]
[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/Szuying-Chen/thunderbolt-thunderbolt-add-vendor-s-NVM-formats/20220822-153229
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 1c23f9e627a7b412978b4e852793c5e3c3efc555
config: openrisc-randconfig-r001-20220821 (https://download.01.org/0day-ci/archive/20220822/202208222014.gb1mZ0S1-lkp@intel.com/config)
compiler: or1k-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/abf17cfc1bbabb9346b4ca1ab723628389b773c5
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Szuying-Chen/thunderbolt-thunderbolt-add-vendor-s-NVM-formats/20220822-153229
        git checkout abf17cfc1bbabb9346b4ca1ab723628389b773c5
        # 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=openrisc SHELL=/bin/bash drivers/soc/qcom/ drivers/thunderbolt/

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

All errors (new ones prefixed by >>):

   drivers/thunderbolt/nvm.c: In function 'intel_nvm_validate':
>> drivers/thunderbolt/nvm.c:140:68: error: expected expression before ',' token
     140 |                                 DMA_PORT_CSS_ADDRESS, buf + NVM_CSS,
         |                                                                    ^


vim +140 drivers/thunderbolt/nvm.c

    94	
    95	static int  intel_nvm_validate(struct tb_switch *sw)
    96	{
    97		unsigned int image_size, hdr_size;
    98		const u8 *buf = sw->nvm->buf;
    99		u16 ds_size;
   100		int ret;
   101	
   102		image_size = sw->nvm->buf_data_size;
   103		if (image_size < NVM_MIN_SIZE || image_size > NVM_MAX_SIZE)
   104			return -EINVAL;
   105	
   106		/*
   107		 * FARB pointer must point inside the image and must at least
   108		 * contain parts of the digital section we will be reading here.
   109		 */
   110		hdr_size = (*(u32 *)buf) & 0xffffff;
   111		if (hdr_size + NVM_DEVID + 2 >= image_size)
   112			return -EINVAL;
   113	
   114		/* Digital section start should be aligned to 4k page */
   115		if (!IS_ALIGNED(hdr_size, SZ_4K))
   116			return -EINVAL;
   117	
   118		/*
   119		 * Read digital section size and check that it also fits inside
   120		 * the image.
   121		 */
   122		ds_size = *(u16 *)(buf + hdr_size);
   123		if (ds_size >= image_size)
   124			return -EINVAL;
   125	
   126		if (!sw->safe_mode) {
   127			u16 device_id;
   128	
   129			/*
   130			 * Make sure the device ID in the image matches the one
   131			 * we read from the switch config space.
   132			 */
   133			device_id = *(u16 *)(buf + hdr_size + NVM_DEVID);
   134			if (device_id != sw->config.device_id)
   135				return -EINVAL;
   136	
   137			if (sw->generation < 3) {
   138				/* Write CSS headers first */
   139				ret = dma_port_flash_write(sw->dma_port,
 > 140					DMA_PORT_CSS_ADDRESS, buf + NVM_CSS,
   141					DMA_PORT_CSS_MAX_SIZE);
   142				if (ret)
   143					return ret;
   144			}
   145	
   146			/* Skip headers in the image */
   147			buf += hdr_size;
   148			image_size -= hdr_size;
   149		}
   150	
   151		return image_size;
   152	}
   153	

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

      parent reply	other threads:[~2022-08-22 12:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-22  7:31 [PATCH v5] thunderbolt: thunderbolt: add vendor's NVM formats Szuying Chen
2022-08-22  7:43 ` Greg KH
2022-08-22  9:07 ` Mika Westerberg
2022-08-22 12:33 ` kernel test robot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202208222014.gb1mZ0S1-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Chloe_Chen@asmedia.com.tw \
    --cc=Richard_Hsu@asmedia.com.tw \
    --cc=Yd_Tseng@asmedia.com.tw \
    --cc=YehezkelShB@gmail.com \
    --cc=andreas.noever@gmail.com \
    --cc=chensiying21@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=michael.jamet@intel.com \
    --cc=mika.westerberg@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox