Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Jan 2010 18:29:17 -0700 (MST)
From:      Warren Block <wblock@wonkity.com>
To:        Jung-uk Kim <jkim@FreeBSD.org>
Cc:        freebsd-hackers@FreeBSD.org, Alexander Best <alexbestms@wwu.de>
Subject:   Re: Spin down HDD after disk sync or before power off
Message-ID:  <alpine.BSF.2.00.1001291745150.47497@wonkity.com>
In-Reply-To: <201001291832.29086.jkim@FreeBSD.org>
References:  <permail-2010012708514080e26a0b0000374a-a_best01@message-id.uni-muenster.de> <alpine.BSF.2.00.1001291422590.46949@wonkity.com> <201001291832.29086.jkim@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

---902635197-664214867-1264814958=:47497
Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII

On Fri, 29 Jan 2010, Jung-uk Kim wrote:
> On Friday 29 January 2010 05:38 pm, Warren Block wrote:
>
> I am not 100% sure but I think it should be something like the
> attached patch.

Yes, I had the two commands backwards.  So let me try to summarize:

ad_shutdown uses ATA_FLUSHCACHE writes out any cached data, but does not 
park the heads.  At powerdown, the heads do an emergency park, which is 
louder than a normal park and possibly damaging.

Adding ATA_STANDBY_IMMEDIATE after the ATA_FLUSHCACHE will park the 
heads more quietly and possibly more safely.  Should do no harm, at 
least.

ad_spindown looks like it's meant to spin the disk down for sleep 
operations, and does some higher-level things.

I suspect flushcache and standby should be as close together as possible 
to avoid the chance of anything getting back into the cache or spinning 
the disk back up.

Anyway, testing this use of ad_spindown inside ad_shutdown brought back 
the GLINK on shutdown.

A fixed version of the earlier patch that does flushcache and then
standbyimmediate is attached.

-Warren Block * Rapid City, South Dakota USA
---902635197-664214867-1264814958=:47497
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=patch-ata-disk.c
Content-Transfer-Encoding: BASE64
Content-ID: <alpine.BSF.2.00.1001291829170.47497@wonkity.com>
Content-Description: 
Content-Disposition: attachment; filename=patch-ata-disk.c

LS0tIHN5cy9kZXYvYXRhL2F0YS1kaXNrLmMub3JpZwkyMDEwLTAxLTI5IDE4
OjE1OjQ5LjAwMDAwMDAwMCAtMDcwMA0KKysrIHN5cy9kZXYvYXRhL2F0YS1k
aXNrLmMJMjAxMC0wMS0yOSAxODoxNjo0Ny4wMDAwMDAwMDAgLTA3MDANCkBA
IC0xOTMsNyArMTkzLDEwIEBADQogDQogICAgIGlmIChhdGFkZXYtPnBhcmFt
LnN1cHBvcnQuY29tbWFuZDIgJiBBVEFfU1VQUE9SVF9GTFVTSENBQ0hFKQ0K
IAlhdGFfY29udHJvbGNtZChkZXYsIEFUQV9GTFVTSENBQ0hFLCAwLCAwLCAw
KTsNCi0gICAgcmV0dXJuIDA7DQorDQorICAgIGlmIChhdGFkZXYtPnBhcmFt
LnN1cHBvcnQuY29tbWFuZDIgJiBBVEFfU1VQUE9SVF9QT1dFUk1HVCkNCisJ
YXRhX2NvbnRyb2xjbWQoZGV2LCBBVEFfU1RBTkRCWV9JTU1FRElBVEUsIDAs
IDAsIDApOw0KKyAgICByZXR1cm4gMDsgICAgDQogfQ0KIA0KIHN0YXRpYyBp
bnQNCg==

---902635197-664214867-1264814958=:47497--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1001291745150.47497>