Date: Fri, 30 Mar 2007 05:59:21 GMT From: URATAN Shigenobu<uratan@po.iijnet.or.jp> To: freebsd-gnats-submit@FreeBSD.org Subject: kern/111023: [ata][request][patch] please expand ata timeouts Message-ID: <200703300559.l2U5xLMG032727@www.freebsd.org> Resent-Message-ID: <200703300610.l2U6A6cE044131@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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 <sys/cdefs.h> -__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 <sys/param.h> @@ -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 <sys/cdefs.h> -__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 <sys/param.h> @@ -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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200703300559.l2U5xLMG032727>