add a rmb() in mite_bytes_transferred()
authorFrank Mori Hess <fmhess@speakeasy.net>
Sun, 21 Mar 2004 17:41:33 +0000 (17:41 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Sun, 21 Mar 2004 17:41:33 +0000 (17:41 +0000)
comedi/drivers/mite.c

index 43000a32850328a7ea148d9b456b1e01c8cc8300..fe5dd2b4541c4f0fc14ed79cddc3af3ccfc1aa71 100644 (file)
@@ -53,6 +53,7 @@
 #include <linux/comedidev.h>
 
 #include <linux/pci.h>
+#include <asm/system.h>
 
 #include "mite.h"
 
@@ -348,9 +349,10 @@ unsigned int mite_bytes_transferred(struct mite_struct *mite, unsigned int chan)
 {
        unsigned int bytes_read;
 
+       bytes_read = mite_bytes_read( mite, chan );
        /* to avoid race, we want to read bytes read before reading bytes
         * in transit */
-       bytes_read = mite_bytes_read( mite, chan );
+       rmb();
        return bytes_read - mite_bytes_in_transit( mite, chan );
 }