[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090418124743.408cb37c@neptune.home>
Date: Sat, 18 Apr 2009 12:47:43 +0200
From: Bruno Prémont <bonbons@...ux-vserver.org>
To: Jeff Garzik <jeff@...zik.org>,
Linux SCSI <linux-scsi@...r.kernel.org>
Cc: Linux IDE <linux-ide@...r.kernel.org>,
Bartlomiej Zolnierkiewicz <bzolnier@...il.com>,
Linux Kernel <linux-kernel@...r.kernel.org>
Subject: [PATCH 2/2] sd: 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@...ux-vserver.org>
---
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 3fcb64b..fdad8bc 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -50,6 +50,7 @@
#include <linux/string_helpers.h>
#include <linux/async.h>
#include <asm/uaccess.h>
+#include <linux/dmi.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
@@ -2127,6 +2128,20 @@ static int sd_start_stop_device(struct scsi_disk *sdkp, int start)
return res;
}
+static const struct dmi_system_id sd_coldreboot_table[] = {
+ {
+ /* Acer TravelMate 66x cuts power during reboot */
+ .ident = "Acer TravelMate 660",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"),
+ },
+ },
+
+ { } /* terminate list */
+};
+
+
/*
* Send a SYNCHRONIZE CACHE instruction down to the device through
* the normal SCSI command structure. Wait for the command to
@@ -2144,7 +2159,9 @@ static void sd_shutdown(struct device *dev)
sd_sync_cache(sdkp);
}
- if (system_state != SYSTEM_RESTART && sdkp->device->manage_start_stop) {
+ if (sdkp->device->manage_start_stop &&
+ (system_state != SYSTEM_RESTART ||
+ dmi_check_system(sd_coldreboot_table))) {
sd_printk(KERN_NOTICE, sdkp, "Stopping disk\n");
sd_start_stop_device(sdkp, 0);
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists