Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Bruno Prémont and committed by
Bartlomiej Zolnierkiewicz
b0aedb04 a1f9a89c

+16 -1
+16 -1
drivers/ide/ide-gd.c
··· 7 7 #include <linux/mutex.h> 8 8 #include <linux/ide.h> 9 9 #include <linux/hdreg.h> 10 + #include <linux/dmi.h> 10 11 11 12 #if !defined(CONFIG_DEBUG_BLOCK_EXT_DEVT) 12 13 #define IDE_DISK_MINORS (1 << PARTN_BITS) ··· 100 99 (void)drive->disk_ops->get_capacity(drive); 101 100 } 102 101 102 + static const struct dmi_system_id ide_coldreboot_table[] = { 103 + { 104 + /* Acer TravelMate 66x cuts power during reboot */ 105 + .ident = "Acer TravelMate 660", 106 + .matches = { 107 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 108 + DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"), 109 + }, 110 + }, 111 + 112 + { } /* terminate list */ 113 + }; 114 + 103 115 static void ide_gd_shutdown(ide_drive_t *drive) 104 116 { 105 117 #ifdef CONFIG_ALPHA ··· 129 115 the disk to expire its write cache. */ 130 116 if (system_state != SYSTEM_POWER_OFF) { 131 117 #else 132 - if (system_state == SYSTEM_RESTART) { 118 + if (system_state == SYSTEM_RESTART && 119 + !dmi_check_system(ide_coldreboot_table)) { 133 120 #endif 134 121 drive->disk_ops->flush(drive); 135 122 return;