aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBruno Prémont <bonbons@linux-vserver.org>2009-04-22 14:33:41 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-04-22 14:33:41 -0400
commitb0aedb04eae79372fbe101d98513773d6b89935d (patch)
treeb99caae4caa2b5973ef63c0b66f90c9695222b08 /drivers
parenta1f9a89c90b4ac143c5b6054c2a157572b272cd2 (diff)
ide: Stop disks on reboot for laptop which cuts power
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émont <bonbons@linux-vserver.org> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/ide-gd.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/ide/ide-gd.c b/drivers/ide/ide-gd.c
index 1aebdf1a4f58..4b6b71e2cdf5 100644
--- a/drivers/ide/ide-gd.c
+++ b/drivers/ide/ide-gd.c
@@ -7,6 +7,7 @@
7#include <linux/mutex.h> 7#include <linux/mutex.h>
8#include <linux/ide.h> 8#include <linux/ide.h>
9#include <linux/hdreg.h> 9#include <linux/hdreg.h>
10#include <linux/dmi.h>
10 11
11#if !defined(CONFIG_DEBUG_BLOCK_EXT_DEVT) 12#if !defined(CONFIG_DEBUG_BLOCK_EXT_DEVT)
12#define IDE_DISK_MINORS (1 << PARTN_BITS) 13#define IDE_DISK_MINORS (1 << PARTN_BITS)
@@ -99,6 +100,19 @@ static void ide_gd_resume(ide_drive_t *drive)
99 (void)drive->disk_ops->get_capacity(drive); 100 (void)drive->disk_ops->get_capacity(drive);
100} 101}
101 102
103static const struct dmi_system_id ide_coldreboot_table[] = {
104 {
105 /* Acer TravelMate 66x cuts power during reboot */
106 .ident = "Acer TravelMate 660",
107 .matches = {
108 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
109 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"),
110 },
111 },
112
113 { } /* terminate list */
114};
115
102static void ide_gd_shutdown(ide_drive_t *drive) 116static void ide_gd_shutdown(ide_drive_t *drive)
103{ 117{
104#ifdef CONFIG_ALPHA 118#ifdef CONFIG_ALPHA
@@ -115,7 +129,8 @@ static void ide_gd_shutdown(ide_drive_t *drive)
115 the disk to expire its write cache. */ 129 the disk to expire its write cache. */
116 if (system_state != SYSTEM_POWER_OFF) { 130 if (system_state != SYSTEM_POWER_OFF) {
117#else 131#else
118 if (system_state == SYSTEM_RESTART) { 132 if (system_state == SYSTEM_RESTART &&
133 !dmi_check_system(ide_coldreboot_table)) {
119#endif 134#endif
120 drive->disk_ops->flush(drive); 135 drive->disk_ops->flush(drive);
121 return; 136 return;