Skip to contentSkip to conversation

Few Tegra210 ADMA fixes

PATCH RESEND In review Sameer Pujar 4 participants 11 messages Sep 15, 2021 – Oct 18, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Few Tegra210 ADMA fixes

Following are the fixes in the series:
- Couple of minor fixes (non functional fixes)

- ADMA FIFO size fix: The slave ADMAIF channels have different default FIFO sizes (ADMAIF FIFO is actually a ring buffer and it is divided amongst all available channels). As per HW recommendation the sizes should match with the corresponding ADMA channels to which ADMAIF channel is mapped to at runtime. Thus program ADMA channel FIFO sizes accordingly. Otherwise FIFO corruption is observed.

Sameer Pujar (3):
dmaengine: tegra210-adma: Re-order 'has_outstanding_reqs' member
dmaengine: tegra210-adma: Add description for 'adma_get_burst_config'
dmaengine: tegra210-adma: Override ADMA FIFO size

 drivers/dma/tegra210-adma.c | 55 +++++++++++++++++++++++++++++++--------------
 1 file changed, 38 insertions(+), 17 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH RESEND 1/3 dmaengine: tegra210-adma: Re-order 'has_outstanding_reqs' member

The 'has_outstanding_reqs' member description order in structure 'tegra_adma_chip_data' does not match with the corresponding member declaration. The same is true for member assignment in chip data structures declared for Tegra210 and Tegra186.

This is a trivial fix to re-order the mentioned member for a better readability.

Fixes 9ec691f48b5e ("dmaengine: tegra210-adma: fix transfer failure")
---
 drivers/dma/tegra210-adma.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/dma/tegra210-adma.c +3 -3
index b1115a6..caf200e 100644
@@ -78,12 +78,12 @@ struct tegra_adma;
  * @ch_req_tx_shift: Register offset for AHUB transmit channel select.
  * @ch_req_rx_shift: Register offset for AHUB receive channel select.
  * @ch_base_offset: Register offset of DMA channel registers.
- * @has_outstanding_reqs: If DMA channel can have outstanding requests.
  * @ch_fifo_ctrl: Default value for channel FIFO CTRL register.
  * @ch_req_mask: Mask for Tx or Rx channel select.
  * @ch_req_max: Maximum number of Tx or Rx channels available.
  * @ch_reg_size: Size of DMA channel register space.
  * @nr_channels: Number of DMA channels available.
+ * @has_outstanding_reqs: If DMA channel can have outstanding requests.
  */
 struct tegra_adma_chip_data {
 	unsigned int (*adma_get_burst_config)(unsigned int burst_size);
@@ -782,12 +782,12 @@ static const struct tegra_adma_chip_data tegra210_chip_data = {
 	.ch_req_tx_shift	= 28,
 	.ch_req_rx_shift	= 24,
 	.ch_base_offset		= 0,
-	.has_outstanding_reqs	= false,
 	.ch_fifo_ctrl		= TEGRA210_FIFO_CTRL_DEFAULT,
 	.ch_req_mask		= 0xf,
 	.ch_req_max		= 10,
 	.ch_reg_size		= 0x80,
 	.nr_channels		= 22,
+	.has_outstanding_reqs	= false,
 };
 
 static const struct tegra_adma_chip_data tegra186_chip_data = {
@@ -797,12 +797,12 @@ static const struct tegra_adma_chip_data tegra186_chip_data = {
 	.ch_req_tx_shift	= 27,
 	.ch_req_rx_shift	= 22,
 	.ch_base_offset		= 0x10000,
-	.has_outstanding_reqs	= true,
 	.ch_fifo_ctrl		= TEGRA186_FIFO_CTRL_DEFAULT,
 	.ch_req_mask		= 0x1f,
 	.ch_req_max		= 20,
 	.ch_reg_size		= 0x100,
 	.nr_channels		= 32,
+	.has_outstanding_reqs	= true,
 };
 
 static const struct of_device_id tegra_adma_of_match[] = {
Signature · 1 line
2.7.4
maintainer Reviewed-by on v1 1/3
#2 lore raw

Re: [RESEND PATCH 1/3] dmaengine: tegra210-adma: Re-order 'has_outstanding_reqs' member

Quoted 51 lines · Sameer Pujar

The 'has_outstanding_reqs' member description order in structure 'tegra_adma_chip_data' does not match with the corresponding member declaration. The same is true for member assignment in chip data structures declared for Tegra210 and Tegra186.

This is a trivial fix to re-order the mentioned member for a better readability.

Fixes 9ec691f48b5e ("dmaengine: tegra210-adma: fix transfer failure")
---
  drivers/dma/tegra210-adma.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/dma/tegra210-adma.c +2 -2
index b1115a6..caf200e 100644
@@ -78,12 +78,12 @@ struct tegra_adma;
   * @ch_req_tx_shift: Register offset for AHUB transmit channel select.
   * @ch_req_rx_shift: Register offset for AHUB receive channel select.
   * @ch_base_offset: Register offset of DMA channel registers.
- * @has_outstanding_reqs: If DMA channel can have outstanding requests.
   * @ch_fifo_ctrl: Default value for channel FIFO CTRL register.
   * @ch_req_mask: Mask for Tx or Rx channel select.
   * @ch_req_max: Maximum number of Tx or Rx channels available.
   * @ch_reg_size: Size of DMA channel register space.
   * @nr_channels: Number of DMA channels available.
+ * @has_outstanding_reqs: If DMA channel can have outstanding requests.
   */
  struct tegra_adma_chip_data {
  	unsigned int (*adma_get_burst_config)(unsigned int burst_size);
@@ -782,12 +782,12 @@ static const struct tegra_adma_chip_data tegra210_chip_data = {
  	.ch_req_tx_shift	= 28,
  	.ch_req_rx_shift	= 24,
  	.ch_base_offset		= 0,
-	.has_outstanding_reqs	= false,
  	.ch_fifo_ctrl		= TEGRA210_FIFO_CTRL_DEFAULT,
  	.ch_req_mask		= 0xf,
  	.ch_req_max		= 10,
  	.ch_reg_size		= 0x80,
  	.nr_channels		= 22,
+	.has_outstanding_reqs	= false,
  };
 
  static const struct tegra_adma_chip_data tegra186_chip_data = {
@@ -797,12 +797,12 @@ static const struct tegra_adma_chip_data tegra186_chip_data = {
  	.ch_req_tx_shift	= 27,
  	.ch_req_rx_shift	= 22,
  	.ch_base_offset		= 0x10000,

drivers/dma/tegra210-adma.c static const struct tegra_adma_chip_data tegra186_chip_data = { · line 808

Quoted 10 lines
drivers/dma/tegra210-adma.c +1 -1
-	.has_outstanding_reqs	= true,
  	.ch_fifo_ctrl		= TEGRA186_FIFO_CTRL_DEFAULT,
  	.ch_req_mask		= 0x1f,
  	.ch_req_max		= 20,
  	.ch_reg_size		= 0x100,
  	.nr_channels		= 32,
+	.has_outstanding_reqs	= true,
  };
 
  static const struct of_device_id tegra_adma_of_match[] = {

Cheers
Jon

Signature · 1 line
nvpublic
#3 lore raw

PATCH RESEND 2/3 dmaengine: tegra210-adma: Add description for 'adma_get_burst_config'

In reply to Sameer Pujar

Trivial change to add description for 'adma_get_burst_config' in chip data structure.

Fixes 433de642a76c ("dmaengine: tegra210-adma: add support for Tegra186/Tegra194")
---
 drivers/dma/tegra210-adma.c | 1 +
 1 file changed, 1 insertion(+)
drivers/dma/tegra210-adma.c +1 -0
index caf200e..03f9776 100644
@@ -73,6 +73,7 @@ struct tegra_adma;
 
 /*
  * struct tegra_adma_chip_data - Tegra chip specific data
+ * @adma_get_burst_config: Function callback used to set DMA burst size.
  * @global_reg_offset: Register offset of DMA global register.
  * @global_int_clear: Register offset of DMA global interrupt clear.
  * @ch_req_tx_shift: Register offset for AHUB transmit channel select.
Signature · 1 line
2.7.4
maintainer Reviewed-by on v1 2/3
#4 lore raw

Re: [RESEND PATCH 2/3] dmaengine: tegra210-adma: Add description for 'adma_get_burst_config'

Quoted 15 lines · Sameer Pujar

Trivial change to add description for 'adma_get_burst_config' in chip data structure.

Fixes 433de642a76c ("dmaengine: tegra210-adma: add support for Tegra186/Tegra194")
---
  drivers/dma/tegra210-adma.c | 1 +
  1 file changed, 1 insertion(+)
drivers/dma/tegra210-adma.c +0 -0
index caf200e..03f9776 100644

drivers/dma/tegra210-adma.c struct tegra_adma; · line 79

Quoted 7 lines
drivers/dma/tegra210-adma.c +1 -0
@@ -73,6 +73,7 @@ struct tegra_adma;
 
  /*
   * struct tegra_adma_chip_data - Tegra chip specific data
+ * @adma_get_burst_config: Function callback used to set DMA burst size.
   * @global_reg_offset: Register offset of DMA global register.
   * @global_int_clear: Register offset of DMA global interrupt clear.
   * @ch_req_tx_shift: Register offset for AHUB transmit channel select.

Cheers
Jon

Signature · 1 line
nvpublic
#5 lore raw

PATCH RESEND 3/3 dmaengine: tegra210-adma: Override ADMA FIFO size

In reply to Sameer Pujar

ADMAIF FIFO uses a ring buffer and it is divided amongst the available channels. The default FIFO size (in multiples of 16 words) of ADMAIF TX/RX channels is as below:
* On Tegra210,
channel 1 to 2 : size = 3
channel 3 to 10: size = 2
* On Tegra186 and later,
channel 1 to 4 : size = 3
channel 5 to 20: size = 2

As per recommendation from HW, FIFO size of ADMA channel should be same as the corresponding ADMAIF channel it maps to. FIFO corruption is observed if the sizes do not match. We are using the default FIFO sizes for ADMAIF and there is no plan to support any custom values.

Thus at runtime, override the ADMA channel FIFO size value depending on the corresponding ADMAIF channel.

Fixes 9ab59bf5dd63 ("dmaengine: tegra210-adma: Fix channel FIFO configuration")
---
 drivers/dma/tegra210-adma.c | 48 ++++++++++++++++++++++++++++++++-------------
 1 file changed, 34 insertions(+), 14 deletions(-)
drivers/dma/tegra210-adma.c +34 -14
index 03f9776..911533c 100644
@@ -43,10 +43,8 @@
 #define TEGRA186_ADMA_CH_CONFIG_OUTSTANDING_REQS(reqs)	(reqs << 4)
 
 #define ADMA_CH_FIFO_CTRL				0x2c
-#define TEGRA210_ADMA_CH_FIFO_CTRL_TXSIZE(val)		(((val) & 0xf) << 8)
-#define TEGRA210_ADMA_CH_FIFO_CTRL_RXSIZE(val)		((val) & 0xf)
-#define TEGRA186_ADMA_CH_FIFO_CTRL_TXSIZE(val)		(((val) & 0x1f) << 8)
-#define TEGRA186_ADMA_CH_FIFO_CTRL_RXSIZE(val)		((val) & 0x1f)
+#define ADMA_CH_TX_FIFO_SIZE_SHIFT			8
+#define ADMA_CH_RX_FIFO_SIZE_SHIFT			0
 
 #define ADMA_CH_LOWER_SRC_ADDR				0x34
 #define ADMA_CH_LOWER_TRG_ADDR				0x3c
@@ -61,12 +59,6 @@
 
 #define TEGRA_ADMA_BURST_COMPLETE_TIME			20
 
-#define TEGRA210_FIFO_CTRL_DEFAULT (TEGRA210_ADMA_CH_FIFO_CTRL_TXSIZE(3) | \
-				    TEGRA210_ADMA_CH_FIFO_CTRL_RXSIZE(3))
-
-#define TEGRA186_FIFO_CTRL_DEFAULT (TEGRA186_ADMA_CH_FIFO_CTRL_TXSIZE(3) | \
-				    TEGRA186_ADMA_CH_FIFO_CTRL_RXSIZE(3))
-
 #define ADMA_CH_REG_FIELD_VAL(val, mask, shift)	(((val) & mask) << shift)
 
 struct tegra_adma;
@@ -84,6 +76,8 @@ struct tegra_adma;
  * @ch_req_max: Maximum number of Tx or Rx channels available.
  * @ch_reg_size: Size of DMA channel register space.
  * @nr_channels: Number of DMA channels available.
+ * @ch_fifo_size_mask: Mask for FIFO size field.
+ * @sreq_index_offset: Slave channel index offset.
  * @has_outstanding_reqs: If DMA channel can have outstanding requests.
  */
 struct tegra_adma_chip_data {
@@ -98,6 +92,8 @@ struct tegra_adma_chip_data {
 	unsigned int ch_req_max;
 	unsigned int ch_reg_size;
 	unsigned int nr_channels;
+	unsigned int ch_fifo_size_mask;
+	unsigned int sreq_index_offset;
 	bool has_outstanding_reqs;
 };
 
@@ -561,13 +557,14 @@ static int tegra_adma_set_xfer_params(struct tegra_adma_chan *tdc,
 {
 	struct tegra_adma_chan_regs *ch_regs = &desc->ch_regs;
 	const struct tegra_adma_chip_data *cdata = tdc->tdma->cdata;
-	unsigned int burst_size, adma_dir;
+	unsigned int burst_size, adma_dir, fifo_size_shift;
 
 	if (desc->num_periods > ADMA_CH_CONFIG_MAX_BUFS)
 		return -EINVAL;
 
 	switch (direction) {
 	case DMA_MEM_TO_DEV:
+		fifo_size_shift = ADMA_CH_TX_FIFO_SIZE_SHIFT;
 		adma_dir = ADMA_CH_CTRL_DIR_MEM2AHUB;
 		burst_size = tdc->sconfig.dst_maxburst;
 		ch_regs->config = ADMA_CH_CONFIG_SRC_BUF(desc->num_periods - 1);
@@ -578,6 +575,7 @@ static int tegra_adma_set_xfer_params(struct tegra_adma_chan *tdc,
 		break;
 
 	case DMA_DEV_TO_MEM:
+		fifo_size_shift = ADMA_CH_RX_FIFO_SIZE_SHIFT;
 		adma_dir = ADMA_CH_CTRL_DIR_AHUB2MEM;
 		burst_size = tdc->sconfig.src_maxburst;
 		ch_regs->config = ADMA_CH_CONFIG_TRG_BUF(desc->num_periods - 1);
@@ -599,7 +597,27 @@ static int tegra_adma_set_xfer_params(struct tegra_adma_chan *tdc,
 	ch_regs->config |= ADMA_CH_CONFIG_WEIGHT_FOR_WRR(1);
 	if (cdata->has_outstanding_reqs)
 		ch_regs->config |= TEGRA186_ADMA_CH_CONFIG_OUTSTANDING_REQS(8);
-	ch_regs->fifo_ctrl = cdata->ch_fifo_ctrl;
+
+	/*
+	 * 'sreq_index' represents the current ADMAIF channel number and as per
+	 * HW recommendation its FIFO size should match with the corresponding
+	 * ADMA channel.
+	 *
+	 * ADMA FIFO size is set as per below (based on default ADMAIF channel
+	 * FIFO sizes):
+	 *    fifo_size = 0x2 (sreq_index > sreq_index_offset)
+	 *    fifo_size = 0x3 (sreq_index <= sreq_index_offset)
+	 *
+	 */
+	if (tdc->sreq_index > cdata->sreq_index_offset)
+		ch_regs->fifo_ctrl =
+			ADMA_CH_REG_FIELD_VAL(2, cdata->ch_fifo_size_mask,
+					      fifo_size_shift);
+	else
+		ch_regs->fifo_ctrl =
+			ADMA_CH_REG_FIELD_VAL(3, cdata->ch_fifo_size_mask,
+					      fifo_size_shift);
+
 	ch_regs->tc = desc->period_len & ADMA_CH_TC_COUNT_MASK;
 
 	return tegra_adma_request_alloc(tdc, direction);
@@ -783,11 +801,12 @@ static const struct tegra_adma_chip_data tegra210_chip_data = {
 	.ch_req_tx_shift	= 28,
 	.ch_req_rx_shift	= 24,
 	.ch_base_offset		= 0,
-	.ch_fifo_ctrl		= TEGRA210_FIFO_CTRL_DEFAULT,
 	.ch_req_mask		= 0xf,
 	.ch_req_max		= 10,
 	.ch_reg_size		= 0x80,
 	.nr_channels		= 22,
+	.ch_fifo_size_mask	= 0xf,
+	.sreq_index_offset	= 2,
 	.has_outstanding_reqs	= false,
 };
 
@@ -798,11 +817,12 @@ static const struct tegra_adma_chip_data tegra186_chip_data = {
 	.ch_req_tx_shift	= 27,
 	.ch_req_rx_shift	= 22,
 	.ch_base_offset		= 0x10000,
-	.ch_fifo_ctrl		= TEGRA186_FIFO_CTRL_DEFAULT,
 	.ch_req_mask		= 0x1f,
 	.ch_req_max		= 20,
 	.ch_reg_size		= 0x100,
 	.nr_channels		= 32,
+	.ch_fifo_size_mask	= 0x1f,
+	.sreq_index_offset	= 4,
 	.has_outstanding_reqs	= true,
 };
 
Signature · 1 line
2.7.4
maintainer Reviewed-by on v1 3/3
#6 lore raw

Re: [RESEND PATCH 3/3] dmaengine: tegra210-adma: Override ADMA FIFO size

Quoted 142 lines · Sameer Pujar

ADMAIF FIFO uses a ring buffer and it is divided amongst the available channels. The default FIFO size (in multiples of 16 words) of ADMAIF TX/RX channels is as below:
* On Tegra210,
channel 1 to 2 : size = 3
channel 3 to 10: size = 2
* On Tegra186 and later,
channel 1 to 4 : size = 3
channel 5 to 20: size = 2

As per recommendation from HW, FIFO size of ADMA channel should be same as the corresponding ADMAIF channel it maps to. FIFO corruption is observed if the sizes do not match. We are using the default FIFO sizes for ADMAIF and there is no plan to support any custom values.

Thus at runtime, override the ADMA channel FIFO size value depending on the corresponding ADMAIF channel.

Fixes 9ab59bf5dd63 ("dmaengine: tegra210-adma: Fix channel FIFO configuration")
---
  drivers/dma/tegra210-adma.c | 48 ++++++++++++++++++++++++++++++++-------------
  1 file changed, 34 insertions(+), 14 deletions(-)
drivers/dma/tegra210-adma.c +32 -13
index 03f9776..911533c 100644
@@ -43,10 +43,8 @@
  #define TEGRA186_ADMA_CH_CONFIG_OUTSTANDING_REQS(reqs)	(reqs << 4)
 
  #define ADMA_CH_FIFO_CTRL				0x2c
-#define TEGRA210_ADMA_CH_FIFO_CTRL_TXSIZE(val)		(((val) & 0xf) << 8)
-#define TEGRA210_ADMA_CH_FIFO_CTRL_RXSIZE(val)		((val) & 0xf)
-#define TEGRA186_ADMA_CH_FIFO_CTRL_TXSIZE(val)		(((val) & 0x1f) << 8)
-#define TEGRA186_ADMA_CH_FIFO_CTRL_RXSIZE(val)		((val) & 0x1f)
+#define ADMA_CH_TX_FIFO_SIZE_SHIFT			8
+#define ADMA_CH_RX_FIFO_SIZE_SHIFT			0
 
  #define ADMA_CH_LOWER_SRC_ADDR				0x34
  #define ADMA_CH_LOWER_TRG_ADDR				0x3c
@@ -61,12 +59,6 @@
 
  #define TEGRA_ADMA_BURST_COMPLETE_TIME			20
 
-#define TEGRA210_FIFO_CTRL_DEFAULT (TEGRA210_ADMA_CH_FIFO_CTRL_TXSIZE(3) | \
-				    TEGRA210_ADMA_CH_FIFO_CTRL_RXSIZE(3))
-
-#define TEGRA186_FIFO_CTRL_DEFAULT (TEGRA186_ADMA_CH_FIFO_CTRL_TXSIZE(3) | \
-				    TEGRA186_ADMA_CH_FIFO_CTRL_RXSIZE(3))
-
  #define ADMA_CH_REG_FIELD_VAL(val, mask, shift)	(((val) & mask) << shift)
 
  struct tegra_adma;
@@ -84,6 +76,8 @@ struct tegra_adma;
   * @ch_req_max: Maximum number of Tx or Rx channels available.
   * @ch_reg_size: Size of DMA channel register space.
   * @nr_channels: Number of DMA channels available.
+ * @ch_fifo_size_mask: Mask for FIFO size field.
+ * @sreq_index_offset: Slave channel index offset.
   * @has_outstanding_reqs: If DMA channel can have outstanding requests.
   */
  struct tegra_adma_chip_data {
@@ -98,6 +92,8 @@ struct tegra_adma_chip_data {
  	unsigned int ch_req_max;
  	unsigned int ch_reg_size;
  	unsigned int nr_channels;
+	unsigned int ch_fifo_size_mask;
+	unsigned int sreq_index_offset;
  	bool has_outstanding_reqs;
  };
 
@@ -561,13 +557,14 @@ static int tegra_adma_set_xfer_params(struct tegra_adma_chan *tdc,
  {
  	struct tegra_adma_chan_regs *ch_regs = &desc->ch_regs;
  	const struct tegra_adma_chip_data *cdata = tdc->tdma->cdata;
-	unsigned int burst_size, adma_dir;
+	unsigned int burst_size, adma_dir, fifo_size_shift;
 
  	if (desc->num_periods > ADMA_CH_CONFIG_MAX_BUFS)
  		return -EINVAL;
 
  	switch (direction) {
  	case DMA_MEM_TO_DEV:
+		fifo_size_shift = ADMA_CH_TX_FIFO_SIZE_SHIFT;
  		adma_dir = ADMA_CH_CTRL_DIR_MEM2AHUB;
  		burst_size = tdc->sconfig.dst_maxburst;
  		ch_regs->config = ADMA_CH_CONFIG_SRC_BUF(desc->num_periods - 1);
@@ -578,6 +575,7 @@ static int tegra_adma_set_xfer_params(struct tegra_adma_chan *tdc,
  		break;
 
  	case DMA_DEV_TO_MEM:
+		fifo_size_shift = ADMA_CH_RX_FIFO_SIZE_SHIFT;
  		adma_dir = ADMA_CH_CTRL_DIR_AHUB2MEM;
  		burst_size = tdc->sconfig.src_maxburst;
  		ch_regs->config = ADMA_CH_CONFIG_TRG_BUF(desc->num_periods - 1);
@@ -599,7 +597,27 @@ static int tegra_adma_set_xfer_params(struct tegra_adma_chan *tdc,
  	ch_regs->config |= ADMA_CH_CONFIG_WEIGHT_FOR_WRR(1);
  	if (cdata->has_outstanding_reqs)
  		ch_regs->config |= TEGRA186_ADMA_CH_CONFIG_OUTSTANDING_REQS(8);
-	ch_regs->fifo_ctrl = cdata->ch_fifo_ctrl;
+
+	/*
+	 * 'sreq_index' represents the current ADMAIF channel number and as per
+	 * HW recommendation its FIFO size should match with the corresponding
+	 * ADMA channel.
+	 *
+	 * ADMA FIFO size is set as per below (based on default ADMAIF channel
+	 * FIFO sizes):
+	 *    fifo_size = 0x2 (sreq_index > sreq_index_offset)
+	 *    fifo_size = 0x3 (sreq_index <= sreq_index_offset)
+	 *
+	 */
+	if (tdc->sreq_index > cdata->sreq_index_offset)
+		ch_regs->fifo_ctrl =
+			ADMA_CH_REG_FIELD_VAL(2, cdata->ch_fifo_size_mask,
+					      fifo_size_shift);
+	else
+		ch_regs->fifo_ctrl =
+			ADMA_CH_REG_FIELD_VAL(3, cdata->ch_fifo_size_mask,
+					      fifo_size_shift);
+
  	ch_regs->tc = desc->period_len & ADMA_CH_TC_COUNT_MASK;
 
  	return tegra_adma_request_alloc(tdc, direction);
@@ -783,11 +801,12 @@ static const struct tegra_adma_chip_data tegra210_chip_data = {
  	.ch_req_tx_shift	= 28,
  	.ch_req_rx_shift	= 24,
  	.ch_base_offset		= 0,
-	.ch_fifo_ctrl		= TEGRA210_FIFO_CTRL_DEFAULT,
  	.ch_req_mask		= 0xf,
  	.ch_req_max		= 10,
  	.ch_reg_size		= 0x80,
  	.nr_channels		= 22,
+	.ch_fifo_size_mask	= 0xf,
+	.sreq_index_offset	= 2,
  	.has_outstanding_reqs	= false,
  };
 
@@ -798,11 +817,12 @@ static const struct tegra_adma_chip_data tegra186_chip_data = {
  	.ch_req_tx_shift	= 27,
  	.ch_req_rx_shift	= 22,

drivers/dma/tegra210-adma.c static const struct tegra_adma_chip_data tegra186_chip_data = { · line 827

Quoted 10 lines
drivers/dma/tegra210-adma.c +2 -1
  	.ch_base_offset		= 0x10000,
-	.ch_fifo_ctrl		= TEGRA186_FIFO_CTRL_DEFAULT,
  	.ch_req_mask		= 0x1f,
  	.ch_req_max		= 20,
  	.ch_reg_size		= 0x100,
  	.nr_channels		= 32,
+	.ch_fifo_size_mask	= 0x1f,
+	.sreq_index_offset	= 4,
  	.has_outstanding_reqs	= true,
  };

Looks good to me. The only minor comment I have is that 'sreq_index_offset' is not very descriptive. Maybe fifo_size_sreq_index? It is not great either, so no big deal either way.

Cheers
Jon

Signature · 1 line
nvpublic
#7 lore raw
In reply to Sameer Pujar

Hi Vinod,

Quoted 10 lines · Sameer Pujar

Following are the fixes in the series:
- Couple of minor fixes (non functional fixes)

- ADMA FIFO size fix: The slave ADMAIF channels have different default FIFO sizes (ADMAIF FIFO is actually a ring buffer and it is divided amongst all available channels). As per HW recommendation the sizes should match with the corresponding ADMA channels to which ADMAIF channel is mapped to at runtime. Thus program ADMA channel FIFO sizes accordingly. Otherwise FIFO corruption is observed.

Quoted 7 lines

Sameer Pujar (3):
dmaengine: tegra210-adma: Re-order 'has_outstanding_reqs' member
dmaengine: tegra210-adma: Add description for 'adma_get_burst_config'
dmaengine: tegra210-adma: Override ADMA FIFO size

  drivers/dma/tegra210-adma.c | 55 +++++++++++++++++++++++++++++++--------------
  1 file changed, 38 insertions(+), 17 deletions(-)

Can you please pick up these changes?

Thanks,
Sameer.

#8 lore raw
In reply to Sameer Pujar

Hi Vinod,

Quoted 10 lines · Sameer Pujar

Following are the fixes in the series:
- Couple of minor fixes (non functional fixes)

- ADMA FIFO size fix: The slave ADMAIF channels have different default FIFO sizes (ADMAIF FIFO is actually a ring buffer and it is divided amongst all available channels). As per HW recommendation the sizes should match with the corresponding ADMA channels to which ADMAIF channel is mapped to at runtime. Thus program ADMA channel FIFO sizes accordingly. Otherwise FIFO corruption is observed.

Quoted 8 lines

Sameer Pujar (3):
dmaengine: tegra210-adma: Re-order 'has_outstanding_reqs' member
dmaengine: tegra210-adma: Add description for 'adma_get_burst_config'
dmaengine: tegra210-adma: Override ADMA FIFO size

  drivers/dma/tegra210-adma.c | 55 +++++++++++++++++++++++++++++++--------------
  1 file changed, 38 insertions(+), 17 deletions(-)

Are these patches good to be picked up? or I need to resend these?

Thanks,
Sameer.

maintainer
#9 lore raw
Quoted 18 lines · Sameer Pujar

Hi Vinod,

Quoted 15 lines · Sameer Pujar

Following are the fixes in the series:
- Couple of minor fixes (non functional fixes)

- ADMA FIFO size fix: The slave ADMAIF channels have different default FIFO sizes (ADMAIF FIFO is actually a ring buffer and it is divided amongst all available channels). As per HW recommendation the sizes should match with the corresponding ADMA channels to which ADMAIF channel is mapped to at runtime. Thus program ADMA channel FIFO sizes accordingly. Otherwise FIFO corruption is observed.

Sameer Pujar (3):
dmaengine: tegra210-adma: Re-order 'has_outstanding_reqs' member
dmaengine: tegra210-adma: Add description for 'adma_get_burst_config'
dmaengine: tegra210-adma: Override ADMA FIFO size

Quoted 5 lines
Quoted 3 lines
  drivers/dma/tegra210-adma.c | 55 +++++++++++++++++++++++++++++++--------------
  1 file changed, 38 insertions(+), 17 deletions(-)

Are these patches good to be picked up? or I need to resend these?

Pls do not send unnecessary pings, I was on vacation, back now and going thru the queue!

Signature · 1 line
~Vinod
maintainer
#10 lore raw
In reply to Sameer Pujar
Quoted 9 lines · Sameer Pujar

Following are the fixes in the series:
- Couple of minor fixes (non functional fixes)

- ADMA FIFO size fix: The slave ADMAIF channels have different default FIFO sizes (ADMAIF FIFO is actually a ring buffer and it is divided amongst all available channels). As per HW recommendation the sizes should match with the corresponding ADMA channels to which ADMAIF channel is mapped to at runtime. Thus program ADMA channel FIFO sizes accordingly. Otherwise FIFO corruption is observed.

The patches are semantically and doing the right thing by ordering. But that does not really make it a 'fix' imo. I am applying these to next

Thanks and apologies for delay

Signature · 1 line
~Vinod