lkml.org 
[lkml]   [2006]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 2.6.16.16] sata_sil24: SII3124 sata driver endian problem
On Fri, Jun 02, 2006 at 04:30:35PM -0700, Andrew Morton wrote:
> > There is an endian issue in the sil24 driver.
> > The follwing pathc seems to fix it for me. (it is also attached in case
> > the mailer borks it for me)
> >
> > Signed-off-by: Rune Torgersen <runet@innovsys.com>
> >
> > Index: linux-innsys-2.6.16.16/drivers/scsi/sata_sil24.c
> > ===================================================================
> > --- linux-innsys-2.6.16.16/drivers/scsi/sata_sil24.c (revision 101)
> > +++ linux-innsys-2.6.16.16/drivers/scsi/sata_sil24.c (working copy)
> > @@ -446,7 +446,7 @@
> > */
> > msleep(10);
> >
> > - prb->ctrl = PRB_CTRL_SRST;
> > + prb->ctrl = cpu_to_le16(PRB_CTRL_SRST);
> > prb->fis[1] = 0; /* no PM yet */
> >
> > writel((u32)paddr, port + PORT_CMD_ACTIVATE);
> > @@ -537,9 +537,9 @@
> >
> > if (qc->tf.protocol != ATA_PROT_ATAPI_NODATA) {
> > if (qc->tf.flags & ATA_TFLAG_WRITE)
> > - prb->ctrl = PRB_CTRL_PACKET_WRITE;
> > + prb->ctrl =
> > cpu_to_le16(PRB_CTRL_PACKET_WRITE);
> > else
> > - prb->ctrl = PRB_CTRL_PACKET_READ;
> > + prb->ctrl =
> > cpu_to_le16(PRB_CTRL_PACKET_READ);

Are there some other fields that should be marked?

[PATCH] sata_sil24: endian annotations

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

drivers/scsi/sata_sil24.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

--- a/drivers/scsi/sata_sil24.c
+++ b/drivers/scsi/sata_sil24.c
@@ -37,7 +37,7 @@
* Port request block (PRB) 32 bytes
*/
struct sil24_prb {
- u16 ctrl;
+ __le16 ctrl;
u16 prot;
u32 rx_cnt;
u8 fis[6 * 4];
@@ -47,9 +47,9 @@ struct sil24_prb {
* Scatter gather entry (SGE) 16 bytes
*/
struct sil24_sge {
- u64 addr;
- u32 cnt;
- u32 flags;
+ __le64 addr;
+ __le32 cnt;
+ __le32 flags;
};

/*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-06-04 18:12    [W:0.076 / U:0.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site