From owner-freebsd-bugs@FreeBSD.ORG Fri Mar 30 06:10:06 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D24A316A403 for ; Fri, 30 Mar 2007 06:10:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id B232713C4BC for ; Fri, 30 Mar 2007 06:10:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l2U6A6bv044132 for ; Fri, 30 Mar 2007 06:10:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l2U6A6cE044131; Fri, 30 Mar 2007 06:10:06 GMT (envelope-from gnats) Resent-Date: Fri, 30 Mar 2007 06:10:06 GMT Resent-Message-Id: <200703300610.l2U6A6cE044131@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, URATAN Shigenobu Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A283F16A405 for ; Fri, 30 Mar 2007 06:04:23 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [69.147.83.33]) by mx1.freebsd.org (Postfix) with ESMTP id 8701F13C4AE for ; Fri, 30 Mar 2007 06:04:23 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l2U64NGA033306 for ; Fri, 30 Mar 2007 06:04:23 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id l2U5xLMG032727; Fri, 30 Mar 2007 05:59:21 GMT (envelope-from nobody) Message-Id: <200703300559.l2U5xLMG032727@www.freebsd.org> Date: Fri, 30 Mar 2007 05:59:21 GMT From: URATAN Shigenobu To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.0 Cc: Subject: kern/111023: [ata][request][patch] please expand ata timeouts X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Mar 2007 06:10:07 -0000 >Number: 111023 >Category: kern >Synopsis: [ata][request][patch] please expand ata timeouts >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Mar 30 06:10:05 GMT 2007 >Closed-Date: >Last-Modified: >Originator: URATAN Shigenobu >Release: 6.2-RELEASE >Organization: personal >Environment: FreeBSD 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Fri Jan 12 10:40:27 UTC 2007 root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 >Description: I'm using my home FreeBSD server with HDD's stand-by timer. I have modified ad_init() to send ATA_IDLE_CMD at every ATA HDD attach. (This modificatin is included in the patch, but disabled because it is not so generic I think. Later, I will send a patch for 'sbin/atacontrol' to do this from command-line.) Also, I had needed to modify these 2 ATA command timeouts, because, at my Maxtor SATA 250GB HDD, it takes about 7seconds to wake up from stand-by mode. 1) ad_strategy() in ata-disk.c: This must be a timeout for generic disk operation. 2) ata_controlcmd() in ata-queue.c: With ATA_IDLE_CMD from ad_init(), when the HDD is already in stand-by mode, ATA_IDLE_CMD is blocked until HDD is ready. (i.e., ATA_IDLE_CMD will wake the HDD up. I'd confirmed this behavior by both Maxtor and Seagate HDDs) So please expand these ATA timeouts to 10seconds. # I'd tuned also crontab/syslog.conf/mount options/etc. # Finally, my server repeats 45min stand-by and 15min active # when service duty is almost none >How-To-Repeat: >Fix: Patch attached with submission follows: diff -u ata-disk.c.orig ata-disk.c --- ata-disk.c.orig Sat Sep 30 23:51:49 2006 +++ ata-disk.c Mon Mar 26 01:47:30 2007 @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-disk.c,v 1.189.2.5 2006/09/30 14:51:49 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-disk.c,v 1.189.2.5 2006/09/30 14:51:49 xxx Exp $"); #include "opt_ata.h" #include @@ -229,7 +229,7 @@ request->dev = dev; request->bio = bp; request->callback = ad_done; - request->timeout = 5; + request->timeout = 10; /* [sec] */ request->retries = 2; request->data = bp->bio_data; request->bytecount = bp->bio_bcount; @@ -334,6 +334,12 @@ else ata_controlcmd(dev, ATA_SETFEATURES, ATA_SF_DIS_WCACHE, 0, 0); } + +#if 0 + device_printf(dev, "try to set IDLE after 10 minutes\n"); + if(ata_controlcmd(dev, ATA_IDLE_CMD, 0, 0, 120)) + device_printf(dev, "fail to set IDLE timer\n"); +#endif /* 0 */ /* use multiple sectors/interrupt if device supports it */ if (ad_version(atadev->param.version_major)) { diff -u ata-queue.c.orig ata-queue.c --- ata-queue.c.orig Sun Sep 3 02:01:32 2006 +++ ata-queue.c Mon Mar 26 01:47:58 2007 @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-queue.c,v 1.50.2.6 2006/09/02 17:01:32 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-queue.c,v 1.50.2.6 2006/09/02 17:01:32 xxx Exp $"); #include "opt_ata.h" #include @@ -129,7 +129,7 @@ request->u.ata.count = count; request->u.ata.feature = feature; request->flags = ATA_R_CONTROL; - request->timeout = 1; + request->timeout = 10; /* [sec] */ request->retries = 0; ata_queue_request(request); error = request->result; >Release-Note: >Audit-Trail: >Unformatted: