linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Rune Torgersen <runet@innovsys.com>
Cc: jgarzik@pobox.com, linuxppc-dev@ozlabs.org,
	linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org,
	Tejun Heo <htejun@gmail.com>
Subject: Re: [PATCH 2.6.16.16] sata_sil24: SII3124 sata driver endian problem
Date: Fri, 2 Jun 2006 16:30:35 -0700	[thread overview]
Message-ID: <20060602163035.05ab7c71.akpm@osdl.org> (raw)
In-Reply-To: <DCEAAC0833DD314AB0B58112AD99B93B0189DE08@ismail.innsys.innovsys.com>

"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?

  reply	other threads:[~2006-06-02 23:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <DCEAAC0833DD314AB0B58112AD99B93B0189DDFF@ismail.innsys.innovsys.com>
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 [this message]
2006-06-04 16:11     ` Alexey Dobriyan
2006-06-04 20:24       ` Tejun Heo

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=20060602163035.05ab7c71.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=htejun@gmail.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=runet@innovsys.com \
    /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).