From patchwork Tue Aug 24 16:27:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 62611 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47050B70A7 for ; Wed, 25 Aug 2010 02:32:33 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755676Ab0HXQc0 (ORCPT ); Tue, 24 Aug 2010 12:32:26 -0400 Received: from hera.kernel.org ([140.211.167.34]:39685 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751531Ab0HXQcZ (ORCPT ); Tue, 24 Aug 2010 12:32:25 -0400 Received: from htj.dyndns.org (localhost [127.0.0.1]) by hera.kernel.org (8.14.4/8.14.3) with ESMTP id o7OGWJHl006992; Tue, 24 Aug 2010 16:32:20 GMT X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.95.2 at hera.kernel.org Received: from [127.0.0.2] (htj.dyndns.org [127.0.0.2]) by htj.dyndns.org (Postfix) with ESMTPSA id 382921CC068E; Tue, 24 Aug 2010 18:27:15 +0200 (CEST) Message-ID: <4C73F2E3.6030909@kernel.org> Date: Tue, 24 Aug 2010 18:27:15 +0200 From: Tejun Heo User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2 MIME-Version: 1.0 To: Anssi Hannula CC: linux-ide@vger.kernel.org Subject: Re: ahci port hangs while hard resetting link References: <201008230010.48355.anssi.hannula@iki.fi> <4C723FF4.1020208@kernel.org> <201008231811.59828.anssi.hannula@iki.fi> In-Reply-To: <201008231811.59828.anssi.hannula@iki.fi> X-Enigmail-Version: 1.1.1 X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on hera.kernel.org X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (hera.kernel.org [127.0.0.1]); Tue, 24 Aug 2010 16:32:20 +0000 (UTC) Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org On 08/23/2010 05:11 PM, Anssi Hannula wrote: > On Monday 23 August 2010 12:31:32 Tejun Heo wrote: >> Hello, >> >> On 08/22/2010 11:10 PM, Anssi Hannula wrote: >>> 22:52:18 : ata6: exception Emask 0x10 SAct 0x0 SErr 0x4050002 action 0xe >>> frozen >>> 22:52:18 : ata6: irq_stat 0x00400040, connection status changed >>> 22:52:18 : ata6: SError: { RecovComm PHYRdyChg CommWake DevExch } >>> 22:52:18 : ata6: hard resetting link >>> 22:52:28 : ata6: softreset failed (device not ready) >>> 22:52:28 : ata6: hard resetting link >>> 22:52:38 : ata6: softreset failed (device not ready) >>> 22:52:38 : ata6: hard resetting link >>> 22:52:49 : ata6: link is slow to respond, please be patient (ready=0) >>> 22:53:13 : ata6: softreset failed (device not ready) >>> 22:53:13 : ata6: limiting SATA link speed to 1.5 Gbps >>> 22:53:13 : ata6: hard resetting link >>> ===================== >>> I disconnect the drive for a few moments, but nothing is output by >>> kernel. I reconnect it again, but again, nothing is output by the >>> kernel. I run: echo "- - -" > >>> /sys/devices/pci0000:00/0000:00:1f.2/host5/scsi_host/host5/scan >>> However, it appeared stuck and still no messages in the kernel log, so >>> I disconnected the device again. Still nothing is output, and the >>> following messages started to be output, indicating that the process >> >>> had become stuck: >> Looks like EH got stuck somehow. Maybe the timeout calculation is >> wrong? Can you please trigger sysrq-t while the system is stuck and >> post the result? > > Ok, here's the output. And the system is not stuck, just the bash process that > is writing to 'scan' file. > > In this occasion, the hard reset had been stuck for some 16 hours, and it is > on ata5 (scsi4): Does the following patch fix the problem? Thanks. --- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 666850d..68dc678 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -1326,7 +1326,7 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class, /* issue the first D2H Register FIS */ msecs = 0; now = jiffies; - if (time_after(now, deadline)) + if (time_after(deadline, now)) msecs = jiffies_to_msecs(deadline - now); tf.ctl |= ATA_SRST;