Stop SSD from waiting for "Spinning up disk..."

From: Jeff Chua
Date: Mon Jun 22 2015 - 03:25:58 EST



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/