This message generated a parse failure. Raw output follows here. Please use 'back' to navigate. From devnull@lkml.org Tue Jun 6 23:55:43 2023 Received: from spaans.ds9a.nl (adsl-xs4all.ds9a.nl [213.84.159.51]) by kylie.puddingonline.com (8.11.6/8.11.6) with SMTP id g8HJvji27839 for ; Tue, 17 Sep 2002 21:57:45 +0200 Received: (qmail 6419 invoked from network); 17 Sep 2002 19:42:38 -0000 Received: from unknown (HELO spaans.ds9a.nl) (3ffe:8280:10:360:202:44ff:fe2a:a1dd) by mayo.ipv6.ds9a.nl with SMTP; 17 Sep 2002 19:42:38 -0000 Received: (qmail 9010 invoked by uid 1000); 17 Sep 2002 19:41:11 -0000 MBOX-Line: From linux-kernel-owner@vger.kernel.org Sat Sep 09 21:55:23 2000 Received: (maildatabase); juh Received: (qmail 21890 invoked by alias); 9 Sep 2000 21:55:23 -0000 Received: (qmail 21887 invoked from network); 9 Sep 2000 21:55:23 -0000 Received: from vger.kernel.org (199.183.24.194) by spaans.ds9a.nl with SMTP; 9 Sep 2000 21:55:23 -0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sat, 9 Sep 2000 17:53:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sat, 9 Sep 2000 17:53:12 -0400 Received: from adsl-63-195-162-81.dsl.snfc21.pacbell.net ([63.195.162.81]:2310 "EHLO master.linux-ide.org") by vger.kernel.org with ESMTP id ; Sat, 9 Sep 2000 17:53:07 -0400 Received: from localhost (andre@localhost) by master.linux-ide.org (8.9.3/8.9.3) with ESMTP id OAA05687; Sat, 9 Sep 2000 14:53:20 -0700 Date: Sat, 9 Sep 2000 14:53:20 -0700 (PDT) From: Andre Hedrick To: Alan Cox Cc: Russell King , linux-kernel@vger.kernel.org Subject: Re: Notebook disk spindown In-Reply-To: Message-Id: Mime-Version: 1.0 Content-Type: text/plain; charset=X-UNKNOWN Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 9 Sep 2000, Alan Cox wrote: Alan you assume that you only have one disk (this is okay). How does this wakeup a spindown? If you call a 'SETMULTI" and the drive is not ready it may/will hang the system. This is why I think that the issue of a reset and then a polling loop of checkpower until you get a response that it is ready is the only safe thing to attempt. Note that I am waiting on my laptop to arrive and then I can comment better. Cheers, > > I have and offered it to the folks at linuxcare the apmd guys. > > The ideas were to create an ioctl pair that would/could knock-out a drive > > and preserve the settings, because the reset command to wake it up flushes > > the settings. Thus after the wakeup reset, and a checkpower-loop for > > ready-status in a passive drive query, the completion of the command would > > set the drive and host back to pre- suspend/hibernate mode. > > Something like > > CASIO FIVA でハイバーネーションを可能にする patch > Ver. 1.01, for Linux kernel-2.2.13 > > Copyright (C) 1999 INOUE, Yoshinari e-mail: pf5y-inue@asahi-net.or.jp > > (This is an excerpt for the IDE bits) > > --- linux/arch/i386/kernel/apm.c.org Wed Nov 24 17:43:08 1999 > +++ linux/arch/i386/kernel/apm.c Wed Nov 24 17:43:18 1999 > @@ -779,6 +779,12 @@ > unsigned long flags; > int err; > > + if (ide_disk_suspend()) { > + printk(KERN_NOTICE "apm: suspend: reset disk failed\n"); > + apm_set_power_state(APM_STATE_REJECT); > + return; > + } > + > #ifndef CONFIG_APM_RTC_IS_GMT > /* > * Estimate time zone so that set_time can update the clock > @@ -807,6 +813,7 @@ > restore_flags(flags); > #endif > set_time(); > + ide_disk_resume(); > } > > static void standby(void) > --- linux/drivers/block/ide-disk.c.org Wed Nov 24 17:42:23 1999 > +++ linux/drivers/block/ide-disk.c Thu Nov 25 12:43:10 1999 > @@ -52,6 +52,13 @@ > > #include "ide.h" > > +#ifdef CONFIG_APM > +#include > + > +static ide_drive_t *hda = 0; > +static int mult_count = -1; > +#endif > + > static void idedisk_bswap_data (void *buffer, int wcount) > { > u16 *p = buffer; > @@ -814,6 +821,10 @@ > continue; > } > idedisk_setup(drive); > +#ifdef CONFIG_APM > + if (!hda) > + hda = drive; > +#endif > if ((!drive->head || drive->head > 16) && !drive->select.b.lba) { > printk(KERN_ERR "%s: INVALID GEOMETRY: %d PHYSICAL HEADS?\n", drive->name, drive->head); > (void) idedisk_cleanup(drive); > @@ -825,6 +836,39 @@ > MOD_DEC_USE_COUNT; > return 0; > } > +#ifdef CONFIG_APM > + > +int ide_disk_suspend(void) > +{ > + int error, retry = 5; > + > + if (!hda) > + return (0); > + mult_count = hda->mult_count; > + if (mult_count == hda->id->max_multsect) { > + mult_count = -1; > + return (0); > + } > + while (retry-- > 0) { > + error = set_multcount(hda, hda->id->max_multsect); > + if (!error) > + return (0); > + } > + return (error); > +} > + > +void ide_disk_resume(void) > +{ > + int retry = 5; > + > + if (mult_count >= 0) > + while (retry-- > 0) > + if (set_multcount(hda, mult_count) == 0) > + break; > + mult_count = -1; > + return; > +} > +#endif > > #ifdef MODULE > int init_module (void) > - > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > Please read the FAQ at http://www.tux.org/lkml/ > Andre Hedrick The Linux ATA/IDE guy - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/