From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261581AbVGGObM (ORCPT ); Thu, 7 Jul 2005 10:31:12 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261487AbVGGO2v (ORCPT ); Thu, 7 Jul 2005 10:28:51 -0400 Received: from smtp104.rog.mail.re2.yahoo.com ([206.190.36.82]:22378 "HELO smtp104.rog.mail.re2.yahoo.com") by vger.kernel.org with SMTP id S261653AbVGGO2S (ORCPT ); Thu, 7 Jul 2005 10:28:18 -0400 From: Shawn Starr Organization: sh0n.net To: hdaps-devel@lists.sourceforge.net Subject: Re: IBM HDAPS things are looking up (was: Re: [Hdaps-devel] Re: [ltp] IBM HDAPS Someone interested? (Accelerometer)) Date: Thu, 7 Jul 2005 10:28:06 -0400 User-Agent: KMail/1.8.1 Cc: Jens Axboe , Lenz Grimmer , Arjan van de Ven , Alejandro Bonilla , Jesper Juhl , Dave Hansen , LKML List References: <42C8D06C.2020608@grimmer.com> <20050704110604.GL1444@suse.de> <20050707080323.GF1823@suse.de> In-Reply-To: <20050707080323.GF1823@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200507071028.06765.spstarr@sh0n.net> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Model: HTS548080M9AT00 (Hitachi) Laptop: T42. segfault:/home/spstarr# ./a /dev/hda head parked Seems to park, heard it click :) Shawn. On July 7, 2005 04:03, Jens Axboe wrote: > On Mon, Jul 04 2005, Jens Axboe wrote: > > On Mon, Jul 04 2005, Lenz Grimmer wrote: > > > -----BEGIN PGP SIGNED MESSAGE----- > > > Hash: SHA1 > > > > > > Hi, > > > > > > Jens Axboe wrote: > > > > It isn't too pretty to rely on such unreliable timing anyways. I'm > > > > not too crazy about spinning the disk down either, it's useless wear > > > > compared to just parking the head. > > > > > > Fully agreed, and that's the approach the IBM Windows driver seems to > > > take - you just hear the disk park its head when the sensor kicks in > > > (you can hear it) - the disk does not spin down when this happens. > > > > > > Could this be some reserved ATA command that only works with certain# > > > drives? > > > > Perhaps the IDLE or IDLEIMMEDIATE commands imply a head parking, that > > would make sense. As you say, you can hear a drive parking its head. > > Here's a test case, it doesn't sound like it's parking the hard here. > > ATA7 defines a park maneuvre, I don't know how well supported it is yet > though. You can test with this little app, if it says 'head parked' it > works. If not, it has just idled the drive. > > > #include > #include > #include > #include > #include > #include > > int main(int argc, char *argv[]) > { > unsigned char buf[8]; > int fd; > > if (argc < 2) { > printf("%s \n", argv[0]); > return 1; > } > > fd = open(argv[1], O_RDONLY); > if (fd == -1) { > perror("open"); > return 1; > } > > memset(buf, 0, sizeof(buf)); > buf[0] = 0xe1; > buf[1] = 0x44; > buf[3] = 0x4c; > buf[4] = 0x4e; > buf[5] = 0x55; > > if (ioctl(fd, HDIO_DRIVE_TASK, buf)) { > perror("ioctl"); > return 1; > } > > if (buf[3] == 0xc4) > printf("head parked\n"); > else > printf("head not parked %x\n", buf[3]); > > close(fd); > return 0; > }