This message generated a parse failure. Raw output follows here. Please use 'back' to navigate. From devnull@lkml.org Fri May 10 10:13:20 2024 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 g8HJvli27915 for ; Tue, 17 Sep 2002 21:57:47 +0200 Received: (qmail 6415 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 8922 invoked by uid 1000); 17 Sep 2002 19:41:09 -0000 MBOX-Line: From linux-kernel-owner@vger.kernel.org Sat Sep 09 14:37:26 2000 Received: (maildatabase); juh Received: (qmail 4293 invoked by alias); 9 Sep 2000 14:37:26 -0000 Received: (qmail 4290 invoked from network); 9 Sep 2000 14:37:25 -0000 Received: from vger.kernel.org (199.183.24.194) by spaans.ds9a.nl with SMTP; 9 Sep 2000 14:37:25 -0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sat, 9 Sep 2000 10:35:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sat, 9 Sep 2000 10:35:24 -0400 Received: from lightning.swansea.uk.linux.org ([194.168.151.1]:4689 "EHLO the-village.bc.nu") by vger.kernel.org with ESMTP id ; Sat, 9 Sep 2000 10:35:20 -0400 Received: from alan by the-village.bc.nu with local (Exim 2.12 #1) id 13Xld5-0007jh-00; Sat, 9 Sep 2000 15:29:15 +0100 Subject: Re: Notebook disk spindown To: andre@linux-ide.org (Andre Hedrick) Date: Sat, 9 Sep 2000 15:29:12 +0100 (BST) Cc: rmk@arm.linux.org.uk (Russell King), linux-kernel@vger.kernel.org In-Reply-To: from "Andre Hedrick" at Sep 09, 2000 02:20:12 AM X-Mailer: ELM [version 2.5 PL1] Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: From: Alan Cox Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org > 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/