0463-snd-bcm2835-Don-t-allow-responses-from-VC-to-be-inte.patch 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. From f491fbf4315a1d4a7210450f835a6fe93880cd5b Mon Sep 17 00:00:00 2001
  2. From: popcornmix <popcornmix@gmail.com>
  3. Date: Fri, 12 Aug 2016 15:46:21 +0100
  4. Subject: [PATCH] snd-bcm2835: Don't allow responses from VC to be interrupted
  5. by user signals
  6. There should always be a response, and retry after a signal interruption is not handled, so don't report
  7. we are interruptible.
  8. See: https://github.com/raspberrypi/linux/issues/1560
  9. ---
  10. sound/arm/bcm2835-vchiq.c | 25 ++++++-------------------
  11. 1 file changed, 6 insertions(+), 19 deletions(-)
  12. --- a/sound/arm/bcm2835-vchiq.c
  13. +++ b/sound/arm/bcm2835-vchiq.c
  14. @@ -511,12 +511,7 @@ static int bcm2835_audio_set_ctls_chan(b
  15. }
  16. /* We are expecting a reply from the videocore */
  17. - ret = wait_for_completion_interruptible(&instance->msg_avail_comp);
  18. - if (ret) {
  19. - LOG_DBG("%s: failed on waiting for event (status=%d)\n",
  20. - __func__, success);
  21. - goto unlock;
  22. - }
  23. + wait_for_completion(&instance->msg_avail_comp);
  24. if (instance->result != 0) {
  25. LOG_ERR("%s: result=%d\n", __func__, instance->result);
  26. @@ -615,12 +610,7 @@ int bcm2835_audio_set_params(bcm2835_als
  27. }
  28. /* We are expecting a reply from the videocore */
  29. - ret = wait_for_completion_interruptible(&instance->msg_avail_comp);
  30. - if (ret) {
  31. - LOG_DBG("%s: failed on waiting for event (status=%d)\n",
  32. - __func__, success);
  33. - goto unlock;
  34. - }
  35. + wait_for_completion(&instance->msg_avail_comp);
  36. if (instance->result != 0) {
  37. LOG_ERR("%s: result=%d", __func__, instance->result);
  38. @@ -761,14 +751,11 @@ int bcm2835_audio_close(bcm2835_alsa_str
  39. goto unlock;
  40. }
  41. - ret = wait_for_completion_interruptible(&instance->msg_avail_comp);
  42. - if (ret) {
  43. - LOG_DBG("%s: failed on waiting for event (status=%d)\n",
  44. - __func__, success);
  45. - goto unlock;
  46. - }
  47. + /* We are expecting a reply from the videocore */
  48. + wait_for_completion(&instance->msg_avail_comp);
  49. +
  50. if (instance->result != 0) {
  51. - LOG_ERR("%s: failed result (status=%d)\n",
  52. + LOG_ERR("%s: failed result (result=%d)\n",
  53. __func__, instance->result);
  54. ret = -1;