aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sata_sil.c
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2006-01-27 16:50:27 -0500
committerJeff Garzik <jgarzik@pobox.com>2006-01-27 16:50:27 -0500
commit51e9f2ff83df6b1c81c5c44f4486c68ed87aa20e (patch)
treee6f54581c145ad1849bc1b2e4c3dbd2ccead405b /drivers/scsi/sata_sil.c
parent3ee68c4af3fd7228c1be63254b9f884614f9ebb2 (diff)
[libata sata_sil] implement 'slow_down' module parameter
On occasion, a user will submit a patch that enables the "mod15write" quirk for their device. Enabling this quirk has the effect of clamping all ATA commands to no more than 15 sectors. The intended use of this quirk is to stop the controller from generating FIS's of unusual size ("but Wesley, what about the FOUS's?"), which in turn works around problems in a <list> of hard drives. One side effect of this quirk is greatly decreased performance. Users often enable the mod15write quirk to fix various system, power, chip, and/or driver problems. For a few rare problematic cases, enabling this has cured lockups or data corruption. Rather than add bogus listings to the mod15write quirk list (I get a patch every month doing such), we add a 'slow_down' module parameter. This allows users to employ a performance sledgehammer in the hopes of curing a problem. It defaults to off (0), of course.
Diffstat (limited to 'drivers/scsi/sata_sil.c')
-rw-r--r--drivers/scsi/sata_sil.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/scsi/sata_sil.c b/drivers/scsi/sata_sil.c
index b017f85e6d6a..17f74d3c10e7 100644
--- a/drivers/scsi/sata_sil.c
+++ b/drivers/scsi/sata_sil.c
@@ -231,6 +231,10 @@ MODULE_LICENSE("GPL");
231MODULE_DEVICE_TABLE(pci, sil_pci_tbl); 231MODULE_DEVICE_TABLE(pci, sil_pci_tbl);
232MODULE_VERSION(DRV_VERSION); 232MODULE_VERSION(DRV_VERSION);
233 233
234static int slow_down = 0;
235module_param(slow_down, int, 0444);
236MODULE_PARM_DESC(slow_down, "Sledgehammer used to work around random problems, by limiting commands to 15 sectors (0=off, 1=on)");
237
234 238
235static unsigned char sil_get_device_cache_line(struct pci_dev *pdev) 239static unsigned char sil_get_device_cache_line(struct pci_dev *pdev)
236{ 240{
@@ -354,8 +358,10 @@ static void sil_dev_config(struct ata_port *ap, struct ata_device *dev)
354 } 358 }
355 359
356 /* limit requests to 15 sectors */ 360 /* limit requests to 15 sectors */
357 if ((ap->flags & SIL_FLAG_MOD15WRITE) && (quirks & SIL_QUIRK_MOD15WRITE)) { 361 if (slow_down ||
358 printk(KERN_INFO "ata%u(%u): applying Seagate errata fix\n", 362 ((ap->flags & SIL_FLAG_MOD15WRITE) &&
363 (quirks & SIL_QUIRK_MOD15WRITE))) {
364 printk(KERN_INFO "ata%u(%u): applying Seagate errata fix (mod15write workaround)\n",
359 ap->id, dev->devno); 365 ap->id, dev->devno);
360 ap->host->max_sectors = 15; 366 ap->host->max_sectors = 15;
361 ap->host->hostt->max_sectors = 15; 367 ap->host->hostt->max_sectors = 15;