All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] Configure Clocks, Add Native Dma support.
@ 2025-01-03  6:04 Vishwaroop A
  2025-01-03  6:04 ` [PATCH V1 1/6] arm64: tegra: Configure QSPI clocks and add DMA Vishwaroop A
                   ` (5 more replies)
  0 siblings, 6 replies; 31+ messages in thread
From: Vishwaroop A @ 2025-01-03  6:04 UTC (permalink / raw)
  To: thierry.reding, jonathanh, skomatineni, ldewangan, broonie,
	linux-spi, linux-tegra, linux-kernel, kyarlagadda, smangipudi
  Cc: va

This patch series configures qspi clocks, fixes combined sequence
programming and introduces native dma support. 

Vishwaroop A (6):
  arm64: tegra: Configure QSPI clocks and add DMA
  spi: tegra210-quad: Update dummy sequence configuration
  spi: tegra210-quad: Fix X1_X2_X4 encoding and support x4 transfers
  spi: tegra210-quad: remove redundant error handling code
  spi: tegra210-quad: modify chip select (CS) deactivation
  spi: tegra210-quad: Introduce native DMA support

 arch/arm64/boot/dts/nvidia/tegra234.dtsi |  14 ++
 drivers/spi/spi-tegra210-quad.c          | 273 +++++++++++++----------
 2 files changed, 174 insertions(+), 113 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 31+ messages in thread
* Re: [PATCH V1 6/6] spi: tegra210-quad: Introduce native DMA support
@ 2025-01-04 21:00 kernel test robot
  0 siblings, 0 replies; 31+ messages in thread
From: kernel test robot @ 2025-01-04 21:00 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

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

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2025-03-07 13:28 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-03  6:04 [PATCH 0/6] Configure Clocks, Add Native Dma support Vishwaroop A
2025-01-03  6:04 ` [PATCH V1 1/6] arm64: tegra: Configure QSPI clocks and add DMA Vishwaroop A
2025-01-09 10:40   ` Thierry Reding
2025-02-12 14:39     ` Vishwaroop A
2025-03-07 13:28       ` Jon Hunter
2025-02-12 14:46     ` [PATCH v2 0/6] Configure Clocks, Add Native Dma support Vishwaroop A
2025-02-12 14:46       ` [PATCH v2 1/6] arm64: tegra: Configure QSPI clocks and add DMA Vishwaroop A
2025-02-27 10:39         ` Thierry Reding
2025-02-27 11:13         ` Jon Hunter
2025-02-12 14:46       ` [PATCH v2 2/6] spi: tegra210-quad: Update dummy sequence configuration Vishwaroop A
2025-02-27 10:42         ` Thierry Reding
2025-02-12 14:46       ` [PATCH v2 3/6] spi: tegra210-quad: Fix X1_X2_X4 encoding and support x4 transfers Vishwaroop A
2025-02-27 10:45         ` Thierry Reding
2025-02-12 14:46       ` [PATCH v2 4/6] spi: tegra210-quad: remove redundant error handling code Vishwaroop A
2025-02-27 10:45         ` Thierry Reding
2025-02-12 14:46       ` [PATCH v2 5/6] spi: tegra210-quad: modify chip select (CS) deactivation Vishwaroop A
2025-02-27 10:46         ` Thierry Reding
2025-02-12 14:46       ` [PATCH v2 6/6] spi: tegra210-quad: Introduce native DMA support Vishwaroop A
2025-02-27 11:14         ` Thierry Reding
2025-02-27 11:17         ` Jon Hunter
2025-02-12 22:08       ` [PATCH v2 0/6] Configure Clocks, Add Native Dma support Rob Herring (Arm)
2025-02-27 11:09       ` Jon Hunter
2025-01-03  6:04 ` [PATCH V1 2/6] spi: tegra210-quad: Update dummy sequence configuration Vishwaroop A
2025-01-03  6:04 ` [PATCH V1 3/6] spi: tegra210-quad: Fix X1_X2_X4 encoding and support x4 transfers Vishwaroop A
2025-01-03  6:04 ` [PATCH V1 4/6] spi: tegra210-quad: remove redundant error handling code Vishwaroop A
2025-01-03  6:04 ` [PATCH V1 5/6] spi: tegra210-quad: modify chip select (CS) deactivation 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
  -- strict thread matches above, loose matches on Subject: below --
2025-01-04 21:00 kernel test robot

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.