Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751790AbZDRK4G (ORCPT ); Sat, 18 Apr 2009 06:56:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753671AbZDRKzt (ORCPT ); Sat, 18 Apr 2009 06:55:49 -0400 Received: from ppp-110-141.adsl.restena.lu ([158.64.110.141]:42976 "EHLO bonbons.gotdns.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750938AbZDRKzs convert rfc822-to-8bit (ORCPT ); Sat, 18 Apr 2009 06:55:48 -0400 Date: Sat, 18 Apr 2009 12:47:43 +0200 From: Bruno =?UTF-8?B?UHLDqW1vbnQ=?= To: Jeff Garzik , Linux SCSI Cc: Linux IDE , Bartlomiej Zolnierkiewicz , Linux Kernel Subject: [PATCH 2/2] sd: Stop disks on reboot for laptop which cuts power Message-ID: <20090418124743.408cb37c@neptune.home> In-Reply-To: <20090418124415.1dc82273@neptune.home> References: <20090418124415.1dc82273@neptune.home> X-Mailer: Claws Mail 3.7.0 (GTK+ 2.14.7; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1749 Lines: 56 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 --- 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 #include #include +#include #include #include @@ -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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/