linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.22] remove Intel combined mode quirk
@ 2007-03-09 16:01 Jeff Garzik
  2007-03-09 16:08 ` Jeff Garzik
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Jeff Garzik @ 2007-03-09 16:01 UTC (permalink / raw)
  To: linux-ide; +Cc: LKML, Linus Torvalds


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.
    
    Signed-off-by: Jeff Garzik <jeff@garzik.org>

 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(-)

diff --git a/arch/i386/defconfig b/arch/i386/defconfig
index 5ae1e0b..0b92a95 100644
--- a/arch/i386/defconfig
+++ b/arch/i386/defconfig
@@ -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
diff --git a/arch/parisc/configs/c3000_defconfig b/arch/parisc/configs/c3000_defconfig
index 782906b..eb2f9a3 100644
--- a/arch/parisc/configs/c3000_defconfig
+++ b/arch/parisc/configs/c3000_defconfig
@@ -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
diff --git a/arch/x86_64/defconfig b/arch/x86_64/defconfig
index 293a4a4..6fe4635 100644
--- a/arch/x86_64/defconfig
+++ b/arch/x86_64/defconfig
@@ -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
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 131a9f7..54ee50b 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -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
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 066689c..0a19466 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,
 		/* 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;
 
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 7f94fc0..75dedc7 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -1307,119 +1307,6 @@ static void __init quirk_alder_ioapic(struct pci_dev *pdev)
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_EESSC,	quirk_alder_ioapic );
 #endif
 
-enum ide_combined_type { COMBINED = 0, IDE = 1, LIBATA = 2 };
-/* Defaults to combined */
-static enum ide_combined_type combined_mode;
-
-static int __init combined_setup(char *str)
-{
-	if (!strncmp(str, "ide", 3))
-		combined_mode = IDE;
-	else if (!strncmp(str, "libata", 6))
-		combined_mode = LIBATA;
-	else /* "combined" or anything else defaults to old behavior */
-		combined_mode = COMBINED;
-
-	return 1;
-}
-__setup("combined_mode=", combined_setup);
-
-#ifdef CONFIG_SATA_INTEL_COMBINED
-static void __devinit quirk_intel_ide_combined(struct pci_dev *pdev)
-{
-	u8 prog, comb, tmp;
-	int ich = 0;
-
-	/*
-	 * Narrow down to Intel SATA PCI devices.
-	 */
-	switch (pdev->device) {
-	/* PCI ids taken from drivers/scsi/ata_piix.c */
-	case 0x24d1:
-	case 0x24df:
-	case 0x25a3:
-	case 0x25b0:
-		ich = 5;
-		break;
-	case 0x2651:
-	case 0x2652:
-	case 0x2653:
-	case 0x2680:	/* ESB2 */
-		ich = 6;
-		break;
-	case 0x27c0:
-	case 0x27c4:
-		ich = 7;
-		break;
-	case 0x2828:	/* ICH8M */
-		ich = 8;
-		break;
-	default:
-		/* we do not handle this PCI device */
-		return;
-	}
-
-	/*
-	 * Read combined mode register.
-	 */
-	pci_read_config_byte(pdev, 0x90, &tmp);	/* combined mode reg */
-
-	if (ich == 5) {
-		tmp &= 0x6;  /* interesting bits 2:1, PATA primary/secondary */
-		if (tmp == 0x4)		/* bits 10x */
-			comb = (1 << 0);	/* SATA port 0, PATA port 1 */
-		else if (tmp == 0x6)	/* bits 11x */
-			comb = (1 << 2);	/* PATA port 0, SATA port 1 */
-		else
-			return;			/* not in combined mode */
-	} else {
-		WARN_ON((ich != 6) && (ich != 7) && (ich != 8));
-		tmp &= 0x3;  /* interesting bits 1:0 */
-		if (tmp & (1 << 0))
-			comb = (1 << 2);	/* PATA port 0, SATA port 1 */
-		else if (tmp & (1 << 1))
-			comb = (1 << 0);	/* SATA port 0, PATA port 1 */
-		else
-			return;			/* not in combined mode */
-	}
-
-	/*
-	 * Read programming interface register.
-	 * (Tells us if it's legacy or native mode)
-	 */
-	pci_read_config_byte(pdev, PCI_CLASS_PROG, &prog);
-
-	/* if SATA port is in native mode, we're ok. */
-	if (prog & comb)
-		return;
-
-	/* Don't reserve any so the IDE driver can get them (but only if
-	 * combined_mode=ide).
-	 */
-	if (combined_mode == IDE)
-		return;
-
-	/* Grab them both for libata if combined_mode=libata. */
-	if (combined_mode == LIBATA) {
-		request_region(0x1f0, 8, "libata");	/* port 0 */
-		request_region(0x170, 8, "libata");	/* port 1 */
-		return;
-	}
-
-	/* SATA port is in legacy mode.  Reserve port so that
-	 * IDE driver does not attempt to use it.  If request_region
-	 * fails, it will be obvious at boot time, so we don't bother
-	 * checking return values.
-	 */
-	if (comb == (1 << 0))
-		request_region(0x1f0, 8, "libata");	/* port 0 */
-	else
-		request_region(0x170, 8, "libata");	/* port 1 */
-}
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,    PCI_ANY_ID,	  quirk_intel_ide_combined );
-#endif /* CONFIG_SATA_INTEL_COMBINED */
-
-
 int pcie_mch_quirk;
 EXPORT_SYMBOL(pcie_mch_quirk);
 
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 6859a3b..71ea923 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -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,
diff --git a/kernel/resource.c b/kernel/resource.c
index bdb55a3..9bd14fd 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -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
  */

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2.6.22] remove Intel combined mode quirk
  2007-03-09 16:01 [PATCH 2.6.22] remove Intel combined mode quirk Jeff Garzik
@ 2007-03-09 16:08 ` Jeff Garzik
  2007-03-09 17:29 ` Alan Cox
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Jeff Garzik @ 2007-03-09 16:08 UTC (permalink / raw)
  To: Tejun Heo, linux-ide; +Cc: LKML, Linus Torvalds

Jeff Garzik wrote:
> diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
> index 066689c..0a19466 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,
>  		/* 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;

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.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2.6.22] remove Intel combined mode quirk
  2007-03-09 17:29 ` Alan Cox
@ 2007-03-09 16:33   ` Jeff Garzik
  0 siblings, 0 replies; 6+ messages in thread
From: Jeff Garzik @ 2007-03-09 16:33 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-ide, LKML, Linus Torvalds

Alan Cox wrote:
>>     Signed-off-by: Jeff Garzik <jeff@garzik.org>
> 
> Acked-by: Alan Cox <alan@redhat.com>
> 
> and you can remove even more code as pci_request_resources() will now
> just do the right thing for all cases.

pci_request_regions() you mean?

	Jeff




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2.6.22] remove Intel combined mode quirk
  2007-03-09 16:01 [PATCH 2.6.22] remove Intel combined mode quirk Jeff Garzik
  2007-03-09 16:08 ` Jeff Garzik
@ 2007-03-09 17:29 ` Alan Cox
  2007-03-09 16:33   ` Jeff Garzik
  2007-03-09 19:56 ` Jesse Barnes
  2007-03-09 20:36 ` Bartlomiej Zolnierkiewicz
  3 siblings, 1 reply; 6+ messages in thread
From: Alan Cox @ 2007-03-09 17:29 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-ide, LKML, Linus Torvalds

>     Signed-off-by: Jeff Garzik <jeff@garzik.org>

Acked-by: Alan Cox <alan@redhat.com>

and you can remove even more code as pci_request_resources() will now
just do the right thing for all cases.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2.6.22] remove Intel combined mode quirk
  2007-03-09 16:01 [PATCH 2.6.22] remove Intel combined mode quirk Jeff Garzik
  2007-03-09 16:08 ` Jeff Garzik
  2007-03-09 17:29 ` Alan Cox
@ 2007-03-09 19:56 ` Jesse Barnes
  2007-03-09 20:36 ` Bartlomiej Zolnierkiewicz
  3 siblings, 0 replies; 6+ messages in thread
From: Jesse Barnes @ 2007-03-09 19:56 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-ide, LKML, Linus Torvalds

On Friday, March 9, 2007 8:01 am Jeff Garzik wrote:
> 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.
>
>     Signed-off-by: Jeff Garzik <jeff@garzik.org>

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.

Acked-by:  Jesse Barnes <jbarnes@virtuousgeek.org>

Jesse

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2.6.22] remove Intel combined mode quirk
  2007-03-09 16:01 [PATCH 2.6.22] remove Intel combined mode quirk Jeff Garzik
                   ` (2 preceding siblings ...)
  2007-03-09 19:56 ` Jesse Barnes
@ 2007-03-09 20:36 ` Bartlomiej Zolnierkiewicz
  3 siblings, 0 replies; 6+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2007-03-09 20:36 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-ide, LKML, Linus Torvalds


On Friday 09 March 2007, Jeff Garzik wrote:
> 
> 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.
>     
>     Signed-off-by: Jeff Garzik <jeff@garzik.org>

Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

Thanks for fixing this.

Bart

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-03-09 20:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-09 16:01 [PATCH 2.6.22] remove Intel combined mode quirk Jeff Garzik
2007-03-09 16:08 ` Jeff Garzik
2007-03-09 17:29 ` Alan Cox
2007-03-09 16:33   ` Jeff Garzik
2007-03-09 19:56 ` Jesse Barnes
2007-03-09 20:36 ` Bartlomiej Zolnierkiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).