linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PATCH: IDE generic tweak
@ 2004-10-13 14:24 Alan Cox
  2004-10-13 15:31 ` Jeff Garzik
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Cox @ 2004-10-13 14:24 UTC (permalink / raw)
  To: Linux Kernel Mailing List, linux-ide

This allows the user to force ide-generic to claim any remaining
IDE_STORAGE_CLASS devices. It isnt a good default to turn on because of
loadable driver modules and confusion with SATA however it is very
useful faced with a mainboard device that isn't supported any other way.
Note that the entry has to come last - if it looks OK I'll comment that
a bit more and update the option docs.

Comments ?

--- linux.vanilla-2.6.9rc3/drivers/ide/pci/generic.c	2004-09-30 16:13:08.000000000 +0100
+++ linux-2.6.9rc3/drivers/ide/pci/generic.c	2004-10-13 15:08:49.586093152 +0100
@@ -41,6 +41,17 @@
 
 #include "generic.h"
 
+static int ide_generic_all;		/* Set to claim all devices */
+
+static int __init ide_generic_all_on(char *unused)
+{
+	ide_generic_all = 1;
+	printk(KERN_INFO "IDE generic will claim all unknown PCI IDE storage controllers.\n");
+	return 1;
+}
+
+__setup("all-generic-ide", ide_generic_all_on);
+
 static unsigned int __init init_chipset_generic (struct pci_dev *dev, const char *name)
 {
 	return 0;
@@ -96,6 +107,11 @@
 {
 	ide_pci_device_t *d = &generic_chipsets[id->driver_data];
 	u16 command;
+	
+	/* Don't use the generic entry unless instructed to do so */
+	if (id->driver_data == 13)
+		if(ide_generic_all == 0)
+			return 1;
 
 	if (dev->vendor == PCI_VENDOR_ID_UMC &&
 	    dev->device == PCI_DEVICE_ID_UMC_UM8886A &&
@@ -108,8 +124,7 @@
 		return 1;
 
 	pci_read_config_word(dev, PCI_COMMAND, &command);
-	if(!(command & PCI_COMMAND_IO))
-	{
+	if(!(command & PCI_COMMAND_IO)) {
 		printk(KERN_INFO "Skipping disabled %s IDE controller.\n", d->name);
 		return 1; 
 	}
@@ -133,6 +148,8 @@
 	{ PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO,     PCI_ANY_ID, PCI_ANY_ID, 0, 0, 10},
 	{ PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_1,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, 11},
 	{ PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_2,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12},
+
+	{ PCI_ANY_ID,		PCI_ANY_ID,			   PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_IDE << 8, 0xFFFFFF00UL, 13},
 	{ 0, },
 };
 MODULE_DEVICE_TABLE(pci, generic_pci_tbl);
--- linux.vanilla-2.6.9rc3/drivers/ide/pci/generic.h	2004-09-30 15:35:49.000000000 +0100
+++ linux-2.6.9rc3/drivers/ide/pci/generic.h	2004-10-13 15:10:54.061170064 +0100
@@ -101,6 +101,13 @@
 		.channels	= 2,
 		.autodma	= NOAUTODMA,
 		.bootable	= ON_BOARD,
+	},{ /* 13 */
+		.name 		= "Unknown",
+		.init_chipset	= init_chipset_generic,
+		.init_hwif	= init_hwif_generic,
+		.channels	= 2,
+		.autodma	= NOAUTODMA,
+		.bootable	= ON_BOARD,
 	}
 };
 

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

* Re: PATCH: IDE generic tweak
  2004-10-13 15:31 ` Jeff Garzik
@ 2004-10-13 14:39   ` Alan Cox
  2004-10-13 15:49     ` Jeff Garzik
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Cox @ 2004-10-13 14:39 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Linux Kernel Mailing List, linux-ide

On Mer, 2004-10-13 at 16:31, Jeff Garzik wrote:
> > Comments ?
> 
> nVidia and others have been pushing for a similar module for libata...
> at least make sure one doesn't preclude the other.

libata can't do ATAPI and doesn't know about PATA errata so it's not
useful in libata yet. The generic grabber will honour pci and io
resource allocations so the existing "borrow 0x170" stuff will do the
right thing.

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

* Re: PATCH: IDE generic tweak
  2004-10-13 15:49     ` Jeff Garzik
@ 2004-10-13 14:54       ` Alan Cox
  2004-10-13 19:46         ` Jeff Garzik
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Cox @ 2004-10-13 14:54 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Linux Kernel Mailing List, linux-ide

On Mer, 2004-10-13 at 16:49, Jeff Garzik wrote:
> nVidia for example specifically wanted it because future __SATA__
> hardware will appear at the legacy IDE addresses, and end users were
> requesting for similar reasons.

Guess we need a pair of options with similar names to specify who
grabs the generic devices. That should be fine because it never wants
to be automatic anyway

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

* Re: PATCH: IDE generic tweak
  2004-10-13 14:24 PATCH: IDE generic tweak Alan Cox
@ 2004-10-13 15:31 ` Jeff Garzik
  2004-10-13 14:39   ` Alan Cox
  0 siblings, 1 reply; 6+ messages in thread
From: Jeff Garzik @ 2004-10-13 15:31 UTC (permalink / raw)
  To: Alan Cox; +Cc: Linux Kernel Mailing List, linux-ide

On Wed, Oct 13, 2004 at 03:24:48PM +0100, Alan Cox wrote:
> This allows the user to force ide-generic to claim any remaining
> IDE_STORAGE_CLASS devices. It isnt a good default to turn on because of
> loadable driver modules and confusion with SATA however it is very
> useful faced with a mainboard device that isn't supported any other way.
> Note that the entry has to come last - if it looks OK I'll comment that
> a bit more and update the option docs.
> 
> Comments ?

nVidia and others have been pushing for a similar module for libata...
at least make sure one doesn't preclude the other.

	Jeff

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

* Re: PATCH: IDE generic tweak
  2004-10-13 14:39   ` Alan Cox
@ 2004-10-13 15:49     ` Jeff Garzik
  2004-10-13 14:54       ` Alan Cox
  0 siblings, 1 reply; 6+ messages in thread
From: Jeff Garzik @ 2004-10-13 15:49 UTC (permalink / raw)
  To: Alan Cox; +Cc: Linux Kernel Mailing List, linux-ide

On Wed, Oct 13, 2004 at 03:39:33PM +0100, Alan Cox wrote:
> On Mer, 2004-10-13 at 16:31, Jeff Garzik wrote:
> > > Comments ?
> > 
> > nVidia and others have been pushing for a similar module for libata...
> > at least make sure one doesn't preclude the other.
> 
> libata can't do ATAPI and doesn't know about PATA errata so it's not
> useful in libata yet.

The people requesting the feature quite disagree :)

nVidia for example specifically wanted it because future __SATA__
hardware will appear at the legacy IDE addresses, and end users were
requesting for similar reasons.

They have configurations both today and in the future where they want to
use this in libata.

	Jeff

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

* Re: PATCH: IDE generic tweak
  2004-10-13 14:54       ` Alan Cox
@ 2004-10-13 19:46         ` Jeff Garzik
  0 siblings, 0 replies; 6+ messages in thread
From: Jeff Garzik @ 2004-10-13 19:46 UTC (permalink / raw)
  To: Alan Cox; +Cc: Linux Kernel Mailing List, linux-ide

Alan Cox wrote:
> On Mer, 2004-10-13 at 16:49, Jeff Garzik wrote:
> 
>>nVidia for example specifically wanted it because future __SATA__
>>hardware will appear at the legacy IDE addresses, and end users were
>>requesting for similar reasons.
> 
> 
> Guess we need a pair of options with similar names to specify who
> grabs the generic devices. That should be fine because it never wants
> to be automatic anyway

Can two drivers declare __setup() with the same string, I wonder?

Then you could do 'idegeneric=yes' and 'idegeneric=libata' or somesuch.

	Jeff

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

end of thread, other threads:[~2004-10-13 19:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-13 14:24 PATCH: IDE generic tweak Alan Cox
2004-10-13 15:31 ` Jeff Garzik
2004-10-13 14:39   ` Alan Cox
2004-10-13 15:49     ` Jeff Garzik
2004-10-13 14:54       ` Alan Cox
2004-10-13 19:46         ` Jeff Garzik

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