linux-kernel.vger.kernel.org archive mirror
 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>,
	Sam Ravnborg <sam@ravnborg.org>,
	linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org,
	linuxppc-dev@ozlabs.org, Kristian Hoegsberg <krh@bitplanet.net>,
	Jarod Wilson <jwilson@redhat.com>
Subject: [PATCH 1/2] firewire: endianess fix
Date: Sat, 23 Feb 2008 12:24:17 +0100 (CET)	[thread overview]
Message-ID: <tkrat.9e19fa31951506af@s5r6.in-berlin.de> (raw)
In-Reply-To: <tkrat.e2bfb30f2c0ae70a@s5r6.in-berlin.de>

The generation of incoming requests was filled in in wrong byte order on
machines with big endian CPU.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: sparclinux@vger.kernel.org
Cc: linuxppc-dev@ozlabs.org
---

This patch is a shot in the dark, based on a warning when building with
C=1 CHECKFLAGS="-D__CHECK_ENDIAN__".  Is it really a fix, or was the
previous code accidentally correct?

This needs to be tested on different big endian PCs, if possible with
the Apple Uninorth FireWire controller and other types of controllers.
One test which involves ohci->request_generation is simply with an SBP-2
device (harddisk, CD-ROM...).  Does SBP-2 login etc. work?

If possible, also test whether the device remains accessible after
forcing a bus reset, e.g. by "echo br short > firecontrol".  You need
the easy to build utility firecontrol and a libraw1394 with "juju"
backend.  See wiki.linux1394.org for directions.


 drivers/firewire/fw-ohci.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux/drivers/firewire/fw-ohci.c
===================================================================
--- linux.orig/drivers/firewire/fw-ohci.c
+++ linux/drivers/firewire/fw-ohci.c
@@ -375,7 +375,7 @@ static __le32 *handle_ar_packet(struct a
 	 */
 
 	if (p.ack + 16 == 0x09)
-		ohci->request_generation = (buffer[2] >> 16) & 0xff;
+		ohci->request_generation = (p.header[2] >> 16) & 0xff;
 	else if (ctx == &ohci->ar_request_ctx)
 		fw_core_handle_request(&ohci->card, &p);
 	else

-- 
Stefan Richter
-=====-==--- --=- =-===
http://arcgraph.de/sr/


  reply	other threads:[~2008-02-23 11:25 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-20 22:03 sparse - make __CHECK_ENDIAN__ default enabled? Sam Ravnborg
2008-02-20 22:18 ` Harvey Harrison
2008-02-23 11:23   ` [PATCH 0/2] firewire: endinaness warnings (was Re: sparse - make __CHECK_ENDIAN__ default enabled?) Stefan Richter
2008-02-23 11:24     ` Stefan Richter [this message]
2008-02-23 11:36       ` [PATCH 1/2] firewire: endianess fix Stefan Richter
2008-02-23 12:12       ` Stefan Richter
2008-03-01 12:36         ` Stefan Richter
2008-02-27 19:58       ` Jarod Wilson
2008-02-27 20:08         ` Stefan Richter
2008-02-27 20:21           ` Jarod Wilson
2008-02-28  2:40         ` Benjamin Herrenschmidt
2008-02-28  3:21           ` Jarod Wilson
2008-02-28  6:25             ` Benjamin Herrenschmidt
2008-02-28 18:42               ` Jarod Wilson
2008-02-28 23:26                 ` Benjamin Herrenschmidt
2008-02-29  5:48                   ` Jarod Wilson
2008-02-29  6:00                     ` Benjamin Herrenschmidt
2008-02-29 11:26                     ` Paul Mackerras
2008-02-29 11:52                       ` Stefan Richter
2008-02-29 21:49                         ` Benjamin Herrenschmidt
2008-02-29 15:34                       ` Jarod Wilson
2008-03-03  9:19                     ` Gabriel Paubert
2008-03-03 14:35                       ` Stefan Richter
2008-03-05 22:59                         ` Gabriel Paubert
2008-03-05 23:26                           ` Stefan Richter
2008-03-06 20:23                             ` Gabriel Paubert
2008-02-28  3:33         ` Jarod Wilson
2008-02-28  2:41       ` Benjamin Herrenschmidt
2008-02-28  8:41         ` Stefan Richter
2008-02-23 11:24     ` [PATCH 2/2] firewire: endianess annotations Stefan Richter
2008-03-01  5:23     ` [PATCH 0/2] firewire: endinaness warnings (was Re: sparse - make __CHECK_ENDIAN__ default enabled?) Jarod Wilson
2008-02-20 22:39 ` sparse - make __CHECK_ENDIAN__ default enabled? Harvey Harrison
2008-02-20 22:51   ` Sam Ravnborg

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=tkrat.9e19fa31951506af@s5r6.in-berlin.de \
    --to=stefanr@s5r6.in-berlin.de \
    --cc=harvey.harrison@gmail.com \
    --cc=jwilson@redhat.com \
    --cc=krh@bitplanet.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=sam@ravnborg.org \
    --cc=sparclinux@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).