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]
Message-ID: <202301080543.0SArZMRq-lkp@intel.com>
Date:   Sun, 8 Jan 2023 06:02:27 +0800
From:   kernel test robot <lkp@...el.com>
To:     William Zhang <william.zhang@...adcom.com>,
        Linux SPI List <linux-spi@...r.kernel.org>,
        Broadcom Kernel List <bcm-kernel-feedback-list@...adcom.com>
Cc:     oe-kbuild-all@...ts.linux.dev, anand.gore@...adcom.com,
        tomer.yacoby@...adcom.com, dan.beygelman@...adcom.com,
        joel.peshkin@...adcom.com, f.fainelli@...il.com,
        jonas.gorski@...il.com, kursad.oney@...adcom.com, dregan@...l.com,
        William Zhang <william.zhang@...adcom.com>,
        Mark Brown <broonie@...nel.org>,
        Rafał Miłecki <rafal@...ecki.pl>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 15/16] spi: bcmbca-hsspi: Add driver for newer HSSPI
 controller

Hi William,

I love your patch! Perhaps something to improve:

[auto build test WARNING on robh/for-next]
[also build test WARNING on broonie-spi/for-next krzk/for-next krzk-dt/for-next krzk-mem-ctrl/for-next linus/master v6.2-rc2 next-20230106]
[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/William-Zhang/dt-bindings-spi-Convert-bcm63xx-hsspi-bindings-to-json-schema/20230107-042320
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link:    https://lore.kernel.org/r/20230106200809.330769-16-william.zhang%40broadcom.com
patch subject: [PATCH 15/16] spi: bcmbca-hsspi: Add driver for newer HSSPI controller
config: ia64-randconfig-s042-20230108
compiler: ia64-linux-gcc (GCC) 12.1.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-39-gce1a6720-dirty
        # https://github.com/intel-lab-lkp/linux/commit/b4aa17674a91bffdc787dc83345cd2bce05e23a3
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review William-Zhang/dt-bindings-spi-Convert-bcm63xx-hsspi-bindings-to-json-schema/20230107-042320
        git checkout b4aa17674a91bffdc787dc83345cd2bce05e23a3
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=ia64 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=ia64 SHELL=/bin/bash drivers/spi/

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

sparse warnings: (new ones prefixed by >>)
>> drivers/spi/spi-bcmbca-hsspi.c:300:30: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned short [usertype] value @@     got restricted __be16 [usertype] @@
   drivers/spi/spi-bcmbca-hsspi.c:300:30: sparse:     expected unsigned short [usertype] value
   drivers/spi/spi-bcmbca-hsspi.c:300:30: sparse:     got restricted __be16 [usertype]

vim +300 drivers/spi/spi-bcmbca-hsspi.c

   254	
   255	static int bcmbca_hsspi_do_txrx(struct spi_device *spi, struct spi_transfer *t,
   256									struct spi_message *msg)
   257	{
   258		struct bcmbca_hsspi *bs = spi_master_get_devdata(spi->master);
   259		unsigned int chip_select = spi->chip_select;
   260		u16 opcode = 0;
   261		int pending = t->len;
   262		int step_size = HSSPI_BUFFER_LEN;
   263		const u8 *tx = t->tx_buf;
   264		u8 *rx = t->rx_buf;
   265		u32 reg = 0, cs_act = 0;
   266	
   267		bcmbca_hsspi_set_clk(bs, spi, t->speed_hz);
   268	
   269		if (tx && rx)
   270			opcode = HSSPI_OP_READ_WRITE;
   271		else if (tx)
   272			opcode = HSSPI_OP_WRITE;
   273		else if (rx)
   274			opcode = HSSPI_OP_READ;
   275	
   276		if (opcode != HSSPI_OP_READ)
   277			step_size -= HSSPI_OPCODE_LEN;
   278	
   279		if ((opcode == HSSPI_OP_READ && t->rx_nbits == SPI_NBITS_DUAL) ||
   280		    (opcode == HSSPI_OP_WRITE && t->tx_nbits == SPI_NBITS_DUAL)) {
   281			opcode |= HSSPI_OP_MULTIBIT;
   282	
   283			if (t->rx_nbits == SPI_NBITS_DUAL)
   284				reg |= 1 << MODE_CTRL_MULTIDATA_RD_SIZE_SHIFT;
   285			if (t->tx_nbits == SPI_NBITS_DUAL)
   286				reg |= 1 << MODE_CTRL_MULTIDATA_WR_SIZE_SHIFT;
   287		}
   288	
   289		__raw_writel(reg | 0xff,
   290			     bs->regs + HSSPI_PROFILE_MODE_CTRL_REG(chip_select));
   291	
   292		while (pending > 0) {
   293			int curr_step = min_t(int, step_size, pending);
   294	
   295			reinit_completion(&bs->done);
   296			if (tx) {
   297				memcpy_toio(bs->fifo + HSSPI_OPCODE_LEN, tx, curr_step);
   298				tx += curr_step;
   299			}
 > 300			__raw_writew(cpu_to_be16(opcode | curr_step), bs->fifo);
   301	
   302			/* enable interrupt */
   303			if (bs->irq > 0)
   304				__raw_writel(HSSPI_PINGx_CMD_DONE(0),
   305				    bs->regs + HSSPI_INT_MASK_REG);
   306	
   307			if (!cs_act) {
   308				bcmbca_hsspi_set_cs(bs, chip_select, true);
   309				cs_act = 1;
   310			}
   311			reg = chip_select << PINGPONG_CMD_SS_SHIFT |
   312				    chip_select << PINGPONG_CMD_PROFILE_SHIFT |
   313				    PINGPONG_COMMAND_START_NOW;
   314			__raw_writel(reg, bs->regs + HSSPI_PINGPONG_COMMAND_REG(0));
   315	
   316			if (bcmbca_hsspi_wait_cmd(bs, spi->chip_select))
   317				return -ETIMEDOUT;
   318	
   319			pending -= curr_step;
   320			if (pending == 0) {
   321				if (list_is_last(&t->transfer_list, &msg->transfers)) {
   322					if (!t->cs_change)
   323						bcmbca_hsspi_set_cs(bs, spi->chip_select, false);
   324				} else {
   325					if (t->cs_change) {
   326						bcmbca_hsspi_set_cs(bs, spi->chip_select, false);
   327						udelay(10);
   328						bcmbca_hsspi_set_cs(bs, spi->chip_select, true);
   329					}
   330				}
   331			}
   332			if (rx) {
   333				memcpy_fromio(rx, bs->fifo, curr_step);
   334				rx += curr_step;
   335			}
   336		}
   337	
   338		return 0;
   339	}
   340	

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

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ