* SII3124-2
@ 2006-06-01 21:10 Rune Torgersen
2006-06-02 20:19 ` [PATCH 2.6.16.16] sata_sil24: SII3124 sata driver endian problem Rune Torgersen
0 siblings, 1 reply; 5+ messages in thread
From: Rune Torgersen @ 2006-06-01 21:10 UTC (permalink / raw)
To: linuxppc-dev
Has anybody been successful in getting a SII3124-2 based SATA controller
to work under PPC?
I have a eval board that I tried on two different freescale boards (a
MPC8266ADS board and a MPC8560ADS board).
Kernel 2.6.16.16.
Here is the relevant output from the kernel.
ata1: SATA max UDMA/100 cmd 0xD1010000 ctl 0x0 bmdma 0x0 irq 115
ata2: SATA max UDMA/100 cmd 0xD1012000 ctl 0x0 bmdma 0x0 irq 115
ata3: SATA max UDMA/100 cmd 0xD1014000 ctl 0x0 bmdma 0x0 irq 115
ata4: SATA max UDMA/100 cmd 0xD1016000 ctl 0x0 bmdma 0x0 irq 115
ata1: SATA link down (SStatus 0)
scsi0 : sata_sil24
ata2: SATA link up 3.0 Gbps (SStatus 123)
sata_sil24 ata2: SRST failed, disabling port
scsi1 : sata_sil24
ata3: SATA link down (SStatus 0)
scsi2 : sata_sil24
ata4: SATA link down (SStatus 0)
scsi3 : sata_sil24
I added debug output to see the content of the Command Error register.
It is set to 26 which according to the datasheet for the 3124-1 (I am
running a -2), is PLDCMDERRORMASTERABORT, "A PCI Master Abort occurred
while the SiI3124 was fetching a Port Request Block (PRB) from host
memory."
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2.6.16.16] sata_sil24: SII3124 sata driver endian problem
2006-06-01 21:10 SII3124-2 Rune Torgersen
@ 2006-06-02 20:19 ` Rune Torgersen
2006-06-02 23:30 ` Andrew Morton
0 siblings, 1 reply; 5+ messages in thread
From: Rune Torgersen @ 2006-06-02 20:19 UTC (permalink / raw)
To: jgarzik; +Cc: linuxppc-dev, linux-kernel, linux-ide
[-- Attachment #1: Type: text/plain, Size: 2350 bytes --]
> -----Original Message-----
> From: Rune Torgersen
> Sent: Thursday, June 01, 2006 16:10
> To: linuxppc-dev@ozlabs.org
> Subject: SII3124-2
>
> Has anybody been successful in getting a SII3124-2 based SATA
> controller
> to work under PPC?
>
> I have a eval board that I tried on two different freescale boards (a
> MPC8266ADS board and a MPC8560ADS board).
> Kernel 2.6.16.16.
>
> Here is the relevant output from the kernel.
>
> ata1: SATA max UDMA/100 cmd 0xD1010000 ctl 0x0 bmdma 0x0 irq 115
> ata2: SATA max UDMA/100 cmd 0xD1012000 ctl 0x0 bmdma 0x0 irq 115
> ata3: SATA max UDMA/100 cmd 0xD1014000 ctl 0x0 bmdma 0x0 irq 115
> ata4: SATA max UDMA/100 cmd 0xD1016000 ctl 0x0 bmdma 0x0 irq 115
> ata1: SATA link down (SStatus 0)
> scsi0 : sata_sil24
> ata2: SATA link up 3.0 Gbps (SStatus 123)
> sata_sil24 ata2: SRST failed, disabling port
> scsi1 : sata_sil24
> ata3: SATA link down (SStatus 0)
> scsi2 : sata_sil24
> ata4: SATA link down (SStatus 0)
> scsi3 : sata_sil24
>
> I added debug output to see the content of the Command Error register.
> It is set to 26 which according to the datasheet for the 3124-1 (I am
> running a -2), is PLDCMDERRORMASTERABORT, "A PCI Master Abort occurred
> while the SiI3124 was fetching a Port Request Block (PRB) from host
> memory."
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);
} else
prb->ctrl = 0;
[-- Attachment #2: sil24_endian_patch --]
[-- Type: application/octet-stream, Size: 795 bytes --]
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);
} else
prb->ctrl = 0;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2.6.16.16] sata_sil24: SII3124 sata driver endian problem
2006-06-02 20:19 ` [PATCH 2.6.16.16] sata_sil24: SII3124 sata driver endian problem Rune Torgersen
@ 2006-06-02 23:30 ` Andrew Morton
2006-06-04 16:11 ` Alexey Dobriyan
0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2006-06-02 23:30 UTC (permalink / raw)
To: Rune Torgersen; +Cc: linuxppc-dev, Tejun Heo, jgarzik, linux-kernel, linux-ide
"Rune Torgersen" <runet@innovsys.com> wrote:
>
> > -----Original Message-----
> > From: Rune Torgersen
> > Sent: Thursday, June 01, 2006 16:10
> > To: linuxppc-dev@ozlabs.org
> > Subject: SII3124-2
> >
> > Has anybody been successful in getting a SII3124-2 based SATA
> > controller
> > to work under PPC?
> >
> > I have a eval board that I tried on two different freescale boards (a
> > MPC8266ADS board and a MPC8560ADS board).
> > Kernel 2.6.16.16.
> >
> > Here is the relevant output from the kernel.
> >
> > ata1: SATA max UDMA/100 cmd 0xD1010000 ctl 0x0 bmdma 0x0 irq 115
> > ata2: SATA max UDMA/100 cmd 0xD1012000 ctl 0x0 bmdma 0x0 irq 115
> > ata3: SATA max UDMA/100 cmd 0xD1014000 ctl 0x0 bmdma 0x0 irq 115
> > ata4: SATA max UDMA/100 cmd 0xD1016000 ctl 0x0 bmdma 0x0 irq 115
> > ata1: SATA link down (SStatus 0)
> > scsi0 : sata_sil24
> > ata2: SATA link up 3.0 Gbps (SStatus 123)
> > sata_sil24 ata2: SRST failed, disabling port
> > scsi1 : sata_sil24
> > ata3: SATA link down (SStatus 0)
> > scsi2 : sata_sil24
> > ata4: SATA link down (SStatus 0)
> > scsi3 : sata_sil24
> >
> > I added debug output to see the content of the Command Error register.
> > It is set to 26 which according to the datasheet for the 3124-1 (I am
> > running a -2), is PLDCMDERRORMASTERABORT, "A PCI Master Abort occurred
> > while the SiI3124 was fetching a Port Request Block (PRB) from host
> > memory."
>
> 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);
> } else
> prb->ctrl = 0;
>
This bug has been fixed in the current libata development tree.
This bug is present in 2.6.16 and is present in 2.6.17-rc. Probably we
should merge Rune's above patch into Linus's tree and into 2.6.16.x.
Jeff ack?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2.6.16.16] sata_sil24: SII3124 sata driver endian problem
2006-06-02 23:30 ` Andrew Morton
@ 2006-06-04 16:11 ` Alexey Dobriyan
2006-06-04 20:24 ` Tejun Heo
0 siblings, 1 reply; 5+ messages in thread
From: Alexey Dobriyan @ 2006-06-04 16:11 UTC (permalink / raw)
To: Andrew Morton; +Cc: Tejun Heo, linux-ide, linux-kernel, linuxppc-dev, jgarzik
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;
};
/*
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2.6.16.16] sata_sil24: SII3124 sata driver endian problem
2006-06-04 16:11 ` Alexey Dobriyan
@ 2006-06-04 20:24 ` Tejun Heo
0 siblings, 0 replies; 5+ messages in thread
From: Tejun Heo @ 2006-06-04 20:24 UTC (permalink / raw)
To: Alexey Dobriyan
Cc: Andrew Morton, linux-ide, linux-kernel, linuxppc-dev, jgarzik
Alexey Dobriyan wrote:
> Are there some other fields that should be marked?
Yeap, prot and rx_cnt of sil24_prb should also be marked __le. Also,
all fields of sil24_port_multiplier
Thanks.
> [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;
> };
>
> /*
--
tejun
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-06-04 20:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-01 21:10 SII3124-2 Rune Torgersen
2006-06-02 20:19 ` [PATCH 2.6.16.16] sata_sil24: SII3124 sata driver endian problem Rune Torgersen
2006-06-02 23:30 ` Andrew Morton
2006-06-04 16:11 ` Alexey Dobriyan
2006-06-04 20:24 ` Tejun Heo
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).