aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-12-13 18:21:29 -0500
committerStefan Richter <stefanr@s5r6.in-berlin.de>2009-01-04 17:50:36 -0500
commitc82cdea1e1cb3790788d04ef5cab33488e1455c9 (patch)
tree30621519f220da63e039f226772b0ed2a05903e4 /drivers/ieee1394
parent7d7039d3650688319670b2e828b1013fbfd2cc3b (diff)
ieee1934: dv1394: interrupt enabling/disabling broken on big-endian
After annotating the frame structs, this was left: drivers/ieee1394/dv1394.c:2113:23: warning: invalid assignment: |= drivers/ieee1394/dv1394.c:2113:23: left side has type restricted __le32 drivers/ieee1394/dv1394.c:2113:23: right side has type int drivers/ieee1394/dv1394.c:2121:24: warning: invalid assignment: &= drivers/ieee1394/dv1394.c:2121:24: left side has type restricted __le32 drivers/ieee1394/dv1394.c:2121:24: right side has type int drivers/ieee1394/dv1394.c:2123:24: warning: invalid assignment: |= drivers/ieee1394/dv1394.c:2123:24: left side has type restricted __le32 drivers/ieee1394/dv1394.c:2123:24: right side has type int Which looks like a real bug on a big-endian arch as it would set/clear the wrong bit. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Bill Fink writes: I finally got a chance to test the patch on my kernel, and live DV viewing using xine still worked fine. Although I admit to being mystified how it works both before and after the patch, since the cpu_to_le32() calls that were added should result in byte swapping on PPC that wasn't being done before. I guess that either the code paths involved aren't actually being triggered by my xine DV viewing, or there's some fortuitous palindromic setting of bits. Tested-by: Bill Fink <billfink@mindspring.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/ieee1394')
-rw-r--r--drivers/ieee1394/dv1394.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/ieee1394/dv1394.c b/drivers/ieee1394/dv1394.c
index f258e618389c..a329e6bd5d2d 100644
--- a/drivers/ieee1394/dv1394.c
+++ b/drivers/ieee1394/dv1394.c
@@ -2110,17 +2110,17 @@ static void ir_tasklet_func(unsigned long data)
2110 f = video->frames[next_i / MAX_PACKETS]; 2110 f = video->frames[next_i / MAX_PACKETS];
2111 next = &(f->descriptor_pool[next_i % MAX_PACKETS]); 2111 next = &(f->descriptor_pool[next_i % MAX_PACKETS]);
2112 next_dma = ((unsigned long) block - (unsigned long) f->descriptor_pool) + f->descriptor_pool_dma; 2112 next_dma = ((unsigned long) block - (unsigned long) f->descriptor_pool) + f->descriptor_pool_dma;
2113 next->u.in.il.q[0] |= 3 << 20; /* enable interrupt */ 2113 next->u.in.il.q[0] |= cpu_to_le32(3 << 20); /* enable interrupt */
2114 next->u.in.il.q[2] = 0; /* disable branch */ 2114 next->u.in.il.q[2] = cpu_to_le32(0); /* disable branch */
2115 2115
2116 /* link previous to next */ 2116 /* link previous to next */
2117 prev_i = (next_i == 0) ? (MAX_PACKETS * video->n_frames - 1) : (next_i - 1); 2117 prev_i = (next_i == 0) ? (MAX_PACKETS * video->n_frames - 1) : (next_i - 1);
2118 f = video->frames[prev_i / MAX_PACKETS]; 2118 f = video->frames[prev_i / MAX_PACKETS];
2119 prev = &(f->descriptor_pool[prev_i % MAX_PACKETS]); 2119 prev = &(f->descriptor_pool[prev_i % MAX_PACKETS]);
2120 if (prev_i % (MAX_PACKETS/2)) { 2120 if (prev_i % (MAX_PACKETS/2)) {
2121 prev->u.in.il.q[0] &= ~(3 << 20); /* no interrupt */ 2121 prev->u.in.il.q[0] &= ~cpu_to_le32(3 << 20); /* no interrupt */
2122 } else { 2122 } else {
2123 prev->u.in.il.q[0] |= 3 << 20; /* enable interrupt */ 2123 prev->u.in.il.q[0] |= cpu_to_le32(3 << 20); /* enable interrupt */
2124 } 2124 }
2125 prev->u.in.il.q[2] = cpu_to_le32(next_dma | 1); /* set Z=1 */ 2125 prev->u.in.il.q[2] = cpu_to_le32(next_dma | 1); /* set Z=1 */
2126 wmb(); 2126 wmb();