[media] saa7164: buffer crc checks and ensure we use the memcpy func
Buffer crc checks and ensure we use the correct PCIe IO memcpy func
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
diff --git a/drivers/media/video/saa7164/saa7164-encoder.c b/drivers/media/video/saa7164/saa7164-encoder.c
index c61907d..f3ecdc9 100644
--- a/drivers/media/video/saa7164/saa7164-encoder.c
+++ b/drivers/media/video/saa7164/saa7164-encoder.c
@@ -865,6 +865,7 @@
/* Configure the encoder with any cache values */
saa7164_api_set_encoder(port);
+ saa7164_api_get_encoder(port);
saa7164_buffer_cfg_port(port);
@@ -1006,11 +1007,19 @@
{
struct saa7164_user_buffer *buf = 0;
struct saa7164_dev *dev = port->dev;
+ u32 crc;
mutex_lock(&port->dmaqueue_lock);
if (!list_empty(&port->list_buf_used.list)) {
buf = list_first_entry(&port->list_buf_used.list,
struct saa7164_user_buffer, list);
+
+ crc = crc32(0, buf->data, buf->actual_size);
+ if (crc != buf->crc) {
+ printk(KERN_ERR "%s() buf %p crc became invalid, was 0x%x became 0x%x\n", __func__,
+ buf, buf->crc, crc);
+ }
+
}
mutex_unlock(&port->dmaqueue_lock);