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

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