echoaudio, about changeset 5389
PATCH 1/1 echoaudio, about changeset 5389
About changeset 5389: Remove superfluous volatile prefix. It's fine, except for the struct comm_page.handshake which is polled by echoaudio_dsp.c::wait_handshake(). Without volatile we need another way to prevent the compiler from moving the read outside of the loop. If I overlooked something, please let me know.
Short descr.: This patch adds a barrier() to prevent the compiler from moving the read outside of the loop. It also fixes a comment.
Signed-off-by Giuliano Pochini <[email protected]>
pci/echoaudio/echoaudio_dsp.c renamed from pci/echoaudio/echoaudio_dsp.c__orig +2 -2
@@ -43,11 +43,11 @@ static int wait_handshake(struct echoaud {int i; -/* Wait up to 10ms for the handshake from the DSP */ +/* Wait up to 20ms for the handshake from the DSP */ for (i =0 ; i <HANDSHAKE_TIMEOUT ; i++) {/* Look for the handshake value */ +barrier ();if (chip->comm_page->handshake) { -/*if (i) DE_ACT(("Handshake time: %d\n", i));*/ return 0 ; }udelay (1 );
--
Giuliano.