Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932945AbbFVHZz (ORCPT ); Mon, 22 Jun 2015 03:25:55 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:33574 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753879AbbFVHZq (ORCPT ); Mon, 22 Jun 2015 03:25:46 -0400 Date: Mon, 22 Jun 2015 15:25:29 +0800 (SGT) From: Jeff Chua X-X-Sender: root@boston.corp.fedex.com To: Linux Kernel cc: Christoph Hellwig , Greg Kroah-Hartman Subject: Stop SSD from waiting for "Spinning up disk..." Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 981 Lines: 37 There's no need to wait for disk spin-up for USB SSD devices. This patch allow the SSD to skip waiting disk spin-up by passing sd_mod.ssd=1 during boot-up. If there's a better way to handle this, please share. Thanks, Jeff --- linux/drivers/scsi/sd.c 2015-05-25 07:29:44.000000000 +0800 +++ linux/drivers/scsi/sd.c 2015-06-19 22:17:35.000000000 +0800 @@ -92,6 +92,9 @@ MODULE_ALIAS_SCSI_DEVICE(TYPE_MOD); MODULE_ALIAS_SCSI_DEVICE(TYPE_RBC); +static int ssd = 0; +module_param(ssd, int, 0); + #if !defined(CONFIG_DEBUG_BLOCK_EXT_DEVT) #define SD_MINORS 16 #else @@ -2738,7 +2741,9 @@ goto out; } - sd_spinup_disk(sdkp); + sd_printk(KERN_NOTICE, sdkp, "ssd %s\n", ssd == 0 ? "off" : "on"); + if(!ssd) + sd_spinup_disk(sdkp); /* * Without media there is no reason to ask; moreover, some devices -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/