From owner-svn-src-all@FreeBSD.ORG Mon Oct 26 15:50:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 307331065679; Mon, 26 Oct 2009 15:50:42 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from poseidon.ceid.upatras.gr (poseidon.ceid.upatras.gr [150.140.141.169]) by mx1.freebsd.org (Postfix) with ESMTP id 851F08FC18; Mon, 26 Oct 2009 15:50:41 +0000 (UTC) Received: from mail.ceid.upatras.gr (unknown [10.1.0.143]) by poseidon.ceid.upatras.gr (Postfix) with ESMTP id 2345FEB46E8; Mon, 26 Oct 2009 17:50:40 +0200 (EET) Received: from localhost (europa.ceid.upatras.gr [127.0.0.1]) by mail.ceid.upatras.gr (Postfix) with ESMTP id F27BD451B2; Mon, 26 Oct 2009 17:50:39 +0200 (EET) X-Quarantine-ID: <4CwU9y8-aMp5> X-Virus-Scanned: amavisd-new at ceid.upatras.gr X-Amavis-Alert: BAD HEADER, Duplicate header field: "Cc" Received: from mail.ceid.upatras.gr ([127.0.0.1]) by localhost (europa.ceid.upatras.gr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4CwU9y8-aMp5; Mon, 26 Oct 2009 17:50:39 +0200 (EET) Received: from kobe.laptop (ppp-94-64-232-242.home.otenet.gr [94.64.232.242]) by mail.ceid.upatras.gr (Postfix) with ESMTP id 81717450C6; Mon, 26 Oct 2009 17:50:39 +0200 (EET) Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id n9QFodNm010191 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 26 Oct 2009 17:50:39 +0200 (EET) (envelope-from keramida@freebsd.org) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id n9QFocFn010190; Mon, 26 Oct 2009 17:50:38 +0200 (EET) (envelope-from keramida@freebsd.org) From: Giorgos Keramidas To: Alexander Motin References: <200910261120.n9QBKFUw086926@svn.freebsd.org> Date: Mon, 26 Oct 2009 17:50:38 +0200 In-Reply-To: <200910261120.n9QBKFUw086926@svn.freebsd.org> (Alexander Motin's message of "Mon, 26 Oct 2009 11:20:15 +0000 (UTC)") Message-ID: <87zl7e2lyp.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: svn-src-head@freebsd.org, Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org, Andriy Gapon Subject: Re: svn commit: r198486 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 15:50:42 -0000 On Mon, 26 Oct 2009 11:20:15 +0000 (UTC), Alexander Motin wrote: > Author: mav > Date: Mon Oct 26 11:20:14 2009 > New Revision: 198486 > URL: http://svn.freebsd.org/changeset/base/198486 > > Log: > Increase ATA command timeouts. Some drives need more then 5s to spin-up. On Mon, 26 Oct 2009 14:42:52 +0000, Alexey Dokuchaev wrote: > Can't it be factored out into a macro so one does not have to make a bunch > of those identical changes over several files shall it be required to > adjust timeout again some time in the future? Yes it can. See attached patch below. On Mon, 26 Oct 2009 16:51:52 +0200, Andriy Gapon wrote: > If this is to happen, then I'd like them to become sysctls too. If it's not a problem, we can add the macro first and then work on making it a sysctl. FWIW, it may also be nice to have a different sysctl for each ata device, or something that can be tuned per bus or per-device with atacontrol. The patch attached below is what we need to make this a compile-time option for kernel config files. It's small enough that I think we can commit this now, and work on the sysctl/atacontrol tunable in the meantime. %%% diff -r 912fc3591cda UPDATING --- a/UPDATING Mon Oct 26 15:41:28 2009 +0200 +++ b/UPDATING Mon Oct 26 17:46:11 2009 +0200 @@ -22,6 +22,11 @@ machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20091026: + The ata(4) driver has been updated to allow rebuilding with a custom + request timeout. ATA_REQUEST_TIMEOUT now defaults to 10 seconds, but + may be set in the kernel configuration file to another value. + 20091025: The iwn(4) driver has been updated to support the 5000 and 5150 series. There's one kernel module for each firmware. Adding "device iwnfw" diff -r 912fc3591cda sys/conf/NOTES --- a/sys/conf/NOTES Mon Oct 26 15:41:28 2009 +0200 +++ b/sys/conf/NOTES Mon Oct 26 17:46:11 2009 +0200 @@ -1716,8 +1716,11 @@ # # ATA_STATIC_ID: controller numbering is static ie depends on location # else the device numbers are dynamically allocated. +# ATA_REQUEST_TIMEOUT: the number of seconds to wait for an ATA request +# before timing out. options ATA_STATIC_ID +#options ATA_REQUEST_TIMEOUT=10 # # Standard floppy disk controllers and floppy tapes, supports diff -r 912fc3591cda sys/conf/options --- a/sys/conf/options Mon Oct 26 15:41:28 2009 +0200 +++ b/sys/conf/options Mon Oct 26 17:46:11 2009 +0200 @@ -350,6 +350,7 @@ # Options used in the 'ata' ATA/ATAPI driver ATA_STATIC_ID opt_ata.h ATA_NOPCI opt_ata.h +ATA_REQUEST_TIMEOUT opt_ata.h # Net stuff. ACCEPT_FILTER_DATA diff -r 912fc3591cda sys/dev/ata/ata-all.h --- a/sys/dev/ata/ata-all.h Mon Oct 26 15:41:28 2009 +0200 +++ b/sys/dev/ata/ata-all.h Mon Oct 26 17:46:11 2009 +0200 @@ -336,6 +336,10 @@ #define ATA_OP_FINISHED 1 #define ATA_MAX_28BIT_LBA 268435455UL +#ifndef ATA_REQUEST_TIMEOUT +#define ATA_REQUEST_TIMEOUT 10 +#endif + /* structure used for composite atomic operations */ #define MAX_COMPOSITES 32 /* u_int32_t bits */ struct ata_composite { diff -r 912fc3591cda sys/dev/ata/ata-disk.c --- a/sys/dev/ata/ata-disk.c Mon Oct 26 15:41:28 2009 +0200 +++ b/sys/dev/ata/ata-disk.c Mon Oct 26 17:46:11 2009 +0200 @@ -230,7 +230,7 @@ } request->dev = dev; request->flags = ATA_R_CONTROL; - request->timeout = 10; + request->timeout = ATA_REQUEST_TIMEOUT; request->retries = 1; request->callback = ad_power_callback; request->u.ata.command = ATA_STANDBY_IMMEDIATE; @@ -265,7 +265,7 @@ request->timeout = 31; } else { - request->timeout = 10; + request->timeout = ATA_REQUEST_TIMEOUT; } request->retries = 2; request->data = bp->bio_data; @@ -468,7 +468,7 @@ request->u.ata.count = 0; request->u.ata.feature = 0; request->flags = ATA_R_CONTROL | ATA_R_QUIET; - request->timeout = 10; + request->timeout = ATA_REQUEST_TIMEOUT; request->retries = 0; ata_queue_request(request); if (request->status & ATA_S_ERROR) @@ -487,7 +487,7 @@ request->u.ata.count = 1; request->u.ata.feature = 0; request->flags = ATA_R_CONTROL; - request->timeout = 10; + request->timeout = ATA_REQUEST_TIMEOUT; request->retries = 0; ata_queue_request(request); if (request->status & ATA_S_ERROR) diff -r 912fc3591cda sys/dev/ata/ata-queue.c --- a/sys/dev/ata/ata-queue.c Mon Oct 26 15:41:28 2009 +0200 +++ b/sys/dev/ata/ata-queue.c Mon Oct 26 17:46:11 2009 +0200 @@ -135,7 +135,7 @@ atadev->spindown_state = 0; request->timeout = 31; } else { - request->timeout = 10; + request->timeout = ATA_REQUEST_TIMEOUT; } request->retries = 0; ata_queue_request(request); @@ -389,7 +389,7 @@ request->bytecount = sizeof(struct atapi_sense); request->donecount = 0; request->transfersize = sizeof(struct atapi_sense); - request->timeout = 10; + request->timeout = ATA_REQUEST_TIMEOUT; request->flags &= (ATA_R_ATAPI | ATA_R_QUIET | ATA_R_DEBUG); request->flags |= (ATA_R_READ | ATA_R_AT_HEAD | ATA_R_REQUEUE); ATA_DEBUG_RQ(request, "autoissue request sense"); diff -r 912fc3591cda sys/dev/ata/atapi-cd.c --- a/sys/dev/ata/atapi-cd.c Mon Oct 26 15:41:28 2009 +0200 +++ b/sys/dev/ata/atapi-cd.c Mon Oct 26 17:46:11 2009 +0200 @@ -700,7 +700,7 @@ request->dev = dev; bcopy(ccb, request->u.atapi.ccb, 16); request->flags = ATA_R_ATAPI; - request->timeout = 10; + request->timeout = ATA_REQUEST_TIMEOUT; ata_queue_request(request); if (!request->error && (request->u.atapi.sense.key == 2 || diff -r 912fc3591cda sys/i386/conf/KOBE --- a/sys/i386/conf/KOBE Mon Oct 26 15:41:28 2009 +0200 +++ b/sys/i386/conf/KOBE Mon Oct 26 17:46:11 2009 +0200 @@ -90,6 +90,7 @@ device atapicam # emulate ATAPI devices as SCSI ditto via CAM # needs CAM to be present (scbus & pass) options ATA_STATIC_ID # Static device numbering +options ATA_REQUEST_TIMEOUT=12 # SCSI peripherals device scbus # SCSI bus (required for SCSI) %%%