Bug 12077 - dv1394: missing byteswap on big-endian CPUs?
dv1394: missing byteswap on big-endian CPUs?
Status: REJECTED WILL_NOT_FIX
Product: Drivers
Classification: Unclassified
Component: IEEE1394
All Linux
: P1 normal
Assigned To: drivers_ieee1394
:
Depends on:
Blocks: 10046
  Show dependency treegraph
 
Reported: 2008-11-22 03:21 UTC by Stefan Richter
Modified: 2008-11-22 03:23 UTC (History)
0 users

See Also:
Kernel Version: all
Tree: Mainline
Regression: ---


Attachments

Description Stefan Richter 2008-11-22 03:21:59 UTC
From Harvey Harrison:
I've been working through annotating the endianness problems in
drivers/ieee1394/ and think I may have come across a missing
swap in dv1394.c.  This would only effect big-endian boxes.

Starting at line 2113:
			next->u.in.il.q[0] |= 3 << 20; /* enable interrupt */
			next->u.in.il.q[2] = 0; /* disable branch */

			/* link previous to next */
			prev_i = (next_i == 0) ? (MAX_PACKETS * video->n_frames - 1) : (next_i - 1);
			f = video->frames[prev_i / MAX_PACKETS];
			prev = &(f->descriptor_pool[prev_i % MAX_PACKETS]);
			if (prev_i % (MAX_PACKETS/2)) {
				prev->u.in.il.q[0] &= ~(3 << 20); /* no interrupt */
			} else {
				prev->u.in.il.q[0] |= 3 << 20; /* enable interrupt */
			}

I think all three accesses of .q[0] should be cpu_to_le32(3 << 20) or ~cpu_to_le32(3 << 20)
as appropriate.  It's treated as a little-endian register averywhere else in code.

Note You need to log in before you can comment on or make changes to this bug.