All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: Re: [PATCH V1 6/6] spi: tegra210-quad: Introduce native DMA support
Date: Sun, 5 Jan 2025 05:00:12 +0800	[thread overview]
Message-ID: <202501050449.DliDXUbw-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20250103060407.1064107-7-va@nvidia.com>
References: <20250103060407.1064107-7-va@nvidia.com>
TO: Vishwaroop A <va@nvidia.com>
TO: thierry.reding@gmail.com
TO: jonathanh@nvidia.com
TO: skomatineni@nvidia.com
TO: ldewangan@nvidia.com
TO: broonie@kernel.org
TO: linux-spi@vger.kernel.org
TO: linux-tegra@vger.kernel.org
TO: linux-kernel@vger.kernel.org
TO: kyarlagadda@nvidia.com
TO: smangipudi@nvidia.com
CC: va@nvidia.com

Hi Vishwaroop,

kernel test robot noticed the following build warnings:

[auto build test WARNING on broonie-spi/for-next]
[also build test WARNING on robh/for-next broonie-sound/for-next linus/master v6.13-rc5 next-20241220]
[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/Vishwaroop-A/arm64-tegra-Configure-QSPI-clocks-and-add-DMA/20250103-141217
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
patch link:    https://lore.kernel.org/r/20250103060407.1064107-7-va%40nvidia.com
patch subject: [PATCH V1 6/6] spi: tegra210-quad: Introduce native DMA support
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: hexagon-randconfig-r072-20250104 (https://download.01.org/0day-ci/archive/20250105/202501050449.DliDXUbw-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 096551537b2a747a3387726ca618ceeb3950e9bc)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202501050449.DliDXUbw-lkp@intel.com/

smatch warnings:
drivers/spi/spi-tegra210-quad.c:721 tegra_qspi_start_dma_based_transfer() warn: right shifting more than type allows 32 vs 32

vim +721 drivers/spi/spi-tegra210-quad.c

921fc1838fb036 Sowjanya Komatineni 2020-12-21  616  
921fc1838fb036 Sowjanya Komatineni 2020-12-21  617  static int tegra_qspi_start_dma_based_transfer(struct tegra_qspi *tqspi, struct spi_transfer *t)
921fc1838fb036 Sowjanya Komatineni 2020-12-21  618  {
921fc1838fb036 Sowjanya Komatineni 2020-12-21  619  	struct dma_slave_config dma_sconfig = { 0 };
5c423922546fcf Vishwaroop A        2025-01-03  620  	dma_addr_t rx_dma_phys, tx_dma_phys;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  621  	unsigned int len;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  622  	u8 dma_burst;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  623  	int ret = 0;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  624  	u32 val;
5c423922546fcf Vishwaroop A        2025-01-03  625  	bool has_ext_dma = tqspi->soc_data->has_ext_dma;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  626  
921fc1838fb036 Sowjanya Komatineni 2020-12-21  627  	if (tqspi->is_packed) {
921fc1838fb036 Sowjanya Komatineni 2020-12-21  628  		ret = tegra_qspi_dma_map_xfer(tqspi, t);
921fc1838fb036 Sowjanya Komatineni 2020-12-21  629  		if (ret < 0)
921fc1838fb036 Sowjanya Komatineni 2020-12-21  630  			return ret;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  631  	}
921fc1838fb036 Sowjanya Komatineni 2020-12-21  632  
921fc1838fb036 Sowjanya Komatineni 2020-12-21  633  	val = QSPI_DMA_BLK_SET(tqspi->curr_dma_words - 1);
921fc1838fb036 Sowjanya Komatineni 2020-12-21  634  	tegra_qspi_writel(tqspi, val, QSPI_DMA_BLK);
921fc1838fb036 Sowjanya Komatineni 2020-12-21  635  
921fc1838fb036 Sowjanya Komatineni 2020-12-21  636  	tegra_qspi_unmask_irq(tqspi);
921fc1838fb036 Sowjanya Komatineni 2020-12-21  637  
921fc1838fb036 Sowjanya Komatineni 2020-12-21  638  	if (tqspi->is_packed)
921fc1838fb036 Sowjanya Komatineni 2020-12-21  639  		len = DIV_ROUND_UP(tqspi->curr_dma_words * tqspi->bytes_per_word, 4) * 4;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  640  	else
921fc1838fb036 Sowjanya Komatineni 2020-12-21  641  		len = tqspi->curr_dma_words * 4;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  642  
921fc1838fb036 Sowjanya Komatineni 2020-12-21  643  	/* set attention level based on length of transfer */
5c423922546fcf Vishwaroop A        2025-01-03  644  	if (has_ext_dma) {
921fc1838fb036 Sowjanya Komatineni 2020-12-21  645  		val = 0;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  646  		if (len & 0xf) {
921fc1838fb036 Sowjanya Komatineni 2020-12-21  647  			val |= QSPI_TX_TRIG_1 | QSPI_RX_TRIG_1;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  648  			dma_burst = 1;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  649  		} else if (((len) >> 4) & 0x1) {
921fc1838fb036 Sowjanya Komatineni 2020-12-21  650  			val |= QSPI_TX_TRIG_4 | QSPI_RX_TRIG_4;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  651  			dma_burst = 4;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  652  		} else {
921fc1838fb036 Sowjanya Komatineni 2020-12-21  653  			val |= QSPI_TX_TRIG_8 | QSPI_RX_TRIG_8;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  654  			dma_burst = 8;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  655  		}
921fc1838fb036 Sowjanya Komatineni 2020-12-21  656  
921fc1838fb036 Sowjanya Komatineni 2020-12-21  657  		tegra_qspi_writel(tqspi, val, QSPI_DMA_CTL);
5c423922546fcf Vishwaroop A        2025-01-03  658  	}
5c423922546fcf Vishwaroop A        2025-01-03  659  
921fc1838fb036 Sowjanya Komatineni 2020-12-21  660  	tqspi->dma_control_reg = val;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  661  
921fc1838fb036 Sowjanya Komatineni 2020-12-21  662  	dma_sconfig.device_fc = true;
5c423922546fcf Vishwaroop A        2025-01-03  663  
5c423922546fcf Vishwaroop A        2025-01-03  664  	if ((tqspi->cur_direction & DATA_DIR_TX)) {
5c423922546fcf Vishwaroop A        2025-01-03  665  		if (has_ext_dma) {
921fc1838fb036 Sowjanya Komatineni 2020-12-21  666  			dma_sconfig.dst_addr = tqspi->phys + QSPI_TX_FIFO;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  667  			dma_sconfig.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  668  			dma_sconfig.dst_maxburst = dma_burst;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  669  			ret = dmaengine_slave_config(tqspi->tx_dma_chan, &dma_sconfig);
921fc1838fb036 Sowjanya Komatineni 2020-12-21  670  			if (ret < 0) {
921fc1838fb036 Sowjanya Komatineni 2020-12-21  671  				dev_err(tqspi->dev, "failed DMA slave config: %d\n", ret);
921fc1838fb036 Sowjanya Komatineni 2020-12-21  672  				return ret;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  673  			}
921fc1838fb036 Sowjanya Komatineni 2020-12-21  674  
921fc1838fb036 Sowjanya Komatineni 2020-12-21  675  			tegra_qspi_copy_client_txbuf_to_qspi_txbuf(tqspi, t);
921fc1838fb036 Sowjanya Komatineni 2020-12-21  676  			ret = tegra_qspi_start_tx_dma(tqspi, t, len);
921fc1838fb036 Sowjanya Komatineni 2020-12-21  677  			if (ret < 0) {
921fc1838fb036 Sowjanya Komatineni 2020-12-21  678  				dev_err(tqspi->dev, "failed to starting TX DMA: %d\n", ret);
921fc1838fb036 Sowjanya Komatineni 2020-12-21  679  				return ret;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  680  			}
5c423922546fcf Vishwaroop A        2025-01-03  681  		} else {
5c423922546fcf Vishwaroop A        2025-01-03  682  			if (tqspi->is_packed)
5c423922546fcf Vishwaroop A        2025-01-03  683  				tx_dma_phys = t->tx_dma;
5c423922546fcf Vishwaroop A        2025-01-03  684  			else
5c423922546fcf Vishwaroop A        2025-01-03  685  				tx_dma_phys = tqspi->tx_dma_phys;
5c423922546fcf Vishwaroop A        2025-01-03  686  			tegra_qspi_copy_client_txbuf_to_qspi_txbuf(tqspi, t);
5c423922546fcf Vishwaroop A        2025-01-03  687  			tegra_qspi_writel(tqspi, lower_32_bits(tx_dma_phys),
5c423922546fcf Vishwaroop A        2025-01-03  688  					  QSPI_DMA_MEM_ADDRESS_REG);
5c423922546fcf Vishwaroop A        2025-01-03  689  			tegra_qspi_writel(tqspi, (upper_32_bits(tx_dma_phys) & 0xff),
5c423922546fcf Vishwaroop A        2025-01-03  690  					  QSPI_DMA_HI_ADDRESS_REG);
5c423922546fcf Vishwaroop A        2025-01-03  691  		}
921fc1838fb036 Sowjanya Komatineni 2020-12-21  692  	}
921fc1838fb036 Sowjanya Komatineni 2020-12-21  693  
921fc1838fb036 Sowjanya Komatineni 2020-12-21  694  	if (tqspi->cur_direction & DATA_DIR_RX) {
5c423922546fcf Vishwaroop A        2025-01-03  695  		if (has_ext_dma) {
921fc1838fb036 Sowjanya Komatineni 2020-12-21  696  			dma_sconfig.src_addr = tqspi->phys + QSPI_RX_FIFO;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  697  			dma_sconfig.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  698  			dma_sconfig.src_maxburst = dma_burst;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  699  			ret = dmaengine_slave_config(tqspi->rx_dma_chan, &dma_sconfig);
921fc1838fb036 Sowjanya Komatineni 2020-12-21  700  			if (ret < 0) {
921fc1838fb036 Sowjanya Komatineni 2020-12-21  701  				dev_err(tqspi->dev, "failed DMA slave config: %d\n", ret);
921fc1838fb036 Sowjanya Komatineni 2020-12-21  702  				return ret;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  703  			}
921fc1838fb036 Sowjanya Komatineni 2020-12-21  704  			dma_sync_single_for_device(tqspi->dev, tqspi->rx_dma_phys,
5c423922546fcf Vishwaroop A        2025-01-03  705  						   tqspi->dma_buf_size, DMA_FROM_DEVICE);
921fc1838fb036 Sowjanya Komatineni 2020-12-21  706  			ret = tegra_qspi_start_rx_dma(tqspi, t, len);
921fc1838fb036 Sowjanya Komatineni 2020-12-21  707  			if (ret < 0) {
921fc1838fb036 Sowjanya Komatineni 2020-12-21  708  				dev_err(tqspi->dev, "failed to start RX DMA: %d\n", ret);
921fc1838fb036 Sowjanya Komatineni 2020-12-21  709  				if (tqspi->cur_direction & DATA_DIR_TX)
921fc1838fb036 Sowjanya Komatineni 2020-12-21  710  					dmaengine_terminate_all(tqspi->tx_dma_chan);
921fc1838fb036 Sowjanya Komatineni 2020-12-21  711  				return ret;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  712  			}
5c423922546fcf Vishwaroop A        2025-01-03  713  		} else {
5c423922546fcf Vishwaroop A        2025-01-03  714  			if (tqspi->is_packed)
5c423922546fcf Vishwaroop A        2025-01-03  715  				rx_dma_phys = t->rx_dma;
5c423922546fcf Vishwaroop A        2025-01-03  716  			else
5c423922546fcf Vishwaroop A        2025-01-03  717  				rx_dma_phys = tqspi->rx_dma_phys;
5c423922546fcf Vishwaroop A        2025-01-03  718  
5c423922546fcf Vishwaroop A        2025-01-03  719  			tegra_qspi_writel(tqspi, (rx_dma_phys & 0xffffffff),
5c423922546fcf Vishwaroop A        2025-01-03  720  					  QSPI_DMA_MEM_ADDRESS_REG);
5c423922546fcf Vishwaroop A        2025-01-03 @721  			tegra_qspi_writel(tqspi, ((rx_dma_phys >> 32) & 0xff),
5c423922546fcf Vishwaroop A        2025-01-03  722  					  QSPI_DMA_HI_ADDRESS_REG);
5c423922546fcf Vishwaroop A        2025-01-03  723  		}
921fc1838fb036 Sowjanya Komatineni 2020-12-21  724  	}
921fc1838fb036 Sowjanya Komatineni 2020-12-21  725  
921fc1838fb036 Sowjanya Komatineni 2020-12-21  726  	tegra_qspi_writel(tqspi, tqspi->command1_reg, QSPI_COMMAND1);
921fc1838fb036 Sowjanya Komatineni 2020-12-21  727  
921fc1838fb036 Sowjanya Komatineni 2020-12-21  728  	tqspi->is_curr_dma_xfer = true;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  729  	tqspi->dma_control_reg = val;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  730  	val |= QSPI_DMA_EN;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  731  	tegra_qspi_writel(tqspi, val, QSPI_DMA_CTL);
921fc1838fb036 Sowjanya Komatineni 2020-12-21  732  
921fc1838fb036 Sowjanya Komatineni 2020-12-21  733  	return ret;
921fc1838fb036 Sowjanya Komatineni 2020-12-21  734  }
921fc1838fb036 Sowjanya Komatineni 2020-12-21  735  

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

             reply	other threads:[~2025-01-04 21:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-04 21:00 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-01-03  6:04 [PATCH 0/6] Configure Clocks, Add Native Dma support Vishwaroop A
2025-01-03  6:04 ` [PATCH V1 6/6] spi: tegra210-quad: Introduce native DMA support Vishwaroop A
2025-01-03 14:21   ` kernel test robot
2025-01-03 23:16   ` kernel test robot
2025-01-06 13:04   ` Mark Brown

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=202501050449.DliDXUbw-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.