aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2007-03-09 10:54:42 -0500
committerJeff Garzik <jeff@garzik.org>2007-04-28 14:15:59 -0400
commit8cdfb29c0cd8018f92214c11c631d8926f4cb032 (patch)
treed4a74d25c301e4c045ca21c45dbcbeadde234548
parente424675f152572d8d2365e351b90bfd81686a150 (diff)
libata/IDE: remove combined mode quirk
Both old-IDE and libata should be able handle all controllers and devices found using normal resource reservation methods. This eliminates the awful, low-performing split-driver configuration where old-IDE drove the PATA portion of a PCI device, in PIO-only mode, and libata drove the SATA portion of the /same/ PCI device, in DMA mode. Typically vendors would ship SATA hard drive / PATA optical configuration, which would lend itself to slow (PIO-only) CD-ROM performance. For Intel users running in combined mode, it is now wholly dependent on your driver choice (potentially link order, if you compile both drivers in) whether old-IDE or libata will drive your hardware. In either case, you will get full performance from both SATA and PATA ports now, without having to pass a kernel command line parameter. Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r--arch/i386/defconfig1
-rw-r--r--arch/parisc/configs/c3000_defconfig1
-rw-r--r--arch/x86_64/defconfig1
-rw-r--r--drivers/ata/Kconfig5
-rw-r--r--drivers/ata/libata-sff.c36
-rw-r--r--drivers/pci/quirks.c113
-rw-r--r--include/linux/ioport.h1
-rw-r--r--kernel/resource.c21
8 files changed, 6 insertions, 173 deletions
diff --git a/arch/i386/defconfig b/arch/i386/defconfig
index f4efd66e1ee..c96911c37ae 100644
--- a/arch/i386/defconfig
+++ b/arch/i386/defconfig
@@ -692,7 +692,6 @@ CONFIG_SATA_SIL=y
692CONFIG_SATA_VIA=y 692CONFIG_SATA_VIA=y
693# CONFIG_SATA_VITESSE is not set 693# CONFIG_SATA_VITESSE is not set
694# CONFIG_SATA_INIC162X is not set 694# CONFIG_SATA_INIC162X is not set
695CONFIG_SATA_INTEL_COMBINED=y
696CONFIG_SATA_ACPI=y 695CONFIG_SATA_ACPI=y
697# CONFIG_PATA_ALI is not set 696# CONFIG_PATA_ALI is not set
698# CONFIG_PATA_AMD is not set 697# CONFIG_PATA_AMD is not set
diff --git a/arch/parisc/configs/c3000_defconfig b/arch/parisc/configs/c3000_defconfig
index 782906b644d..eb2f9a3d515 100644
--- a/arch/parisc/configs/c3000_defconfig
+++ b/arch/parisc/configs/c3000_defconfig
@@ -435,7 +435,6 @@ CONFIG_SCSI_SATA_SIL=m
435# CONFIG_SCSI_SATA_ULI is not set 435# CONFIG_SCSI_SATA_ULI is not set
436CONFIG_SCSI_SATA_VIA=m 436CONFIG_SCSI_SATA_VIA=m
437# CONFIG_SCSI_SATA_VITESSE is not set 437# CONFIG_SCSI_SATA_VITESSE is not set
438CONFIG_SCSI_SATA_INTEL_COMBINED=y
439# CONFIG_SCSI_DMX3191D is not set 438# CONFIG_SCSI_DMX3191D is not set
440# CONFIG_SCSI_FUTURE_DOMAIN is not set 439# CONFIG_SCSI_FUTURE_DOMAIN is not set
441# CONFIG_SCSI_IPS is not set 440# CONFIG_SCSI_IPS is not set
diff --git a/arch/x86_64/defconfig b/arch/x86_64/defconfig
index 7a1e251e333..b26378815b9 100644
--- a/arch/x86_64/defconfig
+++ b/arch/x86_64/defconfig
@@ -631,7 +631,6 @@ CONFIG_SATA_SIL=y
631CONFIG_SATA_VIA=y 631CONFIG_SATA_VIA=y
632# CONFIG_SATA_VITESSE is not set 632# CONFIG_SATA_VITESSE is not set
633# CONFIG_SATA_INIC162X is not set 633# CONFIG_SATA_INIC162X is not set
634CONFIG_SATA_INTEL_COMBINED=y
635CONFIG_SATA_ACPI=y 634CONFIG_SATA_ACPI=y
636# CONFIG_PATA_ALI is not set 635# CONFIG_PATA_ALI is not set
637# CONFIG_PATA_AMD is not set 636# CONFIG_PATA_AMD is not set
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index c679bba4789..365c306c7cf 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -156,11 +156,6 @@ config SATA_INIC162X
156 help 156 help
157 This option enables support for Initio 162x Serial ATA. 157 This option enables support for Initio 162x Serial ATA.
158 158
159config SATA_INTEL_COMBINED
160 bool
161 depends on IDE=y && !BLK_DEV_IDE_SATA && (SATA_AHCI || ATA_PIIX)
162 default y
163
164config SATA_ACPI 159config SATA_ACPI
165 bool 160 bool
166 depends on ACPI && PCI 161 depends on ACPI && PCI
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 066689c5e50..0a194660fd2 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -779,40 +779,16 @@ int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info,
779 /* Deal with combined mode hack. This side of the logic all 779 /* Deal with combined mode hack. This side of the logic all
780 goes away once the combined mode hack is killed in 2.6.21 */ 780 goes away once the combined mode hack is killed in 2.6.21 */
781 if (!devm_request_region(dev, ATA_PRIMARY_CMD, 8, "libata")) { 781 if (!devm_request_region(dev, ATA_PRIMARY_CMD, 8, "libata")) {
782 struct resource *conflict, res; 782 pcim_pin_device(pdev);
783 res.start = ATA_PRIMARY_CMD; 783 printk(KERN_WARNING "ata: 0x%0X IDE port busy\n",
784 res.end = ATA_PRIMARY_CMD + 8 - 1; 784 ATA_PRIMARY_CMD);
785 conflict = ____request_resource(&ioport_resource, &res);
786 while (conflict->child)
787 conflict = ____request_resource(conflict, &res);
788 if (!strcmp(conflict->name, "libata"))
789 legacy_mode |= ATA_PORT_PRIMARY;
790 else {
791 pcim_pin_device(pdev);
792 printk(KERN_WARNING "ata: 0x%0X IDE port busy\n" \
793 "ata: conflict with %s\n",
794 ATA_PRIMARY_CMD,
795 conflict->name);
796 }
797 } else 785 } else
798 legacy_mode |= ATA_PORT_PRIMARY; 786 legacy_mode |= ATA_PORT_PRIMARY;
799 787
800 if (!devm_request_region(dev, ATA_SECONDARY_CMD, 8, "libata")) { 788 if (!devm_request_region(dev, ATA_SECONDARY_CMD, 8, "libata")) {
801 struct resource *conflict, res; 789 pcim_pin_device(pdev);
802 res.start = ATA_SECONDARY_CMD; 790 printk(KERN_WARNING "ata: 0x%X IDE port busy\n",
803 res.end = ATA_SECONDARY_CMD + 8 - 1; 791 ATA_SECONDARY_CMD);
804 conflict = ____request_resource(&ioport_resource, &res);
805 while (conflict->child)
806 conflict = ____request_resource(conflict, &res);
807 if (!strcmp(conflict->name, "libata"))
808 legacy_mode |= ATA_PORT_SECONDARY;
809 else {
810 pcim_pin_device(pdev);
811 printk(KERN_WARNING "ata: 0x%X IDE port busy\n" \
812 "ata: conflict with %s\n",
813 ATA_SECONDARY_CMD,
814 conflict->name);
815 }
816 } else 792 } else
817 legacy_mode |= ATA_PORT_SECONDARY; 793 legacy_mode |= ATA_PORT_SECONDARY;
818 794
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 65d6f23ead4..3411483240c 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -1303,119 +1303,6 @@ static void __init quirk_alder_ioapic(struct pci_dev *pdev)
1303DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EESSC, quirk_alder_ioapic ); 1303DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EESSC, quirk_alder_ioapic );
1304#endif 1304#endif
1305 1305
1306enum ide_combined_type { COMBINED = 0, IDE = 1, LIBATA = 2 };
1307/* Defaults to combined */
1308static enum ide_combined_type combined_mode;
1309
1310static int __init combined_setup(char *str)
1311{
1312 if (!strncmp(str, "ide", 3))
1313 combined_mode = IDE;
1314 else if (!strncmp(str, "libata", 6))
1315 combined_mode = LIBATA;
1316 else /* "combined" or anything else defaults to old behavior */
1317 combined_mode = COMBINED;
1318
1319 return 1;
1320}
1321__setup("combined_mode=", combined_setup);
1322
1323#ifdef CONFIG_SATA_INTEL_COMBINED
1324static void __devinit quirk_intel_ide_combined(struct pci_dev *pdev)
1325{
1326 u8 prog, comb, tmp;
1327 int ich = 0;
1328
1329 /*
1330 * Narrow down to Intel SATA PCI devices.
1331 */
1332 switch (pdev->device) {
1333 /* PCI ids taken from drivers/scsi/ata_piix.c */
1334 case 0x24d1:
1335 case 0x24df:
1336 case 0x25a3:
1337 case 0x25b0:
1338 ich = 5;
1339 break;
1340 case 0x2651:
1341 case 0x2652:
1342 case 0x2653:
1343 case 0x2680: /* ESB2 */
1344 ich = 6;
1345 break;
1346 case 0x27c0:
1347 case 0x27c4:
1348 ich = 7;
1349 break;
1350 case 0x2828: /* ICH8M */
1351 ich = 8;
1352 break;
1353 default:
1354 /* we do not handle this PCI device */
1355 return;
1356 }
1357
1358 /*
1359 * Read combined mode register.
1360 */
1361 pci_read_config_byte(pdev, 0x90, &tmp); /* combined mode reg */
1362
1363 if (ich == 5) {
1364 tmp &= 0x6; /* interesting bits 2:1, PATA primary/secondary */
1365 if (tmp == 0x4) /* bits 10x */
1366 comb = (1 << 0); /* SATA port 0, PATA port 1 */
1367 else if (tmp == 0x6) /* bits 11x */
1368 comb = (1 << 2); /* PATA port 0, SATA port 1 */
1369 else
1370 return; /* not in combined mode */
1371 } else {
1372 WARN_ON((ich != 6) && (ich != 7) && (ich != 8));
1373 tmp &= 0x3; /* interesting bits 1:0 */
1374 if (tmp & (1 << 0))
1375 comb = (1 << 2); /* PATA port 0, SATA port 1 */
1376 else if (tmp & (1 << 1))
1377 comb = (1 << 0); /* SATA port 0, PATA port 1 */
1378 else
1379 return; /* not in combined mode */
1380 }
1381
1382 /*
1383 * Read programming interface register.
1384 * (Tells us if it's legacy or native mode)
1385 */
1386 pci_read_config_byte(pdev, PCI_CLASS_PROG, &prog);
1387
1388 /* if SATA port is in native mode, we're ok. */
1389 if (prog & comb)
1390 return;
1391
1392 /* Don't reserve any so the IDE driver can get them (but only if
1393 * combined_mode=ide).
1394 */
1395 if (combined_mode == IDE)
1396 return;
1397
1398 /* Grab them both for libata if combined_mode=libata. */
1399 if (combined_mode == LIBATA) {
1400 request_region(0x1f0, 8, "libata"); /* port 0 */
1401 request_region(0x170, 8, "libata"); /* port 1 */
1402 return;
1403 }
1404
1405 /* SATA port is in legacy mode. Reserve port so that
1406 * IDE driver does not attempt to use it. If request_region
1407 * fails, it will be obvious at boot time, so we don't bother
1408 * checking return values.
1409 */
1410 if (comb == (1 << 0))
1411 request_region(0x1f0, 8, "libata"); /* port 0 */
1412 else
1413 request_region(0x170, 8, "libata"); /* port 1 */
1414}
1415DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_ANY_ID, quirk_intel_ide_combined );
1416#endif /* CONFIG_SATA_INTEL_COMBINED */
1417
1418
1419int pcie_mch_quirk; 1306int pcie_mch_quirk;
1420EXPORT_SYMBOL(pcie_mch_quirk); 1307EXPORT_SYMBOL(pcie_mch_quirk);
1421 1308
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 6859a3b1408..71ea9231924 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -99,7 +99,6 @@ extern struct resource ioport_resource;
99extern struct resource iomem_resource; 99extern struct resource iomem_resource;
100 100
101extern int request_resource(struct resource *root, struct resource *new); 101extern int request_resource(struct resource *root, struct resource *new);
102extern struct resource * ____request_resource(struct resource *root, struct resource *new);
103extern int release_resource(struct resource *new); 102extern int release_resource(struct resource *new);
104extern int insert_resource(struct resource *parent, struct resource *new); 103extern int insert_resource(struct resource *parent, struct resource *new);
105extern int allocate_resource(struct resource *root, struct resource *new, 104extern int allocate_resource(struct resource *root, struct resource *new,
diff --git a/kernel/resource.c b/kernel/resource.c
index bdb55a33f96..9bd14fd3e6d 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -213,27 +213,6 @@ int request_resource(struct resource *root, struct resource *new)
213EXPORT_SYMBOL(request_resource); 213EXPORT_SYMBOL(request_resource);
214 214
215/** 215/**
216 * ____request_resource - reserve a resource, with resource conflict returned
217 * @root: root resource descriptor
218 * @new: resource descriptor desired by caller
219 *
220 * Returns:
221 * On success, NULL is returned.
222 * On error, a pointer to the conflicting resource is returned.
223 */
224struct resource *____request_resource(struct resource *root, struct resource *new)
225{
226 struct resource *conflict;
227
228 write_lock(&resource_lock);
229 conflict = __request_resource(root, new);
230 write_unlock(&resource_lock);
231 return conflict;
232}
233
234EXPORT_SYMBOL(____request_resource);
235
236/**
237 * release_resource - release a previously reserved resource 216 * release_resource - release a previously reserved resource
238 * @old: resource pointer 217 * @old: resource pointer
239 */ 218 */