Skip to contentSkip to conversation

spi/pxa2xx: change default supported DMA burst size to 1

PATCH In review Chew Chiau Ee 3 participants 3 messages Jun 5, 2014 – Jun 6, 2014

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

PATCH 1/1 spi/pxa2xx: change default supported DMA burst size to 1

From: Chew, Chiau Ee <[email protected]>

This is to fix the SPI DMA transfer failure for speed less than 1M. If using current DMA burst size setting (16), the Rx data bytes are invalid due to each data byte is multiplied according to the burst size setting.

Let's said supposedly we shall receive the following 18 bytes of data:
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 Instead, the data bytes received consist of "16 bytes of '01' + 2 bytes of '02'" :
01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 02 02

Cc Mika Westerberg <mika.westerberg-VuQAYsv1563Yd54FQh9/[email protected]>
---
 drivers/spi/spi-pxa2xx-dma.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/spi/spi-pxa2xx-dma.c +1 -1
index f6759dc..c41ff14 100644
@@ -368,7 +368,7 @@ int pxa2xx_spi_set_dma_burst_and_threshold(struct chip_data *chip,
 	 * otherwise we use the default. Also we use the default FIFO
 	 * thresholds for now.
 	 */
-	*burst_code = chip_info ? chip_info->dma_burst_size : 16;
+	*burst_code = chip_info ? chip_info->dma_burst_size : 1;
 	*threshold = SSCR1_RxTresh(RX_THRESH_DFLT)
 		   | SSCR1_TxTresh(TX_THRESH_DFLT);
 
Signature · 6 lines
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Chew Chiau Ee

From: Chew, Chiau Ee <[email protected]>

This is to fix the SPI DMA transfer failure for speed less than 1M. If using current DMA burst size setting (16), the Rx data bytes are invalid due to each data byte is multiplied according to the burst size setting.

Quoted 8 lines

Let's said supposedly we shall receive the following 18 bytes of data:
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 Instead, the data bytes received consist of "16 bytes of '01' + 2 bytes of '02'" :
01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 02 02

Works for me (and individual chips can tune this by passing custom dma_burst_size if needed).

maintainer
#2 lore raw

PATCH 1/1 spi/pxa2xx: change default supported DMA burst size to 1

In reply to Chew Chiau Ee
Quoted 6 lines · Chew Chiau Ee

From: Chew, Chiau Ee <[email protected]>

This is to fix the SPI DMA transfer failure for speed less than 1M. If using current DMA burst size setting (16), the Rx data bytes are invalid due to each data byte is multiplied according to the burst size setting.

Applied, thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140606/851c658f/attachment.sig>