[I810_AUDIO] 2/x: Fix wait queue race in drain_dac
diff mbox series

Message ID 20031122071345.GA27303@gondor.apana.org.au
State New, archived
Headers show
Series
  • [I810_AUDIO] 2/x: Fix wait queue race in drain_dac
Related show

Commit Message

Herbert Xu Nov. 22, 2003, 7:13 a.m. UTC
Hi:

This patch fixes the value of swptr in case of an underrun/overrun.

Overruns/underruns probably won't occur at all when the driver is
fixed properly, but this doesn't hurt.

Comments

Jeff Garzik Jan. 11, 2004, 9:04 p.m. UTC | #1
thanks, applied patch-2 to 2.4 and 2.6


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Patch
diff mbox series

Index: kernel-source-2.4/drivers/sound/i810_audio.c
===================================================================
RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.4/drivers/sound/i810_audio.c,v
retrieving revision 1.9
diff -u -r1.9 i810_audio.c
--- kernel-source-2.4/drivers/sound/i810_audio.c	22 Nov 2003 07:05:27 -0000	1.9
+++ kernel-source-2.4/drivers/sound/i810_audio.c	22 Nov 2003 07:11:25 -0000
@@ -1445,8 +1445,8 @@ 
                         }
                         continue;
                 }
-		swptr = dmabuf->swptr;
 		cnt = i810_get_available_read_data(state);
+		swptr = dmabuf->swptr;
 		// this is to make the copy_to_user simpler below
 		if(cnt > (dmabuf->dmasize - swptr))
 			cnt = dmabuf->dmasize - swptr;
@@ -1589,8 +1589,8 @@ 
                         continue;
                 }
 
-		swptr = dmabuf->swptr;
 		cnt = i810_get_free_write_space(state);
+		swptr = dmabuf->swptr;
 		/* Bound the maximum size to how much we can copy to the
 		 * dma buffer before we hit the end.  If we have more to
 		 * copy then it will get done in a second pass of this