Skip to contentSkip to conversation

remove Intel combined mode quirk

PATCH In review Jeff Garzik 4 participants 6 messages Mar 9, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remove Intel combined mode quirk

Discussed for 2.6.21, but pushed back because the current SATA code had enough fun stuff to debug already. Thus, just queued the following for 2.6.22 in libata-dev.git#upstream.

The nasty ____request_resource hack is finally gone.

In practical terms, this usually means that some combined mode users will have their SATA devices driven by the old-IDE driver rather than libata (because old-IDE is often non-modular, and thus probes first).

But really, these same users will IMO cheer the removal of the performance-killing split-driver configuration, so its a net win. And the code is smaller and more clean, with one less special case hack.

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.

 arch/i386/defconfig                 |    1 
 arch/parisc/configs/c3000_defconfig |    1 
 arch/x86_64/defconfig               |    1 
 drivers/ata/Kconfig                 |    5 -
 drivers/ata/libata-sff.c            |   36 +----------
 drivers/pci/quirks.c                |  113 ------------------------------------
 include/linux/ioport.h              |    1 
 kernel/resource.c                   |   21 ------
 8 files changed, 6 insertions(+), 173 deletions(-)
arch/i386/defconfig +0 -1
index 5ae1e0b..0b92a95 100644
@@ -678,7 +678,6 @@ CONFIG_SATA_SIL=y
 CONFIG_SATA_VIA=y
 # CONFIG_SATA_VITESSE is not set
 # CONFIG_SATA_INIC162X is not set
-CONFIG_SATA_INTEL_COMBINED=y
 # CONFIG_PATA_ALI is not set
 # CONFIG_PATA_AMD is not set
 # CONFIG_PATA_ARTOP is not set
arch/parisc/configs/c3000_defconfig +0 -1
index 782906b..eb2f9a3 100644
@@ -435,7 +435,6 @@ CONFIG_SCSI_SATA_SIL=m
 # CONFIG_SCSI_SATA_ULI is not set
 CONFIG_SCSI_SATA_VIA=m
 # CONFIG_SCSI_SATA_VITESSE is not set
-CONFIG_SCSI_SATA_INTEL_COMBINED=y
 # CONFIG_SCSI_DMX3191D is not set
 # CONFIG_SCSI_FUTURE_DOMAIN is not set
 # CONFIG_SCSI_IPS is not set
arch/x86_64/defconfig +0 -1
index 293a4a4..6fe4635 100644
@@ -622,7 +622,6 @@ CONFIG_SATA_SIL=y
 CONFIG_SATA_VIA=y
 # CONFIG_SATA_VITESSE is not set
 # CONFIG_SATA_INIC162X is not set
-CONFIG_SATA_INTEL_COMBINED=y
 # CONFIG_PATA_ALI is not set
 # CONFIG_PATA_AMD is not set
 # CONFIG_PATA_ARTOP is not set
drivers/ata/Kconfig +0 -5
index 131a9f7..54ee50b 100644
@@ -156,11 +156,6 @@ config SATA_INIC162X
 	help
 	  This option enables support for Initio 162x Serial ATA.
 
-config SATA_INTEL_COMBINED
-	bool
-	depends on IDE=y && !BLK_DEV_IDE_SATA && (SATA_AHCI || ATA_PIIX)
-	default y
-
 config SATA_ACPI
 	bool
 	depends on ACPI && PCI
drivers/ata/libata-sff.c +6 -30
index 066689c..0a19466 100644
@@ -779,40 +779,16 @@ int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info,
 		/* Deal with combined mode hack. This side of the logic all
 		   goes away once the combined mode hack is killed in 2.6.21 */
 		if (!devm_request_region(dev, ATA_PRIMARY_CMD, 8, "libata")) {
-			struct resource *conflict, res;
-			res.start = ATA_PRIMARY_CMD;
-			res.end = ATA_PRIMARY_CMD + 8 - 1;
-			conflict = ____request_resource(&ioport_resource, &res);
-			while (conflict->child)
-				conflict = ____request_resource(conflict, &res);
-			if (!strcmp(conflict->name, "libata"))
-				legacy_mode |= ATA_PORT_PRIMARY;
-			else {
-				pcim_pin_device(pdev);
-				printk(KERN_WARNING "ata: 0x%0X IDE port busy\n" \
-						    "ata: conflict with %s\n",
-						    ATA_PRIMARY_CMD,
-						    conflict->name);
-			}
+			pcim_pin_device(pdev);
+			printk(KERN_WARNING "ata: 0x%0X IDE port busy\n",
+					    ATA_PRIMARY_CMD);
 		} else
 			legacy_mode |= ATA_PORT_PRIMARY;
 
 		if (!devm_request_region(dev, ATA_SECONDARY_CMD, 8, "libata")) {
-			struct resource *conflict, res;
-			res.start = ATA_SECONDARY_CMD;
-			res.end = ATA_SECONDARY_CMD + 8 - 1;
-			conflict = ____request_resource(&ioport_resource, &res);
-			while (conflict->child)
-				conflict = ____request_resource(conflict, &res);
-			if (!strcmp(conflict->name, "libata"))
-				legacy_mode |= ATA_PORT_SECONDARY;
-			else {
-				pcim_pin_device(pdev);
-				printk(KERN_WARNING "ata: 0x%X IDE port busy\n" \
-						    "ata: conflict with %s\n",
-						    ATA_SECONDARY_CMD,
-						    conflict->name);
-			}
+			pcim_pin_device(pdev);
+			printk(KERN_WARNING "ata: 0x%X IDE port busy\n",
+					    ATA_SECONDARY_CMD);
 		} else
 			legacy_mode |= ATA_PORT_SECONDARY;
 
drivers/pci/quirks.c +0 -113

119 lines not on this page · raw message

include/linux/ioport.h +0 -1
index 6859a3b..71ea923 100644
@@ -99,7 +99,6 @@ extern struct resource ioport_resource;
 extern struct resource iomem_resource;
 
 extern int request_resource(struct resource *root, struct resource *new);
-extern struct resource * ____request_resource(struct resource *root, struct resource *new);
 extern int release_resource(struct resource *new);
 extern int insert_resource(struct resource *parent, struct resource *new);
 extern int allocate_resource(struct resource *root, struct resource *new,
kernel/resource.c +0 -21
index bdb55a3..9bd14fd 100644
@@ -213,27 +213,6 @@ int request_resource(struct resource *root, struct resource *new)
 EXPORT_SYMBOL(request_resource);
 
 /**
- * ____request_resource - reserve a resource, with resource conflict returned
- * @root: root resource descriptor
- * @new: resource descriptor desired by caller
- *
- * Returns:
- * On success, NULL is returned.
- * On error, a pointer to the conflicting resource is returned.
- */
-struct resource *____request_resource(struct resource *root, struct resource *new)
-{
-	struct resource *conflict;
-
-	write_lock(&resource_lock);
-	conflict = __request_resource(root, new);
-	write_unlock(&resource_lock);
-	return conflict;
-}
-
-EXPORT_SYMBOL(____request_resource);
-
-/**
  * release_resource - release a previously reserved resource
  * @old: resource pointer
  */
#1 lore raw
Quoted 40 lines · Jeff Garzik
drivers/ata/libata-sff.c +3 -25
index 066689c..0a19466 100644
@@ -779,40 +779,16 @@ int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info,
 		/* Deal with combined mode hack. This side of the logic all
 		   goes away once the combined mode hack is killed in 2.6.21 */
 		if (!devm_request_region(dev, ATA_PRIMARY_CMD, 8, "libata")) {
-			struct resource *conflict, res;
-			res.start = ATA_PRIMARY_CMD;
-			res.end = ATA_PRIMARY_CMD + 8 - 1;
-			conflict = ____request_resource(&ioport_resource, &res);
-			while (conflict->child)
-				conflict = ____request_resource(conflict, &res);
-			if (!strcmp(conflict->name, "libata"))
-				legacy_mode |= ATA_PORT_PRIMARY;
-			else {
-				pcim_pin_device(pdev);
-				printk(KERN_WARNING "ata: 0x%0X IDE port busy\n" \
-						    "ata: conflict with %s\n",
-						    ATA_PRIMARY_CMD,
-						    conflict->name);
-			}
+			pcim_pin_device(pdev);
+			printk(KERN_WARNING "ata: 0x%0X IDE port busy\n",
+					    ATA_PRIMARY_CMD);
 		} else
 			legacy_mode |= ATA_PORT_PRIMARY;
 
 		if (!devm_request_region(dev, ATA_SECONDARY_CMD, 8, "libata")) {
-			struct resource *conflict, res;
-			res.start = ATA_SECONDARY_CMD;
-			res.end = ATA_SECONDARY_CMD + 8 - 1;
-			conflict = ____request_resource(&ioport_resource, &res);
-			while (conflict->child)
-				conflict = ____request_resource(conflict, &res);
-			if (!strcmp(conflict->name, "libata"))
-				legacy_mode |= ATA_PORT_SECONDARY;
-			else {
-				pcim_pin_device(pdev);

drivers/ata/libata-sff.c int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info, · line 793

Quoted 10 lines
drivers/ata/libata-sff.c +3 -5
-				printk(KERN_WARNING "ata: 0x%X IDE port busy\n" \
-						    "ata: conflict with %s\n",
-						    ATA_SECONDARY_CMD,
-						    conflict->name);
-			}
+			pcim_pin_device(pdev);
+			printk(KERN_WARNING "ata: 0x%X IDE port busy\n",
+					    ATA_SECONDARY_CMD);
 		} else
 			legacy_mode |= ATA_PORT_SECONDARY;

I presume this will lend itself to further devres cleanups, now that this code is gone. I just did the main change.

This will also affect the new init model stuff just posted.

Acked-by on v1 1/1
#4 lore raw
In reply to Jeff Garzik
Quoted 32 lines · Jeff Garzik

Discussed for 2.6.21, but pushed back because the current SATA code had enough fun stuff to debug already. Thus, just queued the following for 2.6.22 in libata-dev.git#upstream.

The nasty ____request_resource hack is finally gone.

In practical terms, this usually means that some combined mode users will have their SATA devices driven by the old-IDE driver rather than libata (because old-IDE is often non-modular, and thus probes first).

But really, these same users will IMO cheer the removal of the performance-killing split-driver configuration, so its a net win. And the code is smaller and more clean, with one less special case hack.

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.

Quoted 5 lines

In either case, you will get full performance from both SATA and
PATA ports now, without having to pass a kernel command line parameter.

Yay! I'm glad we can finally get rid of this in favor of the new pata drivers. Don't forget to kill the stuff in Documentation/kernel-parameters.txt though.

Jesse

Acked-by on v1 1/1
#5 lore raw
In reply to Jeff Garzik
Quoted 28 lines · Jeff Garzik

Discussed for 2.6.21, but pushed back because the current SATA code had enough fun stuff to debug already. Thus, just queued the following for 2.6.22 in libata-dev.git#upstream.

The nasty ____request_resource hack is finally gone.

In practical terms, this usually means that some combined mode users will have their SATA devices driven by the old-IDE driver rather than libata (because old-IDE is often non-modular, and thus probes first).

But really, these same users will IMO cheer the removal of the performance-killing split-driver configuration, so its a net win. And the code is smaller and more clean, with one less special case hack.

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.

Quoted 8 lines

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.

Thanks for fixing this.

Bart