From patchwork Wed May 18 21:25:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jian Peng X-Patchwork-Id: 795352 Received: from smtp1.linux-foundation.org (smtp1.linux-foundation.org [140.211.169.13]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4ILT9RN019950 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Wed, 18 May 2011 21:29:32 GMT Received: from daredevil.linux-foundation.org (localhost [127.0.0.1]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id p4ILQXLa021758; Wed, 18 May 2011 14:27:03 -0700 Received: from mail-vx0-f175.google.com (mail-vx0-f175.google.com [209.85.220.175]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id p4ILPwA6021716 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Wed, 18 May 2011 14:26:00 -0700 Received: by vxd7 with SMTP id 7so1693125vxd.6 for ; Wed, 18 May 2011 14:25:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.179.103 with SMTP id df7mr3551156vdc.148.1305753958161; Wed, 18 May 2011 14:25:58 -0700 (PDT) Received: by 10.52.113.193 with HTTP; Wed, 18 May 2011 14:25:58 -0700 (PDT) In-Reply-To: <201105182144.37713.rjw@sisk.pl> References: <201105120025.34531.rjw@sisk.pl> <20633.1305565337@localhost> <201105182144.37713.rjw@sisk.pl> Date: Wed, 18 May 2011 14:25:58 -0700 Message-ID: From: Jian Peng To: "Rafael J. Wysocki" Received-SPF: pass (localhost is always allowed.) X-Spam-Status: No, hits=-3.748 required=5 tests=AWL, BAYES_00, HTML_MESSAGE, OSDL_HEADER_SPF_PASS, OSDL_HEADER_SUBJECT_BRACKETED X-Spam-Checker-Version: SpamAssassin 3.2.4-osdl_revision__1.47__ X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.21 Cc: Valdis.Kletnieks@vt.edu, Michael Leun , LKML , linux-ide@vger.kernel.org, Tejun Heo , Linux PM mailing list , Jeff Garzik Subject: Re: [linux-pm] [PATCH v2.6.38-rc7] Revert "libata: ahci_start_engine compliant to AHCI spec" X-BeenThere: linux-pm@lists.linux-foundation.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux power management 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 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 18 May 2011 21:29:32 +0000 (UTC) Sure, Please try this. Thanks, 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 > 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);