From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Lord Subject: Re: Disk spin down issue on shut down/suspend to disk Date: Wed, 08 Aug 2007 10:24:25 -0400 Message-ID: <46B9D219.6030509@rtr.ca> References: <46B7AF53.1040307@shaw.ca> <46B8140E.3000509@gmail.com> <1186497925.8780.78.camel@queen.suse.de> <1186514618.5622.9.camel@nx6310> <46B9307D.3000105@gmail.com> <46B9CE79.5030307@rtr.ca> <46B9CFB3.6020402@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from rtr.ca ([64.26.128.89]:1123 "EHLO mail.rtr.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935248AbXHHOY1 (ORCPT ); Wed, 8 Aug 2007 10:24:27 -0400 In-Reply-To: <46B9CFB3.6020402@gmail.com> Sender: linux-ide-owner@vger.kernel.org List-Id: linux-ide@vger.kernel.org To: Tejun Heo Cc: Michael Sedkowski , trenn@suse.de, Robert Hancock , "Rafael J. Wysocki" , Henrique de Moraes Holschuh , linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org, linux-acpi@vger.kernel.org Tejun Heo wrote: > Mark Lord wrote: >> > Tejun Heo wrote: >>> >> Michael Sedkowski wrote: >>>> >>> Dnia 07-08-2007, Wt o godzinie 03:43 +0900, Tejun Heo napisa=C5= =82(a): >>>>> >>>> Does emergency unload count increase >>>>> >>>> after each power down?=20 >>>> >>> I think I got it. >>>> >>> Using smartctl I've done a test and shut down, then repeted th= e test. >>>> >>> The only values that where diffrent are temperatures and >>>> >>> Hardware_ECC_Recovered which rised by 6 points. >>>> >>> However I have no idea which of those is the "emergency count"= =2E.. >>>> >>> Full results in attachment. >>>> >>> >>>> >>> 192 Power-Off_Retract_Count 0x0032 100 100 000 Old_ag= e =20 >>>> >>> Always - 388 >>> >> >>> >> I think this is the one. You can test it by forcefully powering= off the >>> >> machine (press power button for several secs or disconnect AC an= d >>> >> battery) and see whether the count increases. >> >=20 >> > FWIW, Tejun, with 2.6.22, my new Seagate 160GB SATA drive (noteboo= k) >> > increments the "Power-Off_Retract_Count" on each suspend-to-RAM op= eration. >> > It does not do any double spin-up/spin-down things though. >> >=20 >> > What a mess. >=20 > Hmmm.. It shouldn't. libata now issues STANDBYNOW prior to entering > STR. Can you instrument code a bit and see whether it actually gets = issued? Heh.. I haven't instrumented it yet, but I did discover a bit more abou= t it: The Power-Off_Retract_Count incrmenents *only* when there's data in the on-drive write-cache. So if I haven't written anything significantly l= arge before suspending, then it often does NOT increment the retract counter= =2E But if I copy a couple of multi-MB files around and then suspend (to RA= M), the retract count gets incremented. So I've now just stuck "hdparm -F /dev/sda" into my suspend script, and that cures the problem completely for me. "-F" does a FLUSH_CACHE, and requires a recent copy of hdparm. Perhaps libata should also do a FLUSH_CACHE before any STANDBYNOW comma= nd, prior to entering STR, which is what my script is currently now doing.. I'll instrument libata and see what the current sequence is.