Commit beb0e5c2 authored by Peter Osterlund's avatar Peter Osterlund Committed by Linus Torvalds

[PATCH] bttv: fix DMA setup bug in latest update

This fixes the bug that made the card DMA lots of data to random memory
locations, causing lockups and instant reboots. 

The problem was that the yoffset variable got modified inside the loop,
but the logic in the switch statement was meant to work on the initial
value of the yoffset variable.

(Bug fix extracted from
http://marc.theaimsgroup.com/?l=linux-kernel&m=109532814823565&w=2)
Signed-off-by: default avatarPeter Osterlund <petero2@telia.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 9c083ebe
......@@ -125,6 +125,7 @@ bttv_risc_planar(struct bttv *btv, struct btcx_riscmem *risc,
struct scatterlist *ysg;
struct scatterlist *usg;
struct scatterlist *vsg;
int topfield = (0 == yoffset);
int rc;
/* estimate risc mem: worst case is one write per page border +
......@@ -153,13 +154,13 @@ bttv_risc_planar(struct bttv *btv, struct btcx_riscmem *risc,
chroma = 1;
break;
case 1:
if (!yoffset)
if (topfield)
chroma = (line & 1) == 0;
else
chroma = (line & 1) == 1;
break;
case 2:
if (!yoffset)
if (topfield)
chroma = (line & 3) == 0;
else
chroma = (line & 3) == 2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment