From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S263895AbUE1Vn5 (ORCPT ); Fri, 28 May 2004 17:43:57 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S264045AbUE1VmK (ORCPT ); Fri, 28 May 2004 17:42:10 -0400 Received: from jurassic.park.msu.ru ([195.208.223.243]:50049 "EHLO jurassic.park.msu.ru") by vger.kernel.org with ESMTP id S263895AbUE1Vho (ORCPT ); Fri, 28 May 2004 17:37:44 -0400 Date: Sat, 29 May 2004 01:37:38 +0400 From: Ivan Kokshaysky To: Bartlomiej Zolnierkiewicz Cc: Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [patch 2.6] don't put IDE disks in standby mode on halt on Alpha Message-ID: <20040529013738.A629@den.park.msu.ru> References: <20040527194920.A1709@jurassic.park.msu.ru> <200405271940.49386.bzolnier@elka.pw.edu.pl> <20040528191028.A1117@jurassic.park.msu.ru> <200405281740.50798.bzolnier@elka.pw.edu.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200405281740.50798.bzolnier@elka.pw.edu.pl>; from B.Zolnierkiewicz@elka.pw.edu.pl on Fri, May 28, 2004 at 05:40:50PM +0200 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 28, 2004 at 05:40:50PM +0200, Bartlomiej Zolnierkiewicz wrote: > - AFAIR there are some buggy disks having flush cache > bits that need standby anyway Oh horror. I wouldn't be surprised if some drives don't flush the cache even on standby... > - you will hit 'halt problem' on alpha if your disk has > write cache enabled and it doesn't have flush cache bits > > -EAGAIN ;) Yep... :-( Here's variant of the first patch with CONFIG_ALPHA and a Very Big Comment. Ivan. --- 2.6/drivers/ide/ide-disk.c Sat May 29 00:43:41 2004 +++ linux/drivers/ide/ide-disk.c Sat May 29 00:43:06 2004 @@ -1713,7 +1713,22 @@ static void ide_device_shutdown(struct d { ide_drive_t *drive = container_of(dev, ide_drive_t, gendev); +#ifdef CONFIG_ALPHA + /* On Alpha, halt(8) doesn't actually turn the machine off, + it puts you into the sort of firmware monitor. Typically, + it's used to boot another kernel image, so it's not much + different from reboot(8). Therefore, we don't need to + spin down the disk in this case, especially since Alpha + firmware doesn't handle disks in standby mode properly. + On the other hand, it's reasonably safe to turn the power + off when the shutdown process reaches the firmware prompt, + as the firmware initialization takes rather long time - + at least 10 seconds, which should be sufficient for + the disk to expire its write cache. */ + if (system_state != SYSTEM_POWER_OFF) { +#else if (system_state == SYSTEM_RESTART) { +#endif ide_cacheflush_p(drive); return; }