From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jian Peng Subject: Re: [PATCH v2.6.38-rc7] Revert "libata: ahci_start_engine compliant to AHCI spec" Date: Wed, 18 May 2011 14:25:58 -0700 Message-ID: References: <201105120025.34531.rjw@sisk.pl> <20633.1305565337@localhost> <201105182144.37713.rjw@sisk.pl> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8605310058294793643==" Return-path: In-Reply-To: <201105182144.37713.rjw@sisk.pl> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: linux-pm-bounces@lists.linux-foundation.org Errors-To: linux-pm-bounces@lists.linux-foundation.org To: "Rafael J. Wysocki" Cc: Valdis.Kletnieks@vt.edu, Michael Leun , LKML , linux-ide@vger.kernel.org, Tejun Heo , Linux PM mailing list , Jeff Garzik List-Id: linux-pm@vger.kernel.org --===============8605310058294793643== Content-Type: multipart/alternative; boundary=bcaec51a7858d71b7d04a3938803 --bcaec51a7858d71b7d04a3938803 Content-Type: text/plain; charset=ISO-8859-1 Sure, Please try this. Thanks, diff -Naur a/drivers/ata/libahci.c b/drivers/ata/libahci.c --- a/drivers/ata/libahci.c 2011-05-18 14:23:36.564665643 -0700 +++ b/drivers/ata/libahci.c 2011-05-18 14:24:52.564614378 -0700 @@ -539,27 +539,6 @@ { void __iomem *port_mmio = ahci_port_base(ap); u32 tmp; - u8 status; - - status = readl(port_mmio + PORT_TFDATA) & 0xFF; - - /* - * At end of section 10.1 of AHCI spec (rev 1.3), it states - * Software shall not set PxCMD.ST to 1 until it is determined - * that a functoinal device is present on the port as determined by - * PxTFD.STS.BSY=0, PxTFD.STS.DRQ=0 and PxSSTS.DET=3h - * - * Even though most AHCI host controllers work without this check, - * specific controller will fail under this condition - */ - if (status & (ATA_BUSY | ATA_DRQ)) - return; - else { - ahci_scr_read(&ap->link, SCR_STATUS, &tmp); - - if ((tmp & 0xf) != 0x3) - return; - } /* start DMA */ tmp = readl(port_mmio + PORT_CMD); @@ -1353,6 +1332,8 @@ ahci_start_engine(ap); + msleep(5); + if (online) *class = ahci_dev_classify(ap); 2011/5/18 Rafael J. Wysocki > On Wednesday, May 18, 2011, Jian Peng wrote: > > Hi, Valdis/Rafael/Michael, > > > > Could you help me test the following change? > > > > After reverting 81ca7e4, add 5ms delay as follow since that seems also > > fixing the issue on my SATA host controller that requires 81ca7e4. > > > > In drivers/ata/libahci.c, inside ahci_hardreset() function, > > > > > > 1333 > > ahci_start_engine > > (ap > > ); > > > > msleep(5);1334 > > 1335 > > if > > (online )1336 > > > > *class = ahci_dev_classify > > (ap > > ); > > > > Since my host controller requires time to switch internal state to be > ready. > > Please let me know your testing result. > > Could you simply post a patch? > > Rafael > --bcaec51a7858d71b7d04a3938803 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Sure, Please try this. Thanks,
=A0
diff -Naur a/drivers/ata/libahci.c b/drivers/ata/libahci.c
--- a/dr= ivers/ata/libahci.c=A02011-05-18 14:23:36.564665643 -0700
+++ b/drivers/= ata/libahci.c=A02011-05-18 14:24:52.564614378 -0700
@@ -539,27 +539,6 @@=
=A0{
=A0=A0void __iomem *port_mmio =3D ahci_port_base(ap);
=A0=A0u32 = tmp;
-=A0u8 status;
-
-=A0status =3D readl(port_mmio + PORT_TFDATA= ) & 0xFF;
-
-=A0/*
-=A0 * At end of section 10.1 of AHCI spec = (rev 1.3), it states
-=A0 * Software shall not set PxCMD.ST to 1 until it is determined
-=A0 = * that a functoinal device is present on the port as determined by
-=A0 = * PxTFD.STS.BSY=3D0, PxTFD.STS.DRQ=3D0 and PxSSTS.DET=3D3h
-=A0 *
-= =A0 * Even though most AHCI host controllers work without this check,
-=A0 * specific controller will fail under this condition
-=A0 */
-= =A0if (status & (ATA_BUSY | ATA_DRQ))
-=A0=A0return;
-=A0else {-=A0=A0ahci_scr_read(&ap->link, SCR_STATUS, &tmp);
-
-= =A0=A0if ((tmp & 0xf) !=3D 0x3)
-=A0=A0=A0return;
-=A0}
=A0
=A0=A0/* start DMA */
=A0=A0tmp =3D= readl(port_mmio + PORT_CMD);
@@ -1353,6 +1332,8 @@
=A0
=A0=A0ahci= _start_engine(ap);
=A0
+=A0msleep(5);
+
=A0=A0if (online)
= =A0=A0=A0*class =3D ahci_dev_classify(ap);


2011/5/18 Rafael J. Wysocki &l= t;rjw@sisk.pl>
On Wednesday, May 18, 2011, Jian Peng wrote:
> Hi, = Valdis/Rafael/Michael,
>
> Could you help me test the following= change?
>
> After reverting 81ca7e4, add 5ms delay as follow s= ince that seems also
> fixing the issue on my SATA host controller that requires 81ca7e4.
= >
> In drivers/ata/libahci.c, inside ahci_hardreset() function,>
>
> <http://lxr.linux.no/linux+*/+code=3Dap>);
>
> Since my host controller requires time to sw= itch internal state to be ready.
> Please let me know your testing re= sult.

Could you simply post a patch?

Rafael

--bcaec51a7858d71b7d04a3938803-- --===============8605310058294793643== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============8605310058294793643==--