0024-bcm2835-dma-Limit-cyclic-transfers-on-lite-channels-.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. From c9b92657b415bc1b855c394284efa0e33119ef61 Mon Sep 17 00:00:00 2001
  2. From: Matthias Reichl <hias@horus.com>
  3. Date: Sun, 11 Oct 2015 12:28:30 +0200
  4. Subject: [PATCH] bcm2835-dma: Limit cyclic transfers on lite channels to 32k
  5. Transfers larger than 32k cause repeated clicking with I2S soundcards.
  6. The exact reason is yet unknown, so limit to 32k as bcm2708-dmaengine
  7. did as an intermediate fix.
  8. ---
  9. drivers/dma/bcm2835-dma.c | 8 +++++++-
  10. 1 file changed, 7 insertions(+), 1 deletion(-)
  11. --- a/drivers/dma/bcm2835-dma.c
  12. +++ b/drivers/dma/bcm2835-dma.c
  13. @@ -144,6 +144,12 @@ struct bcm2835_desc {
  14. */
  15. #define MAX_LITE_TRANSFER (SZ_64K - 4)
  16. +/*
  17. + * Transfers larger than 32k cause issues with the bcm2708-i2s driver,
  18. + * so limit transfer size to 32k as bcm2708-dmaengine did.
  19. + */
  20. +#define MAX_CYCLIC_LITE_TRANSFER SZ_32K
  21. +
  22. static inline struct bcm2835_dmadev *to_bcm2835_dma_dev(struct dma_device *d)
  23. {
  24. return container_of(d, struct bcm2835_dmadev, ddev);
  25. @@ -412,7 +418,7 @@ static struct dma_async_tx_descriptor *b
  26. d->c = c;
  27. d->dir = direction;
  28. if (c->ch >= 8) /* LITE channel */
  29. - max_size = MAX_LITE_TRANSFER;
  30. + max_size = MAX_CYCLIC_LITE_TRANSFER;
  31. else
  32. max_size = MAX_NORMAL_TRANSFER;
  33. period_len = min(period_len, max_size);