[PATCH] echoaudio, about changeset 5389

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <pochini@xxxxxxxx>

--- alsa-kernel/pci/echoaudio/echoaudio_dsp.c__orig	2007-09-16 22:33:37.000000000 +0200
+++ alsa-kernel/pci/echoaudio/echoaudio_dsp.c	2007-09-16 22:39:58.000000000 +0200
@@ -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.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux