From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruno =?UTF-8?B?UHLDqW1vbnQ=?= Subject: [PATCH 1/2] ide: Stop disks on reboot for laptop which cuts power Date: Sat, 18 Apr 2009 12:45:58 +0200 Message-ID: <20090418124558.0426f74c@neptune.home> References: <20090418124415.1dc82273@neptune.home> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from ppp-110-141.adsl.restena.lu ([158.64.110.141]:36082 "EHLO bonbons.gotdns.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751790AbZDRKzs convert rfc822-to-8bit (ORCPT ); Sat, 18 Apr 2009 06:55:48 -0400 In-Reply-To: <20090418124415.1dc82273@neptune.home> Sender: linux-ide-owner@vger.kernel.org List-Id: linux-ide@vger.kernel.org To: Linux IDE , Bartlomiej Zolnierkiewicz Cc: Jeff Garzik , Linux Kernel , Linux SCSI My laptop (Acer Travelmate 660) always cuts the power when rebooting which causes the disk to emergency-park it's head. Add a dmi check to stop disk as for shutdown on this laptop. Signed-off-by: Bruno Pr=C3=A9mont --- diff --git a/drivers/ide/ide-gd.c b/drivers/ide/ide-gd.c index 1aebdf1..4b6b71e 100644 --- a/drivers/ide/ide-gd.c +++ b/drivers/ide/ide-gd.c @@ -7,6 +7,7 @@ #include #include #include +#include =20 #if !defined(CONFIG_DEBUG_BLOCK_EXT_DEVT) #define IDE_DISK_MINORS (1 << PARTN_BITS) @@ -99,6 +100,19 @@ static void ide_gd_resume(ide_drive_t *drive) (void)drive->disk_ops->get_capacity(drive); } =20 +static const struct dmi_system_id ide_coldreboot_table[] =3D { + { + /* Acer TravelMate 66x cuts power during reboot */ + .ident =3D "Acer TravelMate 660", + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), + DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"), + }, + }, + + { } /* terminate list */ +}; + static void ide_gd_shutdown(ide_drive_t *drive) { #ifdef CONFIG_ALPHA @@ -115,7 +129,8 @@ static void ide_gd_shutdown(ide_drive_t *drive) the disk to expire its write cache. */ if (system_state !=3D SYSTEM_POWER_OFF) { #else - if (system_state =3D=3D SYSTEM_RESTART) { + if (system_state =3D=3D SYSTEM_RESTART && + !dmi_check_system(ide_coldreboot_table)) { #endif drive->disk_ops->flush(drive); return;