[ALSA] echoaudio - Add barrier() to prevent compiler optimization
authorGiuliano Pochini <pochini@shiny.it>
Mon, 17 Sep 2007 10:49:40 +0000 (12:49 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 16 Oct 2007 14:50:38 +0000 (16:50 +0200)
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 <pochini@shiny.it>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
sound/pci/echoaudio/echoaudio_dsp.c

index 42afa837d9b48b78ae542f65ba9c0747c31cc614..e6c100770392ef20b146903bc142305323a301f8 100644 (file)
@@ -43,11 +43,11 @@ static int wait_handshake(struct echoaudio *chip)
 {
        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);