Skip to content
This repository has been archived by the owner on May 3, 2018. It is now read-only.

Commit

Permalink
snd-bcm2835: Don't allow responses from VC to be interrupted by user …
Browse files Browse the repository at this point in the history
…signals

There should always be a response, and retry after a signal interruption is not handled, so don't report
we are interruptible.

See: raspberrypi/linux#1560
  • Loading branch information
popcornmix authored and kelmously committed Dec 15, 2017
1 parent 07f26d6 commit 62adb26
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions sound/arm/bcm2835-vchiq.c
Original file line number Diff line number Diff line change
Expand Up @@ -511,12 +511,7 @@ static int bcm2835_audio_set_ctls_chan(bcm2835_alsa_stream_t * alsa_stream,
}

/* We are expecting a reply from the videocore */
ret = wait_for_completion_interruptible(&instance->msg_avail_comp);
if (ret) {
LOG_DBG("%s: failed on waiting for event (status=%d)\n",
__func__, success);
goto unlock;
}
wait_for_completion(&instance->msg_avail_comp);

if (instance->result != 0) {
LOG_ERR("%s: result=%d\n", __func__, instance->result);
Expand Down Expand Up @@ -615,12 +610,7 @@ int bcm2835_audio_set_params(bcm2835_alsa_stream_t * alsa_stream,
}

/* We are expecting a reply from the videocore */
ret = wait_for_completion_interruptible(&instance->msg_avail_comp);
if (ret) {
LOG_DBG("%s: failed on waiting for event (status=%d)\n",
__func__, success);
goto unlock;
}
wait_for_completion(&instance->msg_avail_comp);

if (instance->result != 0) {
LOG_ERR("%s: result=%d", __func__, instance->result);
Expand Down Expand Up @@ -761,14 +751,11 @@ int bcm2835_audio_close(bcm2835_alsa_stream_t * alsa_stream)
goto unlock;
}

ret = wait_for_completion_interruptible(&instance->msg_avail_comp);
if (ret) {
LOG_DBG("%s: failed on waiting for event (status=%d)\n",
__func__, success);
goto unlock;
}
/* We are expecting a reply from the videocore */
wait_for_completion(&instance->msg_avail_comp);

if (instance->result != 0) {
LOG_ERR("%s: failed result (status=%d)\n",
LOG_ERR("%s: failed result (result=%d)\n",
__func__, instance->result);

ret = -1;
Expand Down

0 comments on commit 62adb26

Please sign in to comment.