From patchwork Thu Dec 3 05:57:38 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Miller X-Patchwork-Id: 40131 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.176.167]) by ozlabs.org (Postfix) with ESMTP id CE114B7C10 for ; Thu, 3 Dec 2009 16:57:42 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751073AbZLCF5d (ORCPT ); Thu, 3 Dec 2009 00:57:33 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751094AbZLCF5d (ORCPT ); Thu, 3 Dec 2009 00:57:33 -0500 Received: from 74-93-104-97-Washington.hfc.comcastbusiness.net ([74.93.104.97]:45574 "EHLO sunset.davemloft.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751073AbZLCF5c (ORCPT ); Thu, 3 Dec 2009 00:57:32 -0500 Received: from localhost (localhost [127.0.0.1]) by sunset.davemloft.net (Postfix) with ESMTP id A72B224C5C5; Wed, 2 Dec 2009 21:57:38 -0800 (PST) Date: Wed, 02 Dec 2009 21:57:38 -0800 (PST) Message-Id: <20091202.215738.12118816.davem@davemloft.net> To: liml@rtr.ca Cc: hancockrwd@gmail.com, phdm@macqel.be, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH ide] : Increase WAIT_DRQ to support slow CF cards From: David Miller In-Reply-To: <4AEC420A.9030502@rtr.ca> References: <20091026162011.GA3289@frolo.macqel> <4AE64031.5060105@gmail.com> <4AEC420A.9030502@rtr.ca> X-Mailer: Mew version 6.2 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org From: Mark Lord Date: Sat, 31 Oct 2009 09:56:26 -0400 > Robert Hancock wrote: > .. >> This has come up before: >> http://marc.info/?l=linux-ide&m=123064513313466&w=2 >> I think this timeout should not even exist. libata has no such timeout >> (only the overall command completion timeout), and I can't find any >> reference in current ATA specs to the device being required to raise >> DRQ in any particular amount of time. > .. > > The reason for the original (20ms, then 50ms) timeout was this text > from the ATA1 specification, long since outdated: > > - Upon receipt of a Class 3 command, the drive sets BSY within 400 nsec, > sets up the sector buffer for a write operation, sets DRQ within 20 > msec, and clears BSY within 400 nsec of setting DRQ. Ok, I'd like to resolve this as follows. We had stated "at least 500msec for SSD drives" so I doubled it. This should be a pretty safe change. The only major side effect is that if the device really does hang before setting DRQ it will take a full second before we notice it. Any major objections? ide: Increase WAIT_DRQ to accomodate some CF cards and SSD drives. Based upon a patch by Philippe De Muyter, and feedback from Mark Lord and Robert Hancock. As noted by Mark Lord, the outdated ATA1 spec specifies a 20msec timeout for setting DRQ but lots of common devices overshoot this. Signed-off-by: David S. Miller Signed-off-by: Philippe De Muyter --- 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/include/linux/ide.h b/include/linux/ide.h index e4135d6..0ec6129 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -125,8 +125,8 @@ struct ide_io_ports { * Timeouts for various operations: */ enum { - /* spec allows up to 20ms */ - WAIT_DRQ = HZ / 10, /* 100ms */ + /* spec allows up to 20ms, but CF cards and SSD drives need more */ + WAIT_DRQ = 1 * HZ, /* 1s */ /* some laptops are very slow */ WAIT_READY = 5 * HZ, /* 5s */ /* should be less than 3ms (?), if all ATAPI CD is closed at boot */