mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: linux1394-devel@lists.sourceforge.net
Cc: Harvey Harrison <harvey.harrison@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] ieee1934: dv1394 interrupt enabling/disabling broken on big-endian
Date: Sun, 14 Dec 2008 01:41:01 +0100	[thread overview]
Message-ID: <4944561D.4010608@s5r6.in-berlin.de> (raw)
In-Reply-To: <1229210489.11257.16.camel@brick>

For linux1394-devel to know:

Harvey Harrison wrote at LKML:
> 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>
> ---
>  drivers/ieee1394/dv1394.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/ieee1394/dv1394.c b/drivers/ieee1394/dv1394.c
> index f258e61..a329e6b 100644
> --- a/drivers/ieee1394/dv1394.c
> +++ b/drivers/ieee1394/dv1394.c
> @@ -2110,17 +2110,17 @@ static void ir_tasklet_func(unsigned long data)
>  			f = video->frames[next_i / MAX_PACKETS];
>  			next = &(f->descriptor_pool[next_i % MAX_PACKETS]);
>  			next_dma = ((unsigned long) block - (unsigned long) f->descriptor_pool) + f->descriptor_pool_dma;
> -			next->u.in.il.q[0] |= 3 << 20; /* enable interrupt */
> -			next->u.in.il.q[2] = 0; /* disable branch */
> +			next->u.in.il.q[0] |= cpu_to_le32(3 << 20); /* enable interrupt */
> +			next->u.in.il.q[2] = cpu_to_le32(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 */
> +				prev->u.in.il.q[0] &= ~cpu_to_le32(3 << 20); /* no interrupt */
>  			} else {
> -				prev->u.in.il.q[0] |= 3 << 20; /* enable interrupt */
> +				prev->u.in.il.q[0] |= cpu_to_le32(3 << 20); /* enable interrupt */
>  			}
>  			prev->u.in.il.q[2] = cpu_to_le32(next_dma | 1); /* set Z=1 */
>  			wmb();

Looks like a bug + correct fix indeed.  Apparently dv1394 was never used on big
endian PCs.  Which is good, because we want to phase out dv1394 eventually.
-- 
Stefan Richter
-=====-==--- ==-- -===-
http://arcgraph.de/sr/

  reply	other threads:[~2008-12-14  0:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-13 23:21 Harvey Harrison
2008-12-14  0:41 ` Stefan Richter [this message]
2008-12-14  1:41   ` Bill Fink
2008-12-14  2:02     ` Stefan Richter
2008-12-23 22:23       ` Bill Fink
2008-12-26  3:02         ` Bill Fink
2009-01-03 16:50           ` Stefan Richter
2009-01-04  2:18             ` Bill Fink
2009-01-04 21:03               ` Stefan Richter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4944561D.4010608@s5r6.in-berlin.de \
    --to=stefanr@s5r6.in-berlin.de \
    --cc=harvey.harrison@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®