aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-08-22 08:15:58 -0400
committerJeff Garzik <jeff@garzik.org>2006-08-24 02:51:24 -0400
commit9dd9c16465c82d1385f97d2a245641464fcb7894 (patch)
tree0f729bb81af48ff79bda7eea0d366c87aed80a10 /drivers/scsi
parentf3745a3f9fa39fa3c62f7d5b8549ee787d2c6848 (diff)
[PATCH] ata_piix: implement force_pcs module parameter
This patch implements force_pcs module parameter for ata_piix. If 1, PCS is ignored, 2 honored. As there seem to be quite a few ICHs w/ impaired PCS, this option will be useful for cases where the default setting doesn't work. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/ata_piix.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/scsi/ata_piix.c b/drivers/scsi/ata_piix.c
index 3b98f1813356..2d20caf377f5 100644
--- a/drivers/scsi/ata_piix.c
+++ b/drivers/scsi/ata_piix.c
@@ -468,6 +468,11 @@ MODULE_LICENSE("GPL");
468MODULE_DEVICE_TABLE(pci, piix_pci_tbl); 468MODULE_DEVICE_TABLE(pci, piix_pci_tbl);
469MODULE_VERSION(DRV_VERSION); 469MODULE_VERSION(DRV_VERSION);
470 470
471static int force_pcs = 0;
472module_param(force_pcs, int, 0444);
473MODULE_PARM_DESC(force_pcs, "force honoring or ignoring PCS to work around "
474 "device mis-detection (0=default, 1=ignore PCS, 2=honor PCS)");
475
471/** 476/**
472 * piix_pata_cbl_detect - Probe host controller cable detect info 477 * piix_pata_cbl_detect - Probe host controller cable detect info
473 * @ap: Port for which cable detect info is desired 478 * @ap: Port for which cable detect info is desired
@@ -812,6 +817,7 @@ static int __devinit piix_check_450nx_errata(struct pci_dev *ata_dev)
812} 817}
813 818
814static void __devinit piix_init_pcs(struct pci_dev *pdev, 819static void __devinit piix_init_pcs(struct pci_dev *pdev,
820 struct ata_port_info *pinfo,
815 const struct piix_map_db *map_db) 821 const struct piix_map_db *map_db)
816{ 822{
817 u16 pcs, new_pcs; 823 u16 pcs, new_pcs;
@@ -825,6 +831,18 @@ static void __devinit piix_init_pcs(struct pci_dev *pdev,
825 pci_write_config_word(pdev, ICH5_PCS, new_pcs); 831 pci_write_config_word(pdev, ICH5_PCS, new_pcs);
826 msleep(150); 832 msleep(150);
827 } 833 }
834
835 if (force_pcs == 1) {
836 dev_printk(KERN_INFO, &pdev->dev,
837 "force ignoring PCS (0x%x)\n", new_pcs);
838 pinfo[0].host_flags |= PIIX_FLAG_IGNORE_PCS;
839 pinfo[1].host_flags |= PIIX_FLAG_IGNORE_PCS;
840 } else if (force_pcs == 2) {
841 dev_printk(KERN_INFO, &pdev->dev,
842 "force honoring PCS (0x%x)\n", new_pcs);
843 pinfo[0].host_flags &= ~PIIX_FLAG_IGNORE_PCS;
844 pinfo[1].host_flags &= ~PIIX_FLAG_IGNORE_PCS;
845 }
828} 846}
829 847
830static void __devinit piix_init_sata_map(struct pci_dev *pdev, 848static void __devinit piix_init_sata_map(struct pci_dev *pdev,
@@ -933,7 +951,8 @@ static int piix_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
933 if (host_flags & ATA_FLAG_SATA) { 951 if (host_flags & ATA_FLAG_SATA) {
934 piix_init_sata_map(pdev, port_info, 952 piix_init_sata_map(pdev, port_info,
935 piix_map_db_table[ent->driver_data]); 953 piix_map_db_table[ent->driver_data]);
936 piix_init_pcs(pdev, piix_map_db_table[ent->driver_data]); 954 piix_init_pcs(pdev, port_info,
955 piix_map_db_table[ent->driver_data]);
937 } 956 }
938 957
939 /* On ICH5, some BIOSen disable the interrupt using the 958 /* On ICH5, some BIOSen disable the interrupt using the